f8bfb124 by Kevin Burton

Updates to the User Manager

1 parent 9ed22bd4
......@@ -20,6 +20,28 @@ jQuery(function() {
}
);
}
jQuery('.remove-user').colorbox({onComplete: function() {
/*
var cb = this;
var options = {
beforeSubmit: function() {}
, success: function(data) {
if (data.refresh == "true") {
document.location.href = document.location.href;
} else {
jQuery.colorbox.close();
}
}
, data: ({ajax:"yes", action: 'update_registration'})
, dataType: 'json'
, url: '/wp-admin/admin-ajax.php'
};
jQuery('#edit-event-form').ajaxForm(options);
*/
}});
jQuery('#admin-edit-user-profile').ajaxForm({
url: '/wp-admin/admin-ajax.php'
......
......@@ -389,6 +389,14 @@ function run_validation() {
class Actions {
public static function wp_ajax_build_user_remove() {
ob_start();
require_once(__DIR__ . DIRECTORY_SEPARATOR . 'views' . DIRECTORY_SEPARATOR . 'partials' . DIRECTORY_SEPARATOR . 'remove_user.php');
$content = ob_get_contents();
ob_end_clean();
die($content);
}
public static function wp_ajax_admin_create_user() {
run_validation();
......
......@@ -110,7 +110,7 @@ unset($rc, $roles['administrator']);
</td>
</tr>
<tr id="create_member_id">
<th>Member ID:</th>
<th class="member_id_label">Member ID:</th>
<td><input type="text" name="member_id" id="member_id" readonly="readonly" /></td>
</tr>
<tr><td colspan="2">&nbsp;</td></tr>
......@@ -146,12 +146,18 @@ unset($rc, $roles['administrator']);
var $role_selector = $('#create_user_role');
var $member_id_container = $('#create_member_id');
var $member_id_label = $('.member_id_label');
var $member_id_field = $('#member_id');
var $form = $('#admin-new-user-form');
var $last_name_field = $('#create_last_name');
function changedUserRole() {
if ($role_selector.val() == "member") {
if ($role_selector.val() == "member" || $role_selector.val()=="student") {
if ($role_selector.val() == "member") {
$member_id_label.html('Member ID:');
} else {
$member_id_label.html('Student ID:');
}
updateMemberID();
$member_id_container.show();
} else {
......
......@@ -86,6 +86,9 @@ if ($filter_role) {
<th scope="col" width="250" class="manage-column">Email</th>
<th scope="col" width="200" class="manage-column">Role</th>
<th scope="col" width="100" class="manage-column">Status</th>
<!--
<th scope="col" width="100" class="manage-column">&nbsp;</th>
-->
</tr>
</thead>
<tbody>
......@@ -99,6 +102,9 @@ if ($filter_role) {
<td><?php echo $user['email']?></td>
<td><?php echo $user['role']?></td>
<td><?php echo ucwords($user['status']);?></td>
<!--
<td><a href="/wp-admin/admin-ajax.php?ajax=yes&action=build_user_remove&uid=<?php echo $user['uid'];?>" class="remove-user" rel="<?php echo $user['uid'];?>">Remove User</a></td>
-->
</tr>
<?php endforeach; ?>
</body>
......
......@@ -9,7 +9,7 @@
<style type="text/css">
html, body { margin:0px; padding:0;}
h3 {
.title-link {
color:#f7bd55;
font-size: 12px;
font-weight: bold;
......@@ -19,7 +19,7 @@
border: solid 1px #FFF;
border-bottom: solid 1px #999;
cursor: default;
padding: 0em; padding:3px 5px 3px 10px;
padding: 0em; padding:3px 10px 3px 10px;
margin: 0em;
}
......@@ -34,7 +34,7 @@
<body>
<h3>Edit <?php echo $name; ?>'s CE Hours:</h3>
<div class="title-link">Edit <?php echo $name; ?>'s CE Hours:</div>
<form method="post" action="" id="edit-cehours-form">
<input type="hidden" name="uid" value="<?php echo $uid; ?>" />
......
......@@ -9,7 +9,7 @@
<style type="text/css">
html, body { margin:0px; padding:0;}
h3 {
.title-link {
color:#f7bd55;
font-size: 12px;
font-weight: bold;
......@@ -19,7 +19,7 @@
border: solid 1px #FFF;
border-bottom: solid 1px #999;
cursor: default;
padding: 0em; padding:3px 5px 3px 10px;
padding: 0em; padding:3px 10px 3px 10px;
margin: 0em;
}
......@@ -34,7 +34,7 @@
<body>
<h3><?php echo $post->post_title;?></h3>
<div class="title-link"><?php echo $post->post_title;?></div>
<?php
$extras = $user_event_meta['extras'];
......