diff --git a/admin/themes/default/css/controllers/order-stay-periods.css b/admin/themes/default/template/controllers/orders/_stay_periods_tooltip.tpl similarity index 60% rename from admin/themes/default/css/controllers/order-stay-periods.css rename to admin/themes/default/template/controllers/orders/_stay_periods_tooltip.tpl index b4a87c615..205a6b32e 100644 --- a/admin/themes/default/css/controllers/order-stay-periods.css +++ b/admin/themes/default/template/controllers/orders/_stay_periods_tooltip.tpl @@ -1,4 +1,4 @@ -/** +{** * NOTICE OF LICENSE * * This source file is subject to the Open Software License version 3.0 @@ -18,16 +18,21 @@ * @author Webkul IN * @copyright Since 2010 Webkul * @license https://opensource.org/license/osl-3-0-php Open Software License version 3.0 -*/ +*} -.qlo-stay-period-tooltip .tip-body { - display: block; -} -.qlo-stay-period-tooltip .qlo-stay-period-row { - display: flex; - justify-content: space-between; -} -.qlo-stay-period-tooltip .qlo-stay-period-row-header { - border-bottom: 1px solid #ddd; - padding-bottom: 6px; -} +
diff --git a/controllers/admin/AdminOrdersController.php b/controllers/admin/AdminOrdersController.php index 64c32281f..6ed7db08e 100644 --- a/controllers/admin/AdminOrdersController.php +++ b/controllers/admin/AdminOrdersController.php @@ -398,10 +398,7 @@ class AdminOrdersControllerCore extends AdminController if ($uniqueStayPeriods > 1) { $stayPeriodHtml .= ' +' + .' data-stay-tip="'.htmlspecialchars(json_encode($stayPeriods)).'">+' .($uniqueStayPeriods - 1).''; } return $stayPeriodHtml; @@ -1402,7 +1399,6 @@ class AdminOrdersControllerCore extends AdminController if ($this->display != 'view') { $this->addJS(_PS_JS_DIR_.'admin/orders_stay_periods.js'); - $this->addCSS(__PS_BASE_URI__.$this->admin_webpath.'/themes/'.$this->bo_theme.'/css/controllers/order-stay-periods.css'); } if ($this->display == 'view') { @@ -1501,6 +1497,8 @@ class AdminOrdersControllerCore extends AdminController $this->content .= $this->context->smarty->fetch('controllers/orders/_resolvable_overbookings.tpl'); } + $this->content .= $this->context->smarty->fetch('controllers/orders/_stay_periods_tooltip.tpl'); + if (Tools::isSubmit('submitBulkupdateOrderStatus'.$this->table)) { if (Tools::getIsset('cancel')) { Tools::redirectAdmin(self::$currentIndex.'&token='.$this->token); diff --git a/js/admin/orders_stay_periods.js b/js/admin/orders_stay_periods.js index f028b5096..d3df55f9b 100644 --- a/js/admin/orders_stay_periods.js +++ b/js/admin/orders_stay_periods.js @@ -33,28 +33,17 @@ $(document).ready(function () { $(this).tooltip({ items: '.qlo-stay-period-badge', content: function () { - var $badge = $(this); - var periods = $badge.data('stay-tip'); + var periods = $(this).data('stay-tip'); if (!periods || !periods.length) { return ''; } - var html = '