public function getSimpleMembersList()
{
- $memberList = $this->wpdb->get_results(
- "
- SELECT id, name
- FROM ".$this->table."
- ;",
- ARRAY_A
- );
+ // Save the current fields array and make a copy
+ $fSave = $this->fields;
+ $f = $fSave;
+
+ // Remove what we don't want form the copy and get the list
+ unset($f['access'], $f['member_type'], $f['created']);
+ $this->fields = $f;
+ $memberList = $this->getList();
+
+ // Restore the fields list
+ $this->fields = $fSave;
return $memberList;
}
public function glmMembersAdminScripts ()
{
+ // jQuery scripts
wp_enqueue_script('jquery');
wp_enqueue_script('jquery-style');
wp_enqueue_script('jquery-ui-core');
wp_enqueue_script('jquery-ui-dialog');
- wp_enqueue_style("wp-jquery-ui-dialog");
+ wp_enqueue_script('jquery-ui-autocomplete');
+
+ // jQuery UI Style
+ wp_enqueue_style('wp-jquery-ui-dialog');
wp_enqueue_media();
wp_register_script('glm-members-admin-js',
font-weight: bold;
}
.glm-admin-table-active {
- background: lightblue;
+ background: #99FFFF;
}
.glm-admin-image-edit-table {
border: 2px #ddd solid;
-// Use media uploaded for all file/image uploads
+// Other needed JS code
+
jQuery(document).ready(function($){
-
+
+ /*
+ * Use media uploaded for all file/image uploads
+ */
+
var custom_uploader;
$('.glm-protp-upload-button').click(function(e) {
});
-
});
\ No newline at end of file
-<?php /* Smarty version Smarty-3.1.21-dev, created on 2015-03-19 12:58:55
+<?php /* Smarty version Smarty-3.1.21-dev, created on 2015-03-25 18:21:40
compiled from "/var/www/server/wordpress/wp-content/plugins/glm-member-db/views/admin/member/index.html" */ ?>
<?php /*%%SmartyHeaderCode:94073808254c05abfc4adf1-45287000%%*/if(!defined('SMARTY_DIR')) exit('no direct access allowed');
$_valid = $_smarty_tpl->decodeProperties(array (
'1be35689c5d30d774f40ebc45e387f5f95c45e90' =>
array (
0 => '/var/www/server/wordpress/wp-content/plugins/glm-member-db/views/admin/member/index.html',
- 1 => 1426784332,
+ 1 => 1427321829,
2 => 'file',
),
),
<thead>
<tr>
<th>Access</th>
+ <th>Reference Name</th>
<th>Created</th>
<th>Last Update</th>
- <th>Reference Name</th>
<th> </th>
</tr>
</thead>
<tbody>
- <?php $_smarty_tpl->tpl_vars["i"] = new Smarty_variable("0", null, 0);?>
+ <?php if (isset($_smarty_tpl->tpl_vars["i"])) {$_smarty_tpl->tpl_vars["i"] = clone $_smarty_tpl->tpl_vars["i"];
+$_smarty_tpl->tpl_vars["i"]->value = "0"; $_smarty_tpl->tpl_vars["i"]->nocache = null; $_smarty_tpl->tpl_vars["i"]->scope = 0;
+} else $_smarty_tpl->tpl_vars["i"] = new Smarty_variable("0", null, 0);?>
<?php $_smarty_tpl->tpl_vars['m'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['m']->_loop = false;
$_from = $_smarty_tpl->tpl_vars['memberInfoRecords']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['m']->key => $_smarty_tpl->tpl_vars['m']->value) {
&id=<?php echo $_smarty_tpl->tpl_vars['m']->value['id'];?>
"<?php if ($_smarty_tpl->tpl_vars['m']->value['status']['value']==$_smarty_tpl->tpl_vars['statusPending']->value) {?> class="glm-notice"<?php }?>><?php echo $_smarty_tpl->tpl_vars['m']->value['status']['name'];?>
</a></td>
+ <td><?php echo $_smarty_tpl->tpl_vars['m']->value['reference_name'];?>
+</td>
<td><?php echo $_smarty_tpl->tpl_vars['m']->value['create_time']['datetime'];?>
</td>
<td><?php echo $_smarty_tpl->tpl_vars['m']->value['modify_time']['datetime'];?>
-</td>
- <td><?php echo $_smarty_tpl->tpl_vars['m']->value['reference_name'];?>
</td>
<td>
<a href="<?php echo $_smarty_tpl->tpl_vars['thisURL']->value;?>
{if $membersList}
<tr>
<td colspan="2">
- <select id="glmMembersList" class="glm-right">
- <option value=""></option>
- {foreach $membersList as $m}
- <option value="{$m.id}">{$m.name}</option>
- {/foreach}
- </select>
- Members
+ <input id="glmMembersList" type="text" id="autoTest" class="glm-right">
+ <span class="glm-left">Member Search:</span>
</td>
</tr>
{/if}
{if $membersList}
<script type="text/javascript">
jQuery(document).ready(function($) {
-
- $('#glmMembersList').change( function() {
- window.location.replace("{$adminURL}?page=glm-members-admin-menu-member&glm_action=index&member=" + $(this).find('option:selected').val() );
- });
-
-
+
+ /*
+ * Do autocomplete search for member
+ * label: What will be searched
+ * value: What will be displayed when selected
+ * id: Member id added so we can go to the member while showing what was selected
+ * Also note that autocomplete does not properly render HTML codes, so we
+ * "unescape" them for HTML in Smarty.
+ */
+ var availableTags = [
+ {foreach $membersList as $m}
+ { label: "{$m.name|unescape:'html'}", value: "{$m.name|unescape:'html'}", id: '{$m.id}' },
+ {/foreach}
+ ];
+ $( "#glmMembersList" ).autocomplete({
+ source: availableTags,
+ html: true,
+ select: function( event, ui ) {
+ var memberID = ui.item.id;
+ window.location.replace("{$adminURL}?page=glm-members-admin-menu-member&glm_action=index&member=" + memberID );
+ }
+ });
+
});
+
</script>
{/if}
\ No newline at end of file
<thead>
<tr>
<th>Access</th>
+ <th>Reference Name</th>
<th>Created</th>
<th>Last Update</th>
- <th>Reference Name</th>
<th> </th>
</tr>
</thead>
<tr class="alternate{if $m.status.name == 'Active'} glm-admin-table-active{/if}">
{/if}
<td><a href="{$thisURL}?page={$thisPage}&glm_action=memberInfo&member={$memberID}&id={$m.id}"{if $m.status.value == $statusPending} class="glm-notice"{/if}>{$m.status.name}</a></td>
+ <td>{$m.reference_name}</td>
<td>{$m.create_time.datetime}</td>
<td>{$m.modify_time.datetime}</td>
- <td>{$m.reference_name}</td>
<td>
<a href="{$thisURL}?page={$thisPage}&glm_action=memberInfo&member={$memberID}&id={$m.id}&option=clone" class="button-primary glm-right">Clone</a>
{if $m.status.name != 'Active'}<a href="{$thisURL}?page={$thisPage}&glm_action=index&member={$memberID}&activateID={$m.id}" class="button-primary glm-button glm-right">Activate</a>{/if}