public function modelAction($actionData = false)
{
- $success_load = false;
+ $success_load = false;
$success_message = "";
- $option = false;
- $view_file = 'list';
- $view = 'list';
-
+ $option = false;
+ $view_file = 'list';
+ $view = 'list';
$where = '';
$whereSep = '';
$filterName = false;
$staffFound = false;
$filteredStaffFound = false;
$list = false;
-
$buildings = false;
$departments = false;
-
$thisPage = false;
$thisAction = false;
$prevStart = false;
$limit = false;
$alphaSelected = false;
-
-
// Paging Parameters
$textSearch = '';
$paging = true;//$this->config['settings']['list_pagination']; // Now this is in management
$nextStart = false;
$start = 1;
$limit = 15;//$this->config['settings']['list_pagination_count']; // Now this is in management
-
+
if (isset($_REQUEST['option']) && trim($_REQUEST['option']) != '') {
$option = $_REQUEST['option'];
}
} else {
$actionData['request']['text-search'] = false;
}
-
+
if (isset($_REQUEST['alpha'])) {
$actionData['request']['alpha'] = $_REQUEST['alpha'];
} else {
// Check for alpha selected
if ($actionData['request']['alpha'] && strlen($actionData['request']['alpha']) == 1) {
$alphaSelected = strtoupper($actionData['request']['alpha']);
- $alphaWhere .= " AND T.fname LIKE '$alphaSelected%'";
-
+ $alphaWhere .= " AND T.lname LIKE '$alphaSelected%'";
+
}
// Get full list for all other filters, but not filtered by alpha (that would be silly)
$alphaList = $this->getAlphaList($where, $alphaSelected);
-
+
}
// If we're not paging, then force $start and $limit to false to data abstract returns everything.
// Get stats for number of members found matching current selection criteria (includes alpha selection)
$filteredStaffFound = $this->getStats(str_replace('T.', '', $where.$alphaWhere));
-
+
$sortOrder = apply_filters( 'glm-member-db-front-search-query-orderby', 'fname' );
$sortOrder = 'fname';
${$resultParam} = $this->getList($where.$alphaWhere, $sortOrder, true, 'id', $start, $limit);
//$staff_data = $this->getList();
-
+
switch ($option) {
case "list":
$view_file = 'list';
-
+
break;
-
+
default:
-
+
break;
}
$success_load = "Yes";
-
-
+
+
// Compile template datas
$templateData = array(
- 'list' => $list,
- 'staffData' => $list,
- 'successLoad' => $success_load,
+ 'list' => $list,
+ 'staffData' => $list,
+ 'successLoad' => $success_load,
'haveStaff' => $haveStaff,
'staff' => $list,
'staffFound' => $staffFound,
- 'haveFilter' => $haveFilter,
- 'filterName' => stripslashes($filterName),
- 'textSearch' => $textSearch,
- 'alphaList' => $alphaList,
- 'alphaSelected' => $alphaSelected,
- 'view' => $view,
-
- 'departments' => $departments,
- 'buildings' => $buildings,
-
- // Paging parameters
+ 'haveFilter' => $haveFilter,
+ 'filterName' => stripslashes($filterName),
+ 'textSearch' => $textSearch,
+ 'alphaList' => $alphaList,
+ 'alphaSelected' => $alphaSelected,
+ 'view' => $view,
+ 'departments' => $departments,
+ 'buildings' => $buildings,
'filteredStaffFound' => $filteredStaffFound,
- 'numbDisplayed' => $numbDisplayed,
- 'lastDisplayed' => $lastDisplayed,
- 'paging' => $paging,
- 'prevStart' => $prevStart,
- 'nextStart' => $nextStart,
- 'start' => $start,
- 'limit' => $limit,
- 'thisPage' => $thisPage,
- 'thisAction' => $thisAction,
- 'limit' => $limit,
- 'alphaSelected' => $alphaSelected,
+ 'numbDisplayed' => $numbDisplayed,
+ 'lastDisplayed' => $lastDisplayed,
+ 'paging' => $paging,
+ 'prevStart' => $prevStart,
+ 'nextStart' => $nextStart,
+ 'start' => $start,
+ 'limit' => $limit,
+ 'thisPage' => $thisPage,
+ 'thisAction' => $thisAction,
+ 'limit' => $limit,
+ 'alphaSelected' => $alphaSelected,
);
// Return status, any suggested view, and any data to controller