_form.php
1 year ago
action_test_preview.php
4 months ago
index.php
1 year ago
new_form.php
1 year ago
test_preview.php
1 year ago
test_preview.php
41 lines
| 1 | <?php |
| 2 | /* @var $process OsProcessModel */ |
| 3 | /* @var $action_settings_html string */ |
| 4 | /* @var $action \LatePoint\Misc\ProcessAction */ |
| 5 | |
| 6 | if ( ! defined( 'ABSPATH' ) ) { |
| 7 | exit; // Exit if accessed directly |
| 8 | } |
| 9 | |
| 10 | ?> |
| 11 | <div class="os-form-header"> |
| 12 | <h2><?php echo esc_html($process->name.' '.__('Test', 'latepoint')); ?></h2> |
| 13 | </div> |
| 14 | <div class="action-settings-wrapper"> |
| 15 | <?php echo $action_settings_html; ?> |
| 16 | </div> |
| 17 | <div class="os-form-content"> |
| 18 | <div class="action-preview-wrapper"> |
| 19 | <h3><?php esc_html_e('Actions to trigger:', 'latepoint'); ?></h3> |
| 20 | <div class="actions-to-run-wrapper"> |
| 21 | <?php |
| 22 | if(!empty($process->actions)){ |
| 23 | foreach($process->actions as $action){ |
| 24 | if($action->status != LATEPOINT_STATUS_ACTIVE) continue; |
| 25 | echo '<div class="action-to-run" data-id="'.esc_attr($action->id).'">'.OsFormHelper::toggler_field('action['.$action->id.']', $action->get_nice_type_name(), true).'</div>'; |
| 26 | } |
| 27 | }else{ |
| 28 | echo '<div class="latepoint-message latepoint-message-subtle">'.esc_html__('No actions were created for this process. Create actions first in order to test them.', 'latepoint').'</div>'; |
| 29 | } |
| 30 | ?> |
| 31 | </div> |
| 32 | </div> |
| 33 | </div> |
| 34 | <?php if(!empty($process->actions)){ ?> |
| 35 | <div class="os-form-buttons"> |
| 36 | <button type="button" class="latepoint-btn latepoint-btn-primary latepoint-run-process-btn" data-route="<?php echo esc_attr(OsRouterHelper::build_route_name('processes', 'test_run'));?>"> |
| 37 | <i class="latepoint-icon latepoint-icon-play-circle"></i> |
| 38 | <span><?php esc_html_e('Run Now', 'latepoint'); ?></span> |
| 39 | </button> |
| 40 | </div> |
| 41 | <?php } ?> |