Plugin Directory

Changeset 2857907


Ignore:
Timestamp:
01/31/2023 06:08:48 PM (3 years ago)
Author:
mintunmedia
Message:

Update to version 2.3.0 from GitHub

Location:
groups-for-membermouse
Files:
6 edited
1 copied

Legend:

Unmodified
Added
Removed
  • groups-for-membermouse/tags/2.3.0/groups-for-membermouse.php

    r2856767 r2857907  
    44 * Plugin Name: Groups for MemberMouse
    55 * 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.0
     6 * Version: 2.3.0
    77 * Author: Mintun Media
    88 * Plugin URI:  https://www.mintunmedia.com
     
    197197        public function rest_api_init() {
    198198            foreach (self::ACTIONS as $action) {
    199                 register_rest_route('mm-groups/v1/', $action, array(
     199                register_rest_route('mm-groups/v1', $action, array(
    200200                    'methods'   => WP_REST_Server::EDITABLE,
    201201                    'callback'  => function () use ($action) {
     
    814814         * If status = cancelled, cancel all group member access as well
    815815         * 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
    816819         *
    817820         * @param array $data
     
    837840            }
    838841
    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.
    840843            if (!empty($groupId)) {
    841                 if ($status == MM_Status::$CANCELED) {
    842                     // Cancelled
     844                if ($status == MM_Status::$CANCELED || $status == MM_Status::$EXPIRED || $status == MM_Status::$ACTIVE) {
     845                    // Handles Status Changes: Cancelled, Expired, Active
    843846
    844847                    $sql = "SELECT member_id FROM " . $wpdb->prefix . "group_sets_members WHERE group_id = '" . $groupId . "'";
     
    848851                        foreach ($results as $result) {
    849852                            $user = new MM_User($result->member_id);
    850                             $userStatus = MM_AccessControlEngine::changeMembershipStatus($user, MM_Status::$CANCELED);
     853                            $userStatus = MM_AccessControlEngine::changeMembershipStatus($user, $status);
    851854                        }
    852855                    }
    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);
    864865                    }
    865866                }
    866 
    867                 // Cancel Group
    868                 $groupSql   = "UPDATE {$wpdb->prefix}group_sets SET group_status='0', modifiedDate = now() WHERE group_leader={$memberId}";
    869                 $wpdb->query($groupSql);
    870867            }
    871868        }
  • groups-for-membermouse/tags/2.3.0/includes/class.shortcodes.php

    r2856767 r2857907  
    308308                    echo $cancellationHtml;
    309309                    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) {
    311311                    $deleteActionUrl = 'href="#" class="delete-member" data-member-id="' .  $member['member_id'] . '" data-name="' . $member['first_name'] . ' ' . $member['last_name'] . '"';
    312312                    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  
    6969
    7070== Changelog ==
     71
     722.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
    71752.2.0
    7276- ENHANCEMENT: Includes changes to how updates are deployed.
  • groups-for-membermouse/trunk/groups-for-membermouse.php

    r2856767 r2857907  
    44 * Plugin Name: Groups for MemberMouse
    55 * 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.0
     6 * Version: 2.3.0
    77 * Author: Mintun Media
    88 * Plugin URI:  https://www.mintunmedia.com
     
    197197        public function rest_api_init() {
    198198            foreach (self::ACTIONS as $action) {
    199                 register_rest_route('mm-groups/v1/', $action, array(
     199                register_rest_route('mm-groups/v1', $action, array(
    200200                    'methods'   => WP_REST_Server::EDITABLE,
    201201                    'callback'  => function () use ($action) {
     
    814814         * If status = cancelled, cancel all group member access as well
    815815         * 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
    816819         *
    817820         * @param array $data
     
    837840            }
    838841
    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.
    840843            if (!empty($groupId)) {
    841                 if ($status == MM_Status::$CANCELED) {
    842                     // Cancelled
     844                if ($status == MM_Status::$CANCELED || $status == MM_Status::$EXPIRED || $status == MM_Status::$ACTIVE) {
     845                    // Handles Status Changes: Cancelled, Expired, Active
    843846
    844847                    $sql = "SELECT member_id FROM " . $wpdb->prefix . "group_sets_members WHERE group_id = '" . $groupId . "'";
     
    848851                        foreach ($results as $result) {
    849852                            $user = new MM_User($result->member_id);
    850                             $userStatus = MM_AccessControlEngine::changeMembershipStatus($user, MM_Status::$CANCELED);
     853                            $userStatus = MM_AccessControlEngine::changeMembershipStatus($user, $status);
    851854                        }
    852855                    }
    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);
    864865                    }
    865866                }
    866 
    867                 // Cancel Group
    868                 $groupSql   = "UPDATE {$wpdb->prefix}group_sets SET group_status='0', modifiedDate = now() WHERE group_leader={$memberId}";
    869                 $wpdb->query($groupSql);
    870867            }
    871868        }
  • groups-for-membermouse/trunk/includes/class.shortcodes.php

    r2856767 r2857907  
    308308                    echo $cancellationHtml;
    309309                    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) {
    311311                    $deleteActionUrl = 'href="#" class="delete-member" data-member-id="' .  $member['member_id'] . '" data-name="' . $member['first_name'] . ' ' . $member['last_name'] . '"';
    312312                    echo MM_Utils::getDeleteIcon("Remove the member from this group", 'margin-left:5px;', $deleteActionUrl);
  • groups-for-membermouse/trunk/readme.txt

    r2856767 r2857907  
    6969
    7070== Changelog ==
     71
     722.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
    71752.2.0
    7276- ENHANCEMENT: Includes changes to how updates are deployed.
Note: See TracChangeset for help on using the changeset viewer.