_agents.php
1 year ago
_complete.php
1 year ago
_default_agent.php
4 months ago
_form_agent.php
1 year ago
_form_service.php
5 months ago
_intro.php
1 year ago
_list_agents.php
1 year ago
_list_services.php
1 year ago
_personal_info.php
2 months ago
_services.php
4 months ago
_settings.php
1 year ago
_work_periods.php
4 months ago
_form_service.php
56 lines
| 1 | <?php |
| 2 | if ( ! defined( 'ABSPATH' ) ) { |
| 3 | exit; // Exit if accessed directly |
| 4 | } |
| 5 | ?> |
| 6 | <div class="os-form-w"> |
| 7 | <form action="" data-os-after-call="latepoint_wizard_item_editing_cancelled" data-os-pass-response="yes" data-os-output-target=".os-wizard-step-content-i" data-os-action="<?php echo esc_attr(OsRouterHelper::build_route_name('wizard', 'save_service')); ?>"> |
| 8 | <?php wp_nonce_field( 'save_service' ); ?> |
| 9 | <div class="os-row"> |
| 10 | <div class="os-col-lg-8"> |
| 11 | <?php echo OsFormHelper::text_field('service[name]', __('Service Name', 'latepoint'), $service->name); ?> |
| 12 | </div> |
| 13 | <div class="os-col-lg-4"> |
| 14 | <?php echo OsFormHelper::text_field('service[duration]', __('Duration (minutes)', 'latepoint'), $service->duration); ?> |
| 15 | </div> |
| 16 | </div> |
| 17 | <?php |
| 18 | echo OsFormHelper::media_uploader_field('service[selection_image_id]', 0, __('Upload Image for Service', 'latepoint'), __('Remove Image', 'latepoint'), $service->selection_image_id); |
| 19 | if(!$service->is_new_record()) echo OsFormHelper::hidden_field('service[id]', $service->id); |
| 20 | ?> |
| 21 | <?php if(count($agents) > 1){ ?> |
| 22 | <h3 class="sub-header"><span><?php esc_html_e('Assign Agents','latepoint'); ?></span></h3> |
| 23 | <div class="os-agents-selector"> |
| 24 | <?php |
| 25 | foreach($agents as $agent){ |
| 26 | $is_active_service = $service->is_new_record() ? true : $location->has_agent_and_service($agent->id, $service->id); |
| 27 | $is_active_service_value = $is_active_service ? 'yes' : 'no'; |
| 28 | $active_class = $is_active_service ? 'active' : ''; |
| 29 | echo '<div class="agent '.esc_attr($active_class).'">'; |
| 30 | echo '<div class="agent-avatar" style="background-image: url(' . esc_url($agent->get_avatar_url()) . ')"></div>'; |
| 31 | echo '<div class="agent-name">' . esc_html($agent->full_name) . '</div>'; |
| 32 | echo OsFormHelper::hidden_field('service[agents][agent_'.$agent->id.'][location_'.$location->id.'][connected]', $is_active_service_value, array('class' => 'connection-child-is-connected')); |
| 33 | echo '</div>'; |
| 34 | } ?> |
| 35 | </div> |
| 36 | <?php }else{ |
| 37 | foreach($agents as $agent) { |
| 38 | echo OsFormHelper::hidden_field( 'service[agents][agent_' . $agent->id . '][location_' . $location->id . '][connected]', 'yes' ); |
| 39 | } |
| 40 | } ?> |
| 41 | <div class="side-by-side-buttons"> |
| 42 | <?php if($services){ ?> |
| 43 | <button type="button" data-os-after-call="latepoint_wizard_item_editing_cancelled" data-os-pass-response="yes" data-os-output-target=".os-wizard-step-content" data-os-params="current_step_code=services" data-os-action="<?php echo esc_attr(OsRouterHelper::build_route_name('wizard', 'load_step')); ?>" class="wizard-finished-editing-trigger latepoint-btn latepoint-btn-lg latepoint-btn-secondary"> |
| 44 | <i class="latepoint-icon latepoint-icon-arrow-left"></i> |
| 45 | <span><?php esc_html_e('Cancel', 'latepoint'); ?></span> |
| 46 | </button> |
| 47 | <?php }else{ ?> |
| 48 | <a href="#" data-route-name="<?php echo esc_attr(OsRouterHelper::build_route_name('wizard', 'prev_step')); ?>" class="latepoint-btn latepoint-btn-lg latepoint-btn-secondary os-wizard-trigger-prev-btn"><i class="latepoint-icon latepoint-icon-arrow-left"></i> <span><?php esc_html_e('Back', 'latepoint'); ?></span></a> |
| 49 | <?php } ?> |
| 50 | <button type="submit" class="latepoint-btn latepoint-btn-primary latepoint-btn-lg "> |
| 51 | <span><?php echo ($service->is_new_record()) ? esc_html__('Save', 'latepoint') : esc_html__('Save', 'latepoint'); ?></span> |
| 52 | <i class="latepoint-icon latepoint-icon-check"></i> |
| 53 | </button> |
| 54 | </div> |
| 55 | </form> |
| 56 | </div> |