Remember last search and add a link to 'Back to Search'.
Saving the search now in php session.
Will reset when the list page is hit again.
Resets for each search.
Now showing the name search back into the field. Fixed issue with quotes
and apostrophes.
color: white;
}
-#glm-admin-content-container .button-primary {
+#glm-admin-content-container .button-primary,
+.glm-associate-admin-wrap .button-primary {
background-color: #0568B3;
color: white;
text-shadow: none;
border: 1px solid darkblue;
box-shadow: 0px 1px 0px darkblue;
}
-#glm-admin-content-container .button-primary:hover {
+#glm-admin-content-container .button-primary:hover,
+.glm-associate-admin-wrap .button-primary:hover {
background-color: #3D84D0;
box-shadow: 0px -1px 0px darkblue;
}
* Plugin Name: GLM Members Database
* Plugin URI: http://www.gaslightmedia.com/
* Description: Gaslight Media Members Database.
- * Version: 2.10.17
+ * Version: 2.10.18
* Author: Gaslight Media
* Author URI: http://www.gaslightmedia.com/
* License: GPL2
* @package glmMembersDatabase
* @author Chuck Scott <cscott@gaslightmedia.com>
* @license http://www.gaslightmedia.com Gaslightmedia
- * @version 2.10.17
+ * @version 2.10.18
*/
// Check that we're being called by WordPress.
*
*/
-define('GLM_MEMBERS_PLUGIN_VERSION', '2.10.17');
+define('GLM_MEMBERS_PLUGIN_VERSION', '2.10.18');
define('GLM_MEMBERS_PLUGIN_DB_VERSION', '1.1.32');
// Check if plugin version is not current in WordPress option and if needed updated it
$enable_members = $this->config['settings']['enable_members'];
$textSearch = false;
+ // Save all query parameters
+ if ( isset( $_REQUEST['glm_action'] ) && $_REQUEST['glm_action'] == 'list' ) {
+ $_SESSION['member_saved_search'] = $_REQUEST;
+ } else if ( !isset( $_REQUEST['glm_action'] ) && !filter_var( $_REQUEST['back_to_search'], FILTER_VALIDATE_BOOLEAN ) ) {
+ unset( $_SESSION['member_saved_search'] );
+ }
+ // Check for back to search flag
+ if ( isset( $_REQUEST['back_to_search'] ) && filter_var( $_REQUEST['back_to_search'], FILTER_VALIDATE_BOOLEAN ) ) {
+ $_REQUEST = $_SESSION['member_saved_search'];
+ }
// Check if this is a request to show archived members
if (isset($_REQUEST['filterArchived'])) {
$where .= " AND access = ".$this->config['access_numb']['Archived'];
// Check for a text search
if (isset($_REQUEST['text_search']) && trim($_REQUEST['text_search']) != '') {
- $textSearch = addslashes(filter_input(INPUT_POST, 'text_search', FILTER_SANITIZE_STRING, FILTER_FLAG_NO_ENCODE_QUOTES));
+ // $textSearch = addslashes(filter_input(INPUT_POST, 'text_search', FILTER_SANITIZE_STRING, FILTER_FLAG_NO_ENCODE_QUOTES));
+ $textSearch = addslashes(filter_var($_REQUEST['text_search'], FILTER_SANITIZE_STRING, FILTER_FLAG_NO_ENCODE_QUOTES));
$where .= " AND T.id in (
SELECT DISTINCT(member)
FROM ".GLM_MEMBERS_PLUGIN_DB_PREFIX."member_info
// Create current month/date string to pre-populate the Month/Year field for
$monthYear = date('F Y');
+ // Update the textSearch for output into the form.
+ $textSearch = str_replace("\'", "'", $textSearch );
+ $textSearch = str_replace('\\"', '"', $textSearch );
+ $textSearch = str_replace('\\', '', $textSearch );
+
// Compile template data
$templateData = array(
'monthYear' => $monthYear,
(none)
== Changelog ==
+= 2.10.18 =
+* Improve member search in admin. Can now use Back To Search button to return
+ to your last search. Resets when list page is called.
+* Member name search improved.
= 2.10.16 =
-* Fixed version number in index.php that wasn't updated with last hotfix.
+* Fixed version number in index.php that wasn't updated with last hotfix.
= 2.10.15 =
* When a new member is added the user is now redirected to the member dashboard
{/if}
<div class="wrap glm-associate-admin-wrap glm-associate-admin-member-wrap">
-
+
<h2>
{if $haveMember}
{$terms.term_member_cap}: <span class="glm-notice">{$memberName}</span>
New {$terms.term_member_cap}
{/if}
</h2>
+ <a class="button button-primary glm-right" href="{$thisUrl}?page=glm-members-admin-menu-members-list&back_to_search=1">Back To Search</a>
<h2 class="nav-tab-wrapper">
<a href="{$thisUrl}?page={$thisPage}" class="nav-tab{if $thisAction==index || $thisAction==memberEdit || $thisAction==memberInfo} nav-tab-active{/if}">{$terms.term_member_cap} Dashboard</a>
{if $memberID}
{foreach $addOnTabs as $a}
<a href="{$thisUrl}?page={$thisPage}&glm_action={$a.action}{if isset($a.option)}&option={$a.option}{/if}&member={$memberID}" class="nav-tab{if $thisAction==$a.action} nav-tab-active{/if}">{$a.text}</a>
- {/foreach}
+ {/foreach}
{/if}
</h2>
<div id="glm-admin-content-container">
-
-
\ No newline at end of file
+
+
<![endif]-->
{if apply_filters('glm_members_permit_admin_member_info_edit', true)}
-
{if $memberInfoID && $memberInfo}
<!-- Delete Member Profile dialog -->
<div id="deleteMemberInfoButton" class="button button-primary glm-right">Delete this {$terms.term_member_cap} Profile Version</div>
<h2 class="glm-admin-table-header">List of {$terms.term_member_plur_cap}</h2>
<div class="glm-row">
- <b>Text Search: </b><input class="glmMembersSearch" type="text" name="text_search" id="autoTest">
+ <b>Text Search: </b><input class="glmMembersSearch" type="text" name="text_search" id="autoTest" {if $textSearch}value="{$textSearch}"{/if}>
<input type="submit" value="Submit" style="margin-right: 2em;">
</div>
<!-- <th>{$terms.term_member_plur_cap} Found:</th><td><span style="margin-right: 2em;">{$memberCount}</span></td> -->
// Autocomplete for list Text Search
$( ".glmMembersSearch" ).autocomplete({
-
source: availableTags,
html: true,
- position: { my : "right top", at: "right bottom" },
+ position: { my : "left top", at: "left bottom" },
select: function( event, ui ) {
var memberID = ui.item.id;
window.location.replace("{$adminUrl}?page=glm-members-admin-menu-member&glm_action=index&member=" + memberID );