* Plugin Name: GLM Associate - Staff Add-on
* Plugin URI: http://www.gaslightmedia.com/
* Description: Staff directory
- * Version: 1.0.2
+ * Version: 1.0.3
* Author: Gaslight Media
* Author URI: http://www.gaslightmedia.com/
* License: GPL2
* @package glmMembersStaffAddOn
* @author Chuck Scott <cscott@gaslightmedia.com>
* @license http://www.gaslightmedia.com Gaslightmedia
- * @version 1.0.2
+ * @version 1.0.3
*/
// Check that we're being called by WordPress.
* so that we're sure the other add-ons see an up to date
* version from this plugin.
*/
-define('GLM_MEMBERS_STAFF_PLUGIN_VERSION', '1.0.2');
+define('GLM_MEMBERS_STAFF_PLUGIN_VERSION', '1.0.3');
define('GLM_MEMBERS_STAFF_PLUGIN_DB_VERSION', '0.0.1');
// This is the minimum version of the GLM Members DB plugin require for this plugin.
}
// Apply any provided text search to name, description, short description, and street address
- if (trim($actionData['request']['text-search']) != '') {
- $textSearch = addslashes(filter_var($actionData['request']['text-search'], FILTER_SANITIZE_STRING, FILTER_FLAG_NO_ENCODE_QUOTES));
- $where .= $whereSep." (
- (
- SELECT true
- FROM ".GLM_MEMBERS_STAFF_PLUGIN_DB_PREFIX."staff
- WHERE id = T.id
- AND fname LIKE '%$textSearch%'
- ) OR
- T.lname LIKE '%$textSearch%' OR
- T.department LIKE '%$textSearch%' OR
- T.building LIKE '%$textSearch%'
- )";
- $textSearch = stripslashes($textSearch);
- }
+ // if (trim($actionData['request']['text-search']) != '') {
+ // $textSearch = addslashes(filter_var($actionData['request']['text-search'], FILTER_SANITIZE_STRING, FILTER_FLAG_NO_ENCODE_QUOTES));
+ // $where .= $whereSep." (
+ // (
+ // SELECT true
+ // FROM ".GLM_MEMBERS_STAFF_PLUGIN_DB_PREFIX."staff
+ // WHERE id = T.id
+ // AND fname LIKE '%$textSearch%'
+ // ) OR
+ // T.lname LIKE '%$textSearch%' OR
+ // T.department LIKE '%$textSearch%' OR
+ // T.building LIKE '%$textSearch%'
+ // )";
+ // $textSearch = stripslashes($textSearch);
+ // }
$Buildings = new GlmDataBuildings( $this->wpdb, $this->config );
if ( isset( $_REQUEST['filter_name'] ) && trim( $_REQUEST['filter_name'] ) != '' ) {
$name_search = addslashes(filter_var($_REQUEST['filter_name'], FILTER_SANITIZE_STRING, FILTER_FLAG_NO_ENCODE_QUOTES));
- $where .= $whereSep." (T.fname like '%$name_search%' OR T.lname like '%$name_search%' OR (T.fname like '%$name_search%' AND T.lname like '%$name_search%') )";
+ $where .= $whereSep." (
+ T.fname like '%$name_search%'
+ OR
+ T.lname like '%$name_search%'
+ OR ( CONCAT_WS( ' ', T.fname, T.lname) like '%$name_search%')
+ )";
}
if ( isset( $_REQUEST['filter_departments'] ) && $filter_departments = filter_var( $_REQUEST['filter_departments'], FILTER_VALIDATE_INT ) ) {
$filteredStaffFound = $this->getStats(str_replace('T.', '', $where.$alphaWhere));
- $sortOrder = apply_filters( 'glm-member-db-front-search-query-orderby', 'lname' );
$sortOrder = 'lname';
${$resultParam} = $this->getList($where.$alphaWhere, $sortOrder, true, 'id', $start, $limit);