PluginProbe
VikBooking Hotel Booking Engine & PMS / 1.8.16
VikBooking Hotel Booking Engine & PMS v1.8.16
1.8.16 1.8.15 1.8.14 1.8.13 1.8.12 1.8.11 1.8.10 1.8.9 1.8.6 1.8.7 1.8.8 trunk 1.6.0 1.6.1 1.6.2 1.6.3 1.6.4 1.6.5 1.6.6 1.6.7 1.6.8 1.6.9 1.7.0 1.7.1 1.7.2 All 37 releases
← All changes | admin/views/dashboard/tmpl/default_widgets.php +38 -1 1.6.6 → 1.8.16 View file →
@@ -9,8 +9,37 @@
9 9 */
10 10
11 11 defined('ABSPATH') or die('No script kiddies please!');
12 12
13 +/**
14 + * Always check for customer records with a "short" PIN code to suggest normalization.
15 + *
16 + * @since 1.18.6 (J) - 1.8.6 (WP)
17 + * @since 1.18.7 (J) - 1.8.7 (WP) enforcement for urgent normalization.
18 + */
19 +if (VikBooking::getCPinInstance()->countShortPins()) {
20 + // access last alert date
21 + $config = VBOFactory::getConfig();
22 + $warn_last_ts = (int) $config->get('warn_cpin_ts', 0);
23 + if ($warn_last_ts && (time() - $warn_last_ts) > (86400 * 2)) {
24 + // enforce urgent normalization
25 + $config->set('warn_cpin_ts', 0);
26 + JFactory::getApplication()->redirect(
27 + VBOFactory::getPlatform()->getUri()->addCSRF('index.php?option=com_vikbooking&task=maintenance.normalize_short_pins', $xhtml = false)
28 + );
29 + JFactory::getApplication()->close();
30 + }
31 + // update last alert date
32 + $config->set('warn_cpin_ts', time());
33 + // display alert message with button to normalize records
34 + JFactory::getApplication()->enqueueMessage(sprintf(
35 + '%s <a class="btn btn-warning" href="%s">%s</a>',
36 + JText::translate('VBO_CUSTOMERS_SHORT_PIN_ALERT'),
37 + VBOFactory::getPlatform()->getUri()->addCSRF('index.php?option=com_vikbooking&task=maintenance.normalize_short_pins', $xhtml = true),
38 + JText::translate('VBADMINNOTESUPD')
39 + ), 'warning');
40 +}
41 +
13 42 $vbo_app = VikBooking::getVboApplication();
14 43
15 44 // get admin widgets helper
16 45 $widgets_helper = VikBooking::getAdminWidgetsInstance();
@@ -699,9 +728,9 @@
699 728 * Dismiss modal window by clicking on an external element.
700 729 */
701 730 jQuery(document).mouseup(function(e) {
702 731 if (!vbo_modal_widgets_on) {
703 - return false;
732 + return;
704 733 }
705 734 if (vbo_modal_widgets_on) {
706 735 var vbo_overlay_cont = jQuery(".vbo-modal-overlay-content-dashwidgets");
707 736 if (!vbo_overlay_cont.is(e.target) && vbo_overlay_cont.has(e.target).length === 0) {
@@ -775,8 +804,9 @@
775 804 let set_mode = jQuery(this).attr('data-scheme');
776 805
777 806 let vbo_css_base_uri = '<?php echo VBO_ADMIN_URI . (VBOPlatformDetection::isWordPress() ? 'resources/' : '') . 'vbo-appearance-%s.css'; ?>';
778 807 let vbo_css_base_id = 'vbo-css-appearance-';
808 + let vcm_css_base_id = 'vcm-css-appearance-';
779 809 let vbo_css_modes = {
780 810 auto: vbo_css_base_uri.replace('%s', 'auto'),
781 811 dark: vbo_css_base_uri.replace('%s', 'dark'),
782 812 light: null,
@@ -819,8 +849,15 @@
819 849 jQuery('link#' + vbo_css_base_id + app_mode).remove();
820 850 } else if (jQuery('link#' + vbo_css_base_id + app_mode + '-css').length) {
821 851 // WP framework may add "-css" as suffix to the given ID
822 852 jQuery('link#' + vbo_css_base_id + app_mode + '-css').remove();
853 + }
854 + // check if the VCM related CSS file should be unset too
855 + if (jQuery('link#' + vcm_css_base_id + app_mode).length) {
856 + jQuery('link#' + vcm_css_base_id + app_mode).remove();
857 + } else if (jQuery('link#' + vcm_css_base_id + app_mode + '-css').length) {
858 + // WP framework may add "-css" as suffix to the given ID
859 + jQuery('link#' + vcm_css_base_id + app_mode + '-css').remove();
823 860 }
824 861 }
825 862 }
826 863