| 1 |
<?php |
| 2 |
if ( ! defined( 'ABSPATH' ) ) { |
| 3 |
exit; // Exit if accessed directly! |
| 4 |
} |
| 5 |
|
| 6 |
if ( ! class_exists( 'WPSC_Onboarding_Step_Statuses' ) ) : |
| 7 |
|
| 8 |
/** |
| 9 |
* Onboarding step 4: Statuses & Priorities (informational). |
| 10 |
* |
| 11 |
* Read-only summary of the existing defaults via WPSC_Status/WPSC_Priority - |
| 12 |
* no changes are forced. No link out to Settings here: every other |
| 13 |
* SupportCandy submenu is hidden while setup is pending (see |
| 14 |
* WPSC_Onboarding::restrict_menu_during_setup()), so that page isn't |
| 15 |
* reachable until the wizard is completed. |
| 16 |
*/ |
| 17 |
final class WPSC_Onboarding_Step_Statuses { |
| 18 |
|
| 19 |
const STEP_ID = 'statuses'; |
| 20 |
|
| 21 |
/** |
| 22 |
* Render step body |
| 23 |
* |
| 24 |
* @param string $step_id - step id. |
| 25 |
* @return void |
| 26 |
*/ |
| 27 |
public static function render( $step_id ) { |
| 28 |
|
| 29 |
$statuses = WPSC_Status::find( array( 'items_per_page' => 0 ) )['results']; |
| 30 |
$priorities = WPSC_Priority::find( array( 'items_per_page' => 0 ) )['results']; |
| 31 |
?> |
| 32 |
<div class="wpsc-onboarding-step"> |
| 33 |
<h2><?php esc_attr_e( 'Statuses & Priorities', 'supportcandy' ); ?></h2> |
| 34 |
<p class="wpsc-onboarding-step-desc"> |
| 35 |
<?php esc_attr_e( 'Statuses show where a ticket is in your support process, while priorities help your team identify which tickets need attention first. The defaults below work well for most teams - you can continue as-is or customize them anytime.', 'supportcandy' ); ?> |
| 36 |
</p> |
| 37 |
|
| 38 |
<div class="wpsc-onboarding-card stacked"> |
| 39 |
<div class="wpsc-onboarding-card-info"> |
| 40 |
<h3><?php WPSC_Icons::get( 'gps-navigation' ); ?> <?php esc_attr_e( 'Statuses', 'supportcandy' ); ?></h3> |
| 41 |
<ul class="wpsc-onboarding-tag-list"> |
| 42 |
<?php foreach ( $statuses as $status ) : ?> |
| 43 |
<li style="background-color:<?php echo esc_attr( $status->bg_color ); ?>;color:<?php echo esc_attr( $status->color ); ?>;"><?php echo esc_html( $status->name ); ?></li> |
| 44 |
<?php endforeach; ?> |
| 45 |
</ul> |
| 46 |
</div> |
| 47 |
</div> |
| 48 |
|
| 49 |
<div class="wpsc-onboarding-card stacked"> |
| 50 |
<div class="wpsc-onboarding-card-info"> |
| 51 |
<h3><?php WPSC_Icons::get( 'prioritize' ); ?> <?php esc_attr_e( 'Priorities', 'supportcandy' ); ?></h3> |
| 52 |
<ul class="wpsc-onboarding-tag-list"> |
| 53 |
<?php foreach ( $priorities as $priority ) : ?> |
| 54 |
<li style="background-color:<?php echo esc_attr( $priority->bg_color ); ?>;color:<?php echo esc_attr( $priority->color ); ?>;"><?php echo esc_html( $priority->name ); ?></li> |
| 55 |
<?php endforeach; ?> |
| 56 |
</ul> |
| 57 |
</div> |
| 58 |
</div> |
| 59 |
|
| 60 |
<p class="wpsc-onboarding-step-desc"><?php esc_attr_e( 'You can review and customize these anytime from Settings once setup is complete.', 'supportcandy' ); ?></p> |
| 61 |
|
| 62 |
<?php WPSC_Onboarding::render_step_footer( $step_id ); ?> |
| 63 |
</div> |
| 64 |
<?php |
| 65 |
wp_die(); |
| 66 |
} |
| 67 |
} |
| 68 |
endif; |
| 69 |
|