$start = $newStart;
}
}
-
-
- $contactsList = $this->getList($where, $order, true, 'id',$start, $limit);
-
- $list = $contactsList['list'];
// If we're not paging, then force $start and $limit to false to data abstract returns everything.
$resultParam = 'listResult';
$limit = false;
$resultParam = 'list';
}
-
- // Get stats for the current selection
- $contactsFound = $this->getStats(str_replace('T.', '', $where));
-
- // Get stats for number of members found matching current selection criteria (includes alpha selection)
- $filteredContactsFound = $this->getStats(str_replace('T.', '', $where.$alphaWhere));
- // Get member list sorted as specified
- switch ($this->config['settings']['list_order_list']) {
+ /*
+ * Get a current list of members - unless this is a blank start
+ */
+ if (!$blankStart) {
- // Pseudo-Random list order
- case $this->config['sort_order_numb']['Pseudo-Random']:
- ${$resultParam} = $this->getList($where.$alphaWhere, 'pseudo-random', true, 'id', $start, $limit);
- break;
+ // Get stats for the current selection
+ $contactsFound = $this->getStats(str_replace('T.', '', $where));
- // Default is alpha-numeric list order
- default:
- case $this->config['sort_order_numb']['Alpha-Numeric']:
- ${$resultParam} = $this->getList($where.$alphaWhere, $order, true, 'id', $start, $limit);
- break;
-
- }
+ // Get stats for number of members found matching current selection criteria (includes alpha selection)
+ $filteredContactsFound = $this->getStats(str_replace('T.', '', $where.$alphaWhere));
+ if (!$paging) {
+ $start = false;
+ $limit = false;
+ $resultParam = 'list';
+ } else {
+ $resultParam = 'listResult';
+ }
+ // Get member list sorted as specified
+ ${$resultParam} = $this->getList($where.$alphaWhere, 'lname', true, 'id', $start, $limit);
- if (GLM_MEMBERS_PLUGIN_FRONT_DEBUG) {
- glmMembersFront::addNotice($list, 'DataBlock', 'Member Data');
}
- if ($contactsList != false) {
+
+
if ($paging) {
//Get paging results
- $numbDisplayed = $contactsList['returned'];
- $lastDisplayed = $contactsList['last'];
+ $numbDisplayed = $listResult['returned'];
+ $lastDisplayed = $listResult['last'];
if ($start == 1) {
$prevStart = false;
} else {
$start = 1;
}
}
- if ($contactsList['returned'] == $limit) {
+ if ($listResult['returned'] == $limit) {
$nextStart = $start + $limit;
}
+ if (count($listResult) > 0) {
+ $haveContacts = true;
+ }
+ // since we're doing paging, we have to break out just the contact data
+ $list = $listResult['list'];
+ unset($listResult);
+
}
- if (count($contactsList) > 0) {
+
+
+ // If we have list entries - even if it's an empty list
+ $success = true;
+ $haveContacts = false;
+ if (!$blankStart && $list !== false) {
+
+ $success = true;
+
+ // If we have any entries
+ if (count($list) > 0) {
$haveContacts = true;
}
}
$haveCounties = true;
}
- // If the option is "edit" don't let lower-level users assign privileges above the user's pay grade
- if (($option == 'edit' || $option == 'create') && $this->config['loggedInUser']['contactUser']) {
-
- // If this is an Entity Manager or lower user, then remove the "MembersManger" role selection
- if ($this->config['loggedInUser']['contactUser']['role'] >= $this->config['contact_role_numb']['EntityManager']) {
- unset($contactInfo['fieldData']['contact_role']['list'][$this->config['contact_role_numb']['MembersManager']]);
- }
-
- }
-
// Compile template data
$templateData = array(
'option' => $option,
'memberName' => $memberName,
'membersList' => $membersList,
'haveContacts' => $haveContacts,
- 'contactsList' => $list,
+ 'contacts' => $list,
'numbContacts' => $numbContacts,
'contactID' => $contactID,
'contactInfo' => $contactInfo,