PluginProbe
SupportCandy – AI Customer Support Ticket System & Live Chatbot Agent / trunk
SupportCandy – AI Customer Support Ticket System & Live Chatbot Agent vtrunk
3.5.4 3.5.3 3.5.2 3.5.1 3.4.9 3.5.0 3.4.8 3.4.7 trunk 2.3.1 3.3.6 3.3.7 3.3.8 3.3.9 3.4.0 3.4.1 3.4.2 3.4.3 3.4.4 3.4.5 3.4.6
supportcandy / includes / admin / onboarding / class-wpsc-onboarding-step-agents.php

class-wpsc-onboarding-step-agents.php in SupportCandy – AI Customer Support Ticket System & Live Chatbot Agent trunk, at includes/admin/onboarding/class-wpsc-onboarding-step-agents.php

91 lines 3.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 if ( ! defined( 'ABSPATH' ) ) {
3 exit; // Exit if accessed directly!
4 }
5
6 if ( ! class_exists( 'WPSC_Onboarding_Step_Agents' ) ) :
7
8 /**
9 * Onboarding step 6: Support Agents & Roles, in two sections.
10 *
11 * Support Agents: shows the real list of existing agents (via
12 * WPSC_Agent::find(), same as the real Support Agents screen), read-only -
13 * adding an agent is never required here, some businesses manage support
14 * themselves, so agents can be added anytime from Support Agents settings
15 * once setup is complete.
16 *
17 * Agent Roles: shows the real list of existing roles (option
18 * 'wpsc-agent-roles', same as every agent above is assigned one of). No
19 * link out to the Agent Roles screen here: every other SupportCandy
20 * submenu is hidden while setup is pending (see
21 * WPSC_Onboarding::restrict_menu_during_setup()), so that page isn't
22 * reachable until the wizard is completed.
23 */
24 final class WPSC_Onboarding_Step_Agents {
25
26 const STEP_ID = 'agents';
27
28 /**
29 * Render step body
30 *
31 * @param string $step_id - step id.
32 * @return void
33 */
34 public static function render( $step_id ) {
35
36 $roles = get_option( 'wpsc-agent-roles', array() );
37 $agents = array_filter(
38 WPSC_Agent::find( array( 'items_per_page' => 0 ) )['results'],
39 function ( $agent ) {
40 return $agent->is_active && ! $agent->is_agentgroup;
41 }
42 );
43 ?>
44 <div class="wpsc-onboarding-step">
45 <h2><?php esc_attr_e( 'Support Agents', 'supportcandy' ); ?></h2>
46 <p class="wpsc-onboarding-step-desc">
47 <?php esc_attr_e( 'Support agents are the members of your team who manage and respond to customer tickets. You can add the people who\'ll be working tickets anytime from Support Agents settings once setup is complete.', 'supportcandy' ); ?>
48 </p>
49
50 <?php if ( ! empty( $agents ) ) : ?>
51 <ul class="wpsc-onboarding-pill-list">
52 <?php foreach ( $agents as $agent ) : ?>
53 <li>
54 <?php echo esc_html( $agent->name ); ?>
55 <?php if ( isset( $roles[ $agent->role ]['label'] ) ) : ?>
56 &middot; <?php echo esc_html( $roles[ $agent->role ]['label'] ); ?>
57 <?php endif; ?>
58 </li>
59 <?php endforeach; ?>
60 </ul>
61 <?php else : ?>
62 <div class="wpsc-onboarding-status pending">
63 <?php esc_attr_e( "You haven't added any support agents yet. Some businesses manage support themselves - you can add agents anytime.", 'supportcandy' ); ?>
64 </div>
65 <?php endif; ?>
66
67 <hr class="wpsc-onboarding-divider">
68
69 <h2><?php esc_attr_e( 'Agent Roles', 'supportcandy' ); ?></h2>
70 <p class="wpsc-onboarding-step-desc">
71 <?php esc_attr_e( 'Roles control what each agent can see and do - for example, whether they can view unassigned tickets, add private notes, or change ticket status. Every agent above is assigned one of the roles below.', 'supportcandy' ); ?>
72 </p>
73
74 <?php if ( ! empty( $roles ) ) : ?>
75 <ul class="wpsc-onboarding-pill-list">
76 <?php foreach ( $roles as $role ) : ?>
77 <li><?php echo esc_html( $role['label'] ); ?></li>
78 <?php endforeach; ?>
79 </ul>
80 <?php endif; ?>
81
82 <p class="wpsc-onboarding-step-desc"><?php esc_attr_e( 'You can manage roles and permissions anytime from Support Agents settings once setup is complete.', 'supportcandy' ); ?></p>
83
84 <?php WPSC_Onboarding::render_step_footer( $step_id ); ?>
85 </div>
86 <?php
87 wp_die();
88 }
89 }
90 endif;
91