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 | templates/staff/onboard.php +148 -52 1.0.2 → 1.0.64 View file →
@@ -4,10 +4,12 @@
4 4 *
5 5 * @package Timetics
6 6 */
7 7
8 -$user = wp_get_current_user();
9 -$integrations = timetics_get_staff_integrations( $user->ID );
8 +defined( 'ABSPATH' ) || exit;
9 +
10 +$timetics_user = wp_get_current_user();
11 +$timetics_integrations = timetics_get_staff_integrations( $timetics_user->ID );
10 12 ?>
11 13
12 14 <!DOCTYPE html>
13 15 <html lang="en">
@@ -17,12 +19,10 @@
17 19 <meta name="viewport" content="width=device-width, initial-scale=1.0" />
18 20 <title><?php esc_html_e( 'Staff onboard', 'timetics' ); ?></title>
19 21 <link rel="preconnect" href="https://fonts.googleapis.com" />
20 22 <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
21 - <link
22 - href="https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600&display=swap"
23 - rel="stylesheet"
24 - />
23 + <?php // phpcs:ignore WordPress.WP.EnqueuedResources.NonEnqueuedStylesheet -- Standalone onboarding page outside normal WordPress context ?>
24 + <link href="https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600&display=swap" rel="stylesheet" />
25 25 </head>
26 26 <style>
27 27 body {
28 28 box-sizing: border-box;
@@ -123,59 +123,155 @@
123 123 <div class="template-container">
124 124 <header><h2><?php esc_html_e( 'Integrations', 'timetics' ); ?></h2></header>
125 125 <main class="main-wrapper">
126 126 <ul>
127 - <?php foreach( $integrations as $integration ): ?>
128 - <li class="single-list">
129 - <div class="single-item">
130 - <div class="integration-logo">
131 - <svg
132 - width="20"
133 - height="20"
134 - viewBox="0 0 20 20"
135 - fill="none"
136 - xmlns="http://www.w3.org/2000/svg"
137 - >
138 - <path
139 - d="M11.1816 10.4049L12.9362 12.4103L15.2955 13.9181L15.7068 10.4172L15.2955 6.99451L12.8909 8.31916L11.1816 10.4049Z"
140 - fill="#00832D"
141 - />
142 - <path
143 - 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"
144 - fill="#0066DA"
145 - />
146 - <path
147 - d="M5.21666 3L1 7.21666L3.17004 7.83373L5.21666 7.21666L5.82345 5.28111L5.21666 3Z"
148 - fill="#E94235"
149 - />
150 - <path
151 - d="M5.21666 7.21666H1V13.5931H5.21666V7.21666Z"
152 - fill="#2684FC"
153 - />
154 - <path
155 - 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"
156 - fill="#00AC47"
157 - />
158 - <path
159 - d="M14.0615 3H5.2168V7.21666H11.1818V10.4049L15.2956 6.99657V4.23414C15.2956 3.55228 14.7434 3 14.0615 3Z"
160 - fill="#FFBA00"
161 - />
162 - </svg>
127 + <?php foreach( $timetics_integrations as $timetics_integration ): ?>
128 + <li class="single-list">
129 + <div class="single-item">
130 + <div class="integration-logo">
131 + <?php
132 + if($timetics_integration['id'] == 'google-calendar-meet'){
133 + ?>
134 + <svg
135 + width="20"
136 + height="20"
137 + viewBox="0 0 20 20"
138 + fill="none"
139 + xmlns="http://www.w3.org/2000/svg"
140 + >
141 + <path
142 + d="M11.1816 10.4049L12.9362 12.4103L15.2955 13.9181L15.7068 10.4172L15.2955 6.99451L12.8909 8.31916L11.1816 10.4049Z"
143 + fill="#00832D"
144 + />
145 + <path
146 + 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"
147 + fill="#0066DA"
148 + />
149 + <path
150 + d="M5.21666 3L1 7.21666L3.17004 7.83373L5.21666 7.21666L5.82345 5.28111L5.21666 3Z"
151 + fill="#E94235"
152 + />
153 + <path
154 + d="M5.21666 7.21666H1V13.5931H5.21666V7.21666Z"
155 + fill="#2684FC"
156 + />
157 + <path
158 + 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"
159 + fill="#00AC47"
160 + />
161 + <path
162 + d="M14.0615 3H5.2168V7.21666H11.1818V10.4049L15.2956 6.99657V4.23414C15.2956 3.55228 14.7434 3 14.0615 3Z"
163 + fill="#FFBA00"
164 + />
165 + </svg>
166 + <?php
167 + } else if($timetics_integration['id'] == 'zoom-meeting'){
168 + ?>
169 + <svg
170 + xmlns="http://www.w3.org/2000/svg"
171 + width="28"
172 + height="15"
173 + viewBox="0 0 28 15"
174 + fill="none"
175 + >
176 + <path
177 + d="M0 0.753028V10.839C0.00914414 13.1197 1.87186 14.955 4.14337 14.9458H18.8445C19.2624 14.9458 19.5986 14.6096 19.5986 14.2008V4.11538C19.5894 1.83473 17.7273 -0.00109453 15.4552 0.00804961H0.754123C0.336182 0.00804961 0 0.344232 0 0.753028ZM20.5345 4.6877L26.6041 0.253328C27.1312 -0.182364 27.54 -0.0737101 27.54 0.716989V14.2369C27.54 15.1368 27.0403 15.0276 26.6041 14.7005L20.5345 10.2753V4.6877Z"
178 + fill="#4A8CFF"
179 + />
180 + </svg>
181 + <?php
182 + } else if($timetics_integration['id'] == 'google-calendar'){
183 + ?>
184 + <svg
185 + width="20"
186 + height="20"
187 + viewBox="0 0 20 20"
188 + fill="none"
189 + xmlns="http://www.w3.org/2000/svg"
190 + >
191 + <path
192 + d="M14.7388 5.26241L10.4758 4.78874L5.26526 5.26241L4.7915 9.99925L5.26517 14.7361L10.002 15.3282L14.7388 14.7361L15.2125 9.8809L14.7388 5.26241Z"
193 + fill="white"
194 + />
195 + <path
196 + d="M7.21058 12.6124C6.85653 12.3732 6.61137 12.0239 6.47754 11.562L7.29941 11.2233C7.37402 11.5075 7.50425 11.7278 7.69019 11.8841C7.87496 12.0404 8.09995 12.1174 8.36284 12.1174C8.63167 12.1174 8.86261 12.0357 9.05557 11.8722C9.24852 11.7088 9.34572 11.5003 9.34572 11.2482C9.34572 10.99 9.24384 10.7792 9.04018 10.6158C8.83651 10.4525 8.58073 10.3707 8.27518 10.3707H7.80035V9.55717H8.22658C8.48947 9.55717 8.71096 9.48616 8.89096 9.34405C9.07096 9.20194 9.16096 9.00772 9.16096 8.76022C9.16096 8.54 9.08041 8.36468 8.9194 8.23328C8.75839 8.10188 8.55463 8.03555 8.30713 8.03555C8.06557 8.03555 7.8737 8.09954 7.73159 8.2286C7.58948 8.35766 7.48643 8.51633 7.42136 8.70344L6.60786 8.36477C6.71559 8.05922 6.91341 7.78922 7.20347 7.55595C7.49363 7.32267 7.86425 7.2054 8.31424 7.2054C8.64697 7.2054 8.94658 7.26939 9.21189 7.39845C9.47712 7.52751 9.68556 7.70633 9.83595 7.93367C9.98634 8.16218 10.0609 8.41805 10.0609 8.70218C10.0609 8.99233 9.99111 9.2374 9.85134 9.43873C9.71157 9.64006 9.53985 9.79396 9.33618 9.90177V9.95028C9.60501 10.0628 9.82407 10.2345 9.99696 10.4654C10.1687 10.6964 10.2551 10.9723 10.2551 11.2944C10.2551 11.6165 10.1734 11.9043 10.0099 12.1565C9.84648 12.4088 9.62031 12.6077 9.33375 12.7521C9.04603 12.8966 8.72275 12.97 8.36392 12.97C7.94831 12.9712 7.56464 12.8516 7.21058 12.6124Z"
197 + fill="#1A73E8"
198 + />
199 + <path
200 + d="M12.2531 8.5348L11.3555 9.1873L10.9043 8.50285L12.5231 7.33521H13.1437V12.8429H12.2531V8.5348Z"
201 + fill="#1A73E8"
202 + />
203 + <path
204 + d="M14.7388 18.9995L19.0019 14.7364L16.8704 13.7891L14.7388 14.7364L13.7915 16.8679L14.7388 18.9995Z"
205 + fill="#EA4335"
206 + />
207 + <path
208 + d="M4.3125 16.8685L5.25983 19H14.7334V14.7369H5.25983L4.3125 16.8685Z"
209 + fill="#34A853"
210 + />
211 + <path
212 + d="M2.421 1C1.63593 1 1 1.63593 1 2.421V14.7367L3.13154 15.684L5.26308 14.7367V5.26308H14.7367L15.684 3.13154L14.7368 1H2.421Z"
213 + fill="#4285F4"
214 + />
215 + <path
216 + d="M1 14.7369V17.579C1 18.3641 1.63593 19 2.421 19H5.26308V14.7369H1Z"
217 + fill="#188038"
218 + />
219 + <path
220 + d="M14.7393 5.26249V14.7361H19.0023V5.26249L16.8708 4.31516L14.7393 5.26249Z"
221 + fill="#FBBC04"
222 + />
223 + <path
224 + d="M19.0023 5.26308V2.421C19.0023 1.63584 18.3664 1 17.5813 1H14.7393V5.26308H19.0023Z"
225 + fill="#1967D2"
226 + />
227 + </svg>
228 + <?php
229 + } ?>
230 +
231 + </div>
232 + <div class="content">
233 + <h3><?php echo esc_html( $timetics_integration['name'] ); ?></h3>
234 + <p>
235 + <?php echo esc_html( $timetics_integration['description'] ); ?>
236 + </p>
237 + </div>
238 + <a class="connect-btn" href="<?php echo esc_url( $timetics_integration['auth_url'] ); ?>"><?php esc_html_e( 'Connect', 'timetics' ); ?></a>
163 239 </div>
164 - <div class="content">
165 - <h3><?php echo esc_html( $integration['name'] ); ?></h3>
166 - <p>
167 - <?php echo esc_html( $integration['description'] ); ?>
168 - </p>
169 - </div>
170 - <a class="connect-btn" href="<?php echo esc_url( $integration['auth_url'] ); ?>"><?php esc_html_e( 'Connect', 'timetics' ); ?></a>
171 - </div>
172 - </li>
240 + </li>
173 241 <?php endforeach; ?>
174 242 </ul>
175 243 <div class="skip-wrapper">
176 - <a class="skip-button" href="<?php echo esc_url( admin_url('admin.php?page=timetics#/my-profile') ); ?>"><?php esc_html_e( 'Skip', 'timetics' ); ?></a>
244 + <a class="skip-button" id="timetics-onboard-skip" href="<?php echo esc_url( admin_url('admin.php?page=timetics#/my-profile') ); ?>"><?php esc_html_e( 'Skip', 'timetics' ); ?></a>
177 245 </div>
246 +
247 + <script>
248 + var onboard = document.getElementById('timetics-onboard-skip');
249 +
250 + onboard.addEventListener('click', function(event) {
251 + event.preventDefault();
252 +
253 + fetch('<?php echo esc_url( admin_url('admin-ajax.php') ); ?>', {
254 + method: 'POST',
255 + headers: {
256 + 'Content-Type': 'application/x-www-form-urlencoded'
257 + },
258 + body: 'action=timetics_staff_onboard_skip&nonce=<?php echo esc_js( wp_create_nonce( 'timetics_staff_onboard_skip' ) ); ?>'
259 +,
260 + })
261 + .then(response => response.json())
262 + .then(data => {
263 + console.log('Response:', data);
264 + // Handle the response data
265 + window.location.href = "<?php echo esc_url( admin_url('admin.php?page=timetics#/my-profile') ); ?>";
266 + })
267 + .catch(error => {
268 + console.error('Error:', error);
269 + // Handle the error
270 + });
271 + });
272 +
273 + </script>
178 274 </main>
179 275 </div>
180 276 </div>
181 277 </body>