PluginProbe
Timetics – Appointment Booking Calendar & Scheduling / 1.0.64
Timetics – Appointment Booking Calendar & Scheduling v1.0.64
1.0.64 1.0.62 1.0.63 1.0.61 1.0.60 1.0.59 1.0.58 1.0.57 1.0.56 trunk 1.0.0 1.0.1 1.0.10 1.0.11 1.0.12 1.0.13 1.0.14 1.0.15 1.0.16 1.0.17 1.0.18 1.0.19 1.0.2 1.0.20 1.0.21 All 65 releases
← All changes | core/frontend/templates/meeting-list.php +93 -86 1.0.10 → 1.0.64 View file →
@@ -1,26 +1,36 @@
1 1 <?php
2 +defined( 'ABSPATH' ) || exit;
2 3
3 4 use Timetics\Core\Appointments\Appointment as Appointment;
4 5 use Timetics\Core\Staffs\Staff;
5 6
6 -$meetings = Appointment::all();
7 -$staffs = Staff::all();
8 -$terms = get_terms( [
7 +$timetics_args = [
8 + 'posts_per_page' => $timetics_limit
9 +];
10 +
11 +if ( ! current_user_can( 'manage_options' ) ) {
12 + $timetics_args['visibility'] = 'enabled';
13 +}
14 +
15 +$timetics_meetings = Appointment::all($timetics_args);
16 +
17 +$timetics_staffs = Staff::all();
18 +$timetics_terms = get_terms( [
9 19 'taxonomy' => 'timetics-meeting-category',
10 20 'hide_empty' => false,
11 21 ] );
12 22
13 23 ?>
14 -<?php if ( $show_filter ) : ?>
15 -<div class="timetics-meeting-filter ant-row timetics-input">
24 +<?php if ( $timetics_show_filter ) : ?>
25 +<div class="timetics-meeting-filter timetics-input">
16 26 <div class="timetics-select-wrapper ant-select">
17 27 <!-- Category List -->
18 28 <select type="select" id="timetics-filter-category" class="timetics-select ant-select-selector">
19 29 <option value=""><?php esc_html_e( 'All Department', 'timetics' ); ?></option>
20 - <?php if ( $terms ): ?>
21 - <?php foreach( $terms as $term ): ?>
22 - <option value="<?php echo esc_attr( $term->term_id ); ?>"><?php echo esc_html( $term->name ); ?></option>
30 + <?php if ( $timetics_terms ): ?>
31 + <?php foreach( $timetics_terms as $timetics_term ): ?>
32 + <option value="<?php echo esc_attr( $timetics_term->term_id ); ?>"><?php echo esc_html( $timetics_term->name ); ?></option>
23 33 <?php endforeach; ?>
24 34 <?php endif; ?>
25 35 </select>
26 36 <!-- End Category List -->
@@ -26,15 +36,15 @@
26 36 <!-- End Category List -->
27 37
28 38 <!-- Staff List -->
29 39 <select type="select" id="timetics-filter-staff"class="timetics-select ant-select-selector">
30 - <option value=""><?php esc_html_e( 'All Staff', 'timetics' ); ?></option>
31 - <?php if ( $staffs ): ?>
32 - <?php foreach( $staffs['items'] as $staff ): ?>
40 + <option value=""><?php esc_html_e( 'All Organizers', 'timetics' ); ?></option>
41 + <?php if ( $timetics_staffs ): ?>
42 + <?php foreach( $timetics_staffs['items'] as $timetics_staff ): ?>
33 43 <?php
34 - $staff = new Staff( $staff->ID );
44 + $timetics_staff = new Staff( $timetics_staff->ID );
35 45 ?>
36 - <option value="<?php echo esc_attr( $staff->get_id() ); ?>"><?php echo $staff->get_display_name(); ?></option>
46 + <option value="<?php echo esc_attr( $timetics_staff->get_id() ); ?>"><?php echo esc_attr( $timetics_staff->get_full_name() ); ?></option>
37 47 <?php endforeach; ?>
38 48 <?php endif; ?>
39 49 </select>
40 50 </div>
@@ -41,86 +51,83 @@
41 51 <!-- Staff List End -->
42 52 </div>
43 53 <?php endif; ?>
44 54
45 -<div class="tt-meeting-list-wrapper toplevel_page_timetics ant-row">
46 - <?php
47 - foreach ($meetings['items'] as $item) {
48 - $meeting = new Appointment($item->ID);
49 - $staffs = $meeting->get_staff();
50 - $locations = $meeting->get_locations();
51 - $id = $meeting->get_id();
52 - $prices = $meeting->get_price();
53 - ?>
54 - <div class="ant-col-8 ant-col-xs-24 ant-col-md-8">
55 +<div class="tt-meeting-list-wrapper toplevel_page_timetics">
56 + <?php if(!empty($timetics_meetings['items'])) : ?>
57 + <?php
58 + foreach ($timetics_meetings['items'] as $timetics_item) {
59 + $timetics_meeting = new Appointment($timetics_item->ID);
60 + $timetics_staffs = $timetics_meeting->get_staff();
61 + $timetics_locations = $timetics_meeting->get_locations();
62 + $timetics_id = $timetics_meeting->get_id();
63 + $timetics_prices = $timetics_meeting->get_price();
64 + ?>
55 65 <div class="tt-meeting-list-item">
56 - <?php
57 - if (!empty($staffs)) {
58 - if (count($staffs) > 2) {
59 - // Display only image for staff members if there are more than two
60 - ?>
61 - <ul class="tt-author tt-author-avatar-list">
66 + <!-- meeting description -->
67 + <div class="tt-meeting-information">
68 + <?php
69 + if (!empty($timetics_staffs)) {
70 +
71 + // Display both image and full name if there are two or fewer staff members
72 + ?>
73 + <ul class="tt-author">
74 + <?php
75 + foreach ($timetics_staffs as $timetics_key => $timetics_staff) {
76 + ?>
77 + <li>
78 + <?php if ($timetics_staff['image']) {
79 + ?>
80 + <img src="<?php echo esc_url($timetics_staff['image']); ?>" alt="<?php echo esc_attr($timetics_staff['full_name']); ?>" />
81 + <?php } ?>
82 + <span><?php echo esc_html($timetics_staff['full_name']); ?></span>
83 + </li>
84 + <?php
85 + }
86 + ?>
87 + </ul>
62 88 <?php
63 - foreach ($staffs as $key => $staff) {
64 - ?>
65 - <li class="tt-single-host">
66 - <img src="<?php echo esc_url($staff['image']); ?>" alt="<?php echo esc_attr($staff['full_name']); ?>" />
67 - <div class="tt-tooltip-text"><?php echo esc_html($staff['full_name']); ?></div>
68 - </li>
69 - <?php
70 - }
71 - ?>
72 - </ul>
73 - <?php
74 - } else {
75 - // Display both image and full name if there are two or fewer staff members
89 +
90 + }
91 + ?>
92 + </ul>
93 + <h3 class="tt-title">
94 + <?php
95 + echo esc_html($timetics_meeting->get_name());
96 + ?>
97 + </h3>
98 + <?php
99 + if($timetics_meeting->get_description()) {
76 100 ?>
77 - <ul class="tt-author">
78 - <?php
79 - foreach ($staffs as $key => $staff) {
80 - ?>
81 - <li>
82 - <img src="<?php echo esc_url($staff['image']); ?>" alt="<?php echo esc_attr($staff['full_name']); ?>" />
83 - <span><?php echo esc_html($staff['full_name']); ?></span>
84 - </li>
85 - <?php
86 - }
87 - ?>
88 - </ul>
101 + <p><?php echo esc_html($timetics_meeting->get_description()); ?></p>
89 102 <?php
90 103 }
91 - }
92 104 ?>
93 - </ul>
94 - <h3 class="tt-title">
95 - <?php
96 - echo esc_html($meeting->get_name());
97 - ?>
98 - </h3>
99 - <!-- meeting description -->
100 - <p><?php echo esc_html($meeting->get_description()); ?></p>
105 + </div>
106 + <div class="tt-meeting-action">
107 + <!-- meeting info -->
108 + <ul class="meeting-info-list">
109 + <!-- meeting duration -->
110 + <?php if (!empty($timetics_meeting->get_duration())) : ?>
111 + <li>
112 + <svg width="20" height="20" viewBox="0 0 20 20" fill="CurrentColor" xmlns="http://www.w3.org/2000/svg">
113 + <path fill-rule="evenodd" clip-rule="evenodd" d="M10 2C5.58172 2 2 5.58172 2 10C2 14.4183 5.58172 18 10 18C14.4183 18 18 14.4183 18 10C18 5.58172 14.4183 2 10 2ZM0 10C0 4.47715 4.47715 0 10 0C15.5228 0 20 4.47715 20 10C20 15.5228 15.5228 20 10 20C4.47715 20 0 15.5228 0 10ZM10 3.6C10.5523 3.6 11 4.04772 11 4.6V9.38197L14.0472 10.9056C14.5412 11.1526 14.7414 11.7532 14.4944 12.2472C14.2474 12.7412 13.6468 12.9414 13.1528 12.6944L9.55279 10.8944C9.214 10.725 9 10.3788 9 10V4.6C9 4.04772 9.44771 3.6 10 3.6Z"/>
114 + </svg>
115 + <?php echo esc_html($timetics_meeting->get_duration()); ?>
116 + </li>
117 + <?php endif; ?>
118 + <!-- meeting price -->
101 119
102 - <!-- meeting info -->
103 - <ul class="meeting-info-list">
104 - <!-- meeting duration -->
105 - <?php if (!empty($meeting->get_duration())) : ?>
106 - <li>
107 - <svg fill="#3263F8" width="18" height="18" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">
108 - <path d="M256 512C114.6 512 0 397.4 0 256S114.6 0 256 0S512 114.6 512 256s-114.6 256-256 256zM232 120V256c0 8 4 15.5 10.7 20l96 64c11 7.4 25.9 4.4 33.3-6.7s4.4-25.9-6.7-33.3L280 243.2V120c0-13.3-10.7-24-24-24s-24 10.7-24 24z" />
109 - </svg>
110 - <?php echo esc_html($meeting->get_duration()); ?>
111 - </li>
112 - <?php endif; ?>
113 - <!-- meeting price -->
114 -
115 - </ul>
116 - <button class="ant-btn ant-btn-primary ant-btn-block" data-id="<?php echo esc_attr($id); ?>">
117 - <?php echo esc_html__("Book Appointment", "timetics"); ?>
118 - </button>
119 -
120 - <div class="timetics-booking-modal"></div>
120 + </ul>
121 + <button class="ant-btn ant-btn-primary ant-btn-block" data-id="<?php echo esc_attr($timetics_id); ?>">
122 + <?php echo esc_html__("Book Now", "timetics"); ?>
123 + </button>
124 + </div>
121 125 </div>
122 - </div>
123 - <?php
124 - }
125 - ?>
126 + <?php
127 + }
128 + ?>
129 + <?php else: ?>
130 + <p><?php echo esc_html__("No meetings found", "timetics")?></p>
131 + <?php endif ;?>
132 + <div class="timetics-booking-modal"></div>
126 133 </div>