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 +114 -78 1.0.0 → 1.0.64 View file →
@@ -1,97 +1,133 @@
1 1 <?php
2 +defined( 'ABSPATH' ) || exit;
2 3
3 4 use Timetics\Core\Appointments\Appointment as Appointment;
5 +use Timetics\Core\Staffs\Staff;
4 6
5 -$meetings = Appointment::all();
7 +$timetics_args = [
8 + 'posts_per_page' => $timetics_limit
9 +];
6 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( [
19 + 'taxonomy' => 'timetics-meeting-category',
20 + 'hide_empty' => false,
21 +] );
22 +
7 23 ?>
24 +<?php if ( $timetics_show_filter ) : ?>
25 +<div class="timetics-meeting-filter timetics-input">
26 + <div class="timetics-select-wrapper ant-select">
27 + <!-- Category List -->
28 + <select type="select" id="timetics-filter-category" class="timetics-select ant-select-selector">
29 + <option value=""><?php esc_html_e( 'All Department', 'timetics' ); ?></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>
33 + <?php endforeach; ?>
34 + <?php endif; ?>
35 + </select>
36 + <!-- End Category List -->
8 37
9 -<div class="tt-meeting-list-wrapper ant-row">
10 - <?php
11 - foreach ($meetings['items'] as $item) {
12 - $meeting = new Appointment($item->ID);
13 - $staffs = $meeting->get_staff();
14 - $locations = $meeting->get_locations();
15 - $id = $meeting->get_id();
16 - ?>
17 - <div class="ant-col-8">
18 - <div class="tt-meeting-list-item">
19 - <ul class="tt-author">
38 + <!-- Staff List -->
39 + <select type="select" id="timetics-filter-staff"class="timetics-select ant-select-selector">
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 ): ?>
20 43 <?php
21 - if (!empty($staffs)) {
22 - foreach ($staffs as $key => $staff) {
44 + $timetics_staff = new Staff( $timetics_staff->ID );
23 45 ?>
24 - <li>
25 - <img src="<?php echo esc_url($staff['image']); ?>" alt="<?php echo esc_attr($staff['full_name']); ?>" />
26 - <span><?php echo esc_html($staff['full_name']); ?></span>
27 - </li>
46 + <option value="<?php echo esc_attr( $timetics_staff->get_id() ); ?>"><?php echo esc_attr( $timetics_staff->get_full_name() ); ?></option>
47 + <?php endforeach; ?>
48 + <?php endif; ?>
49 + </select>
50 + </div>
51 + <!-- Staff List End -->
52 +</div>
53 +<?php endif; ?>
54 +
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 + ?>
65 + <div class="tt-meeting-list-item">
66 + <!-- meeting description -->
67 + <div class="tt-meeting-information">
28 68 <?php
69 + if (!empty($timetics_staffs)) {
29 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>
88 + <?php
89 +
30 90 }
31 - }
32 - ?>
33 - </ul>
34 - <h3 class="tt-title">
91 + ?>
92 + </ul>
93 + <h3 class="tt-title">
94 + <?php
95 + echo esc_html($timetics_meeting->get_name());
96 + ?>
97 + </h3>
35 98 <?php
36 - echo esc_html($meeting->get_name());
99 + if($timetics_meeting->get_description()) {
100 + ?>
101 + <p><?php echo esc_html($timetics_meeting->get_description()); ?></p>
102 + <?php
103 + }
37 104 ?>
38 - </h3>
39 - <!-- meeting description -->
40 - <p><?php echo esc_html($meeting->get_description()); ?></p>
41 -
42 - <!-- meeting info -->
43 - <ul class="meeting-info-list">
44 - <!-- meeting duration -->
45 - <?php if (!empty($meeting->get_duration())) : ?>
46 - <li>
47 - <svg fill="#3263F8" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">
48 - <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" />
49 - </svg>
50 - <?php echo esc_html($meeting->get_duration()); ?>
51 - </li>
52 - <?php endif; ?>
53 -
54 - <!-- meeting location -->
55 - <?php if (!empty($locations)) {
56 - foreach ($locations as $location) { ?>
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())) : ?>
57 111 <li>
58 - <?php if ($location['location_type'] == 'phone-call') { ?>
59 - <svg viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
60 - <path d="M18.2201 9.24952C18.0212 9.24952 17.8305 9.17052 17.6899 9.0299C17.5493 8.88928 17.4703 8.69855 17.4703 8.49968C17.4687 6.90922 16.8362 5.38435 15.7115 4.25972C14.5869 3.13509 13.062 2.50258 11.4716 2.50099C11.2727 2.50099 11.082 2.42199 10.9414 2.28137C10.8007 2.14075 10.7217 1.95003 10.7217 1.75116C10.7217 1.55229 10.8007 1.36156 10.9414 1.22094C11.082 1.08032 11.2727 1.00132 11.4716 1.00132C13.4596 1.0035 15.3656 1.79421 16.7713 3.19995C18.177 4.60569 18.9678 6.51166 18.9699 8.49968C18.9699 8.69855 18.8909 8.88928 18.7503 9.0299C18.6097 9.17052 18.419 9.24952 18.2201 9.24952ZM15.9706 8.49968C15.9706 7.30647 15.4966 6.16213 14.6529 5.3184C13.8091 4.47467 12.6648 4.00067 11.4716 4.00067C11.2727 4.00067 11.082 4.07967 10.9414 4.22029C10.8007 4.36091 10.7217 4.55163 10.7217 4.7505C10.7217 4.94937 10.8007 5.14009 10.9414 5.28072C11.082 5.42134 11.2727 5.50034 11.4716 5.50034C12.267 5.50034 13.0299 5.81634 13.5924 6.37883C14.1549 6.94131 14.4709 7.70421 14.4709 8.49968C14.4709 8.69855 14.5499 8.88928 14.6905 9.0299C14.8312 9.17052 15.0219 9.24952 15.2208 9.24952C15.4196 9.24952 15.6103 9.17052 15.751 9.0299C15.8916 8.88928 15.9706 8.69855 15.9706 8.49968ZM17.6075 17.6207L18.2898 16.8341C18.7241 16.3984 18.968 15.8083 18.968 15.1931C18.968 14.5779 18.7241 13.9878 18.2898 13.5521C18.2666 13.5288 16.4625 12.1409 16.4625 12.1409C16.0295 11.7287 15.4544 11.4992 14.8566 11.5001C14.2588 11.5009 13.6843 11.732 13.2524 12.1454L11.8232 13.3496C10.6566 12.8668 9.59689 12.1583 8.70489 11.2647C7.81288 10.3712 7.10618 9.31021 6.62538 8.14276L7.82512 6.71807C8.23881 6.2863 8.4702 5.7117 8.47118 5.11373C8.47215 4.51575 8.24265 3.9404 7.83037 3.50727C7.83037 3.50727 6.44092 1.70542 6.41767 1.68217C5.98986 1.25158 5.4098 1.00658 4.80285 1.00013C4.19589 0.993677 3.61076 1.22628 3.17388 1.64768L2.31157 2.39752C-2.78282 8.30773 8.18729 19.1931 14.2925 18.9974C14.909 19.001 15.5199 18.881 16.0893 18.6445C16.6587 18.4081 17.1749 18.06 17.6075 17.6207Z" fill="#3263F8" />
61 - </svg>
62 - <?php echo esc_html("Phone Call", 'timetics'); ?>
63 -
64 - <?php } else if ($location['location_type'] == 'google-meet') { ?>
65 - <svg viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
66 - <path d="M11.1816 10.4049L12.9362 12.4103L15.2955 13.9181L15.7068 10.4172L15.2955 6.99451L12.8909 8.31916L11.1816 10.4049Z" fill="#00832D" />
67 - <path d="M1 13.5931V16.5756C1 17.2575 1.55228 17.8097 2.23414 17.8097H5.21666L5.83373 15.5554L5.21666 13.5931L3.17004 12.976L1 13.5931Z" fill="#0066DA" />
68 - <path d="M5.21666 3L1 7.21666L3.17004 7.83373L5.21666 7.21666L5.82345 5.28111L5.21666 3Z" fill="#E94235" />
69 - <path d="M5.21666 7.21666H1V13.5931H5.21666V7.21666Z" fill="#2684FC" />
70 - <path d="M17.9902 4.78541L15.2956 6.99453V13.9181L18.0025 16.1375C18.4077 16.4542 19.0001 16.1652 19.0001 15.65V5.26261C19.0001 4.74118 18.3944 4.45527 17.9902 4.78541ZM11.1818 10.4049V13.5931H5.2168V17.8097H14.0615C14.7434 17.8097 15.2956 17.2575 15.2956 16.5756V13.9181L11.1818 10.4049Z" fill="#00AC47" />
71 - <path d="M14.0615 3H5.2168V7.21666H11.1818V10.4049L15.2956 6.99657V4.23414C15.2956 3.55228 14.7434 3 14.0615 3Z" fill="#FFBA00" />
72 - </svg>
73 - <?php echo esc_html($location['location']); ?>
74 - <?php } else { ?>
75 - <svg viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
76 - <path d="M9.98574 1C8.0012 1.00218 6.09855 1.79146 4.6952 3.19467C3.29184 4.59788 2.50238 6.50045 2.5 8.48499C2.5 10.4125 3.9925 13.429 6.93624 17.4505C7.28669 17.9306 7.74553 18.3211 8.27544 18.5904C8.80535 18.8597 9.39135 19 9.98574 19C10.5801 19 11.1661 18.8597 11.696 18.5904C12.2259 18.3211 12.6848 17.9306 13.0352 17.4505C15.979 13.429 17.4715 10.4125 17.4715 8.48499C17.4691 6.50045 16.6796 4.59788 15.2763 3.19467C13.8729 1.79146 11.9703 1.00218 9.98574 1ZM9.98574 11.4685C9.3924 11.4685 8.81238 11.2925 8.31903 10.9629C7.82568 10.6332 7.44117 10.1647 7.2141 9.61654C6.98704 9.06836 6.92763 8.46516 7.04339 7.88322C7.15914 7.30128 7.44486 6.76673 7.86442 6.34717C8.28398 5.92761 8.81853 5.64189 9.40047 5.52614C9.98241 5.41038 10.5856 5.46979 11.1338 5.69685C11.682 5.92392 12.1505 6.30843 12.4801 6.80178C12.8098 7.29513 12.9857 7.87515 12.9857 8.46849C12.9857 9.26414 12.6697 10.0272 12.1071 10.5898C11.5444 11.1524 10.7814 11.4685 9.98574 11.4685Z" fill="#3263F8" />
77 - </svg>
78 - <?php echo esc_html($location['location']); ?>
79 -
80 - <?php } ?>
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()); ?>
81 116 </li>
82 - <?php
117 + <?php endif; ?>
118 + <!-- meeting price -->
83 119
84 - }
85 - }
86 - ?>
87 -
88 - </ul>
89 - <button class="ant-btn ant-btn-primary ant-btn-block" data-id="<?php echo esc_attr($id); ?>">
90 - <?php echo esc_html__("Book Appointment", "timetics"); ?>
91 - </button>
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>
92 125 </div>
93 - </div>
94 - <?php
95 - }
96 - ?>
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>
97 133 </div>