| @@ -168,11 +168,10 @@ | ||
| 168 | 168 | <span class="vbo-widget-finance-stat-name"><?php echo JText::translate('VBO_GROSS_BOOKING_VALUE'); ?></span> |
| 169 | 169 | <span class="vbo-widget-finance-stat-cmd"><?php VikBookingIcons::e('ellipsis-v'); ?></span> |
| 170 | 170 | </div> |
| 171 | 171 | <div class="vbo-widget-finance-stat-amount"> |
| 172 | - <span class="vbo-widget-finance-stat-amount-value vbo-tooltip vbo-tooltip-top" data-tooltiptext="<?php echo $currencysymb . ' ' . VikBooking::numberFormat($stats['gross_revenue']); ?>"> | |
| 173 | - <span class="vbo-currency"><?php echo $currencysymb; ?></span> | |
| 174 | - <span class="vbo-price"><?php echo $finance->numberFormatShort($stats['gross_revenue']); ?></span> | |
| 172 | + <span class="vbo-widget-finance-stat-amount-value vbo-tooltip vbo-tooltip-top" data-tooltiptext="<?php echo VikBooking::formatCurrencyNumber(VikBooking::numberFormat($stats['gross_revenue']), $currencysymb); ?>"> | |
| 173 | + <?php echo VikBooking::formatCurrencyNumber($finance->numberFormatShort($stats['gross_revenue']), $currencysymb, ['<span class="vbo-currency">%s</span>', '<span class="vbo-price">%s</span>']); ?> | |
| 175 | 174 | </span> |
| 176 | 175 | </div> |
| 177 | 176 | </div> |
| 178 | 177 | </div> |
| @@ -183,11 +182,10 @@ | ||
| 183 | 182 | <span class="vbo-widget-finance-stat-name"><?php echo JText::translate('VBOINVCOLTAX'); ?></span> |
| 184 | 183 | <span class="vbo-widget-finance-stat-cmd"><?php VikBookingIcons::e('ellipsis-v'); ?></span> |
| 185 | 184 | </div> |
| 186 | 185 | <div class="vbo-widget-finance-stat-amount"> |
| 187 | - <span class="vbo-widget-finance-stat-amount-value vbo-tooltip vbo-tooltip-top" data-tooltiptext="<?php echo $currencysymb . ' ' . VikBooking::numberFormat($stats['taxes']); ?>"> | |
| 188 | - <span class="vbo-currency"><?php echo $currencysymb; ?></span> | |
| 189 | - <span class="vbo-price"><?php echo $finance->numberFormatShort($stats['taxes']); ?></span> | |
| 186 | + <span class="vbo-widget-finance-stat-amount-value vbo-tooltip vbo-tooltip-top" data-tooltiptext="<?php echo VikBooking::formatCurrencyNumber(VikBooking::numberFormat($stats['taxes']), $currencysymb); ?>"> | |
| 187 | + <?php echo VikBooking::formatCurrencyNumber($finance->numberFormatShort($stats['taxes']), $currencysymb, ['<span class="vbo-currency">%s</span>', '<span class="vbo-price">%s</span>']); ?> | |
| 190 | 188 | </span> |
| 191 | 189 | </div> |
| 192 | 190 | </div> |
| 193 | 191 | </div> |
| @@ -198,11 +196,10 @@ | ||
| 198 | 196 | <span class="vbo-widget-finance-stat-name"><?php echo JText::translate('VBTOTALCOMMISSIONS'); ?></span> |
| 199 | 197 | <span class="vbo-widget-finance-stat-cmd"><?php VikBookingIcons::e('ellipsis-v'); ?></span> |
| 200 | 198 | </div> |
| 201 | 199 | <div class="vbo-widget-finance-stat-amount"> |
| 202 | - <span class="vbo-widget-finance-stat-amount-value vbo-tooltip vbo-tooltip-top" data-tooltiptext="<?php echo $currencysymb . ' ' . VikBooking::numberFormat($stats['cmms']); ?>"> | |
| 203 | - <span class="vbo-currency"><?php echo $currencysymb; ?></span> | |
| 204 | - <span class="vbo-price"><?php echo $finance->numberFormatShort($stats['cmms']); ?></span> | |
| 200 | + <span class="vbo-widget-finance-stat-amount-value vbo-tooltip vbo-tooltip-top" data-tooltiptext="<?php echo VikBooking::formatCurrencyNumber(VikBooking::numberFormat($stats['cmms']), $currencysymb); ?>"> | |
| 201 | + <?php echo VikBooking::formatCurrencyNumber($finance->numberFormatShort($stats['cmms']), $currencysymb, ['<span class="vbo-currency">%s</span>', '<span class="vbo-price">%s</span>']); ?> | |
| 205 | 202 | </span> |
| 206 | 203 | </div> |
| 207 | 204 | </div> |
| 208 | 205 | </div> |
| @@ -213,11 +210,10 @@ | ||
| 213 | 210 | <span class="vbo-widget-finance-stat-name"><?php echo JText::translate('VBOREPORTREVENUE'); ?></span> |
| 214 | 211 | <span class="vbo-widget-finance-stat-cmd"><?php VikBookingIcons::e('ellipsis-v'); ?></span> |
| 215 | 212 | </div> |
| 216 | 213 | <div class="vbo-widget-finance-stat-amount"> |
| 217 | - <span class="vbo-widget-finance-stat-amount-value vbo-tooltip vbo-tooltip-top" data-tooltiptext="<?php echo $currencysymb . ' ' . VikBooking::numberFormat($stats['revenue']); ?>"> | |
| 218 | - <span class="vbo-currency"><?php echo $currencysymb; ?></span> | |
| 219 | - <span class="vbo-price"><?php echo $finance->numberFormatShort($stats['revenue']); ?></span> | |
| 214 | + <span class="vbo-widget-finance-stat-amount-value vbo-tooltip vbo-tooltip-top" data-tooltiptext="<?php echo VikBooking::formatCurrencyNumber(VikBooking::numberFormat($stats['revenue']), $currencysymb); ?>"> | |
| 215 | + <?php echo VikBooking::formatCurrencyNumber($finance->numberFormatShort($stats['revenue']), $currencysymb, ['<span class="vbo-currency">%s</span>', '<span class="vbo-price">%s</span>']); ?> | |
| 220 | 216 | </span> |
| 221 | 217 | </div> |
| 222 | 218 | </div> |
| 223 | 219 | </div> |
| @@ -228,11 +224,10 @@ | ||
| 228 | 224 | <span class="vbo-widget-finance-stat-name"><?php echo JText::translate('VBOREPORTREVENUEREVWEB'); ?></span> |
| 229 | 225 | <span class="vbo-widget-finance-stat-cmd"><?php VikBookingIcons::e('ellipsis-v'); ?></span> |
| 230 | 226 | </div> |
| 231 | 227 | <div class="vbo-widget-finance-stat-amount"> |
| 232 | - <span class="vbo-widget-finance-stat-amount-value vbo-tooltip vbo-tooltip-top" data-tooltiptext="<?php echo $currencysymb . ' ' . VikBooking::numberFormat($stats['ibe_revenue']); ?>"> | |
| 233 | - <span class="vbo-currency"><?php echo $currencysymb; ?></span> | |
| 234 | - <span class="vbo-price"><?php echo $finance->numberFormatShort($stats['ibe_revenue']); ?></span> | |
| 228 | + <span class="vbo-widget-finance-stat-amount-value vbo-tooltip vbo-tooltip-top" data-tooltiptext="<?php echo VikBooking::formatCurrencyNumber(VikBooking::numberFormat($stats['ibe_revenue']), $currencysymb); ?>"> | |
| 229 | + <?php echo VikBooking::formatCurrencyNumber($finance->numberFormatShort($stats['ibe_revenue']), $currencysymb, ['<span class="vbo-currency">%s</span>', '<span class="vbo-price">%s</span>']); ?> | |
| 235 | 230 | </span> |
| 236 | 231 | </div> |
| 237 | 232 | </div> |
| 238 | 233 | </div> |
| @@ -243,11 +238,10 @@ | ||
| 243 | 238 | <span class="vbo-widget-finance-stat-name"><?php echo JText::translate('VBOREPORTREVENUEREVOTA'); ?></span> |
| 244 | 239 | <span class="vbo-widget-finance-stat-cmd"><?php VikBookingIcons::e('ellipsis-v'); ?></span> |
| 245 | 240 | </div> |
| 246 | 241 | <div class="vbo-widget-finance-stat-amount"> |
| 247 | - <span class="vbo-widget-finance-stat-amount-value vbo-tooltip vbo-tooltip-top" data-tooltiptext="<?php echo $currencysymb . ' ' . VikBooking::numberFormat($stats['ota_revenue']); ?>"> | |
| 248 | - <span class="vbo-currency"><?php echo $currencysymb; ?></span> | |
| 249 | - <span class="vbo-price"><?php echo $finance->numberFormatShort($stats['ota_revenue']); ?></span> | |
| 242 | + <span class="vbo-widget-finance-stat-amount-value vbo-tooltip vbo-tooltip-top" data-tooltiptext="<?php echo VikBooking::formatCurrencyNumber(VikBooking::numberFormat($stats['ota_revenue']), $currencysymb); ?>"> | |
| 243 | + <?php echo VikBooking::formatCurrencyNumber($finance->numberFormatShort($stats['ota_revenue']), $currencysymb, ['<span class="vbo-currency">%s</span>', '<span class="vbo-price">%s</span>']); ?> | |
| 250 | 244 | </span> |
| 251 | 245 | </div> |
| 252 | 246 | </div> |
| 253 | 247 | </div> |
| @@ -252,8 +246,42 @@ | ||
| 252 | 246 | </div> |
| 253 | 247 | </div> |
| 254 | 248 | |
| 255 | 249 | <?php |
| 250 | + if ($stats['tot_vat'] > 0) { | |
| 251 | + ?> | |
| 252 | + <div class="vbo-widget-finance-data-block" data-typestat="tot_vat"> | |
| 253 | + <div class="vbo-widget-finance-stat"> | |
| 254 | + <div class="vbo-widget-finance-stat-info"> | |
| 255 | + <span class="vbo-widget-finance-stat-name"><?php echo JText::translate('VBO_INV_VATGST'); ?></span> | |
| 256 | + <span class="vbo-widget-finance-stat-cmd"><?php VikBookingIcons::e('ellipsis-v'); ?></span> | |
| 257 | + </div> | |
| 258 | + <div class="vbo-widget-finance-stat-amount"> | |
| 259 | + <span class="vbo-widget-finance-stat-amount-value vbo-tooltip vbo-tooltip-top" data-tooltiptext="<?php echo VikBooking::formatCurrencyNumber(VikBooking::numberFormat($stats['tot_vat']), $currencysymb); ?>"> | |
| 260 | + <?php echo VikBooking::formatCurrencyNumber($finance->numberFormatShort($stats['tot_vat']), $currencysymb, ['<span class="vbo-currency">%s</span>', '<span class="vbo-price">%s</span>']); ?> | |
| 261 | + </span> | |
| 262 | + </div> | |
| 263 | + </div> | |
| 264 | + </div> | |
| 265 | + <?php | |
| 266 | + } | |
| 267 | + if ($stats['city_taxes'] > 0) { | |
| 268 | + ?> | |
| 269 | + <div class="vbo-widget-finance-data-block" data-typestat="city_taxes"> | |
| 270 | + <div class="vbo-widget-finance-stat"> | |
| 271 | + <div class="vbo-widget-finance-stat-info"> | |
| 272 | + <span class="vbo-widget-finance-stat-name"><?php echo JText::translate('VBTOTALCITYTAX'); ?></span> | |
| 273 | + <span class="vbo-widget-finance-stat-cmd"><?php VikBookingIcons::e('ellipsis-v'); ?></span> | |
| 274 | + </div> | |
| 275 | + <div class="vbo-widget-finance-stat-amount"> | |
| 276 | + <span class="vbo-widget-finance-stat-amount-value vbo-tooltip vbo-tooltip-top" data-tooltiptext="<?php echo VikBooking::formatCurrencyNumber(VikBooking::numberFormat($stats['city_taxes']), $currencysymb); ?>"> | |
| 277 | + <?php echo VikBooking::formatCurrencyNumber($finance->numberFormatShort($stats['city_taxes']), $currencysymb, ['<span class="vbo-currency">%s</span>', '<span class="vbo-price">%s</span>']); ?> | |
| 278 | + </span> | |
| 279 | + </div> | |
| 280 | + </div> | |
| 281 | + </div> | |
| 282 | + <?php | |
| 283 | + } | |
| 256 | 284 | if ($stats['cmm_savings'] > 0) { |
| 257 | 285 | ?> |
| 258 | 286 | <div class="vbo-widget-finance-data-block" data-typestat="ota_avg_cmms"> |
| 259 | 287 | <div class="vbo-widget-finance-stat"> |
| @@ -275,11 +303,10 @@ | ||
| 275 | 303 | <span class="vbo-widget-finance-stat-name"><?php echo JText::translate('VBO_COMMISSION_SAVINGS'); ?></span> |
| 276 | 304 | <span class="vbo-widget-finance-stat-cmd"><?php VikBookingIcons::e('ellipsis-v'); ?></span> |
| 277 | 305 | </div> |
| 278 | 306 | <div class="vbo-widget-finance-stat-amount"> |
| 279 | - <span class="vbo-widget-finance-stat-amount-value vbo-tooltip vbo-tooltip-top" data-tooltiptext="<?php echo $currencysymb . ' ' . VikBooking::numberFormat($stats['cmm_savings']); ?>"> | |
| 280 | - <span class="vbo-currency"><?php echo $currencysymb; ?></span> | |
| 281 | - <span class="vbo-price"><?php echo $finance->numberFormatShort($stats['cmm_savings']); ?></span> | |
| 307 | + <span class="vbo-widget-finance-stat-amount-value vbo-tooltip vbo-tooltip-top" data-tooltiptext="<?php echo VikBooking::formatCurrencyNumber(VikBooking::numberFormat($stats['cmm_savings']), $currencysymb); ?>"> | |
| 308 | + <?php echo VikBooking::formatCurrencyNumber($finance->numberFormatShort($stats['cmm_savings']), $currencysymb, ['<span class="vbo-currency">%s</span>', '<span class="vbo-price">%s</span>']); ?> | |
| 282 | 309 | </span> |
| 283 | 310 | </div> |
| 284 | 311 | </div> |
| 285 | 312 | </div> |
| @@ -284,8 +311,31 @@ | ||
| 284 | 311 | </div> |
| 285 | 312 | </div> |
| 286 | 313 | <?php |
| 287 | 314 | } |
| 315 | + | |
| 316 | + /** | |
| 317 | + * Return the information about the damage deposits collected/held. | |
| 318 | + * | |
| 319 | + * @since 1.18.0 (J) - 1.8.0 (WP) | |
| 320 | + */ | |
| 321 | + if ($stats['damage_deposits'] > 0) { | |
| 322 | + ?> | |
| 323 | + <div class="vbo-widget-finance-data-block" data-typestat="damage_deposits"> | |
| 324 | + <div class="vbo-widget-finance-stat"> | |
| 325 | + <div class="vbo-widget-finance-stat-info"> | |
| 326 | + <span class="vbo-widget-finance-stat-name"><?php echo JText::translate('VBO_TOT_DAMAGE_DEPOSITS'); ?></span> | |
| 327 | + <span class="vbo-widget-finance-stat-cmd"><?php VikBookingIcons::e('ellipsis-v'); ?></span> | |
| 328 | + </div> | |
| 329 | + <div class="vbo-widget-finance-stat-amount"> | |
| 330 | + <span class="vbo-widget-finance-stat-amount-value vbo-tooltip vbo-tooltip-top" data-tooltiptext="<?php echo VikBooking::formatCurrencyNumber(VikBooking::numberFormat($stats['damage_deposits']), $currencysymb); ?>"> | |
| 331 | + <?php echo VikBooking::formatCurrencyNumber($finance->numberFormatShort($stats['damage_deposits']), $currencysymb, ['<span class="vbo-currency">%s</span>', '<span class="vbo-price">%s</span>']); ?> | |
| 332 | + </span> | |
| 333 | + </div> | |
| 334 | + </div> | |
| 335 | + </div> | |
| 336 | + <?php | |
| 337 | + } | |
| 288 | 338 | ?> |
| 289 | 339 | |
| 290 | 340 | <div class="vbo-widget-finance-data-block" data-typestat="tot_bookings"> |
| 291 | 341 | <div class="vbo-widget-finance-stat"> |
| @@ -363,11 +413,10 @@ | ||
| 363 | 413 | <span class="vbo-widget-finance-stat-name"><?php echo JText::translate('VBO_CANCELLATIONS'); ?></span> |
| 364 | 414 | <span class="vbo-widget-finance-stat-cmd"><?php VikBookingIcons::e('ellipsis-v'); ?></span> |
| 365 | 415 | </div> |
| 366 | 416 | <div class="vbo-widget-finance-stat-amount"> |
| 367 | - <span class="vbo-widget-finance-stat-amount-value vbo-tooltip vbo-tooltip-top" data-tooltiptext="<?php echo $currencysymb . ' ' . VikBooking::numberFormat($stats['cancellations_amt']) . ($stats['tot_cancellations'] ? ' (' . $stats['tot_cancellations'] . ')' : ''); ?>"> | |
| 368 | - <span class="vbo-currency"><?php echo $currencysymb; ?></span> | |
| 369 | - <span class="vbo-price"><?php echo $finance->numberFormatShort($stats['cancellations_amt']); ?></span> | |
| 417 | + <span class="vbo-widget-finance-stat-amount-value vbo-tooltip vbo-tooltip-top" data-tooltiptext="<?php echo VikBooking::formatCurrencyNumber(VikBooking::numberFormat($stats['cancellations_amt']), $currencysymb) . ($stats['tot_cancellations'] ? ' (' . $stats['tot_cancellations'] . ')' : ''); ?>"> | |
| 418 | + <?php echo VikBooking::formatCurrencyNumber($finance->numberFormatShort($stats['cancellations_amt']), $currencysymb, ['<span class="vbo-currency">%s</span>', '<span class="vbo-price">%s</span>']); ?> | |
| 370 | 419 | </span> |
| 371 | 420 | </div> |
| 372 | 421 | </div> |
| 373 | 422 | </div> |
| @@ -401,10 +450,18 @@ | ||
| 401 | 450 | <div class="vbo-widget-finance-stat-rank-name"> |
| 402 | 451 | <span><?php echo $country_rank['name']; ?></span> |
| 403 | 452 | </div> |
| 404 | 453 | <div class="vbo-widget-finance-stat-rank-amount"> |
| 405 | - <span class="vbo-currency"><?php echo $currencysymb; ?></span> | |
| 406 | - <span class="vbo-price vbo-tooltip vbo-tooltip-top" data-tooltiptext="<?php echo $currencysymb . ' ' . VikBooking::numberFormat($country_rank['revenue']); ?>"><?php echo $finance->numberFormatShort($country_rank['revenue']); ?></span> | |
| 454 | + <?php | |
| 455 | + echo VikBooking::formatCurrencyNumber( | |
| 456 | + $finance->numberFormatShort($country_rank['revenue']), | |
| 457 | + $currencysymb, | |
| 458 | + [ | |
| 459 | + '<span class="vbo-currency">%s</span>', | |
| 460 | + '<span class="vbo-price vbo-tooltip vbo-tooltip-top" data-tooltiptext="' . VikBooking::formatCurrencyNumber(VikBooking::numberFormat($country_rank['revenue']), $currencysymb) . '">%s</span>', | |
| 461 | + ] | |
| 462 | + ); | |
| 463 | + ?> | |
| 407 | 464 | </div> |
| 408 | 465 | <div class="vbo-widget-finance-stat-rank-pcent"> |
| 409 | 466 | <progress class="vbo-widget-finance-progress" value="<?php echo $country_rank['pcent']; ?>" max="100"><?php echo $country_rank['pcent']; ?>%</progress> |
| 410 | 467 | </div> |
| @@ -450,10 +507,18 @@ | ||
| 450 | 507 | <div class="vbo-widget-finance-stat-rank-name"> |
| 451 | 508 | <span><?php echo $say_pos_name; ?></span> |
| 452 | 509 | </div> |
| 453 | 510 | <div class="vbo-widget-finance-stat-rank-amount"> |
| 454 | - <span class="vbo-currency"><?php echo $currencysymb; ?></span> | |
| 455 | - <span class="vbo-price vbo-tooltip vbo-tooltip-top" data-tooltiptext="<?php echo $currencysymb . ' ' . VikBooking::numberFormat($pos_revenue['revenue']); ?>"><?php echo $finance->numberFormatShort($pos_revenue['revenue']); ?></span> | |
| 511 | + <?php | |
| 512 | + echo VikBooking::formatCurrencyNumber( | |
| 513 | + $finance->numberFormatShort($pos_revenue['revenue']), | |
| 514 | + $currencysymb, | |
| 515 | + [ | |
| 516 | + '<span class="vbo-currency">%s</span>', | |
| 517 | + '<span class="vbo-price vbo-tooltip vbo-tooltip-top" data-tooltiptext="' . VikBooking::formatCurrencyNumber(VikBooking::numberFormat($pos_revenue['revenue']), $currencysymb) . '">%s</span>', | |
| 518 | + ] | |
| 519 | + ); | |
| 520 | + ?> | |
| 456 | 521 | </div> |
| 457 | 522 | <div class="vbo-widget-finance-stat-rank-pcent"> |
| 458 | 523 | <progress class="vbo-widget-finance-progress" value="<?php echo $pos_revenue['pcent']; ?>" max="100"><?php echo $pos_revenue['pcent']; ?>%</progress> |
| 459 | 524 | </div> |
| @@ -624,39 +689,42 @@ | ||
| 624 | 689 | $comparison = []; |
| 625 | 690 | |
| 626 | 691 | // stats that require percent values for comparison |
| 627 | 692 | $pcent_stats = [ |
| 628 | - 'gross_revenue' => [], | |
| 629 | - 'taxes' => [], | |
| 630 | - 'cmms' => [ | |
| 631 | - 'reverse' => 1, | |
| 693 | + 'gross_revenue' => [], | |
| 694 | + 'taxes' => [], | |
| 695 | + 'tot_vat' => [], | |
| 696 | + 'city_taxes' => [], | |
| 697 | + 'cmms' => [ | |
| 698 | + 'reverse' => 1, | |
| 632 | 699 | ], |
| 633 | - 'revenue' => [], | |
| 634 | - 'ibe_revenue' => [], | |
| 635 | - 'ota_revenue' => [], | |
| 636 | - 'ota_avg_cmms' => [ | |
| 700 | + 'revenue' => [], | |
| 701 | + 'ibe_revenue' => [], | |
| 702 | + 'ota_revenue' => [], | |
| 703 | + 'ota_avg_cmms' => [ | |
| 637 | 704 | 'reverse' => 1, |
| 638 | 705 | 'no_pcent' => 1, |
| 639 | 706 | 'fixednum' => 1, |
| 640 | 707 | ], |
| 641 | - 'cmm_savings' => [], | |
| 642 | - 'tot_bookings' => [ | |
| 708 | + 'cmm_savings' => [], | |
| 709 | + 'damage_deposits' => [], | |
| 710 | + 'tot_bookings' => [ | |
| 643 | 711 | 'fixednum' => 1, |
| 644 | 712 | ], |
| 645 | - 'nights_booked' => [ | |
| 713 | + 'nights_booked' => [ | |
| 646 | 714 | 'fixednum' => 1, |
| 647 | 715 | ], |
| 648 | - 'avg_los' => [ | |
| 716 | + 'avg_los' => [ | |
| 649 | 717 | 'fixednum' => 1, |
| 650 | 718 | ], |
| 651 | - 'abw' => [ | |
| 719 | + 'abw' => [ | |
| 652 | 720 | 'fixednum' => 1, |
| 653 | 721 | ], |
| 654 | - 'rooms_booked' => [ | |
| 722 | + 'rooms_booked' => [ | |
| 655 | 723 | 'fixednum' => 1, |
| 656 | 724 | ], |
| 657 | 725 | 'cancellations_amt' => [ |
| 658 | - 'reverse' => 1, | |
| 726 | + 'reverse' => 1, | |
| 659 | 727 | ], |
| 660 | 728 | ]; |
| 661 | 729 | |
| 662 | 730 | foreach ($pcent_stats as $stat_name => $stat_opt) { |
| @@ -727,13 +795,13 @@ | ||
| 727 | 795 | /** |
| 728 | 796 | * Main method to invoke the widget. Contents will be loaded |
| 729 | 797 | * through AJAX requests, not via PHP when the page loads. |
| 730 | 798 | * |
| 731 | - * @param VBOMultitaskData $data | |
| 799 | + * @param ?VBOMultitaskData $data | |
| 732 | 800 | * |
| 733 | 801 | * @return void |
| 734 | 802 | */ |
| 735 | - public function render(VBOMultitaskData $data = null) | |
| 803 | + public function render(?VBOMultitaskData $data = null) | |
| 736 | 804 | { |
| 737 | 805 | // increase widget's instance counter |
| 738 | 806 | static::$instance_counter++; |
| 739 | 807 | |
| @@ -1337,9 +1405,15 @@ | ||
| 1337 | 1405 | ajax: { |
| 1338 | 1406 | delay: 350, |
| 1339 | 1407 | url: "<?php echo VikBooking::ajaxUrl('index.php?option=com_vikbooking&task=bookings.rooms_search'); ?>", |
| 1340 | 1408 | dataType: 'json', |
| 1341 | - } | |
| 1409 | + }, | |
| 1410 | + templateResult: (element) => { | |
| 1411 | + if (!element.img) { | |
| 1412 | + return element.text; | |
| 1413 | + } | |
| 1414 | + return jQuery('<span class="vbo-sel2-element-img"><img src="' + element.img + '" /> <span>' + element.text + '</span></span>'); | |
| 1415 | + }, | |
| 1342 | 1416 | }); |
| 1343 | 1417 | |
| 1344 | 1418 | // when document is ready, load stats for this widget's instance |
| 1345 | 1419 | vboWidgetFinanceLoad('<?php echo $wrapper_id; ?>'); |