Recent Support Tickets show list from all user

Hi, I’ve installed Support System Plugin on my wordpress site networks. It working as expected!

But, our problem is the Support System Plugin is listing all tickets from all user.

What we want is the recent support tickets only showing all tickets from current logged in user ONLY. How I can implement it on my side? any suggestion or patch?

notes: i’ve implement this to the plugin. https://premium.wpmudev.org/forums/topic/making-the-support-system-plugin-available-to-subscribers

Thanks.

  • yehaa3u
    • New Recruit

    Hello Tom,

    ok.. let me clarify it to you. Now, on the subsite, current logged user (role: subscriber) can view all recent tickets..

    What I need is to filter it so that the recent tickets only display tickets submitted by current logged user only.

    For example, I’m logged in as UserA (role: subscriber), on my recent tickets, I only can see tickets submitted by me only.

    You may use this access to test on our site.

    http://n56.umnosabah.com/wp-admin

    id: ak88

    pass: MBjvt3r8ORSE

  • S H Mohanjith
    • Developer

    You could change line 1893 in incsub-support.php from

    $tickets = $wpdb->get_results("
    SELECT t.ticket_id, t.blog_id, t.user_id, t.cat_id, t.admin_id, t.ticket_type, t.ticket_priority, t.ticket_status, t.ticket_updated, t.title, c.cat_name, u.display_name
    FROM ".incsub_support_tablename('tickets')." AS t
    LEFT JOIN ".incsub_support_tablename('tickets_cats')." AS c ON (t.cat_id = c.cat_id)
    LEFT JOIN $wpdb->users AS u ON (t.admin_id = u.ID)
    WHERE t.site_id = '{$current_site->id}' AND t.blog_id = '{$blog_id}' {$do_history}
    ");

    to

    $current_user = wp_get_current_user();
    $tickets = $wpdb->get_results("
    SELECT t.ticket_id, t.blog_id, t.user_id, t.cat_id, t.admin_id, t.ticket_type, t.ticket_priority, t.ticket_status, t.ticket_updated, t.title, c.cat_name, u.display_name
    FROM ".incsub_support_tablename('tickets')." AS t
    LEFT JOIN ".incsub_support_tablename('tickets_cats')." AS c ON (t.cat_id = c.cat_id)
    LEFT JOIN $wpdb->users AS u ON (t.admin_id = u.ID)
    WHERE t.site_id = '{$current_site->id}' AND t.blog_id = '{$blog_id}' AND t.user_id = {$current_user->ID} {$do_history}
    ");

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.