Updates to the User Manager
Showing
6 changed files
with
49 additions
and
7 deletions
| ... | @@ -21,6 +21,28 @@ jQuery(function() { | ... | @@ -21,6 +21,28 @@ jQuery(function() { |
| 21 | ); | 21 | ); |
| 22 | } | 22 | } |
| 23 | 23 | ||
| 24 | jQuery('.remove-user').colorbox({onComplete: function() { | ||
| 25 | /* | ||
| 26 | var cb = this; | ||
| 27 | var options = { | ||
| 28 | beforeSubmit: function() {} | ||
| 29 | , success: function(data) { | ||
| 30 | |||
| 31 | if (data.refresh == "true") { | ||
| 32 | document.location.href = document.location.href; | ||
| 33 | } else { | ||
| 34 | jQuery.colorbox.close(); | ||
| 35 | } | ||
| 36 | |||
| 37 | } | ||
| 38 | , data: ({ajax:"yes", action: 'update_registration'}) | ||
| 39 | , dataType: 'json' | ||
| 40 | , url: '/wp-admin/admin-ajax.php' | ||
| 41 | }; | ||
| 42 | jQuery('#edit-event-form').ajaxForm(options); | ||
| 43 | */ | ||
| 44 | }}); | ||
| 45 | |||
| 24 | jQuery('#admin-edit-user-profile').ajaxForm({ | 46 | jQuery('#admin-edit-user-profile').ajaxForm({ |
| 25 | url: '/wp-admin/admin-ajax.php' | 47 | url: '/wp-admin/admin-ajax.php' |
| 26 | , data: ({ajax:"yes", action: 'update_edit_profile'}) | 48 | , data: ({ajax:"yes", action: 'update_edit_profile'}) | ... | ... |
| ... | @@ -389,6 +389,14 @@ function run_validation() { | ... | @@ -389,6 +389,14 @@ function run_validation() { |
| 389 | 389 | ||
| 390 | class Actions { | 390 | class Actions { |
| 391 | 391 | ||
| 392 | public static function wp_ajax_build_user_remove() { | ||
| 393 | ob_start(); | ||
| 394 | require_once(__DIR__ . DIRECTORY_SEPARATOR . 'views' . DIRECTORY_SEPARATOR . 'partials' . DIRECTORY_SEPARATOR . 'remove_user.php'); | ||
| 395 | |||
| 396 | $content = ob_get_contents(); | ||
| 397 | ob_end_clean(); | ||
| 398 | die($content); | ||
| 399 | } | ||
| 392 | 400 | ||
| 393 | public static function wp_ajax_admin_create_user() { | 401 | public static function wp_ajax_admin_create_user() { |
| 394 | run_validation(); | 402 | run_validation(); | ... | ... |
| ... | @@ -110,7 +110,7 @@ unset($rc, $roles['administrator']); | ... | @@ -110,7 +110,7 @@ unset($rc, $roles['administrator']); |
| 110 | </td> | 110 | </td> |
| 111 | </tr> | 111 | </tr> |
| 112 | <tr id="create_member_id"> | 112 | <tr id="create_member_id"> |
| 113 | <th>Member ID:</th> | 113 | <th class="member_id_label">Member ID:</th> |
| 114 | <td><input type="text" name="member_id" id="member_id" readonly="readonly" /></td> | 114 | <td><input type="text" name="member_id" id="member_id" readonly="readonly" /></td> |
| 115 | </tr> | 115 | </tr> |
| 116 | <tr><td colspan="2"> </td></tr> | 116 | <tr><td colspan="2"> </td></tr> |
| ... | @@ -146,12 +146,18 @@ unset($rc, $roles['administrator']); | ... | @@ -146,12 +146,18 @@ unset($rc, $roles['administrator']); |
| 146 | 146 | ||
| 147 | var $role_selector = $('#create_user_role'); | 147 | var $role_selector = $('#create_user_role'); |
| 148 | var $member_id_container = $('#create_member_id'); | 148 | var $member_id_container = $('#create_member_id'); |
| 149 | var $member_id_label = $('.member_id_label'); | ||
| 149 | var $member_id_field = $('#member_id'); | 150 | var $member_id_field = $('#member_id'); |
| 150 | var $form = $('#admin-new-user-form'); | 151 | var $form = $('#admin-new-user-form'); |
| 151 | var $last_name_field = $('#create_last_name'); | 152 | var $last_name_field = $('#create_last_name'); |
| 152 | 153 | ||
| 153 | function changedUserRole() { | 154 | function changedUserRole() { |
| 155 | if ($role_selector.val() == "member" || $role_selector.val()=="student") { | ||
| 154 | if ($role_selector.val() == "member") { | 156 | if ($role_selector.val() == "member") { |
| 157 | $member_id_label.html('Member ID:'); | ||
| 158 | } else { | ||
| 159 | $member_id_label.html('Student ID:'); | ||
| 160 | } | ||
| 155 | updateMemberID(); | 161 | updateMemberID(); |
| 156 | $member_id_container.show(); | 162 | $member_id_container.show(); |
| 157 | } else { | 163 | } else { | ... | ... |
| ... | @@ -86,6 +86,9 @@ if ($filter_role) { | ... | @@ -86,6 +86,9 @@ if ($filter_role) { |
| 86 | <th scope="col" width="250" class="manage-column">Email</th> | 86 | <th scope="col" width="250" class="manage-column">Email</th> |
| 87 | <th scope="col" width="200" class="manage-column">Role</th> | 87 | <th scope="col" width="200" class="manage-column">Role</th> |
| 88 | <th scope="col" width="100" class="manage-column">Status</th> | 88 | <th scope="col" width="100" class="manage-column">Status</th> |
| 89 | <!-- | ||
| 90 | <th scope="col" width="100" class="manage-column"> </th> | ||
| 91 | --> | ||
| 89 | </tr> | 92 | </tr> |
| 90 | </thead> | 93 | </thead> |
| 91 | <tbody> | 94 | <tbody> |
| ... | @@ -99,6 +102,9 @@ if ($filter_role) { | ... | @@ -99,6 +102,9 @@ if ($filter_role) { |
| 99 | <td><?php echo $user['email']?></td> | 102 | <td><?php echo $user['email']?></td> |
| 100 | <td><?php echo $user['role']?></td> | 103 | <td><?php echo $user['role']?></td> |
| 101 | <td><?php echo ucwords($user['status']);?></td> | 104 | <td><?php echo ucwords($user['status']);?></td> |
| 105 | <!-- | ||
| 106 | <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> | ||
| 107 | --> | ||
| 102 | </tr> | 108 | </tr> |
| 103 | <?php endforeach; ?> | 109 | <?php endforeach; ?> |
| 104 | </body> | 110 | </body> | ... | ... |
| ... | @@ -9,7 +9,7 @@ | ... | @@ -9,7 +9,7 @@ |
| 9 | <style type="text/css"> | 9 | <style type="text/css"> |
| 10 | 10 | ||
| 11 | html, body { margin:0px; padding:0;} | 11 | html, body { margin:0px; padding:0;} |
| 12 | h3 { | 12 | .title-link { |
| 13 | color:#f7bd55; | 13 | color:#f7bd55; |
| 14 | font-size: 12px; | 14 | font-size: 12px; |
| 15 | font-weight: bold; | 15 | font-weight: bold; |
| ... | @@ -19,7 +19,7 @@ | ... | @@ -19,7 +19,7 @@ |
| 19 | border: solid 1px #FFF; | 19 | border: solid 1px #FFF; |
| 20 | border-bottom: solid 1px #999; | 20 | border-bottom: solid 1px #999; |
| 21 | cursor: default; | 21 | cursor: default; |
| 22 | padding: 0em; padding:3px 5px 3px 10px; | 22 | padding: 0em; padding:3px 10px 3px 10px; |
| 23 | margin: 0em; | 23 | margin: 0em; |
| 24 | } | 24 | } |
| 25 | 25 | ||
| ... | @@ -34,7 +34,7 @@ | ... | @@ -34,7 +34,7 @@ |
| 34 | 34 | ||
| 35 | <body> | 35 | <body> |
| 36 | 36 | ||
| 37 | <h3>Edit <?php echo $name; ?>'s CE Hours:</h3> | 37 | <div class="title-link">Edit <?php echo $name; ?>'s CE Hours:</div> |
| 38 | 38 | ||
| 39 | <form method="post" action="" id="edit-cehours-form"> | 39 | <form method="post" action="" id="edit-cehours-form"> |
| 40 | <input type="hidden" name="uid" value="<?php echo $uid; ?>" /> | 40 | <input type="hidden" name="uid" value="<?php echo $uid; ?>" /> | ... | ... |
| ... | @@ -9,7 +9,7 @@ | ... | @@ -9,7 +9,7 @@ |
| 9 | <style type="text/css"> | 9 | <style type="text/css"> |
| 10 | 10 | ||
| 11 | html, body { margin:0px; padding:0;} | 11 | html, body { margin:0px; padding:0;} |
| 12 | h3 { | 12 | .title-link { |
| 13 | color:#f7bd55; | 13 | color:#f7bd55; |
| 14 | font-size: 12px; | 14 | font-size: 12px; |
| 15 | font-weight: bold; | 15 | font-weight: bold; |
| ... | @@ -19,7 +19,7 @@ | ... | @@ -19,7 +19,7 @@ |
| 19 | border: solid 1px #FFF; | 19 | border: solid 1px #FFF; |
| 20 | border-bottom: solid 1px #999; | 20 | border-bottom: solid 1px #999; |
| 21 | cursor: default; | 21 | cursor: default; |
| 22 | padding: 0em; padding:3px 5px 3px 10px; | 22 | padding: 0em; padding:3px 10px 3px 10px; |
| 23 | margin: 0em; | 23 | margin: 0em; |
| 24 | } | 24 | } |
| 25 | 25 | ||
| ... | @@ -34,7 +34,7 @@ | ... | @@ -34,7 +34,7 @@ |
| 34 | 34 | ||
| 35 | <body> | 35 | <body> |
| 36 | 36 | ||
| 37 | <h3><?php echo $post->post_title;?></h3> | 37 | <div class="title-link"><?php echo $post->post_title;?></div> |
| 38 | 38 | ||
| 39 | <?php | 39 | <?php |
| 40 | $extras = $user_event_meta['extras']; | 40 | $extras = $user_event_meta['extras']; | ... | ... |
-
Please register or sign in to post a comment