Changeset 2857907
- Timestamp:
- 01/31/2023 06:08:48 PM (3 years ago)
- Location:
- groups-for-membermouse
- Files:
-
- 6 edited
- 1 copied
-
tags/2.3.0 (copied) (copied from groups-for-membermouse/trunk)
-
tags/2.3.0/groups-for-membermouse.php (modified) (5 diffs)
-
tags/2.3.0/includes/class.shortcodes.php (modified) (1 diff)
-
tags/2.3.0/readme.txt (modified) (1 diff)
-
trunk/groups-for-membermouse.php (modified) (5 diffs)
-
trunk/includes/class.shortcodes.php (modified) (1 diff)
-
trunk/readme.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
groups-for-membermouse/tags/2.3.0/groups-for-membermouse.php
r2856767 r2857907 4 4 * Plugin Name: Groups for MemberMouse 5 5 * Description: Adds group support to MemberMouse. You can define different types of groups allowing a single customer to pay for multiple seats and members to join existing groups for free or for a price based on how you configure the group type. <strong>Requires MemberMouse to activate and use.</strong> 6 * Version: 2. 2.06 * Version: 2.3.0 7 7 * Author: Mintun Media 8 8 * Plugin URI: https://www.mintunmedia.com … … 197 197 public function rest_api_init() { 198 198 foreach (self::ACTIONS as $action) { 199 register_rest_route('mm-groups/v1 /', $action, array(199 register_rest_route('mm-groups/v1', $action, array( 200 200 'methods' => WP_REST_Server::EDITABLE, 201 201 'callback' => function () use ($action) { … … 814 814 * If status = cancelled, cancel all group member access as well 815 815 * If status = expired, expire all group member access as well 816 * If status = active, activate all group member access as well 817 * 818 * Also handles active/inactive status for the leaders group 816 819 * 817 820 * @param array $data … … 837 840 } 838 841 839 // Check if User is Cancelled and in a group. Cancels all members in the group.842 // Check if User Status is changed and has a group. Update all members in group accordingly. 840 843 if (!empty($groupId)) { 841 if ($status == MM_Status::$CANCELED ) {842 // Cancelled844 if ($status == MM_Status::$CANCELED || $status == MM_Status::$EXPIRED || $status == MM_Status::$ACTIVE) { 845 // Handles Status Changes: Cancelled, Expired, Active 843 846 844 847 $sql = "SELECT member_id FROM " . $wpdb->prefix . "group_sets_members WHERE group_id = '" . $groupId . "'"; … … 848 851 foreach ($results as $result) { 849 852 $user = new MM_User($result->member_id); 850 $userStatus = MM_AccessControlEngine::changeMembershipStatus($user, MM_Status::$CANCELED);853 $userStatus = MM_AccessControlEngine::changeMembershipStatus($user, $status); 851 854 } 852 855 } 853 } else if ($status == MM_Status::$EXPIRED) { 854 // Expired 855 856 $sql = "SELECT member_id FROM " . $wpdb->prefix . "group_sets_members WHERE group_id = '" . $groupId . "'"; 857 $results = $wpdb->get_results($sql); 858 859 if (count($results) > 0) { 860 foreach ($results as $result) { 861 $user = new MM_User($result->member_id); 862 $userStatus = MM_AccessControlEngine::changeMembershipStatus($user, MM_Status::$EXPIRED); 863 } 856 857 if ($status == MM_Status::$CANCELED || $status == MM_Status::$EXPIRED) { 858 // Change group Status to Cancelled 859 $groupSql = "UPDATE {$wpdb->prefix}group_sets SET group_status='0', modifiedDate = now() WHERE group_leader={$memberId}"; 860 $wpdb->query($groupSql); 861 } else if ($status == MM_Status::$ACTIVE) { 862 // Change group Status back to Active 863 $groupSql = "UPDATE {$wpdb->prefix}group_sets SET group_status='1', modifiedDate = now() WHERE group_leader={$memberId}"; 864 $wpdb->query($groupSql); 864 865 } 865 866 } 866 867 // Cancel Group868 $groupSql = "UPDATE {$wpdb->prefix}group_sets SET group_status='0', modifiedDate = now() WHERE group_leader={$memberId}";869 $wpdb->query($groupSql);870 867 } 871 868 } -
groups-for-membermouse/tags/2.3.0/includes/class.shortcodes.php
r2856767 r2857907 308 308 echo $cancellationHtml; 309 309 echo MM_Utils::getDeleteIcon("This member has an active paid membership which must be canceled before they can be removed from the group. Please contact support.", 'margin-left:5px;', '', true); 310 } else if ($ statusId=== 1) {310 } else if ($member['status_id'] === 1) { 311 311 $deleteActionUrl = 'href="#" class="delete-member" data-member-id="' . $member['member_id'] . '" data-name="' . $member['first_name'] . ' ' . $member['last_name'] . '"'; 312 312 echo MM_Utils::getDeleteIcon("Remove the member from this group", 'margin-left:5px;', $deleteActionUrl); -
groups-for-membermouse/tags/2.3.0/readme.txt
r2856767 r2857907 69 69 70 70 == Changelog == 71 72 2.3.0 73 - BUG FIX: Fixed a conditional bug that caused the delete action button to not show in the Group Leader Dashboard shortcode 74 71 75 2.2.0 72 76 - ENHANCEMENT: Includes changes to how updates are deployed. -
groups-for-membermouse/trunk/groups-for-membermouse.php
r2856767 r2857907 4 4 * Plugin Name: Groups for MemberMouse 5 5 * Description: Adds group support to MemberMouse. You can define different types of groups allowing a single customer to pay for multiple seats and members to join existing groups for free or for a price based on how you configure the group type. <strong>Requires MemberMouse to activate and use.</strong> 6 * Version: 2. 2.06 * Version: 2.3.0 7 7 * Author: Mintun Media 8 8 * Plugin URI: https://www.mintunmedia.com … … 197 197 public function rest_api_init() { 198 198 foreach (self::ACTIONS as $action) { 199 register_rest_route('mm-groups/v1 /', $action, array(199 register_rest_route('mm-groups/v1', $action, array( 200 200 'methods' => WP_REST_Server::EDITABLE, 201 201 'callback' => function () use ($action) { … … 814 814 * If status = cancelled, cancel all group member access as well 815 815 * If status = expired, expire all group member access as well 816 * If status = active, activate all group member access as well 817 * 818 * Also handles active/inactive status for the leaders group 816 819 * 817 820 * @param array $data … … 837 840 } 838 841 839 // Check if User is Cancelled and in a group. Cancels all members in the group.842 // Check if User Status is changed and has a group. Update all members in group accordingly. 840 843 if (!empty($groupId)) { 841 if ($status == MM_Status::$CANCELED ) {842 // Cancelled844 if ($status == MM_Status::$CANCELED || $status == MM_Status::$EXPIRED || $status == MM_Status::$ACTIVE) { 845 // Handles Status Changes: Cancelled, Expired, Active 843 846 844 847 $sql = "SELECT member_id FROM " . $wpdb->prefix . "group_sets_members WHERE group_id = '" . $groupId . "'"; … … 848 851 foreach ($results as $result) { 849 852 $user = new MM_User($result->member_id); 850 $userStatus = MM_AccessControlEngine::changeMembershipStatus($user, MM_Status::$CANCELED);853 $userStatus = MM_AccessControlEngine::changeMembershipStatus($user, $status); 851 854 } 852 855 } 853 } else if ($status == MM_Status::$EXPIRED) { 854 // Expired 855 856 $sql = "SELECT member_id FROM " . $wpdb->prefix . "group_sets_members WHERE group_id = '" . $groupId . "'"; 857 $results = $wpdb->get_results($sql); 858 859 if (count($results) > 0) { 860 foreach ($results as $result) { 861 $user = new MM_User($result->member_id); 862 $userStatus = MM_AccessControlEngine::changeMembershipStatus($user, MM_Status::$EXPIRED); 863 } 856 857 if ($status == MM_Status::$CANCELED || $status == MM_Status::$EXPIRED) { 858 // Change group Status to Cancelled 859 $groupSql = "UPDATE {$wpdb->prefix}group_sets SET group_status='0', modifiedDate = now() WHERE group_leader={$memberId}"; 860 $wpdb->query($groupSql); 861 } else if ($status == MM_Status::$ACTIVE) { 862 // Change group Status back to Active 863 $groupSql = "UPDATE {$wpdb->prefix}group_sets SET group_status='1', modifiedDate = now() WHERE group_leader={$memberId}"; 864 $wpdb->query($groupSql); 864 865 } 865 866 } 866 867 // Cancel Group868 $groupSql = "UPDATE {$wpdb->prefix}group_sets SET group_status='0', modifiedDate = now() WHERE group_leader={$memberId}";869 $wpdb->query($groupSql);870 867 } 871 868 } -
groups-for-membermouse/trunk/includes/class.shortcodes.php
r2856767 r2857907 308 308 echo $cancellationHtml; 309 309 echo MM_Utils::getDeleteIcon("This member has an active paid membership which must be canceled before they can be removed from the group. Please contact support.", 'margin-left:5px;', '', true); 310 } else if ($ statusId=== 1) {310 } else if ($member['status_id'] === 1) { 311 311 $deleteActionUrl = 'href="#" class="delete-member" data-member-id="' . $member['member_id'] . '" data-name="' . $member['first_name'] . ' ' . $member['last_name'] . '"'; 312 312 echo MM_Utils::getDeleteIcon("Remove the member from this group", 'margin-left:5px;', $deleteActionUrl); -
groups-for-membermouse/trunk/readme.txt
r2856767 r2857907 69 69 70 70 == Changelog == 71 72 2.3.0 73 - BUG FIX: Fixed a conditional bug that caused the delete action button to not show in the Group Leader Dashboard shortcode 74 71 75 2.2.0 72 76 - ENHANCEMENT: Includes changes to how updates are deployed.
Note: See TracChangeset
for help on using the changeset viewer.