| 1 |
<?php |
| 2 |
/** |
| 3 |
* Booking Listing Template - Booking Row |
| 4 |
* |
| 5 |
* @version 1.0 |
| 6 |
* @package Any |
| 7 |
* @category Templates for Booking Listing |
| 8 |
* @author wpdevelop |
| 9 |
* |
| 10 |
* @web-site https://wpbookingcalendar.com/ |
| 11 |
* @email info@wpbookingcalendar.com |
| 12 |
* |
| 13 |
* @modified 2025-03-24 |
| 14 |
*/ |
| 15 |
|
| 16 |
if ( ! defined( 'ABSPATH' ) ) { |
| 17 |
exit; // Exit, if accessed directly. |
| 18 |
} |
| 19 |
|
| 20 |
function wpbc_template__booking_listing_header() { |
| 21 |
|
| 22 |
// Header |
| 23 |
?><script type="text/html" id="tmpl-wpbc_ajx_booking_list_header"> |
| 24 |
<div class="wpbc__list__head wpbc_selectable_head"> |
| 25 |
<div class="wpbc__list__row"> |
| 26 |
<div class="wpbc__list__col wpbc_col_id check-column"> |
| 27 |
<div class="content_text"><input type="checkbox" /></div> |
| 28 |
</div> |
| 29 |
<div class="wpbc__list__col"> |
| 30 |
<div class="content_text"><?php WPBC_Listing_Actions__Bulk_Actions::get_button(); ?></div> |
| 31 |
<div class="wpbc_ui_el__divider"><div class="wpbc_ui_el__vertical_space"></div></div> |
| 32 |
<div class="content_text"><?php WPBC_Listing_Filters__Expand_Colapse_All::get_button(); ?></div> |
| 33 |
</div> |
| 34 |
<div class="wpbc__list__col col__right"> |
| 35 |
<div class="content_text"><?php WPBC_Listing_Filters__Sort_By::get_button(); ?></div> |
| 36 |
<div class="wpbc_ui_el__divider"><div class="wpbc_ui_el__vertical_line"></div></div> |
| 37 |
<div class="wpbc_ajx_booking_pagination_header wpbc__list__col"></div> |
| 38 |
</div> |
| 39 |
</div> |
| 40 |
</div> |
| 41 |
</script><?php |
| 42 |
} |
| 43 |
|
| 44 |
/** |
| 45 |
* Footer Template for listing Table. |
| 46 |
* |
| 47 |
* @return void |
| 48 |
*/ |
| 49 |
function wpbc_template__booking_listing_footer() { |
| 50 |
|
| 51 |
// Footer. |
| 52 |
?> |
| 53 |
<script type="text/html" id="tmpl-wpbc_ajx_booking_list_footer"> |
| 54 |
<div class="wpbc__list__foot wpbc_selectable_foot"> |
| 55 |
<div class="wpbc__list__row"> |
| 56 |
<?php /* ?> |
| 57 |
<div class="wpbc__list__col wpbc_col_id check-column"> |
| 58 |
<div class="content_text"><input type="checkbox"/></div> |
| 59 |
</div> |
| 60 |
<?php */ ?> |
| 61 |
<div class="wpbc__list__col col__right"> |
| 62 |
<div class="wpbc_ajx_booking_pagination_footer wpbc__list__col"></div> |
| 63 |
</div> |
| 64 |
</div> |
| 65 |
</div> |
| 66 |
</script> |
| 67 |
<?php |
| 68 |
} |
| 69 |
|
| 70 |
|
| 71 |
function wpbc_template__booking_listing_row() { |
| 72 |
|
| 73 |
// Rows. |
| 74 |
?> |
| 75 |
<script type="text/html" id="tmpl-wpbc_ajx_booking_list_row"> |
| 76 |
<div id="row_id_{{{data.parsed_fields.booking_id}}}" |
| 77 |
class="wpbc_listing_usual_row wpbc_list_row wpbc_row wpbc_ui_el__listing_row |
| 78 |
<# if ( '1' === data.parsed_fields.trash ) { #> wpbc_row_booking_trash <# } #> |
| 79 |
<# if ( '1' == data.approved ) { #>wpbc_row_booking_approved<# } else { #>wpbc_row_booking_pending<# } #> |
| 80 |
"> |
| 81 |
<?php wpbc_for_booking_template__action_read(); ?> |
| 82 |
<span class="wpbc_row_wrap max_height_a"> |
| 83 |
<div class="wpbc_a_row wpbc_a_row__booking wpbc_a_row_nowrap"> |
| 84 |
<div class="wpbc_a_col wpbc_a_col__check check-column "><?php wpbc_template__booking_listing_row__section_col__checkrow(); ?></div> |
| 85 |
<div class="wpbc_a_col wpbc_a_col__dates"><?php wpbc_template__booking_listing_row__section_col__dates(); ?></div> |
| 86 |
<div class="wpbc_a_col wpbc_a_col__data wpbc_a_overflow_hide"> |
| 87 |
<div class="wpbc_a_row wpbc_a_row_nowrap"> |
| 88 |
<div class="wpbc_a_col wpbc_a_col__details_lables wpbc_a_overflow_hide"> |
| 89 |
<div class="wpbc_a_row"> |
| 90 |
<div class="wpbc_a_col"><?php wpbc_template__booking_listing_row__section_col__booking_data(); ?></div> |
| 91 |
</div> |
| 92 |
<div class="wpbc_a_row"> |
| 93 |
<div class="wpbc_a_col"><?php wpbc_template__booking_listing_row__section_col__labels(); ?></div> |
| 94 |
</div> |
| 95 |
</div> |
| 96 |
<div class="wpbc_a_col wpbc_a_col__cost"><?php wpbc_template__booking_listing_row__section_col__cost(); ?></div> |
| 97 |
<div class="wpbc_a_col wpbc_a_col__action"><?php wpbc_template__booking_listing_row__section_col__action_button(); ?></div> |
| 98 |
</div> |
| 99 |
<?php wpbc_template__booking_listing_row__section_col__appointment_details(); ?> |
| 100 |
<?php wpbc_template__booking_listing_row__section_col__resource_allocation(); ?> |
| 101 |
<div class="wpbc_a_row wpbc_a_row__notes"> |
| 102 |
<div class="wpbc_a_col"><?php wpbc_template__booking_listing_row__section_col__note_readonly(); ?></div> |
| 103 |
</div> |
| 104 |
<div class="wpbc_a_row wpbc_a_row__system"> |
| 105 |
<div class="wpbc_a_col"><?php wpbc_template__booking_listing_row__section_col__sys_info(); ?></div> |
| 106 |
</div> |
| 107 |
<?php wpbc_template__booking_listing_row__section_col__hidden_fields(); ?> |
| 108 |
</div> |
| 109 |
</div> |
| 110 |
</span> |
| 111 |
</div> |
| 112 |
</script> |
| 113 |
<?php |
| 114 |
|
| 115 |
/** |
| 116 |
* data objet = { "booking_db": { |
| 117 |
"booking_id": "3", |
| 118 |
"trash": "0", |
| 119 |
"sync_gid": "", |
| 120 |
"is_new": "0", |
| 121 |
"status": "", |
| 122 |
"sort_date": "2022-02-03 12:00:01", |
| 123 |
"modification_date": "2022-03-14 17:48:23", |
| 124 |
"form": "selectbox-one^rangetime2^12:00 - 14:00~text^name2^Anthony~text^secondname2^Gomez~text^email2^Gomez.example@wpbookingcalendar.com~text^address2^144 Hitchcock Rd~text^city2^Jacksonville~text^postcode2^38374~text^country2^US~text^phone2^988-48-45~selectbox-one^visitors2^3~checkbox^children2[]^2~textarea^details2^", |
| 125 |
"hash": "993086af7a382f3956e6a0010932c856", |
| 126 |
"booking_type": "2", |
| 127 |
"remark": null, |
| 128 |
"cost": "58.00", |
| 129 |
"pay_status": "", |
| 130 |
"pay_request": "0" |
| 131 |
}, |
| 132 |
"id": "3", |
| 133 |
"approved": "0", |
| 134 |
"dates": [ "2022-02-03 12:00:01", "2022-02-03 14:00:02" ], |
| 135 |
"child_id": [ "", "" ], |
| 136 |
"short_dates": [ "2022-02-03 12:00:01", "-", "2022-02-03 14:00:02" ], |
| 137 |
"short_dates_child_id": [ "", "", "" ], |
| 138 |
"parsed_fields": { |
| 139 |
"rangetime": "12:00 PM - 2:00 PM", |
| 140 |
"name": "Anthony", |
| 141 |
"secondname": "Gomez", |
| 142 |
"email": "Gomez.example@wpbookingcalendar.com", |
| 143 |
"address": "144 Hitchcock Rd", |
| 144 |
"city": "Jacksonville", |
| 145 |
"postcode": "38374", |
| 146 |
"country": "US", |
| 147 |
"phone": "988-48-45", |
| 148 |
"visitors": "3", |
| 149 |
"children": "2", |
| 150 |
"details": "", |
| 151 |
"booking_id": "3", |
| 152 |
"trash": "0", |
| 153 |
"sync_gid": "", |
| 154 |
"is_new": "0", |
| 155 |
"status": "", |
| 156 |
"sort_date": "2022-02-03 12:00:01", |
| 157 |
"modification_date": "March 14, 2022 5:48 PM", |
| 158 |
"hash": "993086af7a382f3956e6a0010932c856", |
| 159 |
"booking_type": "2", |
| 160 |
"cost": "58.00", |
| 161 |
"pay_status": "", |
| 162 |
"pay_request": "0", |
| 163 |
"id": "3", |
| 164 |
"approved": "0" |
| 165 |
}, |
| 166 |
"templates": { |
| 167 |
"form_show": "<div class=\"standard-content-form\"> \r\n\t<strong>First Name</strong>:<span class=\"fieldvalue\">Anthony</span> \r\n\t<strong>Last Name</strong>:<span class=\"fieldvalue\">Gomez</span> \r\n\t<strong>Email</strong>:<span class=\"fieldvalue\">Gomez.example@wpbookingcalendar.com</span> \r\n\t<strong>Adults</strong>:<span class=\"fieldvalue\"> 3</span> \r\n\t<strong>Children</strong>:<span class=\"fieldvalue\"> 2</span> \r\n\t<strong>Details</strong>: <span class=\"fieldvalue\"> </span> \r\n</div>" |
| 168 |
}, |
| 169 |
"__search_request_keyword__": "" |
| 170 |
} |
| 171 |
*/ |
| 172 |
} |
| 173 |
|
| 174 |
// --------------------------------------------------------------------------------------------------------------------- |
| 175 |
// Booking Row Elements |
| 176 |
// --------------------------------------------------------------------------------------------------------------------- |
| 177 |
function wpbc_template__booking_listing_row__section_col__checkrow(){ |
| 178 |
|
| 179 |
?> |
| 180 |
<div class="content_text"><input type="checkbox"/></div> |
| 181 |
<?php |
| 182 |
} |
| 183 |
|
| 184 |
function wpbc_template__booking_listing_row__section_col__dates() { |
| 185 |
|
| 186 |
?> |
| 187 |
<# if ( undefined !== data.resource_allocation && data.resource_allocation.is_multiple_resources ) { #> |
| 188 |
<div class="booking_dates_resource_allocation_summary booking_dates_expand_section"> |
| 189 |
<div class="content_text"> |
| 190 |
<span class="wpbc_label wpbc_label_booking_dates">{{data.resource_allocation.date_summary_label}}</span> |
| 191 |
<span class="wpbc_booking_resource_count">{{data.resource_allocation.resource_count_label}}</span> |
| 192 |
</div> |
| 193 |
</div> |
| 194 |
<# } else { #> |
| 195 |
<div class="booking_dates_small booking_dates_expand_section" style="<# /* if ( 'short' !== wpbc_ajx_booking_listing.search_get_param('ui_usr__dates_short_wide') ) { #>display: none;<# } */ #>" > |
| 196 |
<div class="content_text">{{{data.templates.short_dates_content}}}</div> |
| 197 |
</div> |
| 198 |
<div class="booking_dates_full booking_dates_expand_section" style="<# /* if ( 'wide' !== wpbc_ajx_booking_listing.search_get_param('ui_usr__dates_short_wide') ) { #>display: none;<# } */ #>" > |
| 199 |
<div class="content_text">{{{data.templates.wide_dates_content}}}</div> |
| 200 |
</div> |
| 201 |
<# } #> |
| 202 |
<div class="wpbc_btn_expand_down"> |
| 203 |
<a class="wpbc_btn_expand_down_a" |
| 204 |
href="javascript:void(0)" |
| 205 |
onclick="javascript:jQuery(this).parents('.wpbc_row_wrap').toggleClass('max_height_a');jQuery( this ).find('.menu_icon').toggle();"> |
| 206 |
<i class="menu_icon icon-1x wpbc_icn_expand_more" title="<?php echo esc_js( __( 'Expand', 'booking' ) ); ?>"></i> |
| 207 |
<i class="menu_icon icon-1x wpbc_icn_expand_less" title="<?php echo esc_js( __( 'Colapse', 'booking' ) ); ?>" style="display:none;"></i> |
| 208 |
</a> |
| 209 |
</div> |
| 210 |
<?php |
| 211 |
} |
| 212 |
|
| 213 |
function wpbc_template__booking_listing_row__section_col__booking_data(){ |
| 214 |
|
| 215 |
?> |
| 216 |
<div class="wpbc_listing_col wpbc_col_data"> |
| 217 |
<div class="content_text"> |
| 218 |
<# |
| 219 |
var booking_details_simple = data.templates.form_show_simple; |
| 220 |
var booking_details = data.templates.form_show; |
| 221 |
var booking_keyword = data[ '__search_request_keyword__' ]; |
| 222 |
booking_details = wpbc_get_highlighted_search_keyword( booking_details, booking_keyword ); |
| 223 |
booking_details_simple = wpbc_get_highlighted_search_keyword( booking_details_simple, booking_keyword ); |
| 224 |
#> |
| 225 |
<a title="<?php echo esc_js( __( 'Expand', 'booking' ) ); ?>" |
| 226 |
href="javascript:void(0)" |
| 227 |
onclick="javascript:jQuery(this).parents('.wpbc_row_wrap').toggleClass('max_height_a');jQuery(this).parents('.wpbc_row_wrap').find('.wpbc_btn_expand_down_a .menu_icon').toggle();" |
| 228 |
class="booking_details_simple__expand" |
| 229 |
><div class="booking_details_simple">{{{booking_details_simple}}}</div></a> |
| 230 |
<span <?php /* ?> |
| 231 |
title="<?php echo esc_js( __( 'Collapse', 'booking' ) ); ?>" |
| 232 |
href="javascript:void(0)" |
| 233 |
onclick="javascript:jQuery(this).parents('.wpbc_row_wrap').toggleClass('max_height_a');jQuery(this).parents('.wpbc_row_wrap').find('.wpbc_btn_expand_down_a .menu_icon').toggle();" |
| 234 |
<?php // FixIn: 10.11.3.2 */ ?> |
| 235 |
class="booking_details_simple__expand" |
| 236 |
><div class="booking_details_full">{{{booking_details}}}</div></span> |
| 237 |
</div> |
| 238 |
</div> |
| 239 |
<?php |
| 240 |
} |
| 241 |
|
| 242 |
/** |
| 243 |
* Render immutable Appointment information in the expanded Booking row. |
| 244 |
* |
| 245 |
* The complete row is emitted only for a booking that has an Appointment |
| 246 |
* snapshot in its parsed listing fields. |
| 247 |
* |
| 248 |
* @return void |
| 249 |
*/ |
| 250 |
function wpbc_template__booking_listing_row__section_col__appointment_details() { |
| 251 |
?> |
| 252 |
<# if ( undefined != data.parsed_fields.appointment_service_title && '' != data.parsed_fields.appointment_service_title ) { #> |
| 253 |
<div class="wpbc_a_row wpbc_a_row__appointment"> |
| 254 |
<div class="wpbc_a_col"> |
| 255 |
<div class="wpbc_listing_col wpbc_col_appointment_details"> |
| 256 |
<div class="content_text"> |
| 257 |
<div class="wpbc_appointment_booking_details"> |
| 258 |
<strong><?php echo esc_js( __( 'Appointment details', 'booking' ) ); ?></strong> |
| 259 |
<span><?php echo esc_js( __( 'Service', 'booking' ) ); ?>: <strong>{{data.parsed_fields.appointment_service_title}}</strong></span> |
| 260 |
<span><?php echo esc_js( __( 'Provider', 'booking' ) ); ?>: <strong>{{data.parsed_fields.appointment_provider_title}}</strong></span> |
| 261 |
<# if ( undefined != data.parsed_fields.appointment_service_cost_formatted && '' != data.parsed_fields.appointment_service_cost_formatted ) { #> |
| 262 |
<span><?php echo esc_js( __( 'Service price', 'booking' ) ); ?>: <strong>{{data.parsed_fields.appointment_service_cost_formatted}}</strong></span> |
| 263 |
<# } #> |
| 264 |
<# if ( undefined != data.parsed_fields.appointment_time_label ) { #> |
| 265 |
<span><?php echo esc_js( __( 'Appointment time', 'booking' ) ); ?>: <strong>{{data.parsed_fields.appointment_time_label}}</strong></span> |
| 266 |
<span><?php echo esc_js( __( 'Buffer before / after', 'booking' ) ); ?>: <strong>{{data.parsed_fields.appointment_buffer_before_minutes}} / {{data.parsed_fields.appointment_buffer_after_minutes}} <?php echo esc_js( __( 'min', 'booking' ) ); ?></strong></span> |
| 267 |
<span><?php echo esc_js( __( 'Provider reserved', 'booking' ) ); ?>: <strong>{{data.parsed_fields.appointment_reserved_time_label}}</strong></span> |
| 268 |
<# } #> |
| 269 |
</div> |
| 270 |
</div> |
| 271 |
</div> |
| 272 |
</div> |
| 273 |
</div> |
| 274 |
<# } #> |
| 275 |
<?php |
| 276 |
} |
| 277 |
|
| 278 |
/** |
| 279 |
* Render date-to-Resource allocation details in an expanded Booking row. |
| 280 |
* |
| 281 |
* The normalized DTO is produced from the saved booking-date rows. This |
| 282 |
* template owns presentation only and remains hidden for bookings that use one |
| 283 |
* Resource, preserving the familiar compact layout for the common case. |
| 284 |
* |
| 285 |
* @return void |
| 286 |
*/ |
| 287 |
function wpbc_template__booking_listing_row__section_col__resource_allocation() { |
| 288 |
?> |
| 289 |
<# |
| 290 |
if ( |
| 291 |
undefined !== data.resource_allocation |
| 292 |
&& data.resource_allocation.is_multiple_resources |
| 293 |
&& data.resource_allocation.segments.length |
| 294 |
) { |
| 295 |
#> |
| 296 |
<div class="wpbc_a_row wpbc_a_row__resource_allocation"> |
| 297 |
<div class="wpbc_a_col"> |
| 298 |
<div class="wpbc_listing_col wpbc_col_resource_allocation"> |
| 299 |
<div |
| 300 |
class="wpbc_resource_allocation" |
| 301 |
role="group" |
| 302 |
aria-label="<?php echo esc_attr( __( 'Resource allocation', 'booking' ) ); ?>" |
| 303 |
> |
| 304 |
<div class="wpbc_resource_allocation__header"> |
| 305 |
<strong><?php esc_html_e( 'Resource allocation', 'booking' ); ?></strong> |
| 306 |
<span class="wpbc_resource_allocation__count">{{data.resource_allocation.resource_count_label}}</span> |
| 307 |
</div> |
| 308 |
<div class="wpbc_resource_allocation__segments"> |
| 309 |
<# _.each( data.resource_allocation.segments, function( allocation_segment ) { #> |
| 310 |
<div class="wpbc_resource_allocation__segment"> |
| 311 |
<span class="wpbc_resource_allocation__period">{{allocation_segment.period_label}}</span> |
| 312 |
<span class="wpbc_resource_allocation__arrow" aria-hidden="true"><i class="menu_icon icon-1x wpbc_icn_arrow_forward"></i></span> |
| 313 |
<span class="wpbc_resource_allocation__resources"> |
| 314 |
<# _.each( allocation_segment.resources, function( allocation_resource ) { #> |
| 315 |
<span class="wpbc_label wpbc_label_resource<# if ( allocation_resource.is_missing ) { #> wpbc_label_deleted_resource<# } #>">{{allocation_resource.resource_title}}</span> |
| 316 |
<# } ); #> |
| 317 |
</span> |
| 318 |
</div> |
| 319 |
<# } ); #> |
| 320 |
</div> |
| 321 |
</div> |
| 322 |
</div> |
| 323 |
</div> |
| 324 |
</div> |
| 325 |
<# } #> |
| 326 |
<?php |
| 327 |
} |
| 328 |
|
| 329 |
function wpbc_template__booking_listing_row__section_col__labels(){ |
| 330 |
|
| 331 |
?> |
| 332 |
<div class="wpbc_listing_col wpbc_col_booking_labels wpbc_col_labels"> |
| 333 |
<div class="content_text"> |
| 334 |
<span class="wpbc_label wpbc_label_booking_id"><span class="label_sup">ID:</span>{{data['parsed_fields']['booking_id']}}</span><?php |
| 335 |
?> |
| 336 |
<# |
| 337 |
var resource_title_listing = ( undefined != data.parsed_fields.resource_title_listing && '' != data.parsed_fields.resource_title_listing ) |
| 338 |
? data.parsed_fields.resource_title_listing |
| 339 |
: data.parsed_fields.resource_title; |
| 340 |
var resource_id_listing = ( undefined != data.parsed_fields.resource_id_listing && '' != data.parsed_fields.resource_id_listing ) |
| 341 |
? data.parsed_fields.resource_id_listing |
| 342 |
: data.parsed_fields.resource_id; |
| 343 |
|
| 344 |
if ( '<?php echo esc_js(__( 'Resource not exist', 'booking' )); ?>' == resource_title_listing ) { |
| 345 |
#><span class="wpbc_label wpbc_label_resource wpbc_label_deleted_resource">{{{resource_title_listing}}}</span><# |
| 346 |
} else if ( '' != resource_title_listing ) { |
| 347 |
#><a href="javascript:void(0)" class="wpbc_label_link " title='<?php echo esc_attr( __( 'Change resource', 'booking' ) ); ?>' |
| 348 |
onclick="wpbc_boo_listing__click__change_booking_resource( {{data['parsed_fields']['booking_id']}}, {{resource_id_listing}} );"> |
| 349 |
<span class="wpbc_label wpbc_label_resource">{{{resource_title_listing}}}</span></a><# |
| 350 |
} |
| 351 |
|
| 352 |
if ( '' != data.templates.payment_label_template ) { |
| 353 |
#><a href="javascript:void(0)" class="wpbc_label_link " title='<?php echo esc_attr( __( 'Update payment status', 'booking' ) ); ?>' |
| 354 |
onclick="javascript:wpbc_boo_listing__click__set_payment_status( {{data.parsed_fields.booking_id}}, '{{data.parsed_fields.pay_status}}' );"> |
| 355 |
{{{data.templates.payment_label_template}}} |
| 356 |
</a><# |
| 357 |
} |
| 358 |
|
| 359 |
if ( undefined != data.parsed_fields.appointment_service_title && '' != data.parsed_fields.appointment_service_title ) { |
| 360 |
#><span class="wpbc_label wpbc_label_appointment_service">{{data.parsed_fields.appointment_service_title}} <span aria-hidden="true">·</span> {{data.parsed_fields.appointment_duration_minutes}} <?php echo esc_js( __( 'min', 'booking' ) ); ?></span><# |
| 361 |
} |
| 362 |
|
| 363 |
if ( '' != data.parsed_fields.sync_gid ) { |
| 364 |
#><span class="wpbc_label wpbc_label_imported"><i class="menu_icon icon-1x wpbc_icn_cloud_download system_update_alt"></i><?php echo esc_js(__( 'Imported', 'booking' )); ?></span><# |
| 365 |
} |
| 366 |
|
| 367 |
#><span class="wpbc_label wpbc_label_trash<# if ( '1' != data.parsed_fields.trash ) { #> hidden_items <# } #>"><i style="color: #f6efe8;" class="menu_icon icon-1x wpbc_icn_delete_forever"></i><?php echo esc_js(__( 'In Trash', 'booking' )); ?></span><# |
| 368 |
|
| 369 |
#><span class="wpbc_label wpbc_label_approved<# if ( '0' == data.approved ) { #> hidden_items <# } #>"><i style="color: #def5d4;" class="menu_icon icon-1x wpbc_icn_done_all"></i><?php echo esc_js(__( 'Approved', 'booking' )); ?></span><# |
| 370 |
#><span class="wpbc_label wpbc_label_pending<# if ( '1' == data.approved ) { #> hidden_items <# } #>"><i style="color: #f6efe8;" class="menu_icon icon-1x wpbc_icn_hourglass_empty"></i><?php echo esc_js(__( 'Pending', 'booking' )); ?></span><# |
| 371 |
|
| 372 |
#><?php |
| 373 |
|
| 374 |
|
| 375 |
$labels = get_bk_option( 'wpbc_ajx_booking_labels' ); |
| 376 |
$labels = explode( "\n", $labels ); |
| 377 |
$labels = array_map( 'trim', $labels ); |
| 378 |
|
| 379 |
// Check for Labels and colors. |
| 380 |
foreach ( $labels as $label ) { |
| 381 |
|
| 382 |
if ( ( ! empty( $label ) ) && ( false !== strpos( ':', $label ) ) ) { |
| 383 |
list( $label, $color, $text_color ) = explode( ':', $label ); |
| 384 |
} else { |
| 385 |
$color = ''; |
| 386 |
$text_color = ''; |
| 387 |
} |
| 388 |
|
| 389 |
if ( ! empty( $label ) ) { |
| 390 |
?><span class="wpbc_label" style="color:<?php echo esc_attr( $text_color ); ?>;background-color:<?php echo esc_attr( $color ); ?>;">{{{data.parsed_fields<?php |
| 391 |
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped |
| 392 |
echo $label; |
| 393 |
?>}}}</span><?php |
| 394 |
} |
| 395 |
} |
| 396 |
|
| 397 |
// Predefined internal Labels. |
| 398 |
?> |
| 399 |
<# |
| 400 |
if ( ( undefined != data._paid ) |
| 401 |
&& ( -1 != data._paid.toLowerCase().indexOf( 'refund' ) ) |
| 402 |
) { |
| 403 |
#><span class="wpbc_label booking_label__refund"><?php echo esc_js(__('Refund','booking')); ?></span><# |
| 404 |
} |
| 405 |
console.log( 'row listing', data ); // LISTING_ROWS |
| 406 |
#> |
| 407 |
</div> |
| 408 |
</div> |
| 409 |
<?php |
| 410 |
} |
| 411 |
|
| 412 |
function wpbc_template__booking_listing_row__section_col__note_readonly(){ |
| 413 |
|
| 414 |
if ( ! class_exists( 'wpdev_bk_personal' ) ) { |
| 415 |
return false; |
| 416 |
} |
| 417 |
|
| 418 |
$booking_action = 'set_booking_note'; |
| 419 |
|
| 420 |
$el_id = 'ui_btn_' . $booking_action . '__note_readonly'; |
| 421 |
|
| 422 |
if ( ! wpbc_is_user_can( $booking_action, wpbc_get_current_user_id() ) ) { |
| 423 |
return false; |
| 424 |
} |
| 425 |
|
| 426 |
$params_textarea = array( |
| 427 |
'id' => "{$booking_action}_text_{{data.parsed_fields.booking_id}}", |
| 428 |
'name' => "{$booking_action}_text_{{data.parsed_fields.booking_id}}", |
| 429 |
'label' => '', |
| 430 |
'style' => '', |
| 431 |
'class' => "{$booking_action}_text", |
| 432 |
'disabled' => ! false, |
| 433 |
'attr' => array(), |
| 434 |
'rows' => '3', |
| 435 |
'cols' => '50', |
| 436 |
'placeholder' => '', |
| 437 |
'value' => '{{{data.parsed_fields.remark}}}', |
| 438 |
'is_escape_value' => true, |
| 439 |
//, 'onfocus' => "console.log( 'ON FOCUS:', jQuery( this ).val() , 'in element:' , jQuery( this ) );" // JavaScript code. |
| 440 |
//, 'onchange' => "console.log( 'ON CHANGE:', jQuery( this ).val() , 'in element:' , jQuery( this ) );" // JavaScript code. |
| 441 |
); |
| 442 |
|
| 443 |
?> |
| 444 |
<div class="wpbc_listing_col wpbc_col_note_readonly"> |
| 445 |
<div class="content_text"> |
| 446 |
<div class="ui_remark_section ui_remark_section__note_readonly is_expand_remarks_<?php //echo ($is_expand_remarks) ? 'on' : 'off'; ?>" |
| 447 |
style="<# if ( 'Off' === wpbc_ajx_booking_listing.search_get_param('ui_usr__is_expand_remarks') ) { #>display0: none;<# } #><# if ( '' == data.parsed_fields.remark.trim() ) { #>display: none;<# } #>" |
| 448 |
> |
| 449 |
<label><?php esc_html_e( 'Notes', 'booking' ); ?></label> |
| 450 |
<a href="javascript:void(0)" |
| 451 |
onclick="javascript:wpbc_boo_listing__click__set_booking_note( {{data.parsed_fields.booking_id}}, jQuery( '#set_booking_note_text_{{data.parsed_fields.booking_id}}').val() );" |
| 452 |
style="text-de" |
| 453 |
> |
| 454 |
<span><?php esc_html_e('Edit note','booking'); ?> </span> |
| 455 |
<i class="menu_icon icon-1x wpbc_icn_edit"></i> |
| 456 |
</a> |
| 457 |
<?php |
| 458 |
wpbc_flex_textarea( $params_textarea ); |
| 459 |
?> |
| 460 |
</div> |
| 461 |
</div> |
| 462 |
</div> |
| 463 |
<?php |
| 464 |
} |
| 465 |
|
| 466 |
function wpbc_template__booking_listing_row__section_col__sys_info(){ |
| 467 |
|
| 468 |
?> |
| 469 |
<div class="wpbc_listing_col wpbc_col_sys_info"> |
| 470 |
<div class="content_text"> |
| 471 |
<div class="wpbc_actions_sysinfo"> |
| 472 |
<span class="sysinfo_id"><?php echo esc_js(__( 'Booking ID', 'booking' )); ?>: <strong>{{data['parsed_fields']['booking_id']}}</strong></span><div class="wpbc_ui_el__vetical_line sysinfo_id"></div> |
| 473 |
<span class="sysinfo_edited"><?php echo esc_js(__( 'Edited', 'booking' )); ?>: <strong>{{data['parsed_fields']['modification_date']}}</strong></span><div class="wpbc_ui_el__vetical_line sysinfo_edited"></div> |
| 474 |
<span class="sysinfo_created"><?php echo esc_js(__( 'Created', 'booking' )); ?>: <strong>{{data['parsed_fields']['creation_date']}}</strong></span><div class="wpbc_ui_el__vetical_line sysinfo_created"></div> |
| 475 |
<# if ( |
| 476 |
undefined != data.parsed_fields.appointment_reserved_time_label |
| 477 |
&& ( Number( data.parsed_fields.appointment_buffer_before_minutes || 0 ) > 0 || Number( data.parsed_fields.appointment_buffer_after_minutes || 0 ) > 0 ) |
| 478 |
) { #> |
| 479 |
<span class="sysinfo_appointment_buffer"><?php echo esc_js( __( 'Buffer', 'booking' ) ); ?>: <strong>{{data.parsed_fields.appointment_buffer_before_minutes}} / {{data.parsed_fields.appointment_buffer_after_minutes}} <?php echo esc_js( __( 'min', 'booking' ) ); ?></strong></span><div class="wpbc_ui_el__vetical_line sysinfo_appointment_buffer"></div> |
| 480 |
<span class="sysinfo_appointment_reserved"><?php echo esc_js( __( 'Blocked', 'booking' ) ); ?>: <strong>{{data.parsed_fields.appointment_reserved_time_label}}</strong></span><div class="wpbc_ui_el__vetical_line sysinfo_appointment_reserved"></div> |
| 481 |
<# } #> |
| 482 |
<span class="sysinfo_hash"><?php echo esc_js(__( 'Hash', 'booking' )); ?>: <strong>{{data['parsed_fields']['hash']}}</strong></span><div class="wpbc_ui_el__vetical_line sysinfo_hash"></div> |
| 483 |
<span class="sysinfo_sync_id"><?php echo esc_js(__( 'Sync ID', 'booking' )); ?>: <strong>{{data['parsed_fields']['sync_id']}}</strong></span> |
| 484 |
</div> |
| 485 |
</div> |
| 486 |
</div> |
| 487 |
<?php |
| 488 |
} |
| 489 |
|
| 490 |
function wpbc_template__booking_listing_row__section_col__hidden_fields(){ |
| 491 |
?> |
| 492 |
<# |
| 493 |
var selected_locale_value = ''; |
| 494 |
if ( |
| 495 |
( 'undefined' !== typeof( data.parsed_fields.booking_options) ) |
| 496 |
&& ( 'undefined' !== typeof( data.parsed_fields.booking_options.booking_meta_locale ) ) |
| 497 |
){ |
| 498 |
var selected_locale_value = data.parsed_fields.booking_options.booking_meta_locale; |
| 499 |
} |
| 500 |
#> |
| 501 |
<input type="hidden" id="locale_for_booking{{data['parsed_fields']['booking_id']}}" name="locale_for_booking{{data['parsed_fields']['booking_id']}}" value="{{selected_locale_value}}" /> |
| 502 |
<?php |
| 503 |
} |
| 504 |
|
| 505 |
function wpbc_template__booking_listing_row__section_col__cost() { |
| 506 |
|
| 507 |
if ( ! class_exists( 'wpdev_bk_biz_s' ) ) { |
| 508 |
return false; |
| 509 |
} |
| 510 |
|
| 511 |
?> |
| 512 |
<div class="wpbc_listing_col wpbc_col_cost"> |
| 513 |
<a href="javascript:void(0)" |
| 514 |
onclick="javascript:wpbc_boo_listing__click__set_booking_cost( {{data.parsed_fields.booking_id}}, '{{data.parsed_fields.cost}}' );"> |
| 515 |
{{{data.parsed_fields.currency_symbol}}} |
| 516 |
{{data.parsed_fields.cost}} |
| 517 |
</a> |
| 518 |
</div> |
| 519 |
<?php |
| 520 |
} |
| 521 |
|
| 522 |
function wpbc_template__booking_listing_row__section_col__action_button() { |
| 523 |
|
| 524 |
?> |
| 525 |
<div class="wpbc_listing_col wpbc_col_action"> |
| 526 |
<?php |
| 527 |
wpbc_template__booking_listing__el__btn_action() |
| 528 |
?> |
| 529 |
</div> |
| 530 |
<?php |
| 531 |
} |
| 532 |
|
| 533 |
// --------------------------------------------------------------------------------------------------------------------- |
| 534 |
// Action Button |
| 535 |
// --------------------------------------------------------------------------------------------------------------------- |
| 536 |
|
| 537 |
function wpbc_template__booking_listing__el__btn_action(){ |
| 538 |
|
| 539 |
$el_arr = array( |
| 540 |
'title' => '', |
| 541 |
'font_icon' => 'wpbc_icn_more_vert', |
| 542 |
'position' => 'right', |
| 543 |
'has_down_arrow' => false, |
| 544 |
'container_style' => 'position:absolute;', |
| 545 |
'items' => array(), |
| 546 |
); |
| 547 |
|
| 548 |
$el_arr['items'][] = array( 'type' => 'html', 'html' => wpbc_template__booking_listing__action_approved() ); |
| 549 |
$el_arr['items'][] = array( 'type' => 'html', 'html' => wpbc_template__booking_listing__action_pending() ); |
| 550 |
$el_arr['items'][] = array( 'type' => 'divider' ); |
| 551 |
$el_arr['items'][] = array( 'type' => 'html', 'html' => wpbc_template__booking_listing__action_edit_booking() ); |
| 552 |
$el_arr['items'][] = array( 'type' => 'html', 'html' => WPBC_Action_Booking_Note::get_button() ); |
| 553 |
$el_arr['items'][] = array( 'type' => 'html', 'html' => wpbc_template__booking_listing__action_print() ); |
| 554 |
if ( class_exists( 'wpdev_bk_biz_s' ) ) { |
| 555 |
$el_arr['items'][] = array( 'type' => 'header', 'title' => __( 'Collect Payment', 'booking' ) ); |
| 556 |
$el_arr['items'][] = array( 'type' => 'html', 'html' => WPBC_Action_Payment_Request::get_button() ); |
| 557 |
$el_arr['items'][] = array( 'type' => 'divider' ); |
| 558 |
$el_arr['items'][] = array( 'type' => 'header', 'title' => __( 'Payment Price and Status', 'booking' ) ); |
| 559 |
$el_arr['items'][] = array( 'type' => 'html', 'html' => WPBC_Action_Booking_Cost::get_button() ); |
| 560 |
$el_arr['items'][] = array( 'type' => 'html', 'html' => WPBC_Action_Payment_Satatus::get_button() ); |
| 561 |
} |
| 562 |
$el_arr['items'][] = array( 'type' => 'divider' ); |
| 563 |
$el_arr['items'][] = array( 'type' => 'html', 'html' => wpbc_template__booking_listing__action_add_google_calendar() ); |
| 564 |
$el_arr['items'][] = array( 'type' => 'html', 'html' => WPBC_Action_Change_Resource::get_button() ); |
| 565 |
$el_arr['items'][] = array( 'type' => 'html', 'html' => WPBC_Action_Duplicate_Booking::get_button() ); |
| 566 |
$el_arr['items'][] = array( 'type' => 'html', 'html' => WPBC_Action_Change_Locale::get_button() ); |
| 567 |
$el_arr['items'][] = array( 'type' => 'divider' ); |
| 568 |
$el_arr['items'][] = array( 'type' => 'html', 'html' => wpbc_template__booking_listing__action_trash() ); |
| 569 |
$el_arr['items'][] = array( 'type' => 'html', 'html' => wpbc_template__booking_listing__action_trash_restore() ); |
| 570 |
$el_arr['items'][] = array( 'type' => 'html', 'html' => wpbc_template__booking_listing__action_delete() ); |
| 571 |
|
| 572 |
$el_arr = apply_filters( 'wpbc_template__booking_listing__el__btn_action' , $el_arr ); |
| 573 |
|
| 574 |
wpbc_ui_el__dropdown_menu( $el_arr ); |
| 575 |
} |
| 576 |
|
| 577 |
// --------------------------------------------------------------------------------------------------------------------- |
| 578 |
// -- Action for Options in Dropdown Menu |
| 579 |
// --------------------------------------------------------------------------------------------------------------------- |
| 580 |
|
| 581 |
/** |
| 582 |
* -- Approve -- Option for "Actions Dropdown Menu" |
| 583 |
* |
| 584 |
* @return string |
| 585 |
*/ |
| 586 |
function wpbc_template__booking_listing__action_approved() { |
| 587 |
|
| 588 |
$booking_action = 'set_booking_approved'; |
| 589 |
if ( ! wpbc_is_user_can( $booking_action, wpbc_get_current_user_id() ) ) { |
| 590 |
return false; |
| 591 |
} |
| 592 |
$html_for_drop_down_option = "<# if ( '0' == data['approved']) { #>"; |
| 593 |
$html_for_drop_down_option .= "<a class=\"ul_dropdown_menu_li_action ul_dropdown_menu_li_action_" . $booking_action . "\" |
| 594 |
href=\"javascript:void(0)\" |
| 595 |
onclick=\"wpbc_ajx_booking_ajax_action_request( { |
| 596 |
'booking_action' : '{$booking_action}', |
| 597 |
'booking_id' : {{data['parsed_fields']['booking_id']}} |
| 598 |
} ); |
| 599 |
wpbc_button_enable_loading_icon( this );\" |
| 600 |
>" . |
| 601 |
esc_js( __( 'Approve', 'booking' ) ) . |
| 602 |
"<i class='menu_icon icon-1x wpbc_icn_done_all'></i>" . |
| 603 |
'</a>'; |
| 604 |
$html_for_drop_down_option .= '<# } #>'; |
| 605 |
|
| 606 |
return $html_for_drop_down_option; |
| 607 |
} |
| 608 |
|
| 609 |
/** |
| 610 |
* -- Pending -- Option for "Actions Dropdown Menu" |
| 611 |
* |
| 612 |
* @return string |
| 613 |
*/ |
| 614 |
function wpbc_template__booking_listing__action_pending() { |
| 615 |
|
| 616 |
$booking_action = 'set_booking_pending'; |
| 617 |
if ( ! wpbc_is_user_can( $booking_action, wpbc_get_current_user_id() ) ) { |
| 618 |
return false; |
| 619 |
} |
| 620 |
|
| 621 |
$html_for_drop_down_option = "<# if ( '1' == data['approved']) { #>"; |
| 622 |
$html_for_drop_down_option .= "<a class=\"ul_dropdown_menu_li_action ul_dropdown_menu_li_action_" . $booking_action . "\" |
| 623 |
href=\"javascript:void(0)\" |
| 624 |
onclick=\"if ( ! wpbc_is_modal_accessible( '#wpbc_modal__set_booking_pending__section' ) ) { |
| 625 |
return false; |
| 626 |
} |
| 627 |
jQuery( '.wpbc_modal__title__reason__booking_id' ).html( 'ID: ' + {{data.parsed_fields.booking_id}} ); |
| 628 |
jQuery( '#wpbc_modal__set_booking_pending__booking_id').val('{{data.parsed_fields.booking_id}}'); |
| 629 |
jQuery( '#wpbc_modal__set_booking_pending__section' ).wpbc_my_modal( 'show' ); |
| 630 |
jQuery( '#wpbc_modal__set_booking_pending__value' ).trigger( 'focus' ); |
| 631 |
\" |
| 632 |
>" . |
| 633 |
esc_js( __( 'Set as Pending', 'booking' ) ) . |
| 634 |
"<i class='menu_icon icon-1x wpbc_icn_hourglass_empty'></i>" . |
| 635 |
'</a>'; |
| 636 |
$html_for_drop_down_option .= '<# } #>'; |
| 637 |
|
| 638 |
return $html_for_drop_down_option; |
| 639 |
} |
| 640 |
|
| 641 |
/** |
| 642 |
* -- Edit Booking -- Option for "Actions Dropdown Menu" |
| 643 |
* |
| 644 |
* @return string |
| 645 |
*/ |
| 646 |
function wpbc_template__booking_listing__action_edit_booking() { |
| 647 |
|
| 648 |
$booking_action = 'edit_booking'; |
| 649 |
|
| 650 |
if ( ! wpbc_is_user_can( $booking_action, wpbc_get_current_user_id() ) ) { |
| 651 |
return false; |
| 652 |
} |
| 653 |
|
| 654 |
$edit_booking_url = 'javascript:void(0)'; |
| 655 |
$edit_booking_onclick = "if ( '' == '{{data.parsed_fields.hash}}' ) { return false; }" |
| 656 |
. " wpbc_boo_listing__click__add_booking_modal_from_row(" |
| 657 |
. " '{{data.parsed_fields.booking_id}}'," |
| 658 |
. " '{{data.parsed_fields.resource_id}}'," |
| 659 |
. " '{{data.parsed_fields.hash}}'," |
| 660 |
. " '{{data.parsed_fields.wpbc_custom_booking_form}}'" |
| 661 |
. ' );'; |
| 662 |
|
| 663 |
if ( wpbc_is_booking_admin_edit_page_enabled() ) { |
| 664 |
$edit_booking_url = '{{{data.parsed_fields.admin_edit_url}}}'; |
| 665 |
$edit_booking_onclick = "if ( '' == '{{data.parsed_fields.hash}}' ) { return false; }"; |
| 666 |
} |
| 667 |
// FixIn: 10.10.1.2 $edit_booking_url .= ( 'Off' !== get_bk_option( 'booking_is_resource_no_update__during_editing' ) ) ? '&resource_no_update=1' : ''; // FixIn: 9.4.2.3. |
| 668 |
|
| 669 |
$html_for_drop_down_option = "<a href='" . $edit_booking_url . "' |
| 670 |
onclick=\"" . $edit_booking_onclick . "\" |
| 671 |
class=\"ul_dropdown_menu_li_action ul_dropdown_menu_li_action_" . $booking_action . |
| 672 |
" <# if ( '' == data['parsed_fields']['hash']) { #>wpbc_field_disabled<# } #>\" >" . |
| 673 |
esc_js( __( 'Edit booking', 'booking' ) ) . |
| 674 |
"<i class='menu_icon icon-1x wpbc_icn_draw'></i>" . |
| 675 |
'</a>'; |
| 676 |
|
| 677 |
return $html_for_drop_down_option; |
| 678 |
} |
| 679 |
|
| 680 |
/** |
| 681 |
* -- Add to Google Calendar -- Option for "Actions Dropdown Menu" |
| 682 |
* |
| 683 |
* @return string |
| 684 |
*/ |
| 685 |
function wpbc_template__booking_listing__action_add_google_calendar() { |
| 686 |
|
| 687 |
$booking_action = 'booking_add_google_calendar'; |
| 688 |
|
| 689 |
if ( ! wpbc_is_user_can( $booking_action, wpbc_get_current_user_id() ) ) { |
| 690 |
return false; |
| 691 |
} |
| 692 |
|
| 693 |
$edit_booking_url = '{{{data.parsed_fields.google_calendar_link}}}'; |
| 694 |
|
| 695 |
$html_for_drop_down_option = "<a href='" . $edit_booking_url . "' |
| 696 |
target='_blank' |
| 697 |
class='ul_dropdown_menu_li_action ul_dropdown_menu_li_action_" . $booking_action . "' >" . |
| 698 |
esc_js( __( 'Add to Google Calendar', 'booking' ) ) . |
| 699 |
"<i class='menu_icon icon-1x wpbc_icn_event'></i>" . |
| 700 |
'</a>'; |
| 701 |
|
| 702 |
return $html_for_drop_down_option; |
| 703 |
} |
| 704 |
|
| 705 |
/** |
| 706 |
* -- Trash -- Option for "Actions Dropdown Menu" |
| 707 |
* |
| 708 |
* @return string |
| 709 |
*/ |
| 710 |
function wpbc_template__booking_listing__action_trash() { |
| 711 |
|
| 712 |
$booking_action = 'move_booking_to_trash'; |
| 713 |
|
| 714 |
if ( ! wpbc_is_user_can( $booking_action, wpbc_get_current_user_id() ) ) { |
| 715 |
return false; |
| 716 |
} |
| 717 |
|
| 718 |
$html_for_drop_down_option = "<# if ( '0' == data['parsed_fields']['trash'] ) { #>"; |
| 719 |
$html_for_drop_down_option .= "<a class=\"ul_dropdown_menu_li_action ul_dropdown_menu_li_action_" . $booking_action . "\" |
| 720 |
href=\"javascript:void(0)\" |
| 721 |
onclick=\"if ( ! wpbc_is_modal_accessible( '#wpbc_modal__move_booking_to_trash__section' ) ) { |
| 722 |
return false; |
| 723 |
} |
| 724 |
jQuery( '#wpbc_modal__move_booking_to_trash__booking_id').val('{{data.parsed_fields.booking_id}}'); |
| 725 |
jQuery( '.wpbc_modal__title__reason__booking_id' ).html( 'ID: ' + {{data['parsed_fields']['booking_id']}} ); |
| 726 |
jQuery( '#wpbc_modal__move_booking_to_trash__section' ).wpbc_my_modal( 'show' ); |
| 727 |
jQuery( '#wpbc_modal__move_booking_to_trash__value' ).trigger( 'focus' ); |
| 728 |
\" |
| 729 |
>" . |
| 730 |
esc_js( __( 'Reject - move to trash', 'booking' ) ) . |
| 731 |
"<i class='menu_icon icon-1x wpbc_icn_delete_outline'></i>" . |
| 732 |
'</a>'; |
| 733 |
$html_for_drop_down_option .= '<# } #>'; |
| 734 |
|
| 735 |
return $html_for_drop_down_option; |
| 736 |
} |
| 737 |
|
| 738 |
/** |
| 739 |
* -- Restore -- Option for "Actions Dropdown Menu" |
| 740 |
* |
| 741 |
* @return string |
| 742 |
*/ |
| 743 |
function wpbc_template__booking_listing__action_trash_restore() { |
| 744 |
|
| 745 |
$booking_action = 'restore_booking_from_trash'; |
| 746 |
|
| 747 |
if ( ! wpbc_is_user_can( $booking_action, wpbc_get_current_user_id() ) ) { |
| 748 |
return false; |
| 749 |
} |
| 750 |
|
| 751 |
$html_for_drop_down_option = "<# if ( '1' == data['parsed_fields']['trash'] ) { #>"; |
| 752 |
$html_for_drop_down_option .= "<a class=\"ul_dropdown_menu_li_action ul_dropdown_menu_li_action_" . $booking_action . "\" |
| 753 |
href=\"javascript:void(0)\" |
| 754 |
onclick=\"if ( ! wpbc_is_modal_accessible( '#wpbc_modal__restore_booking_from_trash__section' ) ) { |
| 755 |
return false; |
| 756 |
} |
| 757 |
jQuery( '#wpbc_modal__restore_booking_from_trash__booking_id').val('{{data.parsed_fields.booking_id}}'); |
| 758 |
jQuery( '.wpbc_modal__title__reason__booking_id' ).html( 'ID: ' + {{data.parsed_fields.booking_id}} ); |
| 759 |
jQuery( '#wpbc_modal__restore_booking_from_trash__section' ).wpbc_my_modal( 'show' ); |
| 760 |
jQuery( '#wpbc_modal__restore_booking_from_trash__value' ).trigger( 'focus' ); |
| 761 |
\" |
| 762 |
>" . |
| 763 |
esc_js( __( 'Restore', 'booking' ) ) . |
| 764 |
"<i class='menu_icon icon-1x wpbc_icn_rotate_left'></i>" . |
| 765 |
'</a>'; |
| 766 |
$html_for_drop_down_option .= '<# } #>'; |
| 767 |
|
| 768 |
return $html_for_drop_down_option; |
| 769 |
} |
| 770 |
|
| 771 |
/** |
| 772 |
* -- Completely Delete -- Option for "Actions Dropdown Menu" |
| 773 |
* |
| 774 |
* @return string |
| 775 |
*/ |
| 776 |
function wpbc_template__booking_listing__action_delete() { |
| 777 |
|
| 778 |
$booking_action = 'delete_booking_completely'; |
| 779 |
|
| 780 |
if ( ! wpbc_is_user_can( $booking_action, wpbc_get_current_user_id() ) ) { |
| 781 |
return false; |
| 782 |
} |
| 783 |
|
| 784 |
$html_for_drop_down_option = "<# if ( '1' == data['parsed_fields']['trash'] ) { #>"; |
| 785 |
$html_for_drop_down_option .= "<a class=\"ul_dropdown_menu_li_action ul_dropdown_menu_li_action_" . $booking_action . "\" |
| 786 |
href=\"javascript:void(0)\" |
| 787 |
onclick=\"if ( ! wpbc_is_modal_accessible( '#wpbc_modal__delete_booking_completely__section' ) ) { |
| 788 |
return false; |
| 789 |
} |
| 790 |
jQuery( '#wpbc_modal__delete_booking_completely__booking_id').val('{{data.parsed_fields.booking_id}}'); |
| 791 |
jQuery( '.wpbc_modal__title__reason__booking_id' ).html( 'ID: ' + {{data['parsed_fields']['booking_id']}} ); |
| 792 |
jQuery( '#wpbc_modal__delete_booking_completely__section' ).wpbc_my_modal( 'show' ); |
| 793 |
jQuery( '#wpbc_modal__delete_booking_completely__value' ).trigger( 'focus' ); |
| 794 |
\" |
| 795 |
>" . |
| 796 |
esc_js( __( 'Completely Delete', 'booking' ) ) . |
| 797 |
"<i class='menu_icon icon-1x wpbc_icn_close'></i>" . |
| 798 |
'</a>'; |
| 799 |
$html_for_drop_down_option .= '<# } #>'; |
| 800 |
|
| 801 |
return $html_for_drop_down_option; |
| 802 |
} |
| 803 |
|
| 804 |
/** |
| 805 |
* -- Print one booking -- Option for "Actions Dropdown Menu" |
| 806 |
* |
| 807 |
* @return string |
| 808 |
*/ |
| 809 |
function wpbc_template__booking_listing__action_print() { |
| 810 |
|
| 811 |
$booking_action = 'set_print'; |
| 812 |
|
| 813 |
if ( ! wpbc_is_user_can( $booking_action, wpbc_get_current_user_id() ) ) { |
| 814 |
return false; |
| 815 |
} |
| 816 |
|
| 817 |
$html_for_drop_down_option = "<a class=\"ul_dropdown_menu_li_action ul_dropdown_menu_li_action_" . $booking_action . "\" |
| 818 |
href=\"javascript:void(0)\" |
| 819 |
onclick=\"wpbc_print_dialog__show( {{data['parsed_fields']['booking_id']}} );\" |
| 820 |
>" . |
| 821 |
esc_js( __( 'Print', 'booking' ) ) . |
| 822 |
"<i class='menu_icon icon-1x wpbc_icn_print'></i>" . |
| 823 |
'</a>'; |
| 824 |
|
| 825 |
return $html_for_drop_down_option; |
| 826 |
} |
| 827 |
|