Merge branch 'Qloapps:develop' into ari_api_datewise_breakdown
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -53,6 +53,7 @@ composer.lock
|
||||
|
||||
img/**
|
||||
!/img/404.gif
|
||||
!/img/.htaccess
|
||||
!/img/admin/
|
||||
!/img/admin/*.gif
|
||||
!/img/admin/*.png
|
||||
|
||||
@@ -60,22 +60,39 @@ $exclude_packs = (bool)Tools::getValue('exclude_packs', true);
|
||||
|
||||
$bookingProduct = (int) Tools::getValue('booking_product');
|
||||
|
||||
$idHotel = (int) Tools::getValue('id_hotel');
|
||||
|
||||
$context = Context::getContext();
|
||||
|
||||
$sql = 'SELECT p.`id_product`, pl.`link_rewrite`, p.`reference`, pl.`name`, image_shop.`id_image` id_image, il.`legend`, p.`cache_default_attribute`
|
||||
FROM `'._DB_PREFIX_.'product` p
|
||||
'.Shop::addSqlAssociation('product', 'p').'
|
||||
LEFT JOIN `'._DB_PREFIX_.'product_lang` pl ON (pl.id_product = p.id_product AND pl.id_lang = '.(int)$context->language->id.Shop::addSqlRestrictionOnLang('pl').')
|
||||
$sqlSelect = 'SELECT p.`id_product`, pl.`link_rewrite`, p.`reference`, pl.`name`, image_shop.`id_image` id_image, il.`legend`, p.`cache_default_attribute`';
|
||||
|
||||
$sqlFrom = ' FROM `'._DB_PREFIX_.'product` p '.Shop::addSqlAssociation('product', 'p');
|
||||
|
||||
$sqlJoin =' LEFT JOIN `'._DB_PREFIX_.'product_lang` pl ON (pl.`id_product` = p.`id_product` AND pl.`id_lang` = '.(int) $context->language->id.Shop::addSqlRestrictionOnLang('pl').')
|
||||
LEFT JOIN `'._DB_PREFIX_.'image_shop` image_shop
|
||||
ON (image_shop.`id_product` = p.`id_product` AND image_shop.cover=1 AND image_shop.id_shop='.(int)$context->shop->id.')
|
||||
LEFT JOIN `'._DB_PREFIX_.'image_lang` il ON (image_shop.`id_image` = il.`id_image` AND il.`id_lang` = '.(int)$context->language->id.')
|
||||
WHERE (pl.name LIKE \'%'.pSQL($query).'%\' OR p.reference LIKE \'%'.pSQL($query).'%\')'.
|
||||
ON (image_shop.`id_product` = p.`id_product` AND image_shop.`cover`=1 AND image_shop.`id_shop`='.(int) $context->shop->id.')
|
||||
LEFT JOIN `'._DB_PREFIX_.'image_lang` il ON (image_shop.`id_image` = il.`id_image` AND il.`id_lang` = '.(int) $context->language->id.')';
|
||||
|
||||
$sqlWhere = ' WHERE (pl.name LIKE \'%'.pSQL($query).'%\' OR p.reference LIKE \'%'.pSQL($query).'%\')'.
|
||||
(!empty($excludeIds) ? ' AND p.id_product NOT IN ('.$excludeIds.') ' : ' ').
|
||||
(!empty($excludePackItself) ? ' AND p.id_product <> '.$excludePackItself.' ' : ' ').
|
||||
($excludeVirtuals ? 'AND NOT EXISTS (SELECT 1 FROM `'._DB_PREFIX_.'product_download` pd WHERE (pd.id_product = p.id_product))' : '').
|
||||
($exclude_packs ? 'AND (p.cache_is_pack IS NULL OR p.cache_is_pack = 0)' : '').
|
||||
($bookingProduct ? 'AND p.`booking_product` = '.(int) $bookingProduct : '').
|
||||
' GROUP BY p.id_product';
|
||||
($bookingProduct ? 'AND p.`booking_product` = '.(int) $bookingProduct : '');
|
||||
|
||||
$sqlGroupBy = ' GROUP BY p.id_product';
|
||||
|
||||
if ($idHotel && $bookingProduct) {
|
||||
// To get hotel info for the booking product only
|
||||
$sqlSelect .= ', hbil.`hotel_name`, hbil.`id` AS id_hotel ';
|
||||
$sqlJoin .= ' LEFT JOIN `'._DB_PREFIX_.'htl_room_type` hrt
|
||||
ON hrt.`id_product` = p.`id_product`
|
||||
LEFT JOIN `'._DB_PREFIX_.'htl_branch_info_lang` hbil
|
||||
ON pl.`id_lang` = hbil.`id_lang` AND hbil.`id` = hrt.`id_hotel`';
|
||||
$sqlWhere .= ' AND hbil.`id`='.(int) $idHotel ;
|
||||
}
|
||||
|
||||
$sql = $sqlSelect.' '.$sqlFrom.' '.$sqlJoin.' '.$sqlWhere.' '.$sqlGroupBy;
|
||||
|
||||
$items = Db::getInstance()->executeS($sql);
|
||||
|
||||
|
||||
@@ -1,2 +1,10 @@
|
||||
Order deny,allow
|
||||
Deny from all
|
||||
# Apache 2.2
|
||||
<IfModule !mod_authz_core.c>
|
||||
Order deny,allow
|
||||
Deny from all
|
||||
</IfModule>
|
||||
|
||||
# Apache 2.4
|
||||
<IfModule mod_authz_core.c>
|
||||
Require all denied
|
||||
</IfModule>
|
||||
|
||||
@@ -1,2 +1,10 @@
|
||||
Order deny,allow
|
||||
Deny from all
|
||||
# Apache 2.2
|
||||
<IfModule !mod_authz_core.c>
|
||||
Order deny,allow
|
||||
Deny from all
|
||||
</IfModule>
|
||||
|
||||
# Apache 2.4
|
||||
<IfModule mod_authz_core.c>
|
||||
Require all denied
|
||||
</IfModule>
|
||||
|
||||
@@ -1,2 +1,10 @@
|
||||
Order deny,allow
|
||||
Deny from all
|
||||
# Apache 2.2
|
||||
<IfModule !mod_authz_core.c>
|
||||
Order deny,allow
|
||||
Deny from all
|
||||
</IfModule>
|
||||
|
||||
# Apache 2.4
|
||||
<IfModule mod_authz_core.c>
|
||||
Require all denied
|
||||
</IfModule>
|
||||
|
||||
@@ -1,2 +1,10 @@
|
||||
Order deny,allow
|
||||
Deny from all
|
||||
# Apache 2.2
|
||||
<IfModule !mod_authz_core.c>
|
||||
Order deny,allow
|
||||
Deny from all
|
||||
</IfModule>
|
||||
|
||||
# Apache 2.4
|
||||
<IfModule mod_authz_core.c>
|
||||
Require all denied
|
||||
</IfModule>
|
||||
|
||||
@@ -84,14 +84,20 @@
|
||||
@import "partials/date-range-picker"
|
||||
@import "partials/multistore"
|
||||
@import "partials/product"
|
||||
@import "partials/skeleton-loading"
|
||||
|
||||
//Controllers
|
||||
@import "controllers/carrier-wizard"
|
||||
@import "controllers/dashboard"
|
||||
@import "controllers/login"
|
||||
@import "controllers/modules_catalog"
|
||||
@import "controllers/modules"
|
||||
@import "controllers/search"
|
||||
@import "controllers/translations"
|
||||
@import "controllers/customer-thread"
|
||||
@import "controllers/themes"
|
||||
@import "controllers/order"
|
||||
@import "controllers/products"
|
||||
@import "vendor/bootstrap-rtl-sass/bootstrap-rtl"
|
||||
|
||||
//Plug-ins
|
||||
@@ -99,6 +105,9 @@
|
||||
@import "partials/growl"
|
||||
@import "partials/chosen"
|
||||
@import "partials/ladda"
|
||||
@import "partials/date-picker"
|
||||
@import "partials/select2"
|
||||
@import "partials/ndv3"
|
||||
|
||||
//RTL
|
||||
@import "partials/rtl"
|
||||
@@ -106,3 +115,5 @@
|
||||
//Backward compatibility
|
||||
@import "partials/backward"
|
||||
|
||||
//Print support
|
||||
@import "partials/print"
|
||||
|
||||
@@ -53,10 +53,12 @@
|
||||
.module-info-wrapper
|
||||
position: relative
|
||||
height: 100%
|
||||
.module-logo img
|
||||
max-height: 60px
|
||||
.module-logo
|
||||
display: flex
|
||||
gap: 10px
|
||||
margin-bottom: 20px
|
||||
margin-right: 10px
|
||||
img
|
||||
max-height: 60px
|
||||
.panel-action
|
||||
.module-price
|
||||
font-size: 14px
|
||||
|
||||
@@ -77,3 +77,9 @@
|
||||
.room_status_info_form
|
||||
.room_status
|
||||
white-space: normal
|
||||
|
||||
#noteContent
|
||||
max-height: 200px
|
||||
|
||||
.panel-refund-request .refunded_amount
|
||||
margin-top: 2px
|
||||
@@ -3,6 +3,7 @@ $kpi-gap: 10px
|
||||
|
||||
.kpi-container
|
||||
display: flex
|
||||
gap: 15px
|
||||
justify-content: space-between
|
||||
padding: 12px !important
|
||||
.kpis-wrap
|
||||
@@ -23,7 +24,6 @@ $kpi-gap: 10px
|
||||
padding-right: $kpi-gap / 2
|
||||
.actions-wrap
|
||||
width: 16px
|
||||
margin-left: 16px
|
||||
button
|
||||
padding: 0
|
||||
border: none
|
||||
@@ -97,11 +97,21 @@ $kpi-gap: 10px
|
||||
border: 1px solid #e7edfa
|
||||
border-left-width: 3px
|
||||
border-radius: 6px
|
||||
padding: 4px 8px 8px 42px
|
||||
padding: 4px 8px 8px 4px
|
||||
display: flex
|
||||
flex-direction: column
|
||||
justify-content: space-between
|
||||
gap: 10px
|
||||
white-space: normal
|
||||
i.kpi-icon
|
||||
font-size: 15px
|
||||
text-align: center
|
||||
color: white
|
||||
line-height: 26px
|
||||
background: #eee
|
||||
width: 28px
|
||||
height: 28px
|
||||
@include border-radius(6px)
|
||||
.kpi-data
|
||||
flex-grow: 1
|
||||
.title-subtitle
|
||||
display: flex
|
||||
justify-content: space-between
|
||||
@@ -109,22 +119,7 @@ $kpi-gap: 10px
|
||||
display: block
|
||||
color: #666
|
||||
font-size: 13px
|
||||
i
|
||||
position: absolute
|
||||
top: 5px
|
||||
font-size: 15px
|
||||
text-align: center
|
||||
color: white
|
||||
line-height: 26px
|
||||
background: #eee
|
||||
width: 28px
|
||||
height: 28px
|
||||
@include left(5px)
|
||||
@include border-radius(6px)
|
||||
&::before
|
||||
position: absolute
|
||||
top: 1px
|
||||
left: 8px
|
||||
|
||||
.subtitle
|
||||
display: block
|
||||
text-transform: capitalize
|
||||
@@ -144,12 +139,8 @@ $kpi-gap: 10px
|
||||
&.loading
|
||||
height: 22px
|
||||
min-width: 40px
|
||||
.arrow
|
||||
position: absolute
|
||||
bottom: 7px
|
||||
right: 9px
|
||||
i
|
||||
color: #828282 !important
|
||||
.arrow i
|
||||
color: #828282 !important
|
||||
&:hover
|
||||
text-decoration: none
|
||||
.color1
|
||||
|
||||
@@ -119,3 +119,8 @@ html
|
||||
margin-left: 0px
|
||||
@include border-right(1px solid $sidebar-menu-bg-hover-color)
|
||||
border-left: 0px
|
||||
#nav-topbar
|
||||
#ellipsistab
|
||||
ul#ellipsis_submenu
|
||||
left: 0
|
||||
right: unset
|
||||
|
||||
@@ -62,4 +62,8 @@
|
||||
.tree-panel-label-title
|
||||
font-weight: 400
|
||||
margin: 0
|
||||
@include padding(0, 0, 0, 8px)
|
||||
@include padding(0, 0, 0, 8px)
|
||||
|
||||
.tree.cattree
|
||||
max-height: 350px
|
||||
overflow-y: auto
|
||||
|
||||
@@ -2,14 +2,8 @@
|
||||
// Button groups
|
||||
// --------------------------------------------------
|
||||
|
||||
// Make the div behave like a button
|
||||
.btn-group,
|
||||
.btn-group-vertical
|
||||
> .btn
|
||||
float: right
|
||||
|
||||
// Prevent double borders when buttons are next to each other
|
||||
.btn-group
|
||||
.btn-group
|
||||
.btn + .btn,
|
||||
.btn + .btn-group,
|
||||
.btn-group + .btn,
|
||||
|
||||
@@ -187,28 +187,42 @@
|
||||
.col-sm-push-11
|
||||
right: percentage((11/ $grid-columns))
|
||||
|
||||
.col-sm-pull-0
|
||||
left: auto
|
||||
right: auto
|
||||
.col-sm-pull-1
|
||||
left: percentage((1 / $grid-columns))
|
||||
right: auto
|
||||
.col-sm-pull-2
|
||||
left: percentage((2 / $grid-columns))
|
||||
right: auto
|
||||
.col-sm-pull-3
|
||||
left: percentage((3 / $grid-columns))
|
||||
right: auto
|
||||
.col-sm-pull-4
|
||||
left: percentage((4 / $grid-columns))
|
||||
right: auto
|
||||
.col-sm-pull-5
|
||||
left: percentage((5 / $grid-columns))
|
||||
right: auto
|
||||
.col-sm-pull-6
|
||||
left: percentage((6 / $grid-columns))
|
||||
right: auto
|
||||
.col-sm-pull-7
|
||||
left: percentage((7 / $grid-columns))
|
||||
right: auto
|
||||
.col-sm-pull-8
|
||||
left: percentage((8 / $grid-columns))
|
||||
right: auto
|
||||
.col-sm-pull-9
|
||||
left: percentage((9 / $grid-columns))
|
||||
right: auto
|
||||
.col-sm-pull-10
|
||||
left: percentage((10/ $grid-columns))
|
||||
right: auto
|
||||
.col-sm-pull-11
|
||||
left: percentage((11/ $grid-columns))
|
||||
right: auto
|
||||
|
||||
// Offsets
|
||||
.col-sm-offset-1
|
||||
@@ -269,23 +283,23 @@
|
||||
.col-md-10,
|
||||
.col-md-11
|
||||
float: right
|
||||
.col-md-1
|
||||
.col-md-1
|
||||
width: percentage((1 / $grid-columns))
|
||||
.col-md-2
|
||||
.col-md-2
|
||||
width: percentage((2 / $grid-columns))
|
||||
.col-md-3
|
||||
.col-md-3
|
||||
width: percentage((3 / $grid-columns))
|
||||
.col-md-4
|
||||
.col-md-4
|
||||
width: percentage((4 / $grid-columns))
|
||||
.col-md-5
|
||||
.col-md-5
|
||||
width: percentage((5 / $grid-columns))
|
||||
.col-md-6
|
||||
.col-md-6
|
||||
width: percentage((6 / $grid-columns))
|
||||
.col-md-7
|
||||
.col-md-7
|
||||
width: percentage((7 / $grid-columns))
|
||||
.col-md-8
|
||||
.col-md-8
|
||||
width: percentage((8 / $grid-columns))
|
||||
.col-md-9
|
||||
.col-md-9
|
||||
width: percentage((9 / $grid-columns))
|
||||
.col-md-10
|
||||
width: percentage((10/ $grid-columns))
|
||||
@@ -318,28 +332,42 @@
|
||||
.col-md-push-11
|
||||
right: percentage((11/ $grid-columns))
|
||||
|
||||
.col-md-pull-0
|
||||
left: auto
|
||||
right: auto
|
||||
.col-md-pull-1
|
||||
left: percentage((1 / $grid-columns))
|
||||
right: auto
|
||||
.col-md-pull-2
|
||||
left: percentage((2 / $grid-columns))
|
||||
right: auto
|
||||
.col-md-pull-3
|
||||
left: percentage((3 / $grid-columns))
|
||||
right: auto
|
||||
.col-md-pull-4
|
||||
left: percentage((4 / $grid-columns))
|
||||
right: auto
|
||||
.col-md-pull-5
|
||||
left: percentage((5 / $grid-columns))
|
||||
right: auto
|
||||
.col-md-pull-6
|
||||
left: percentage((6 / $grid-columns))
|
||||
right: auto
|
||||
.col-md-pull-7
|
||||
left: percentage((7 / $grid-columns))
|
||||
right: auto
|
||||
.col-md-pull-8
|
||||
left: percentage((8 / $grid-columns))
|
||||
right: auto
|
||||
.col-md-pull-9
|
||||
left: percentage((9 / $grid-columns))
|
||||
right: auto
|
||||
.col-md-pull-10
|
||||
left: percentage((10/ $grid-columns))
|
||||
right: auto
|
||||
.col-md-pull-11
|
||||
left: percentage((11/ $grid-columns))
|
||||
right: auto
|
||||
|
||||
// Offsets
|
||||
.col-md-offset-1
|
||||
@@ -402,77 +430,92 @@
|
||||
.col-lg-11
|
||||
float: right
|
||||
|
||||
.col-lg-1
|
||||
.col-lg-1
|
||||
width: percentage((1 / $grid-columns))
|
||||
.col-lg-2
|
||||
.col-lg-2
|
||||
width: percentage((2 / $grid-columns))
|
||||
.col-lg-3
|
||||
.col-lg-3
|
||||
width: percentage((3 / $grid-columns))
|
||||
.col-lg-4
|
||||
.col-lg-4
|
||||
width: percentage((4 / $grid-columns))
|
||||
.col-lg-5
|
||||
.col-lg-5
|
||||
width: percentage((5 / $grid-columns))
|
||||
.col-lg-6
|
||||
.col-lg-6
|
||||
width: percentage((6 / $grid-columns))
|
||||
.col-lg-7
|
||||
.col-lg-7
|
||||
width: percentage((7 / $grid-columns))
|
||||
.col-lg-8
|
||||
.col-lg-8
|
||||
width: percentage((8 / $grid-columns))
|
||||
.col-lg-9
|
||||
.col-lg-9
|
||||
width: percentage((9 / $grid-columns))
|
||||
.col-lg-10
|
||||
.col-lg-10
|
||||
width: percentage((10/ $grid-columns))
|
||||
.col-lg-11
|
||||
.col-lg-11
|
||||
width: percentage((11/ $grid-columns))
|
||||
.col-lg-12
|
||||
.col-lg-12
|
||||
width: 100%
|
||||
|
||||
// Push and pull columns for source order changes
|
||||
.col-lg-push-1
|
||||
.col-lg-push-1
|
||||
right: percentage((1 / $grid-columns))
|
||||
.col-lg-push-2
|
||||
.col-lg-push-2
|
||||
right: percentage((2 / $grid-columns))
|
||||
.col-lg-push-3
|
||||
.col-lg-push-3
|
||||
right: percentage((3 / $grid-columns))
|
||||
.col-lg-push-4
|
||||
.col-lg-push-4
|
||||
right: percentage((4 / $grid-columns))
|
||||
.col-lg-push-5
|
||||
.col-lg-push-5
|
||||
right: percentage((5 / $grid-columns))
|
||||
.col-lg-push-6
|
||||
.col-lg-push-6
|
||||
right: percentage((6 / $grid-columns))
|
||||
.col-lg-push-7
|
||||
.col-lg-push-7
|
||||
right: percentage((7 / $grid-columns))
|
||||
.col-lg-push-8
|
||||
.col-lg-push-8
|
||||
right: percentage((8 / $grid-columns))
|
||||
.col-lg-push-9
|
||||
.col-lg-push-9
|
||||
right: percentage((9 / $grid-columns))
|
||||
.col-lg-push-10
|
||||
right: percentage((10/ $grid-columns))
|
||||
.col-lg-push-11
|
||||
right: percentage((11/ $grid-columns))
|
||||
|
||||
.col-lg-pull-1
|
||||
.col-lg-pull-0
|
||||
left: auto
|
||||
right: auto
|
||||
.col-lg-pull-1
|
||||
left: percentage((1 / $grid-columns))
|
||||
.col-lg-pull-2
|
||||
right: auto
|
||||
.col-lg-pull-2
|
||||
left: percentage((2 / $grid-columns))
|
||||
.col-lg-pull-3
|
||||
right: auto
|
||||
.col-lg-pull-3
|
||||
left: percentage((3 / $grid-columns))
|
||||
.col-lg-pull-4
|
||||
right: auto
|
||||
.col-lg-pull-4
|
||||
left: percentage((4 / $grid-columns))
|
||||
.col-lg-pull-5
|
||||
right: auto
|
||||
.col-lg-pull-5
|
||||
left: percentage((5 / $grid-columns))
|
||||
.col-lg-pull-6
|
||||
right: auto
|
||||
.col-lg-pull-6
|
||||
left: percentage((6 / $grid-columns))
|
||||
.col-lg-pull-7
|
||||
right: auto
|
||||
.col-lg-pull-7
|
||||
left: percentage((7 / $grid-columns))
|
||||
.col-lg-pull-8
|
||||
right: auto
|
||||
right: unset
|
||||
.col-lg-pull-8
|
||||
left: percentage((8 / $grid-columns))
|
||||
.col-lg-pull-9
|
||||
right: auto
|
||||
.col-lg-pull-9
|
||||
left: percentage((9 / $grid-columns))
|
||||
right: auto
|
||||
.col-lg-pull-10
|
||||
left: percentage((10/ $grid-columns))
|
||||
right: auto
|
||||
.col-lg-pull-11
|
||||
left: percentage((11/ $grid-columns))
|
||||
right: auto
|
||||
|
||||
// Offsets
|
||||
.col-lg-offset-1
|
||||
|
||||
@@ -118,7 +118,7 @@ h1, h2, h3, h4, h5, h6,
|
||||
border-radius: $border-radius-base $border-radius-base 0 0
|
||||
|
||||
// pulling this in mainly for less shorthand
|
||||
&.nav-justified
|
||||
&.nav-justified
|
||||
@extend .nav-justified
|
||||
@extend .nav-tabs-justified
|
||||
|
||||
@@ -169,9 +169,9 @@ h1, h2, h3, h4, h5, h6,
|
||||
|
||||
// The dropdown menu (ul)
|
||||
.dropdown-menu
|
||||
right: 0
|
||||
float: left
|
||||
left: auto
|
||||
right: unset
|
||||
float: right
|
||||
left: 0
|
||||
|
||||
// Aligns the dropdown menu to left
|
||||
&.pull-left
|
||||
@@ -185,6 +185,11 @@ h1, h2, h3, h4, h5, h6,
|
||||
float: right
|
||||
right: auto
|
||||
|
||||
.pull-right > .dropdown-menu
|
||||
right: unset
|
||||
float: right
|
||||
left: 0
|
||||
|
||||
// Right aligned menus need alt position
|
||||
.navbar-nav.pull-left > li > .dropdown-menu,
|
||||
.navbar-nav > li > .dropdown-menu.pull-left
|
||||
@@ -338,13 +343,13 @@ h1, h2, h3, h4, h5, h6,
|
||||
|
||||
// Popovers
|
||||
// -------------------------
|
||||
.popover.top,
|
||||
.popover.top,
|
||||
.popover.bottom
|
||||
direction:ltr
|
||||
|
||||
.popover.top .popover-title,
|
||||
.popover.top .popover-title,
|
||||
.popover.top .popover-content,
|
||||
.popover.bottom .popover-title,
|
||||
.popover.bottom .popover-title,
|
||||
.popover.bottom .popover-content
|
||||
direction: rtl
|
||||
text-align: right
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
// Kill the scroll on the body
|
||||
.modal-open {
|
||||
overflow-x: hidden;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
// Container that the modal scrolls within
|
||||
|
||||
@@ -29,31 +29,29 @@
|
||||
{if $input.name == 'vat_number'}
|
||||
<div id="vat_area" style="display: visible">
|
||||
{/if}
|
||||
|
||||
{if $input.type == 'text_customer' && !isset($customer)}
|
||||
<label class="control-label col-lg-3 required" for="email">{l s='Customer email'}</label>
|
||||
{else}
|
||||
{$smarty.block.parent}
|
||||
{/if}
|
||||
{$smarty.block.parent}
|
||||
{/block}
|
||||
|
||||
{block name="field"}
|
||||
{block name="input"}
|
||||
{if $input.type == 'text_customer'}
|
||||
{if isset($customer)}
|
||||
<div class="col-lg-9">
|
||||
<a class="btn btn-default" href="?tab=AdminCustomers&id_customer={$customer->id|intval}&viewcustomer&token={$tokenCustomer}">
|
||||
<i class="icon-eye-open"></i> {$customer->lastname} {$customer->firstname} ({$customer->email})
|
||||
</a>
|
||||
</div>
|
||||
<a class="btn btn-default" href="?tab=AdminCustomers&id_customer={$customer->id|intval}&viewcustomer&token={$tokenCustomer}">
|
||||
<i class="icon-eye-open"></i> {$customer->lastname} {$customer->firstname} ({$customer->email})
|
||||
</a>
|
||||
<input type="hidden" name="id_customer" value="{$customer->id}" />
|
||||
<input type="hidden" name="email" value="{$customer->email}" />
|
||||
{else}
|
||||
<script type="text/javascript">
|
||||
$('input[name=email]').live('blur', function(e)
|
||||
{/if}
|
||||
{else if $input.type == 'select' && $input.name == 'id_customer'}
|
||||
{$smarty.block.parent}
|
||||
<input type="hidden" name="email" id="email" value="">
|
||||
<script type="text/javascript">
|
||||
$('#id_customer').on('change', function(e)
|
||||
{
|
||||
var email = $(this).val();
|
||||
if (email.length > 5)
|
||||
{
|
||||
var id_customer = parseInt($(this).val());
|
||||
$('#email').val('');
|
||||
if (!isNaN(id_customer)) {
|
||||
var email = $(this).find('[value="'+id_customer+'"]').text();
|
||||
$('#email').val(email);
|
||||
var data = {};
|
||||
data.email = email;
|
||||
data.token = "{$token|escape:'html':'UTF-8'}";
|
||||
@@ -66,31 +64,29 @@
|
||||
data: data,
|
||||
dataType: 'json',
|
||||
async : true,
|
||||
success: function(msg)
|
||||
{
|
||||
if (msg)
|
||||
{
|
||||
success: function(msg) {
|
||||
if (msg) {
|
||||
var infos = msg.infos.replace("\\'", "'").split('_');
|
||||
|
||||
$('input[name=firstname]').val(infos[0]);
|
||||
$('input[name=lastname]').val(infos[1]);
|
||||
$('input[name=company]').val(infos[2]);
|
||||
$('input[name=id_customer]').val(infos[3]);
|
||||
} else {
|
||||
resetCustomerRelatedAddressFields();
|
||||
}
|
||||
},
|
||||
error: function(msg)
|
||||
{
|
||||
}
|
||||
});
|
||||
} else {
|
||||
resetCustomerRelatedAddressFields();
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
<div class="col-lg-4">
|
||||
<input type="hidden" name="id_customer" value="{$fields_value[$input.name]}" />
|
||||
<input type="email" id="email" name="email" value="{$fields_value[$input.name]|escape:'html':'UTF-8'}"/>
|
||||
</div>
|
||||
{/if}
|
||||
function resetCustomerRelatedAddressFields() {
|
||||
$('input[name=firstname]').val('');
|
||||
$('input[name=lastname]').val('');
|
||||
$('input[name=company]').val('');
|
||||
$('input[name=id_customer]').val('');
|
||||
}
|
||||
</script>
|
||||
{else}
|
||||
{$smarty.block.parent}
|
||||
{/if}
|
||||
|
||||
@@ -46,7 +46,6 @@
|
||||
<span class="input-group-addon">%</span>
|
||||
<input type="text" id="reduction_percent" class="input-mini" name="reduction_percent" value="{$currentTab->getFieldValue($currentObject, 'reduction_percent')|floatval}" />
|
||||
</div>
|
||||
<span class="help-block"><i class="icon-warning-sign"></i> {l s='Does not apply to the shipping costs'}</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -47,7 +47,7 @@
|
||||
<div class="form-group">
|
||||
<label class="control-label col-lg-3">
|
||||
<span class="label-tooltip" data-toggle="tooltip"
|
||||
title="{l s='You can choose a minimum amount for the cart either with or without the taxes and shipping.'}">
|
||||
title="{l s='You can choose a minimum amount for the cart either with or without the taxes.'}">
|
||||
{l s='Minimum amount'}
|
||||
</span>
|
||||
</label>
|
||||
@@ -125,7 +125,6 @@
|
||||
{l s='Country selection'}
|
||||
</label>
|
||||
</p>
|
||||
<span class="help-block">{l s='This restriction applies to the country of delivery.'}</span>
|
||||
<div id="country_restriction_div">
|
||||
<br />
|
||||
<table class="table">
|
||||
|
||||
@@ -35,15 +35,9 @@
|
||||
<h3><i class="icon-user"></i> {l s='Customer information'}</h3>
|
||||
{if $customer->id}
|
||||
<a class="btn btn-default pull-right" href="mailto:{$customer->email}"><i class="icon-envelope"></i> {$customer->email}</a>
|
||||
<h2>
|
||||
{if $customer->id_gender == 1}
|
||||
<i class="icon-male"></i>
|
||||
{elseif $customer->id_gender == 2}
|
||||
<i class="icon-female"></i>
|
||||
{else}
|
||||
<i class="icon-question"></i>
|
||||
{/if}
|
||||
<a href="{$link->getAdminLink('AdminCustomers')|escape:'html':'UTF-8'}&id_customer={$customer->id|intval}&viewcustomer">{$customer->firstname} {$customer->lastname}</a></h2>
|
||||
<h4 style="padding-top:10px">
|
||||
{l s='Customer Name'}:
|
||||
<a href="{$link->getAdminLink('AdminCustomers')|escape:'html':'UTF-8'}&id_customer={$customer->id|intval}&viewcustomer">{$customer->firstname} {$customer->lastname}</a></h4>
|
||||
<div class="form-horizontal">
|
||||
<div class="form-group">
|
||||
<label class="col-lg-3 control-label">{l s='Account registration date:'}</label>
|
||||
|
||||
@@ -146,15 +146,27 @@
|
||||
<label class="control-label col-lg-3">{l s='Status'}</label>
|
||||
<div class="col-lg-9">
|
||||
<p class="form-control-static">
|
||||
{if $customer->active}
|
||||
<span class="label label-success">
|
||||
<i class="icon-check"></i>
|
||||
{l s='Active'}
|
||||
{if !$customer->deleted}
|
||||
{if $customer->active}
|
||||
<span class="label label-success">
|
||||
<i class="icon-check"></i>
|
||||
{l s='Active'}
|
||||
</span>
|
||||
{else}
|
||||
<span class="label label-danger">
|
||||
<i class="icon-remove"></i>
|
||||
{l s='Inactive'}
|
||||
</span>
|
||||
{/if}
|
||||
{elseif $customer->deleted == Customer::STATUS_BANNED}
|
||||
<span class="label label-warning">
|
||||
<i class="icon-remove"></i>
|
||||
{l s='Banned'}
|
||||
</span>
|
||||
{else}
|
||||
{elseif $customer->deleted == Customer::STATUS_DELETED}
|
||||
<span class="label label-danger">
|
||||
<i class="icon-remove"></i>
|
||||
{l s='Inactive'}
|
||||
{l s='Deleted'}
|
||||
</span>
|
||||
{/if}
|
||||
</p>
|
||||
|
||||
@@ -67,6 +67,7 @@
|
||||
</label>
|
||||
<input name="passwd" type="password" id="passwd" class="form-control" value="{if isset($password)}{$password|escape:'html':'UTF-8'}{/if}" tabindex="2" placeholder=" {l s='Password'}" />
|
||||
</div>
|
||||
{hook h="displayAdminLoginFormFieldsAfter"}
|
||||
<div class="form-group row-padding-top">
|
||||
<button name="submitLogin" type="submit" tabindex="4" class="btn btn-primary btn-lg btn-block ladda-button" data-style="slide-up" data-spinner-color="white" >
|
||||
<span class="ladda-label">
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
||||
<meta name="robots" content="NOFOLLOW, NOINDEX">
|
||||
<title>
|
||||
{$shop_name} {if $meta_title != ''}{if isset($navigationPipe)}{$navigationPipe|escape:'html':'UTF-8'}{else}>{/if} {$meta_title}{/if} (PrestaShop™)
|
||||
{$shop_name} {if $meta_title != ''}{if isset($navigationPipe)}{$navigationPipe|escape:'html':'UTF-8'}{else}>{/if} {$meta_title}{/if} (QloApps™)
|
||||
</title>
|
||||
{if isset($css_files)}
|
||||
{foreach from=$css_files key=css_uri item=media}
|
||||
|
||||
@@ -152,7 +152,7 @@
|
||||
{l s='All'} <span class="badge pull-right">{$nb_modules}</span>
|
||||
</a>
|
||||
{foreach from=$list_modules_categories item=module_category key=module_category_key}
|
||||
<a class="categoryModuleFilterLink list-group-item {if isset($categoryFiltered[$module_category_key])}active{/if}" href="{$currentIndex|escape:'html':'UTF-8'}&token={$token|escape:'html':'UTF-8'}&{if isset($categoryFiltered[$module_category_key])}un{/if}filterCategory={$module_category_key}" id="filter_{$module_category_key}">
|
||||
<a class="categoryModuleFilterLink list-group-item {if isset($categoryFiltered[$module_category_key])}active{/if}" href="{$currentIndex|escape:'html':'UTF-8'}&token={$token|escape:'html':'UTF-8'}&filterCategory={$module_category_key}" id="filter_{$module_category_key}">
|
||||
{$module_category.name} <span class="badge pull-right">{$module_category.nb}</span>
|
||||
</a>
|
||||
{/foreach}
|
||||
|
||||
@@ -22,10 +22,12 @@
|
||||
<div class="col-xs-12 col-sm-6 col-md-4 element-panel">
|
||||
<div class="panel">
|
||||
<div class="module-info-wrapper">
|
||||
<div class="module-logo clearfix">
|
||||
<img src="{if isset($element->image)}{$element->image}{else}{$modules_uri}/{$element->name}/{$element->logo}{/if}" title="{$element->displayName}" class="pull-left">
|
||||
<h4 class="name" data-name="{$element->name}">{$element->displayName}</h4>
|
||||
<p class="text-muted">{$element->version} {l s='By'} {$element->author}</p>
|
||||
<div class="module-logo">
|
||||
<img src="{if isset($element->image)}{$element->image}{else}{$modules_uri}/{$element->name}/{$element->logo}{/if}" title="{$element->displayName}">
|
||||
<div>
|
||||
<h4 class="name" data-name="{$element->name}">{$element->displayName}</h4>
|
||||
<p class="text-muted">{$element->version} {l s='By'} {$element->author}</p>
|
||||
</div>
|
||||
</div>
|
||||
<p>
|
||||
{if $element->description_full}
|
||||
|
||||
@@ -48,28 +48,18 @@
|
||||
}
|
||||
|
||||
{if isset($use_checkbox) && $use_checkbox == true}
|
||||
function checkAllAssociatedCategories($tree)
|
||||
function checkAllAssociatedHotels($tree)
|
||||
{
|
||||
$tree.find(':input[type=checkbox]').each(function(){
|
||||
$(this).prop('checked', true);
|
||||
|
||||
addDefaultCategory($(this));
|
||||
$(this).parent().addClass('tree-selected');
|
||||
});
|
||||
}
|
||||
|
||||
function uncheckAllAssociatedCategories($tree)
|
||||
function uncheckAllAssociatedHotels($tree)
|
||||
{
|
||||
$tree.find(':input[type=checkbox]').each(function(){
|
||||
$(this).prop('checked', false);
|
||||
|
||||
$('select#id_category_default option[value='+$(this).val()+']').remove();
|
||||
if ($('select#id_category_default option').length == 0)
|
||||
{
|
||||
$('select#id_category_default').closest('.form-group').hide();
|
||||
$('#no_default_category').show();
|
||||
}
|
||||
|
||||
$(this).parent().removeClass('tree-selected');
|
||||
});
|
||||
}
|
||||
|
||||
@@ -200,7 +200,7 @@ $(document).ready(function () {
|
||||
<input maxlength="27" id="ecotax" name="ecotax" type="text" value="{$product->ecotax|string_format:$priceDisplayPrecisionFormat}" onkeyup="$('#priceType').val('TI');if (isArrowKey(event))return; calcPriceTE(); this.value = this.value.replace(/,/g, '.'); if (parseInt(this.value) > getE('priceTE').value) this.value = getE('priceTE').value; if (isNaN(this.value)) this.value = 0;" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group {if $product->auto_add_to_cart && $product->price_addition_type == Product::PRICE_ADDITION_TYPE_WITH_ROOM}hide_on_auto_add_Withroom{/if}" {if !$country_display_tax_label || $tax_exclude_taxe_option}style="display:none;"{/if} {if $product->auto_add_to_cart && $product->price_addition_type == Product::PRICE_ADDITION_TYPE_WITH_ROOM}style="display:none"{/if}>
|
||||
{* <div class="form-group {if $product->auto_add_to_cart && $product->price_addition_type == Product::PRICE_ADDITION_TYPE_WITH_ROOM}hide_on_auto_add_Withroom{/if}" {if !$country_display_tax_label || $tax_exclude_taxe_option}style="display:none;"{/if} {if $product->auto_add_to_cart && $product->price_addition_type == Product::PRICE_ADDITION_TYPE_WITH_ROOM}style="display:none"{/if}>
|
||||
<label class="control-label col-lg-3" for="priceTI">{l s='Retail price with tax'}</label>
|
||||
<div class="input-group col-lg-2">
|
||||
<span class="input-group-addon">{$currency->prefix}{$currency->suffix}</span>
|
||||
@@ -208,7 +208,7 @@ $(document).ready(function () {
|
||||
<input id="priceTI" name="priceTI" type="text" value="" onchange="noComma('priceTI');" maxlength="27" onkeyup="$('#priceType').val('TI');if (isArrowKey(event)) return; calcPriceTE();" />
|
||||
</div>
|
||||
{if isset($pack) && $pack->isPack($product->id)}<p class="col-lg-9 col-lg-offset-3 help-block">{l s='The sum of prices of the products in the pack is %s%s%s' sprintf=[$currency->prefix,{toolsConvertPrice price=$pack->noPackPrice($product->id)|string_format:$priceDisplayPrecisionFormat},$currency->suffix]}</p>{/if}
|
||||
</div>
|
||||
</div> *}
|
||||
<div class="form-group">
|
||||
<label class="control-label col-lg-3" for="price_calculation_method">
|
||||
<span class="label-tooltip" data-toggle="tooltip" title="{l s='Select whether price for this service will be added for each day of the booking or price will be added to the entire date range of the booking'}">
|
||||
|
||||
@@ -92,7 +92,7 @@
|
||||
{foreach $data['child_ages'] as $childAge}
|
||||
<p class="col-xs-12 col-sm-12 col-md-6 col-lg-6">
|
||||
<select class="guest_child_age room_occupancies" name="occupancy[0][child_ages][]">
|
||||
<option value="-1" {if $childAge == -1}selected{/if}>{l s='Select 1'}</option>
|
||||
<option value="-1" {if $childAge == -1}selected{/if}>{l s='Select age'}</option>
|
||||
<option value="0" {if $childAge == 0}selected{/if}>{l s='Under 1'}</option>
|
||||
{for $age=1 to ($max_child_age-1)}
|
||||
<option value="{$age|escape:'htmlall':'UTF-8'}" {if $childAge == $age}selected{/if}>{$age|escape:'htmlall':'UTF-8'}</option>
|
||||
|
||||
@@ -1,196 +0,0 @@
|
||||
{*
|
||||
* 2007-2017 PrestaShop
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Academic Free License (AFL 3.0)
|
||||
* that is bundled with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://opensource.org/licenses/afl-3.0.php
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@prestashop.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to http://www.prestashop.com for more information.
|
||||
*
|
||||
* @author PrestaShop SA <contact@prestashop.com>
|
||||
* @copyright 2007-2017 PrestaShop SA
|
||||
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*}
|
||||
<tr id="new_product" style="display:none">
|
||||
<td style="display:none;" colspan="3" class="text-center">
|
||||
<input type="hidden" id="add_product_product_id" name="add_product[product_id]" value="0" />
|
||||
|
||||
<div class="form-group">
|
||||
<label>{l s='Room Type:'}</label>
|
||||
<div class="input-group">
|
||||
<input type="text" id="add_product_product_name" value=""/>
|
||||
<div class="input-group-addon">
|
||||
<i class="icon-search"></i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- <div id="add_product_product_attribute_area" class="form-group" style="display: none;">
|
||||
<label>{l s='Combinations'}</label>
|
||||
<select name="add_product[product_attribute_id]" id="add_product_product_attribute_id"></select>
|
||||
</div>
|
||||
|
||||
<div id="add_product_product_warehouse_area" class="form-group" style="display: none;">
|
||||
<label>{l s='Warehouse'}</label>
|
||||
<select id="add_product_warehouse" name="add_product_warehouse"></select>
|
||||
</div> -->
|
||||
</td>
|
||||
<td style="display:none;" class="bookingDuration text-center" colspan="2">
|
||||
<center>
|
||||
<div class="room_check_in_div">
|
||||
<div class="input-group fixed-width-xl">
|
||||
<div class="input-group-addon">{l s='Check In'}</div>
|
||||
<input type="text" class="form-control add_room_date_from" name="add_product[date_from]" readonly />
|
||||
<div class="input-group-addon"><i class="icon-calendar"></i></div>
|
||||
</div>
|
||||
</div>
|
||||
<br/>
|
||||
<div class="room_check_out_div">
|
||||
<div class="input-group fixed-width-xl">
|
||||
<div class="input-group-addon">{l s='Check Out'}</div>
|
||||
<input type="text" class="form-control add_room_date_to" name="add_product[date_to]" readonly/>
|
||||
<div class="input-group-addon"><i class="icon-calendar"></i></div>
|
||||
</div>
|
||||
</div>
|
||||
</center>
|
||||
</td>
|
||||
<td style="display:none;" class="productQuantity text-center" colspan="1">
|
||||
{if $order->with_occupancy}
|
||||
<div class="booking_occupancy">
|
||||
<div class="dropdown">
|
||||
<button class="booking_guest_occupancy form-control btn btn-default btn-left btn-block input-occupancy disabled" type="button">
|
||||
<span>{l s='Select occupancy'}</span>
|
||||
</button>
|
||||
<input type="hidden" class="max_avail_type_qty" value="">
|
||||
<div class="dropdown-menu booking_occupancy_wrapper fixed-width-xxl well well-sm">
|
||||
<div class="booking_occupancy_inner">
|
||||
<div class="occupancy_info_block col-sm-12" occ_block_index="0">
|
||||
<div class="occupancy_info_head col-sm-12"><label class="room_num_wrapper">{l s='Room - 1'}</label></div>
|
||||
<div class="col-sm-12">
|
||||
<div class="row">
|
||||
<div class="form-group col-xs-6 occupancy_count_block">
|
||||
<label>{l s='Adults'}</label>
|
||||
<input type="number" class="form-control num_occupancy num_adults" name="occupancy[0][adults]" value="1" min="1">
|
||||
</div>
|
||||
<div class="form-group col-xs-6 occupancy_count_block">
|
||||
<label>{l s='Child'} <span class="label-desc-txt"></span></label>
|
||||
<input type="number" class="form-control num_occupancy num_children" name="occupancy[0][children]" value="0" min="0">
|
||||
({l s='Below'} {$max_child_age|escape:'htmlall':'UTF-8'} {l s='years'})
|
||||
</div>
|
||||
</div>
|
||||
<p style="display:none;"><span class="text-danger occupancy-input-errors"></span></p>
|
||||
<div class="row children_age_info_block" style="display:none">
|
||||
<div class="form-group col-sm-12">
|
||||
<label class="">{l s='All Children'}</label>
|
||||
<div class="">
|
||||
<div class="row children_ages">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<hr class="occupancy-info-separator col-sm-12">
|
||||
<div class="add_occupancy_block col-sm-12">
|
||||
<a class="add_new_occupancy_btn" href="#"><i class="icon-plus"></i> <span>{l s='Add Room'}</span></a>
|
||||
<a class="pull-right close_occupancy_link" href="#">{l s='close'} <i class="icon-remove"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{else}
|
||||
<center>
|
||||
<input type="number" class="form-control fixed-width-sm" name="add_product[product_quantity]" id="add_product_product_quantity" value="1" disabled="disabled" min="1"/>
|
||||
</center>
|
||||
{/if}
|
||||
|
||||
</td>
|
||||
<td style="display:none;" class="text-center" colspan="2">
|
||||
<center>
|
||||
<div class="row">
|
||||
<div class="input-group fixed-width-xl">
|
||||
{if $currency->format % 2}<div class="input-group-addon">{$currency->sign} {l s='tax excl.'}</div>{/if}
|
||||
<input type="text" name="add_product[product_price_tax_excl]" id="add_product_product_price_tax_excl" value="" />
|
||||
{if !($currency->format % 2)}<div class="input-group-addon">{$currency->sign} {l s='tax excl.'}</div>{/if}
|
||||
</div>
|
||||
</div>
|
||||
<br/>
|
||||
<div class="row">
|
||||
<div class="input-group fixed-width-xl">
|
||||
{if $currency->format % 2}<div class="input-group-addon">{$currency->sign} {l s='tax incl.'}</div>{/if}
|
||||
<input type="text" name="add_product[product_price_tax_incl]" id="add_product_product_price_tax_incl" value="" />
|
||||
{if !($currency->format % 2)}<div class="input-group-addon">{$currency->sign} {l s='tax incl.'}</div>{/if}
|
||||
</div>
|
||||
</div>
|
||||
</center>
|
||||
</td>
|
||||
|
||||
|
||||
{*{if ($order->hasBeenPaid())}<td style="display:none;" class="productQuantity"></td>{/if}
|
||||
{if $display_warehouse}<td></td>{/if}
|
||||
{if ($order->hasBeenDelivered())}<td style="display:none;" class="productQuantity"></td>{/if}
|
||||
<td style="display:none;" class="productQuantity" id="add_product_product_stock">0</td>*}
|
||||
<td style="display:none;" id="add_product_product_total" class="text-center">{displayPrice price=0 currency=$currency->id}</td>
|
||||
<td style="display:none;" class="text-center">
|
||||
{if sizeof($invoices_collection)}
|
||||
<select class="form-control" name="add_product[invoice]" id="add_product_product_invoice" disabled="disabled">
|
||||
<optgroup class="existing" label="{l s='Existing'}">
|
||||
{foreach from=$invoices_collection item=invoice}
|
||||
<option value="{$invoice->id}">{$invoice->getInvoiceNumberFormatted($current_id_lang)}</option>
|
||||
{/foreach}
|
||||
</optgroup>
|
||||
<optgroup label="{l s='New'}">
|
||||
<option value="0">{l s='Create a new invoice'}</option>
|
||||
</optgroup>
|
||||
</select>
|
||||
{/if}
|
||||
</td>
|
||||
<td style="display:none;" class="text-center">
|
||||
<button type="button" class="btn btn-default" id="cancelAddProduct">
|
||||
<i class="icon-remove text-danger"></i>
|
||||
{l s='Cancel'}
|
||||
</button>
|
||||
<button type="button" class="btn btn-default" id="submitAddProduct" disabled="disabled">
|
||||
<i class="icon-ok text-success"></i>
|
||||
{l s='Add'}
|
||||
</button>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<!-- <tr id="new_invoice" style="display:none">
|
||||
<td colspan="10">
|
||||
<h4>{l s='New invoice information'}</h4>
|
||||
<div class="form-horizontal">
|
||||
<div class="form-group">
|
||||
<label class="control-label col-lg-3">{l s='Carrier'}</label>
|
||||
<div class="col-lg-9">
|
||||
<p class="form-control-static"><strong>{$carrier->name}</strong></p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-lg-3">{l s='Shipping Cost'}</label>
|
||||
<div class="col-lg-9">
|
||||
<div class="checkbox">
|
||||
<label>
|
||||
<input type="checkbox" name="add_invoice[free_shipping]" value="1" />
|
||||
{l s='Free shipping'}
|
||||
</label>
|
||||
<p class="help-block">{l s='If you don\'t select "Free shipping," the normal shipping cost will be applied.'}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
-->
|
||||
@@ -43,15 +43,19 @@
|
||||
<td>
|
||||
{if $order->with_occupancy && $data['children']}
|
||||
<div class="dropdown booking_occupancy_show">
|
||||
<button class="btn btn-default btn-left btn-block" data-toggle="dropdown" type="button">
|
||||
<a data-toggle="dropdown">
|
||||
<span>{if $data['adults']}{$data['adults']}{/if} {if $data['adults'] > 1}{l s='Adults'}{else}{l s='Adult'}{/if}{if {$data['children']}}, {$data['children']} {if $data['children'] > 1}{l s='Children'}{else}{l s='Child'}{/if}{/if}</span>
|
||||
</button>
|
||||
</a>
|
||||
<div class="dropdown-menu well well-sm">
|
||||
<label>{l s='Children Ages'}</label>
|
||||
{if isset($data['child_ages']) && $data['child_ages']}
|
||||
{foreach $data['child_ages'] as $childAge}
|
||||
<p class="">
|
||||
{l s='Child %s : %s years' sprintf=[$childAge@iteration, $childAge]}
|
||||
{if $childAge == 0}
|
||||
{l s='Child %s : Under 1' sprintf=[$childAge@iteration]}
|
||||
{else}
|
||||
{l s='Child %s : %s' sprintf=[$childAge@iteration, $childAge]} {if $childAge > 1}{l s='years'}{else}{l s='year'}{/if}
|
||||
{/if}
|
||||
</p>
|
||||
{/foreach}
|
||||
{/if}
|
||||
|
||||
@@ -70,7 +70,11 @@
|
||||
{if isset($data['child_ages']) && $data['child_ages']}
|
||||
{foreach $data['child_ages'] as $childAge}
|
||||
<p class="">
|
||||
{l s='Child %s : %s years' sprintf=[$childAge@iteration, $childAge]}
|
||||
{if $childAge == 0}
|
||||
{l s='Child %s : Under 1' sprintf=[$childAge@iteration]}
|
||||
{else}
|
||||
{l s='Child %s : %s' sprintf=[$childAge@iteration, $childAge]} {if $childAge > 1}{l s='years'}{else}{l s='year'}{/if}
|
||||
{/if}
|
||||
</p>
|
||||
{/foreach}
|
||||
{/if}
|
||||
@@ -193,18 +197,22 @@
|
||||
</div>
|
||||
{/if}
|
||||
</td>
|
||||
{if (isset($refundReqBookings) && $refundReqBookings) || (isset($isCancelledRoom) && $isCancelledRoom)}
|
||||
{if (isset($refundReqBookings) && $refundReqBookings)}
|
||||
<td>
|
||||
{if $data.is_cancelled}
|
||||
<span class="badge badge-danger">{l s='Cancelled'}</span>
|
||||
{elseif isset($data.refund_info) && $data.refund_info}
|
||||
<span class="badge" style="background-color:{$data.refund_info.color|escape:'html':'UTF-8'}">{$data.refund_info.name|escape:'html':'UTF-8'}</span>
|
||||
{if $data.id|in_array:$refundReqBookings}
|
||||
{if $data.is_cancelled}
|
||||
<span class="badge badge-danger">{l s='Cancelled'}</span>
|
||||
{elseif isset($data.refund_info) && (!$data.refund_info.refunded || $data.refund_info.id_customization)}
|
||||
<span class="badge" style="background-color:{$data.refund_info.color|escape:'html':'UTF-8'}">{$data.refund_info.name|escape:'html':'UTF-8'}</span>
|
||||
{else}
|
||||
<span>--</span>
|
||||
{/if}
|
||||
{else}
|
||||
<span>--</span>
|
||||
{/if}
|
||||
<span>--</span>
|
||||
{/if}
|
||||
</td>
|
||||
<td>
|
||||
{if isset($data.refund_info) && $data.refund_info}
|
||||
{if $data.is_refunded && isset($data.refund_info) && $data.refund_info}
|
||||
{convertPriceWithCurrency price=$data.refund_info.refunded_amount currency=$currency->id}
|
||||
{else}
|
||||
--
|
||||
@@ -227,27 +235,34 @@
|
||||
</td>
|
||||
<td class="product_action">
|
||||
<div class="btn-group">
|
||||
<button href="#" class="btn btn-default edit_room_change_link" data-product_line_data="{$data|json_encode|escape}">
|
||||
<i class="icon-pencil"></i>
|
||||
{l s='Edit'}
|
||||
</button>
|
||||
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
|
||||
<span class="caret"></span>
|
||||
</button>
|
||||
<ul class="dropdown-menu" role="menu">
|
||||
<li>
|
||||
<a href="#" class="room_reallocate_swap" id="reallocate_room_{$data['id']}" data-room_type_name="{$data['room_type_name']}" data-toggle="modal" data-target="#mySwappigModal" data-id_htl_booking="{$data['id']}" data-room_num='{$data.room_num}' data-id_room_type='{$data.id_product}' data-cust_name='{$data.alloted_cust_name}' data-cust_email='{$data.alloted_cust_email}' data-avail_rm_swap='{$data.avail_rooms_to_swap|@json_encode}' data-avail_realloc_room_types='{$data.avail_room_types_to_realloc|@json_encode}'>
|
||||
<i class="icon-refresh"></i>
|
||||
{l s='Reallocate/Swap Room'}
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#" class="delete_room_line">
|
||||
<i class="icon-trash"></i>
|
||||
{l s='Delete'}
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
{if isset($refundReqBookings) && $refundReqBookings && $data.id|in_array:$refundReqBookings && $data.is_cancelled}
|
||||
<button href="#" class="btn btn-default delete_room_line">
|
||||
<i class="icon-trash"></i>
|
||||
{l s='Delete'}
|
||||
</button>
|
||||
{else}
|
||||
<button href="#" class="btn btn-default edit_room_change_link" data-product_line_data="{$data|json_encode|escape}">
|
||||
<i class="icon-pencil"></i>
|
||||
{l s='Edit'}
|
||||
</button>
|
||||
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
|
||||
<span class="caret"></span>
|
||||
</button>
|
||||
<ul class="dropdown-menu" role="menu">
|
||||
<li>
|
||||
<a href="#" class="room_reallocate_swap" id="reallocate_room_{$data['id']}" data-room_type_name="{$data['room_type_name']}" data-toggle="modal" data-target="#mySwappigModal" data-id_htl_booking="{$data['id']}" data-id_order="{$data['id_order']}" data-room_num='{$data.room_num}' data-id_room_type='{$data.id_product}' data-cust_name='{$data.alloted_cust_name}' data-cust_email='{$data.alloted_cust_email}' data-avail_rm_swap='{$data.avail_rooms_to_swap|@json_encode}' data-avail_realloc_room_types='{$data.avail_room_types_to_realloc|@json_encode}' data-allotment_type='{$data['booking_type']}' data-allotment_type_label='{if $data['booking_type'] == $ALLOTMENT_MANUAL}{l s='Manual'}{else}{l s='Auto'}{/if}' data-comment='{$data.comment}'>
|
||||
<i class="icon-refresh"></i>
|
||||
{l s='Reallocate/Swap Room'}
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#" class="delete_room_line">
|
||||
<i class="icon-trash"></i>
|
||||
{l s='Delete'}
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
{/if}
|
||||
</div>
|
||||
</td>
|
||||
{/if}
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
<th><span class="title_box">{l s='Extra Services/Fee (Tax excl.)'}</span></th>
|
||||
<th><span class="title_box">{l s='Total Tax'}</span></th>
|
||||
<th><span class="title_box">{l s='Total Price (Tax incl.)'}</span></th>
|
||||
{if (isset($refundReqBookings) && $refundReqBookings) || (isset($isCancelledRoom) && $isCancelledRoom)}
|
||||
{if (isset($refundReqBookings) && $refundReqBookings)}
|
||||
<th><span class="title_box">{l s='Refund/Cancel Status'}</span></th>
|
||||
<th><span class="title_box">{l s='Refunded amount'}</span></th>
|
||||
{/if}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -28,9 +28,9 @@
|
||||
{block name=pageTitle}
|
||||
<h2 class="order_page_title page-title">
|
||||
{if is_array($title)}{$title|end|strip_tags}{else}{$title|strip_tags}{/if}
|
||||
{if $currentState == Configuration::get('PS_OS_REFUND')}
|
||||
{if $currentState->id == Configuration::get('PS_OS_REFUND')}
|
||||
<span class="toolbar_order_status_badge badge badge-danger">{l s='Refunded'}</span>
|
||||
{elseif $currentState == Configuration::get('PS_OS_CANCELED')}
|
||||
{elseif $currentState->id == Configuration::get('PS_OS_CANCELED')}
|
||||
<span class="toolbar_order_status_badge badge badge-danger">{l s='Cancelled'}</span>
|
||||
{else}
|
||||
<span class="toolbar_order_status_badge badge badge-success">{l s='Booked'}</span>
|
||||
@@ -41,6 +41,7 @@
|
||||
{block name="override_tpl"}
|
||||
<script type="text/javascript">
|
||||
var admin_order_tab_link = "{$link->getAdminLink('AdminOrders')|addslashes}";
|
||||
var rooms_reallocation_url = "{$link->getAdminLink('AdminOrders')|addslashes}";
|
||||
var id_order = {$order->id};
|
||||
var id_lang = {$current_id_lang};
|
||||
var id_currency = {$order->id_currency};
|
||||
@@ -97,11 +98,11 @@
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>{l s='Room No.'}</th>
|
||||
<th>{l s='Room Type'}</th>
|
||||
<th>{l s='Room'}</th>
|
||||
<th>{l s='Duration'}</th>
|
||||
<th>{l s='Documents'}</th>
|
||||
<th>{l s='Room Status'}</th>
|
||||
<th>{l s='Check-In'}</th>
|
||||
<th>{l s='Check-Out'}</th>
|
||||
<th>{l s='Allotment'}</th>
|
||||
<th>{l s='Action'}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
@@ -110,34 +111,43 @@
|
||||
{foreach from=$htl_booking_order_data item=data}
|
||||
<tr>
|
||||
<td>
|
||||
{$data['room_num']}
|
||||
</td>
|
||||
<td>
|
||||
{$data['room_num']}<br>
|
||||
<a href="{$link->getAdminLink('AdminProducts')|escape:'html':'UTF-8'}&id_product={$data['id_product']}&updateproduct" target="_blank">{$data['room_type_name']|escape:'html':'UTF-8'}</a>
|
||||
</td>
|
||||
<td>
|
||||
{dateFormat date=$data['date_from']} - {dateFormat date=$data['date_to']}
|
||||
</td>
|
||||
<td>
|
||||
<a href="#" onclick="BookingDocumentsModal.init({$data.id|intval}, this); return false;">
|
||||
{if $data.num_checkin_documents > 0}{$data.num_checkin_documents}{else}{l s='Upload'}{/if} {l s='Documents'}
|
||||
</a>
|
||||
</td>
|
||||
<td>
|
||||
{if $data['id_status'] == $hotel_order_status['STATUS_ALLOTED']['id_status']}
|
||||
{l s='Alloted'}
|
||||
{elseif $data['id_status'] == $hotel_order_status['STATUS_CHECKED_IN']['id_status']}
|
||||
<span class="text-danger room_status">{l s='Checked in on'} {dateFormat date=$data['check_in']}</span>
|
||||
{elseif $data['id_status'] == $hotel_order_status['STATUS_CHECKED_OUT']['id_status']}
|
||||
<span class="text-success room_status">{l s='Checked out on'} {dateFormat date=$data['check_out']}</span>
|
||||
{if ($data['id_status'] == $hotel_order_status['STATUS_CHECKED_IN']['id_status']) || ($data['id_status'] == $hotel_order_status['STATUS_CHECKED_OUT']['id_status'])}
|
||||
<span class="text-danger room_status">{l s='Checked in on'}<br>{dateFormat date=$data['check_in'] full=1}</span>
|
||||
{else}
|
||||
--
|
||||
{/if}
|
||||
</td>
|
||||
<td class="text-center">
|
||||
{if $data.is_refunded || $data.is_cancelled}
|
||||
<td>
|
||||
{if $data['id_status'] == $hotel_order_status['STATUS_CHECKED_OUT']['id_status']}
|
||||
<span class="text-success room_status">{l s='Checked out on'}<br>{dateFormat date=$data['check_out'] full=1}</span>
|
||||
{else}
|
||||
--
|
||||
{/if}
|
||||
</td>
|
||||
<td>
|
||||
{if $data['booking_type'] == $ALLOTMENT_MANUAL}
|
||||
{l s='Manual'} {if $data['comment'] != ''}<a class="manual_allotment_comment" href="#" data-id_hotel_booking_detail="{$data['id']}"><i class="icon-info-circle"></i></a>{/if}
|
||||
{else}
|
||||
{l s='Auto'}
|
||||
{/if}
|
||||
</td>
|
||||
<td>
|
||||
<a title="{l s='Upload/Check guest documents'}" class="btn btn-default" href="#" onclick="BookingDocumentsModal.init({$data.id|intval}, this); return false;">
|
||||
<span class="badge badge-info">{if $data.num_checkin_documents > 0}{$data.num_checkin_documents}{else}0{/if}</span> <i class="icon-file-text"></i>
|
||||
</a>
|
||||
|
||||
{if isset($refundReqBookings) && $refundReqBookings && $data.id|in_array:$refundReqBookings && $data.is_refunded}
|
||||
<span class="badge badge-danger">{if $data.is_cancelled}{l s='Cancelled'}{else}{l s='Refunded'}{/if}</span>
|
||||
{else}
|
||||
<a class="open_room_status_form btn btn-default" href="#" data-id_hotel_booking_detail="{$data['id']}" data-id_order="{$data['id_order']}" data-id_status="{$data['id_status']}" data-id_room="{$data['id_room']}" data-date_from="{$data['date_from']|date_format:"%Y-%m-%d"}" data-date_to="{$data['date_to']|date_format:"%Y-%m-%d"}" data-check_in_time="{$data['check_in_time']}" data-check_out_time="{$data['check_out_time']}">
|
||||
<i class="icon-pencil"></i>
|
||||
<i class="icon-pencil"></i> {l s='Edit'}
|
||||
</a>
|
||||
{/if}
|
||||
</td>
|
||||
@@ -246,7 +256,7 @@
|
||||
<div class="col-lg-9">
|
||||
<select id="id_order_state" class="chosen form-control" name="id_order_state">
|
||||
{foreach from=$states item=state}
|
||||
<option value="{$state['id_order_state']|intval}"{if isset($currentState) && $state['id_order_state'] == $currentState->id} selected="selected" disabled="disabled"{elseif ($state['id_order_state'] == Configuration::get('PS_OS_REFUND') && !$allBookingsRefunded)} disabled="disabled"{elseif ($state['id_order_state'] == Configuration::get('PS_OS_CANCELED') && !$allBookingsCancelled)} disabled="disabled"{elseif ($state['id_order_state'] == Configuration::get('PS_OS_OVERBOOKING_PAID') || $state['id_order_state'] == Configuration::get('PS_OS_OVERBOOKING_UNPAID') || $state['id_order_state'] == Configuration::get('PS_OS_OVERBOOKING_PARTIAL_PAID')) && (!isset($orderOverBookings) || !$orderOverBookings)} disabled="disabled"{/if}>{$state['name']|escape}</option>
|
||||
<option value="{$state['id_order_state']|intval}"{if isset($currentState) && $state['id_order_state'] == $currentState->id} selected="selected" disabled="disabled"{elseif ($state['id_order_state'] == Configuration::get('PS_OS_REFUND') && ($total_paid <= 0 && !$discounts|count))} disabled="disabled"{elseif ($state['id_order_state'] == Configuration::get('PS_OS_CANCELED') && ($totalRefundedRooms || $discounts|count || $total_paid > 0))} disabled="disabled"{elseif ($state['id_order_state'] == Configuration::get('PS_OS_OVERBOOKING_PAID') || $state['id_order_state'] == Configuration::get('PS_OS_OVERBOOKING_UNPAID') || $state['id_order_state'] == Configuration::get('PS_OS_OVERBOOKING_PARTIAL_PAID')) && (!isset($orderOverBookings) || !$orderOverBookings)} disabled="disabled"{/if}>{$state['name']|escape}</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
<input type="hidden" name="id_order" value="{$order->id}" />
|
||||
@@ -542,6 +552,7 @@
|
||||
<dl class="list-detail col-sm-12">
|
||||
<label class="label-title">{l s='Guest info'}</label>
|
||||
|
||||
<dd><i class="icon-user"></i> <b><a href="?tab=AdminCustomers&id_customer={$customer->id}&viewcustomer&token={getAdminToken tab='AdminCustomers'}">{$customer->firstname} {$customer->lastname}</a></b></dd>
|
||||
<dd><i class="icon-envelope"></i> <b><a href="mailto:{$customer->email}">{$customer->email}</a></b></dd>
|
||||
{if $addresses.invoice->phone_mobile || $addresses.invoice->phone}
|
||||
<dd><i class="icon-phone"></i> <b><a href="tel:{if $addresses.invoice->phone_mobile}{$addresses.invoice->phone_mobile}{else}{$addresses.invoice->phone}{/if}">{if $addresses.invoice->phone_mobile}{$addresses.invoice->phone_mobile}{else}{$addresses.invoice->phone}{/if}</a></b></dd>
|
||||
@@ -781,7 +792,7 @@
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
<div class="panel">
|
||||
<div class="panel panel-refund-request">
|
||||
<div class="panel-heading">
|
||||
<i class="icon-undo"></i> {l s='Refund Requests'}
|
||||
</div>
|
||||
@@ -812,7 +823,7 @@
|
||||
<td>
|
||||
<span class="badge" style="background-color:{$return_info.state_color}">{$return_info.state_name}</span>
|
||||
{if $return_info.refunded_amount > 0}
|
||||
<span class="badge badge-success">{displayPrice price=$return_info.refunded_amount currency=$currency->id}</span>
|
||||
<span class="badge badge-success refunded_amount">{displayPrice price=$return_info.refunded_amount currency=$currency->id}</span>
|
||||
{/if}
|
||||
</td>
|
||||
</tr>
|
||||
@@ -869,7 +880,7 @@
|
||||
<div class="panel" id="refundForm">
|
||||
<div class="panel-heading">
|
||||
<i class="icon-bed"></i> {l s='Rooms Booking Detail'} <span class="badge">{$order_detail_data|@count}</span>
|
||||
{if !$order->hasBeenDelivered()}
|
||||
{if !$order->hasBeenDelivered() && $currentState->id != Configuration::get('PS_OS_REFUND') && $currentState->id != Configuration::get('PS_OS_CANCELED')}
|
||||
<button type="button" id="add_room" class="btn btn-primary pull-right">
|
||||
<i class="icon-plus-sign"></i> {l s='Add Rooms'}
|
||||
</button>
|
||||
@@ -916,7 +927,7 @@
|
||||
{assign var=additional_service_price_tax_incl value=($order->getTotalProductsWithTaxes(false, false, Product::SERVICE_PRODUCT_WITH_ROOMTYPE) + $totalDemandsPriceTI)}
|
||||
{if $room_price_tax_excl}
|
||||
<tr id="total_products">
|
||||
<td class="text-right">{l s='Total Rooms Cost (tax excl.)'}</td>
|
||||
<td class="text-right">{l s='Total Rooms Cost (Tax excl.)'}</td>
|
||||
<td class="amount text-right nowrap">
|
||||
{displayPrice price=$room_price_tax_excl currency=$currency->id}
|
||||
</td>
|
||||
@@ -925,34 +936,16 @@
|
||||
{/if}
|
||||
{if isset($additional_service_price_tax_excl) && $additional_service_price_tax_excl > 0}
|
||||
<tr id="total_products">
|
||||
<td class="text-right">{l s='Total Extra services (tax excl.)'}</td>
|
||||
<td class="text-right">{l s='Total Extra services (Tax excl.)'}</td>
|
||||
<td class="amount text-right nowrap">
|
||||
{displayPrice price=($additional_service_price_tax_excl - $totalConvenienceFeeTE) currency=$currency->id}
|
||||
</td>
|
||||
<td class="partial_refund_fields current-edit" style="display:none;"></td>
|
||||
</tr>
|
||||
{/if}
|
||||
{* {if $room_price_tax_excl}
|
||||
<tr id="total_tax_order">
|
||||
<td class="text-right"><strong>{l s='Total Rooms Tax'}</strong></td>
|
||||
<td class="text-right nowrap">
|
||||
<strong>{displayPrice price=($room_price_tax_incl - $room_price_tax_excl) currency=$currency->id}</strong>
|
||||
</td>
|
||||
<td class="partial_refund_fields current-edit" style="display:none;"></td>
|
||||
</tr>
|
||||
{/if}
|
||||
{if isset($additional_service_price_tax_excl) && $additional_service_price_tax_excl > 0}
|
||||
<tr id="total_tax_order">
|
||||
<td class="text-right"><strong>{l s='Extra services Tax'}</strong></td>
|
||||
<td class="text-right nowrap">
|
||||
<strong>{displayPrice price=($additional_service_price_tax_incl - $additional_service_price_tax_excl) currency=$currency->id}</strong>
|
||||
</td>
|
||||
<td class="partial_refund_fields current-edit" style="display:none;"></td>
|
||||
</tr>
|
||||
{/if} *}
|
||||
{if $service_products_price_tax_excl}
|
||||
<tr id="total_products">
|
||||
<td class="text-right">{l s='Total service products cost (tax excl.)'}</td>
|
||||
<td class="text-right">{l s='Total service products cost (Tax excl.)'}</td>
|
||||
<td class="amount text-right nowrap">
|
||||
{displayPrice price=$service_products_price_tax_excl currency=$currency->id}
|
||||
</td>
|
||||
@@ -960,10 +953,64 @@
|
||||
</tr>
|
||||
{/if}
|
||||
|
||||
{if isset($totalConvenienceFeeTE) && $totalConvenienceFeeTE > 0}
|
||||
<tr id="total_products">
|
||||
<td class="text-right">{l s='Convenience Fee (Tax excl.)'}</td>
|
||||
<td class="amount text-right nowrap">
|
||||
{displayPrice price=$totalConvenienceFeeTE currency=$currency->id}
|
||||
</td>
|
||||
<td class="partial_refund_fields current-edit" style="display:none;"></td>
|
||||
</tr>
|
||||
{/if}
|
||||
|
||||
{if $room_price_tax_excl}
|
||||
<tr id="total_tax_order">
|
||||
<td class="text-right">{l s='Total Rooms Tax'}</td>
|
||||
<td class="text-right nowrap">
|
||||
{displayPrice price=($room_price_tax_incl - $room_price_tax_excl) currency=$currency->id}
|
||||
</td>
|
||||
<td class="partial_refund_fields current-edit" style="display:none;"></td>
|
||||
</tr>
|
||||
{/if}
|
||||
{if isset($additional_service_price_tax_excl) && $additional_service_price_tax_excl > 0}
|
||||
<tr id="total_tax_order">
|
||||
<td class="text-right">{l s='Extra services Tax'}</td>
|
||||
<td class="text-right nowrap">
|
||||
{displayPrice price=(($additional_service_price_tax_incl - $additional_service_price_tax_excl) - ($totalConvenienceFeeTI - $totalConvenienceFeeTE)) currency=$currency->id}
|
||||
</td>
|
||||
<td class="partial_refund_fields current-edit" style="display:none;"></td>
|
||||
</tr>
|
||||
{/if}
|
||||
{if isset($totalConvenienceFeeTE) && $totalConvenienceFeeTE > 0}
|
||||
<tr id="total_products">
|
||||
<td class="text-right">{l s='Convenience Fee Tax'}</td>
|
||||
<td class="amount text-right nowrap">
|
||||
{displayPrice price=($totalConvenienceFeeTI - $totalConvenienceFeeTE) currency=$currency->id}
|
||||
</td>
|
||||
<td class="partial_refund_fields current-edit" style="display:none;"></td>
|
||||
</tr>
|
||||
{/if}
|
||||
|
||||
{* {if ($order->getTaxCalculationMethod() == $smarty.const.PS_TAX_EXC)} *}
|
||||
<tr id="total_taxes">
|
||||
<td class="text-right"><strong>{l s='Total Taxes'}</strong>
|
||||
</td>
|
||||
<td class="amount text-right nowrap" ><strong>{displayPrice price=(($order->total_paid_tax_incl + $order->total_discounts_tax_incl) - ($order->total_paid_tax_excl + $order->total_discounts_tax_excl)) currency=$currency->id}</strong>
|
||||
</td>
|
||||
<td class="partial_refund_fields current-edit" style="display:none;"></td>
|
||||
</tr>
|
||||
{* {/if} *}
|
||||
<tr id="total_discounts" {if $order->total_discounts_tax_incl == 0}style="display: none;"{/if}>
|
||||
<td class="text-right">{l s='Discounts'}</td>
|
||||
<td class="text-right"><strong>{l s='Total Booking Amount'}</strong></td>
|
||||
<td class="amount text-right nowrap">
|
||||
-{displayPrice price=$order_discount_price currency=$currency->id}
|
||||
<strong>{displayPrice price=($order->total_paid_tax_incl + $order->total_discounts_tax_incl) currency=$currency->id}</strong>
|
||||
</td>
|
||||
<td class="partial_refund_fields current-edit" style="display:none;"></td>
|
||||
</tr>
|
||||
<tr id="total_discounts" {if $order->total_discounts_tax_incl == 0}style="display: none;"{/if}>
|
||||
<td class="text-right"><strong>{l s='Discounts'}</strong></td>
|
||||
<td class="amount text-right nowrap">
|
||||
<strong>-{displayPrice price=$order->total_discounts_tax_incl currency=$currency->id}</strong>
|
||||
</td>
|
||||
<td class="partial_refund_fields current-edit" style="display:none;"></td>
|
||||
</tr>
|
||||
@@ -974,24 +1021,6 @@
|
||||
</td>
|
||||
<td class="partial_refund_fields current-edit" style="display:none;"></td>
|
||||
</tr>
|
||||
{if isset($totalConvenienceFeeTI) && $totalConvenienceFeeTI > 0}
|
||||
<tr id="total_products">
|
||||
<td class="text-right">{l s='Convenience Fee'}</td>
|
||||
<td class="amount text-right nowrap">
|
||||
{displayPrice price=$totalConvenienceFeeTE currency=$currency->id}
|
||||
</td>
|
||||
<td class="partial_refund_fields current-edit" style="display:none;"></td>
|
||||
</tr>
|
||||
{/if}
|
||||
{* {if ($order->getTaxCalculationMethod() == $smarty.const.PS_TAX_EXC)} *}
|
||||
<tr id="total_taxes">
|
||||
<td class="text-right">{l s='Total Taxes'}
|
||||
</td>
|
||||
<td class="amount text-right nowrap" >{displayPrice price=($order->total_paid_tax_incl - $order->total_paid_tax_excl) currency=$currency->id}
|
||||
</td>
|
||||
<td class="partial_refund_fields current-edit" style="display:none;"></td>
|
||||
</tr>
|
||||
{* {/if} *}
|
||||
<tr id="total_order">
|
||||
<td class="text-right"><strong>{l s='Final Booking Total'}</strong></td>
|
||||
<td class="amount text-right nowrap">
|
||||
@@ -1246,12 +1275,13 @@
|
||||
{addJsDefL name='select_room_txt'}{l s='Select room' js=1}{/addJsDefL}
|
||||
{addJsDef max_child_age=$max_child_age|escape:'quotes':'UTF-8'}
|
||||
{addJsDef max_child_in_room=$max_child_in_room|escape:'quotes':'UTF-8'}
|
||||
{addJsDef ROOM_STATUS_ALLOTED=$ROOM_STATUS_ALLOTED|escape:'quotes':'UTF-8'}
|
||||
{addJsDef ROOM_STATUS_CHECKED_IN=$ROOM_STATUS_CHECKED_IN|escape:'quotes':'UTF-8'}
|
||||
{addJsDef ROOM_STATUS_CHECKED_OUT=$ROOM_STATUS_CHECKED_OUT|escape:'quotes':'UTF-8'}
|
||||
|
||||
{addJsDef ALLOTMENT_MANUAL=$ALLOTMENT_MANUAL|escape:'quotes':'UTF-8'}
|
||||
{addJsDef PS_OS_CANCELED=Configuration::get('PS_OS_CANCELED')|escape:'quotes':'UTF-8'}
|
||||
{addJsDef PS_OS_REFUND=Configuration::get('PS_OS_REFUND')|escape:'quotes':'UTF-8'}
|
||||
{addJsDefL name=txt_booking_document_upload_success}{l s='Document uploaded successfully.' js=1}{/addJsDefL}
|
||||
{addJsDefL name=txt_booking_document_delete_confirm}{l s='Are you sure?' js=1}{/addJsDefL}
|
||||
{addJsDefL name=txt_booking_document_delete_success}{l s='Document deleted successfully.' js=1}{/addJsDefL}
|
||||
{/strip}
|
||||
{/block}
|
||||
{/block}
|
||||
|
||||
@@ -49,7 +49,7 @@
|
||||
|
||||
<div class="row form-group">
|
||||
<div class="col-sm-6">
|
||||
<label class="control-label">{l s='Price (Tax excl.)'}</label>
|
||||
<label class="control-label">{l s='Price (tax excl.)'}</label>
|
||||
<div class="input-group">
|
||||
{if $currency->format % 2}<div class="input-group-addon">{$currency->sign}</div>{/if}
|
||||
<input class="form-control" type="text" name="add_product[product_price_tax_excl]" id="add_product_product_price_tax_excl" value="" disabled="disabled"/>
|
||||
@@ -57,7 +57,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-6">
|
||||
<label class="control-label">{l s='Price (Tax incl.)'}</label>
|
||||
<label class="control-label">{l s='Price (tax incl.)'}</label>
|
||||
<div class="input-group">
|
||||
{if $currency->format % 2}<div class="input-group-addon">{$currency->sign}</div>{/if}
|
||||
<input class="form-control" type="text" name="add_product[product_price_tax_incl]" id="add_product_product_price_tax_incl" value="" disabled="disabled"/>
|
||||
|
||||
@@ -65,7 +65,7 @@
|
||||
<div class="list-empty">
|
||||
<div class="list-empty-msg">
|
||||
<i class="icon-warning-sign list-empty-icon"></i>
|
||||
{l s='No room bookings found.'}
|
||||
{l s='No room bookings found to cancel'}
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
*}
|
||||
|
||||
<div class="modal-body">
|
||||
<form action="{$current_index}&viewOrder&id_order={$order->id}{if isset($smarty.get.token)}&token={$smarty.get.token|escape:'html':'UTF-8'}{/if}" method="post">
|
||||
<form action="{$current_index}&vieworder&id_order={$order->id}{if isset($smarty.get.token)}&token={$smarty.get.token|escape:'html':'UTF-8'}{/if}" method="post">
|
||||
<div class="form-group">
|
||||
<label class="control-label">{l s='Note Detail'}</label>
|
||||
<input type="hidden" name="id_order_invoice" id="id_order_invoice" value="" />
|
||||
|
||||
@@ -33,24 +33,32 @@
|
||||
<div class="col-sm-6 room_check_in_div">
|
||||
<label class="control-label">{l s='Check-In'}</label>
|
||||
<div class="input-group">
|
||||
<input type="text" class="form-control edit_product_date_from" readonly/>
|
||||
<input type="hidden" class="edit_product_date_from_actual" name="edit_product[date_from]"/>
|
||||
<div class="input-group-addon"><i class="icon-calendar"></i></div>
|
||||
{if isset($refundReqBookings) && $refundReqBookings && $data.id|in_array:$refundReqBookings && $data.is_refunded}
|
||||
{dateFormat date=$data.date_from}
|
||||
{else}
|
||||
<input type="text" class="form-control edit_product_date_from" readonly/>
|
||||
<div class="input-group-addon"><i class="icon-calendar"></i></div>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-6 room_check_out_div">
|
||||
<label class="control-label">{l s='Check-Out'}</label>
|
||||
<div class="input-group">
|
||||
<input type="text" class="form-control edit_product_date_to" readonly/>
|
||||
<input type="hidden" class="edit_product_date_to_actual" name="edit_product[date_to]"/>
|
||||
<div class="input-group-addon"><i class="icon-calendar"></i></div>
|
||||
{if isset($refundReqBookings) && $refundReqBookings && $data.id|in_array:$refundReqBookings && $data.is_refunded}
|
||||
{dateFormat date=$data.date_to}
|
||||
{else}
|
||||
<input type="text" class="form-control edit_product_date_to" readonly/>
|
||||
<div class="input-group-addon"><i class="icon-calendar"></i></div>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row form-group">
|
||||
<div class="col-sm-6">
|
||||
<label class="control-label">{l s='Price (Tax excl.)'}</label>
|
||||
<label class="control-label">{l s='Price (tax excl.)'}</label>
|
||||
<div class="input-group">
|
||||
{if $currency->format % 2}<div class="input-group-addon">{$currency->sign}</div>{/if}
|
||||
<input class="form-control room_unit_price" type="text" name="room_unit_price" value=""/>
|
||||
@@ -59,55 +67,55 @@
|
||||
</div>
|
||||
<div class="col-sm-6">
|
||||
<label class="control-label">{l s='Occupancy'}</label>
|
||||
{if $order->with_occupancy}
|
||||
<div class="booking_occupancy_edit">
|
||||
<div class="dropdown">
|
||||
<button class="form-control booking_guest_occupancy btn btn-default btn-left btn-block input-occupancy" type="button">
|
||||
<span>
|
||||
{if $data['adults']}{$data['adults']}{/if} {if $data['adults'] > 1}{l s='Adults'}{else}{l s='Adult'}{/if}{if {$data['children']}}, {$data['children']} {if $data['children'] > 1}{l s='Children'}{else}{l s='Child'}{/if}{/if}
|
||||
</span>
|
||||
</button>
|
||||
<div class="dropdown-menu booking_occupancy_wrapper fixed-width-xxl well well-sm">
|
||||
<div class="booking_occupancy_inner">
|
||||
<input type="hidden" class="max_adults" value="{if isset($data['room_type_info'])}{$data['room_type_info']['max_adults']|escape:'html':'UTF-8'}{/if}">
|
||||
<input type="hidden" class="max_children" value="{if isset($data['room_type_info'])}{$data['room_type_info']['max_children']|escape:'html':'UTF-8'}{/if}">
|
||||
<input type="hidden" class="max_guests" value="{if isset($data['room_type_info'])}{$data['room_type_info']['max_guests']|escape:'html':'UTF-8'}{/if}">
|
||||
<div class="occupancy_info_block" occ_block_index="0">
|
||||
<div class="occupancy_info_head col-sm-12"><span class="room_num_wrapper">{l s='Room - 1'}</span></div>
|
||||
<div class="row">
|
||||
<div class="col-xs-6 occupancy_count_block">
|
||||
<div class="col-sm-12">
|
||||
<label>{l s='Adults'}</label>
|
||||
<input type="number" class="form-control num_occupancy num_adults" name="occupancy[0][adults]" value="{$data['adults']}" min="1" max="{$data['room_type_info']['max_adults']|escape:'html':'UTF-8'}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-6 occupancy_count_block">
|
||||
<div class="col-sm-12">
|
||||
<label>{l s='Child'} <span class="label-desc-txt"></span></label>
|
||||
<input type="number" class="form-control num_occupancy num_children" name="occupancy[0][children]" value="{$data['children']}" min="0" max="{$data['room_type_info']['max_children']|escape:'html':'UTF-8'}">
|
||||
({l s='Below'} {$max_child_age|escape:'htmlall':'UTF-8'} {l s='years'})
|
||||
</div>
|
||||
<div class="booking_occupancy_edit">
|
||||
<div class="dropdown">
|
||||
<button class="form-control booking_guest_occupancy btn btn-default btn-left btn-block input-occupancy" type="button">
|
||||
<span>
|
||||
{if $data['adults']}{$data['adults']}{/if} {if $data['adults'] > 1}{l s='Adults'}{else}{l s='Adult'}{/if}{if {$data['children']}}, {$data['children']} {if $data['children'] > 1}{l s='Children'}{else}{l s='Child'}{/if}{/if}
|
||||
</span>
|
||||
</button>
|
||||
<div class="dropdown-menu booking_occupancy_wrapper fixed-width-xxl well well-sm">
|
||||
<div class="booking_occupancy_inner">
|
||||
<input type="hidden" class="max_adults" value="{if isset($data['room_type_info'])}{$data['room_type_info']['max_adults']|escape:'html':'UTF-8'}{/if}">
|
||||
<input type="hidden" class="max_children" value="{if isset($data['room_type_info'])}{$data['room_type_info']['max_children']|escape:'html':'UTF-8'}{/if}">
|
||||
<input type="hidden" class="max_guests" value="{if isset($data['room_type_info'])}{$data['room_type_info']['max_guests']|escape:'html':'UTF-8'}{/if}">
|
||||
<div class="occupancy_info_block" occ_block_index="0">
|
||||
<div class="occupancy_info_head col-sm-12"><span class="room_num_wrapper">{l s='Room - 1'}</span></div>
|
||||
<div class="row">
|
||||
<div class="col-xs-6 occupancy_count_block">
|
||||
<div class="col-sm-12">
|
||||
<label>{l s='Adults'}</label>
|
||||
<input type="number" class="form-control num_occupancy num_adults" name="occupancy[0][adults]" value="{$data['adults']}" min="1" max="{$data['room_type_info']['max_adults']|escape:'html':'UTF-8'}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="row children_age_info_block" {if !isset($data['child_ages']) || !$data['child_ages']}style="display:none"{/if}>
|
||||
<div class="col-xs-6 occupancy_count_block">
|
||||
<div class="col-sm-12">
|
||||
<label class="col-sm-12">{l s='All Children'}</label>
|
||||
<div class="col-sm-12">
|
||||
<div class="row children_ages">
|
||||
{if isset($data['child_ages']) && $data['child_ages']}
|
||||
{foreach $data['child_ages'] as $childAge}
|
||||
<p class="col-xs-12 col-sm-12 col-md-6 col-lg-6">
|
||||
<select class="guest_child_age room_occupancies" name="occupancy[0][child_ages][]">
|
||||
<option value="-1" {if $childAge == -1}selected{/if}>{l s='Select 1'}</option>
|
||||
<option value="0" {if $childAge == 0}selected{/if}>{l s='Under 1'}</option>
|
||||
{for $age=1 to ($max_child_age-1)}
|
||||
<option value="{$age|escape:'htmlall':'UTF-8'}" {if $childAge == $age}selected{/if}>{$age|escape:'htmlall':'UTF-8'}</option>
|
||||
{/for}
|
||||
</select>
|
||||
</p>
|
||||
{/foreach}
|
||||
{/if}
|
||||
</div>
|
||||
<label>{l s='Child'} <span class="label-desc-txt"></span></label>
|
||||
<input type="number" class="form-control num_occupancy num_children" name="occupancy[0][children]" value="{$data['children']}" min="0" max="{$data['room_type_info']['max_children']|escape:'html':'UTF-8'}">
|
||||
({l s='Below'} {$max_child_age|escape:'htmlall':'UTF-8'} {l s='years'})
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<p style="display:none;"><span class="text-danger occupancy-input-errors"></span></p>
|
||||
<div class="row children_age_info_block" {if !isset($data['child_ages']) || !$data['child_ages']}style="display:none"{/if}>
|
||||
<div class="col-sm-12">
|
||||
<label class="col-sm-12">{l s='All Children'}</label>
|
||||
<div class="col-sm-12">
|
||||
<div class="row children_ages">
|
||||
{if isset($data['child_ages']) && $data['child_ages']}
|
||||
{foreach $data['child_ages'] as $childAge}
|
||||
<p class="col-xs-12 col-sm-12 col-md-6 col-lg-6">
|
||||
<select class="guest_child_age room_occupancies" name="occupancy[0][child_ages][]">
|
||||
<option value="-1" {if $childAge == -1}selected{/if}>{l s='Select age'}</option>
|
||||
<option value="0" {if $childAge == 0}selected{/if}>{l s='Under 1'}</option>
|
||||
{for $age=1 to ($max_child_age-1)}
|
||||
<option value="{$age|escape:'htmlall':'UTF-8'}" {if $childAge == $age}selected{/if}>{$age|escape:'htmlall':'UTF-8'}</option>
|
||||
{/for}
|
||||
</select>
|
||||
</p>
|
||||
{/foreach}
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -116,9 +124,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{else}
|
||||
<span class="booking_occupancy_edit" style="display:none;">{if $data['adults']}{$data['adults']}{/if} {if $data['adults'] > 1}{l s='Adults'}{else}{l s='Adult'}{/if}{if {$data['children']}}, {$data['children']} {if $data['children'] > 1}{l s='Children'}{else}{l s='Child'}{/if}{/if}</span>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -31,8 +31,8 @@
|
||||
<thead>
|
||||
<tr>
|
||||
<th>{l s='Name'}</th>
|
||||
<th>{l s='Unit Price'}</th>
|
||||
<th>{l s='Total Price'}</th>
|
||||
<th>{l s='Unit Price (tax excl.)'}</th>
|
||||
<th>{l s='Total Price (tax excl.)'}</th>
|
||||
<th class="text-right">{l s='Action'}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
@@ -77,7 +77,7 @@
|
||||
<th></th>
|
||||
<th>{l s='Name'}</th>
|
||||
<th>{l s='Option'}</th>
|
||||
<th>{l s='Unit Price'}</th>
|
||||
<th>{l s='Unit Price (tax excl.)'}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
@@ -33,8 +33,8 @@
|
||||
<th>{l s='Name'}</th>
|
||||
<th class="fixed-width-sm"></th>
|
||||
<th class="fixed-width-sm text-center">{l s='Quantity'}</th>
|
||||
<th>{l s='Unit Price'}</th>
|
||||
<th>{l s='Total Price'}</th>
|
||||
<th>{l s='Unit Price (tax excl.)'}</th>
|
||||
<th>{l s='Total Price (tax excl.)'}</th>
|
||||
<th class="text-right">{l s='Action'}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
@@ -101,7 +101,7 @@
|
||||
<th>{l s='Name'}</th>
|
||||
<th class="fixed-width-sm"> </th>
|
||||
<th class="fixed-width-sm text-center">{l s='Quantity'}</th>
|
||||
<th>{l s='Unit Price'}</th>
|
||||
<th>{l s='Unit Price (tax excl.)'}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
{*
|
||||
* Since 2010 Webkul.
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* All right is reserved,
|
||||
* Please go through this link for complete license : https://store.webkul.com/license.html
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade this module to newer
|
||||
* versions in the future. If you wish to customize this module for your
|
||||
* needs please refer to https://store.webkul.com/customisation-guidelines/ for more information.
|
||||
*
|
||||
* @author Webkul IN <support@webkul.com>
|
||||
* @copyright Since 2010 Webkul IN
|
||||
* @license https://store.webkul.com/license.html
|
||||
*}
|
||||
|
||||
<div class="modal-body">
|
||||
<div><b>{l s='Allotment remark'}</b>: {$comment}</div>
|
||||
|
||||
{if isset($loaderImg) && $loaderImg}
|
||||
<div class="loading_overlay">
|
||||
<img src='{$loaderImg}' class="loading-img"/>
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
@@ -28,20 +28,30 @@
|
||||
</ul>
|
||||
<div class="tab-content active">
|
||||
<div role="tabpanel" class="tab-pane active" id="reallocate_room_tab">
|
||||
<div class="row">
|
||||
<dl class="list-detail col-sm-6">
|
||||
<label class="label-title">{l s='Current Room Number'}</label>
|
||||
<dd><i class="icon-bed"></i> <span class="modal_curr_room_num"></span></dd>
|
||||
</dl>
|
||||
<dl class="list-detail col-sm-6">
|
||||
<label class="label-title">{l s='Allotment type'}</label>
|
||||
<dd><span class="modal_curr_allotent_type"></span></dd>
|
||||
</dl>
|
||||
</div>
|
||||
<div class="row">
|
||||
<dl class="list-detail col-sm-6">
|
||||
<label class="label-title">{l s='Currently Alloted Customer'}</label>
|
||||
<dd><i class="icon-user"></i> <span class="cust_name"></span></dd>
|
||||
<dd><i class="icon-envelope"></i> <span class="cust_email"></span></dd>
|
||||
</dl>
|
||||
<dl class="list-detail col-sm-6">
|
||||
<label class="label-title">{l s='Current Room Number'}</label>
|
||||
<dd><i class="icon-bed"></i> <span class="modal_curr_room_num"></span></dd>
|
||||
<dl class="list-detail col-sm-6 allotment_comment_block">
|
||||
<label class="label-title">{l s='Allotment Comment'}</label>
|
||||
<dd><span class="modal_curr_allotment_comment"></span></dd>
|
||||
</dl>
|
||||
</div>
|
||||
|
||||
<hr>
|
||||
<form class="form-hozizontal" method="post" action="{$current_index}&vieworder&token={$smarty.get.token|escape:'html':'UTF-8'}&id_order={$order->id|intval}">
|
||||
<form class="form-hozizontal" method="post" action="{$reallocate_form_action}">
|
||||
<div class="form-group">
|
||||
<div class="row">
|
||||
<div class="form-group col-sm-6">
|
||||
@@ -90,19 +100,29 @@
|
||||
</form>
|
||||
</div>
|
||||
<div role="tabpanel" class="tab-pane" id="swap_room_tab">
|
||||
<div class="row">
|
||||
<dl class="list-detail col-sm-6">
|
||||
<label class="label-title">{l s='Current Room Number'}</label>
|
||||
<dd><i class="icon-bed"></i> <span class="modal_curr_room_num"></span></dd>
|
||||
</dl>
|
||||
<dl class="list-detail col-sm-6">
|
||||
<label class="label-title">{l s='Allotment type'}</label>
|
||||
<dd><span class="modal_curr_allotent_type"></span></dd>
|
||||
</dl>
|
||||
</div>
|
||||
<div class="row">
|
||||
<dl class="list-detail col-sm-6">
|
||||
<label class="label-title">{l s='Currently Alloted Customer'}</label>
|
||||
<dd><i class="icon-user"></i> <span class="cust_name"></span></dd>
|
||||
<dd><i class="icon-envelope"></i> <span class="cust_email"></span></dd>
|
||||
</dl>
|
||||
<dl class="list-detail col-sm-6">
|
||||
<label class="label-title">{l s='Current Room Number'}</label>
|
||||
<dd><i class="icon-bed"></i> <span class="modal_curr_room_num"></span></dd>
|
||||
<dl class="list-detail col-sm-6 allotment_comment_block">
|
||||
<label class="label-title">{l s='Allotment Comment'}</label>
|
||||
<dd><span class="modal_curr_allotment_comment"></span></dd>
|
||||
</dl>
|
||||
</div>
|
||||
<hr>
|
||||
<form method="post" action="{$current_index}&vieworder&token={$smarty.get.token|escape:'html':'UTF-8'}&id_order={$order->id|intval}">
|
||||
<form method="post" action="{$reallocate_form_action}">
|
||||
<div class="form-group">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
*}
|
||||
|
||||
<div class="modal-body">
|
||||
<div class="text-left errors-wrap"></div>
|
||||
<form id="customer-guest-details-form">
|
||||
<div class="form-group row">
|
||||
<div class="col-sm-2">
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
{l s='Price'}
|
||||
</th>
|
||||
<th>
|
||||
{l s='Tax rate'}
|
||||
{l s='Tax rule'}
|
||||
</th>
|
||||
<th class="fixed-width-lg text-center">
|
||||
{l s='Per day price calculation'}
|
||||
|
||||
@@ -446,24 +446,21 @@
|
||||
{if isset($product->id) && $product->id}
|
||||
<div class="form-group">
|
||||
<label class="control-label col-lg-3" id="category_position" for="category_position">
|
||||
<span class="label-tooltip" data-toggle="tooltip" title="{l s='Set position of the room type when hotel search results are displayed.'}">
|
||||
<span class="label-tooltip" data-toggle="tooltip" title="{l s='Set display position of room type on the search results page.'}">
|
||||
{l s='Position'}
|
||||
</span>
|
||||
</label>
|
||||
<div class="col-lg-9">
|
||||
<input type="text" id="category_position" class="form-control fixed-width-lg" name="category_position" value="{$category_position}" />
|
||||
<p class="help-block">{l s='Please note that position numbering starts from 0. A position of 0 means room type will be displayed at the topmost.'}</p>
|
||||
<p class="help-block">{l s='Please note that position numbering starts from 0. A position of 0 means room type will be displayed at the topmost position.'}</p>
|
||||
<div class="alert alert-info">
|
||||
{l s='You can manage positions of the room types of this hotel from'}
|
||||
<a href="{$link->getAdminLink('AdminProducts')}&id_category={$htl_full_info['id_category']}">{l s='here.'}</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
{if isset($product->id) && $product->id}
|
||||
<div class="alert alert-info">
|
||||
{l s='You can change positions of room types of this hotel from '}
|
||||
<a href="{$link->getAdminLink('AdminProducts')}&id_category={$htl_full_info['id_category']}">{l s='here.'}</a>
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
{* <div class="form-group">
|
||||
<label class="control-label col-lg-3" for="tags_{$id_lang}">
|
||||
<span class="label-tooltip" data-toggle="tooltip"
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
|
||||
<div class="alert alert-info">
|
||||
{l s='Below, enter the base occupancy of this room type.'}
|
||||
<p><b>{l s='Note'}</b>: {l s='Minimum 1 adult is madatory in the base occupancy of the room type'}</p>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
@@ -35,7 +36,7 @@
|
||||
</span>
|
||||
</label>
|
||||
<div class="col-sm-3">
|
||||
<input id="base_adults" type="text" name="base_adults" class="form-control" value="{if isset($roomTypeInfo)}{$roomTypeInfo['adults']|escape:'htmlall':'UTF-8'}{else}2{/if}">
|
||||
<input id="base_adults" type="text" name="base_adults" class="form-control" value="{if isset($smarty.post.base_adults)}{$smarty.post.base_adults|escape:'html':'UTF-8'}{elseif isset($roomTypeInfo['adults'])}{$roomTypeInfo['adults']|escape:'html':'UTF-8'}{else}2{/if}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
@@ -46,7 +47,7 @@
|
||||
</span>
|
||||
</label>
|
||||
<div class="col-sm-3">
|
||||
<input id="base_children" type="text" name="base_children" class="form-control" {if isset($roomTypeInfo)}value="{$roomTypeInfo['children']|escape:'htmlall':'UTF-8'}"{/if}>
|
||||
<input id="base_children" type="text" name="base_children" class="form-control" value="{if isset($smarty.post.base_children)}{$smarty.post.base_children|escape:'html':'UTF-8'}{elseif isset($roomTypeInfo['children'])}{$roomTypeInfo['children']|escape:'html':'UTF-8'}{else}0{/if}">
|
||||
</div>
|
||||
</div>
|
||||
<input id="is_occupancy_submit" type="hidden" name="is_occupancy_submit" class="form-control" value="0">
|
||||
@@ -67,7 +68,7 @@
|
||||
</span>
|
||||
</label>
|
||||
<div class="col-sm-3">
|
||||
<input id="max_adults" type="text" name="max_adults" class="form-control" {if isset($roomTypeInfo)}value="{$roomTypeInfo['max_adults']|escape:'htmlall':'UTF-8'}"{/if}>
|
||||
<input id="max_adults" type="text" name="max_adults" class="form-control" value="{if isset($smarty.post.max_adults)}{$smarty.post.max_adults|escape:'html':'UTF-8'}{elseif isset($roomTypeInfo['max_adults'])}{$roomTypeInfo['max_adults']|escape:'html':'UTF-8'}{/if}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
@@ -78,7 +79,7 @@
|
||||
</span>
|
||||
</label>
|
||||
<div class="col-sm-3">
|
||||
<input id="max_children" type="text" name="max_children" class="form-control" {if isset($roomTypeInfo)}value="{$roomTypeInfo['max_children']|escape:'htmlall':'UTF-8'}"{/if}>
|
||||
<input id="max_children" type="text" name="max_children" class="form-control" value="{if isset($smarty.post.max_children)}{$smarty.post.max_children|escape:'html':'UTF-8'}{elseif isset($roomTypeInfo['max_children'])}{$roomTypeInfo['max_children']|escape:'html':'UTF-8'}{/if}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
@@ -89,7 +90,7 @@
|
||||
</span>
|
||||
</label>
|
||||
<div class="col-sm-3">
|
||||
<input id="max_guests" type="text" name="max_guests" class="form-control" {if isset($roomTypeInfo)}value="{$roomTypeInfo['max_guests']|escape:'htmlall':'UTF-8'}"{/if}>
|
||||
<input id="max_guests" type="text" name="max_guests" class="form-control" value="{if isset($smarty.post.max_guests)}{$smarty.post.max_guests|escape:'html':'UTF-8'}{elseif isset($roomTypeInfo['max_guests'])}{$roomTypeInfo['max_guests']|escape:'html':'UTF-8'}{/if}">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
<span>{l s='Price'}</span>
|
||||
</th>
|
||||
<th>
|
||||
<span>{l s='Tax'}</span>
|
||||
<span>{l s='Tax rule'}</span>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
@@ -210,6 +210,7 @@
|
||||
</div>
|
||||
</li>
|
||||
{/if}
|
||||
{hook h='displayBackOfficeTopNotificaiton'}
|
||||
</ul>
|
||||
{if count($quick_access) >= 0}
|
||||
<ul id="header_quick">
|
||||
|
||||
@@ -25,39 +25,41 @@
|
||||
|
||||
<{if isset($href) && $href}a style="display:block" href="{$href|escape:'html':'UTF-8'}"{else}div{/if} id="{$id|escape:'html':'UTF-8'}" data-toggle="tooltip" class="box-stats label-tooltip {$color|escape}" data-original-title="{$tooltip|escape}" {if $target}target="_blank"{/if}>
|
||||
<div class="kpi-content">
|
||||
<div class="title-subtitle">
|
||||
<div class="title-container">
|
||||
<span class="title">
|
||||
{if isset($icon) && $icon}<i class="{$icon|escape}"></i>{/if}
|
||||
{$title|escape}
|
||||
</span>
|
||||
</div>
|
||||
{if $subtitle}
|
||||
<div class="subtitle-container">
|
||||
<span class="subtitle">
|
||||
{$subtitle|escape}
|
||||
{if isset($icon) && $icon}<i class="{$icon|escape} kpi-icon"></i>{/if}
|
||||
<div class="kpi-data">
|
||||
<div class="title-subtitle">
|
||||
<div class="title-container">
|
||||
<span class="title">
|
||||
{$title|escape}
|
||||
</span>
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
{if isset($chart) && $chart}
|
||||
<div class="boxchart-overlay">
|
||||
<div class="boxchart">
|
||||
</div>
|
||||
{if $subtitle}
|
||||
<div class="subtitle-container">
|
||||
<span class="subtitle">
|
||||
{$subtitle|escape}
|
||||
</span>
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
{/if}
|
||||
<div class="value-container">
|
||||
{if isset($source) && $source}
|
||||
<span class="value skeleton-loading-wave loading-container-bar loading"></span>
|
||||
{elseif isset($value) && $value !== ''}
|
||||
<span class="value">{$value|escape:'html':'UTF-8'}</span>
|
||||
{if isset($chart) && $chart}
|
||||
<div class="boxchart-overlay">
|
||||
<div class="boxchart">
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
<div class="value-container">
|
||||
{if isset($source) && $source}
|
||||
<span class="value skeleton-loading-wave loading-container-bar loading"></span>
|
||||
{elseif isset($value) && $value !== ''}
|
||||
<span class="value">{$value|escape:'html':'UTF-8'}</span>
|
||||
{/if}
|
||||
</div>
|
||||
{if isset($href) && $href}
|
||||
<span class="arrow pull-right"><i class="icon-angle-right"></i></span>
|
||||
{/if}
|
||||
</div>
|
||||
|
||||
{if isset($href) && $href}
|
||||
<span class="arrow"><i class="icon-angle-right"></i></span>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
</{if isset($href) && $href}a{else}div{/if}>
|
||||
|
||||
{if isset($source) && $source}
|
||||
|
||||
@@ -147,47 +147,51 @@
|
||||
|
||||
form.submit();
|
||||
});
|
||||
{if $fields_optional|count}
|
||||
toggleVisibleColumns($('#form-{$list_id}'));
|
||||
{/if}
|
||||
$('#optional-list-toggle').on('click', function(e) {
|
||||
e.stopPropagation();
|
||||
})
|
||||
$('#form-{$list_id} input[name="list_fields_visibility"]').on('change', function(){
|
||||
toggleVisibleColumns($('#form-{$list_id}'));
|
||||
})
|
||||
});
|
||||
|
||||
function toggleVisibleColumns(form) {
|
||||
var list_fields_visibility = [];
|
||||
$(form).find('input[name="list_fields_visibility"]:checked').each(function(i, field){
|
||||
list_fields_visibility.push($(field).val());
|
||||
});
|
||||
|
||||
$(form).find('table.table .field_optional').hide();
|
||||
$(form).find('table.table .field_optional').each(function(i, val) {
|
||||
if (list_fields_visibility.includes($(this).data('key'))) {
|
||||
$(this).show();
|
||||
}
|
||||
});
|
||||
updateListVisibility(list_fields_visibility)
|
||||
}
|
||||
function updateListVisibility(list_fields_visibility) {
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
headers: { "cache-control": "no-cache" },
|
||||
url: '{$action}',
|
||||
data: {
|
||||
ajax: 1,
|
||||
action: 'updateListVisivility',
|
||||
list_fields_visibility: list_fields_visibility
|
||||
},
|
||||
cache: false,
|
||||
dataType: 'json'
|
||||
});
|
||||
}
|
||||
</script>
|
||||
{/if}
|
||||
<script>
|
||||
$(document).ready(function(){
|
||||
{if $fields_optional|count}
|
||||
toggleVisibleColumns($('#form-{$list_id}'));
|
||||
{/if}
|
||||
$('#optional-list-toggle').on('click', function(e) {
|
||||
e.stopPropagation();
|
||||
})
|
||||
$('#form-{$list_id} input[name="list_fields_visibility"]').on('change', function(){
|
||||
toggleVisibleColumns($('#form-{$list_id}'));
|
||||
})
|
||||
});
|
||||
|
||||
function toggleVisibleColumns(form) {
|
||||
var list_fields_visibility = [];
|
||||
$(form).find('input[name="list_fields_visibility"]:checked').each(function(i, field){
|
||||
list_fields_visibility.push($(field).val());
|
||||
});
|
||||
|
||||
$(form).find('table.table .field_optional').hide();
|
||||
$(form).find('table.table .field_optional').each(function(i, val) {
|
||||
if (list_fields_visibility.includes($(this).data('key'))) {
|
||||
$(this).show();
|
||||
}
|
||||
});
|
||||
updateListVisibility(list_fields_visibility)
|
||||
}
|
||||
function updateListVisibility(list_fields_visibility) {
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
headers: { "cache-control": "no-cache" },
|
||||
url: '{$action}',
|
||||
data: {
|
||||
ajax: 1,
|
||||
action: 'updateListVisivility',
|
||||
list_fields_visibility: list_fields_visibility
|
||||
},
|
||||
cache: false,
|
||||
dataType: 'json'
|
||||
});
|
||||
}
|
||||
</script>
|
||||
{block name="updatelist"}
|
||||
{if $new_list_header_design}
|
||||
<div class="list_action_wrapper">
|
||||
@@ -291,28 +295,30 @@
|
||||
<label class="col-xs-3" for="filter_input_{$key}">{$params['title']|escape:'html':'UTF-8'}</label>
|
||||
<div class="col-xs-9">
|
||||
{if $params.type == 'range'}
|
||||
{$field_name="`$list_id`Filter_{if isset($params.filter_key)}`$params.filter_key`{else}`$key`{/if}"}
|
||||
<div class="input_range">
|
||||
<input type="text" class="filter form-control" name="{$list_id}Filter_{if isset($params.filter_key)}{$params.filter_key}{else}{$key}{/if}[0]" placeholder="{l s='From'}" value="{if isset($params.value.0)}{$params.value.0}{/if}">
|
||||
<input type="text" class="filter form-control" name="{$list_id}Filter_{if isset($params.filter_key)}{$params.filter_key}{else}{$key}{/if}[1]" placeholder="{l s='To'}" value="{if isset($params.value.1)}{$params.value.1}{/if}">
|
||||
<input type="text" class="filter form-control" name="{$field_name}[0]" placeholder="{l s='From'}" value="{if isset($smarty.post[$field_name][0]) && $smarty.post[$field_name][0]}{$smarty.post[$field_name][0]}{elseif isset($params.value.0)}{$params.value.0}{/if}">
|
||||
<input type="text" class="filter form-control" name="{$field_name}[1]" placeholder="{l s='To'}" value="{if isset($smarty.post[$field_name][1]) && $smarty.post[$field_name][1]}{$smarty.post[$field_name][1]}{elseif isset($params.value.1)}{$params.value.1}{/if}">
|
||||
</div>
|
||||
{elseif $params.type == 'bool'}
|
||||
<select id="filter_input_{$key}" class="filter center" name="{$list_id}Filter_{if isset($params.filter_key)}{$params.filter_key}{else}{$key}{/if}">
|
||||
{$field_name="`$list_id`Filter_{if isset($params.filter_key)}`$params.filter_key`{else}`$key`{/if}"}
|
||||
<select id="filter_input_{$key}" class="filter center" name="{$field_name}">
|
||||
<option value="">-</option>
|
||||
<option value="1" {if $params.value == 1} selected="selected" {/if}>{l s='Yes'}</option>
|
||||
<option value="0" {if $params.value == 0 && $params.value != ''} selected="selected" {/if}>{l s='No'}</option>
|
||||
<option value="1" {if isset($smarty.post.$field_name) && $smarty.post.$field_name == 1} selected="selected"{elseif $params.value == 1} selected="selected" {/if}>{l s='Yes'}</option>
|
||||
<option value="0" {if isset($smarty.post.$field_name) && $smarty.post.$field_name == 0} selected="selected"{elseif $params.value == 0 && $params.value != ''} selected="selected" {/if}>{l s='No'}</option>
|
||||
</select>
|
||||
{elseif $params.type == 'date' || $params.type == 'datetime'}
|
||||
<div class="date_range">
|
||||
<div class="input-group center">
|
||||
<input type="text" class="filter datepicker date-input form-control" id="local_{$params.id_date}_0" name="local_{$params.name_date}[0]" placeholder="{l s='From'}" autocomplete="off"/>
|
||||
<input type="hidden" id="{$params.id_date}_0" name="{$params.name_date}[0]" value="{if isset($params.value.0)}{$params.value.0}{/if}">
|
||||
<input type="hidden" id="{$params.id_date}_0" name="{$params.name_date}[0]" value="{if isset($smarty.post[$params.name_date][0]) && $smarty.post[$params.name_date][0]}{$smarty.post[$params.name_date][0]}{elseif isset($params.value.0)}{$params.value.0}{/if}">
|
||||
<span class="input-group-addon">
|
||||
<i class="icon-calendar"></i>
|
||||
</span>
|
||||
</div>
|
||||
<div class="input-group center">
|
||||
<input type="text" class="filter datepicker date-input form-control" id="local_{$params.id_date}_1" name="local_{$params.name_date}[1]" placeholder="{l s='To'}" autocomplete="off"/>
|
||||
<input type="hidden" id="{$params.id_date}_1" name="{$params.name_date}[1]" value="{if isset($params.value.1)}{$params.value.1}{/if}">
|
||||
<input type="hidden" id="{$params.id_date}_1" name="{$params.name_date}[1]" value="{if isset($smarty.post[$params.name_date][1]) && $smarty.post[$params.name_date][1]}{$smarty.post[$params.name_date][1]}{elseif isset($params.value.1)}{$params.value.1}{/if}">
|
||||
<span class="input-group-addon">
|
||||
<i class="icon-calendar"></i>
|
||||
</span>
|
||||
@@ -366,28 +372,30 @@
|
||||
</script>
|
||||
</div>
|
||||
{elseif $params.type == 'select'}
|
||||
{$field_name="`$list_id`Filter_`$params.filter_key`"}
|
||||
{if isset($params.multiple) && $params.multiple}
|
||||
<select id="filter_input_{$key}" class="filter{if isset($params.align) && $params.align == 'center'}center{/if} select_multiple_{$params.operator} chosen" multiple name="{$list_id}Filter_{$params.filter_key}[]" {if isset($params.width)} style="width:{$params.width}px"{/if}>
|
||||
<select id="filter_input_{$key}" class="filter{if isset($params.align) && $params.align == 'center'}center{/if} select_multiple_{$params.operator} chosen" multiple name="{$field_name}[]" {if isset($params.width)} style="width:{$params.width}px"{/if}>
|
||||
{if isset($params.list) && is_array($params.list)}
|
||||
{foreach $params.list AS $option_value => $option_display}
|
||||
<option value="{$option_value}" {if isset($params.value) && $params.value}{if in_array($option_value, $params.value)} selected="selected"{/if}{/if}>{$option_display}</option>
|
||||
<option value="{$option_value}" {if isset($smarty.post.$field_name) && $smarty.post.$field_name && in_array($option_value, $smarty.post.$field_name)} selected="selected"{elseif isset($params.value) && $params.value}{if in_array($option_value, $params.value)} selected="selected"{/if}{/if}>{$option_display}</option>
|
||||
{/foreach}
|
||||
{/if}
|
||||
</select>
|
||||
{else}
|
||||
{if isset($params.filter_key)}
|
||||
<select id="filter_input_{$key}" class="filter{if isset($params.align) && $params.align == 'center'}center{/if} {if isset($params.class)}{$params.class}{/if}" name="{$list_id}Filter_{$params.filter_key}" {if isset($params.width)} style="width:{$params.width}px"{/if}>
|
||||
<select id="filter_input_{$key}" class="filter{if isset($params.align) && $params.align == 'center'}center{/if} {if isset($params.class)}{$params.class}{/if}" name="{$field_name}" {if isset($params.width)} style="width:{$params.width}px"{/if}>
|
||||
<option value="" {if $params.value == ''} selected="selected" {/if}>-</option>
|
||||
{if isset($params.list) && is_array($params.list)}
|
||||
{foreach $params.list AS $option_value => $option_display}
|
||||
<option value="{$option_value}" {if (string)$option_display === (string)$params.value || (string)$option_value === (string)$params.value} selected="selected"{/if}>{$option_display}</option>
|
||||
<option value="{$option_value}" {if isset($smarty.post.$field_name) && $smarty.post.$field_name == $option_value} selected="selected"{elseif (string)$option_display === (string)$params.value || (string)$option_value === (string)$params.value} selected="selected"{/if}>{$option_display}</option>
|
||||
{/foreach}
|
||||
{/if}
|
||||
</select>
|
||||
{/if}
|
||||
{/if}
|
||||
{else}
|
||||
<input type="text" id="filter_input_{$key}" class="filter" name="{$list_id}Filter_{if isset($params.filter_key)}{$params.filter_key}{else}{$key}{/if}" value="{$params.value|escape:'html':'UTF-8'}" {if isset($params.width) && $params.width != 'auto'} style="width:{$params.width}px"{/if} />
|
||||
{$field_name="`$list_id`Filter_{if isset($params.filter_key)}`$params.filter_key`{else}`$key`{/if}"}
|
||||
<input type="text" id="filter_input_{$key}" class="filter" name="{$field_name}" value="{if isset($smarty.post.$field_name) && $smarty.post.$field_name}{$smarty.post.$field_name}{else}{$params.value|escape:'html':'UTF-8'}{/if}" {if isset($params.width) && $params.width != 'auto'} style="width:{$params.width}px"{/if} />
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
@@ -553,10 +561,11 @@
|
||||
<style>
|
||||
@media (max-width: 992px) {
|
||||
{foreach from=$fields_display item=param name=params}
|
||||
{if isset($params.displayed) && $params.displayed === false}{continue}{/if}
|
||||
.table-responsive-row td:nth-of-type({math equation="x+y" x=$smarty.foreach.params.index y=$y}):before {
|
||||
{if isset($param.displayed) && $param.displayed === false}{continue}{/if}
|
||||
.table-responsive-row td:nth-of-type({$y}):before {
|
||||
content: "{$param.title}";
|
||||
}
|
||||
{assign var=y value=$y+1}
|
||||
{/foreach}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -138,6 +138,9 @@
|
||||
</select>
|
||||
{elseif isset($input.empty_message)}
|
||||
{$input.empty_message}
|
||||
{else}
|
||||
<select class="form-control fixed-width-xxl {if isset($field['class'])}{$field['class']}{/if}" name="{$key}"{if isset($field['js'])} onchange="{$field['js']}"{/if} id="{$key}" {if isset($field['size'])} size="{$field['size']}"{/if}>
|
||||
</select>
|
||||
{/if}
|
||||
</div>
|
||||
{elseif $field['type'] == 'bool'}
|
||||
|
||||
@@ -64,7 +64,7 @@
|
||||
</li>
|
||||
<li class="search-invoices search-option">
|
||||
<a href="#" data-value="{$QLO_SEARCH_TYPE_INVOICE}" data-placeholder="{l s='Invoice Number'}" data-icon="icon-book">
|
||||
<i class="icon-book"></i> {l s='Invoices'}
|
||||
<i class="icon-file-text"></i> {l s='Invoices'}
|
||||
</a>
|
||||
</li>
|
||||
<li class="search-carts search-option">
|
||||
|
||||
@@ -1,2 +1,10 @@
|
||||
Order deny,allow
|
||||
Deny from all
|
||||
# Apache 2.2
|
||||
<IfModule !mod_authz_core.c>
|
||||
Order deny,allow
|
||||
Deny from all
|
||||
</IfModule>
|
||||
|
||||
# Apache 2.4
|
||||
<IfModule mod_authz_core.c>
|
||||
Require all denied
|
||||
</IfModule>
|
||||
|
||||
@@ -483,6 +483,14 @@ class AddressCore extends ObjectModel
|
||||
return array();
|
||||
}
|
||||
|
||||
public function cacheFieldsRequiredDatabase($all = false)
|
||||
{
|
||||
parent::cacheFieldsRequiredDatabase($all);
|
||||
if ($this->id_hotel) {
|
||||
self::$fieldsRequiredDatabase['Address'] = array();
|
||||
}
|
||||
}
|
||||
|
||||
public function searchByName($query, $idLang = false)
|
||||
{
|
||||
if (!$idLang) {
|
||||
@@ -509,5 +517,4 @@ class AddressCore extends ObjectModel
|
||||
)
|
||||
');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
31
classes/BoOrder.php
Normal file
31
classes/BoOrder.php
Normal file
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
/**
|
||||
* 2010-2022 Webkul.
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* All right is reserved,
|
||||
* Please go through this link for complete license : https://store.webkul.com/license.html
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade this module to newer
|
||||
* versions in the future. If you wish to customize this module for your
|
||||
* needs please refer to https://store.webkul.com/customisation-guidelines/ for more information.
|
||||
*
|
||||
* @author Webkul IN <support@webkul.com>
|
||||
* @copyright 2010-2022 Webkul IN
|
||||
* @license https://store.webkul.com/license.html
|
||||
*/
|
||||
|
||||
class BoOrder extends PaymentModule
|
||||
{
|
||||
public $active = 1;
|
||||
public $name = 'bo_order';
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->displayName = $this->l('Back office order');
|
||||
$this->validateOrderAmount = false;
|
||||
}
|
||||
}
|
||||
@@ -374,7 +374,7 @@ class CartCore extends ObjectModel
|
||||
if ($cart_vat_amount == 0 || $cart_amount_te == 0) {
|
||||
return 0;
|
||||
} else {
|
||||
return Tools::ps_round($cart_vat_amount / $cart_amount_te, 3);
|
||||
return Tools::ps_round($cart_vat_amount / $cart_amount_te, 6);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2380,7 +2380,6 @@ class CartCore extends ObjectModel
|
||||
$array = array();
|
||||
foreach($selectedServiceProducts as $selectedProduct) {
|
||||
if (isset($array[$selectedProduct['id_hotel']])) {
|
||||
$array[$selectedProduct['id_hotel']]['quantity'] += $selectedProduct['quantity'];
|
||||
$array[$selectedProduct['id_hotel']]['total_price_tax_excl'] += $selectedProduct['total_price_tax_excl'];
|
||||
$array[$selectedProduct['id_hotel']]['total_price_tax_incl'] += $selectedProduct['total_price_tax_incl'];
|
||||
} else {
|
||||
@@ -2407,7 +2406,8 @@ class CartCore extends ObjectModel
|
||||
$product['cart_quantity'] = $selectedProduct['quantity'];
|
||||
$product['total'] = $selectedProduct['total_price_tax_excl'];
|
||||
$product['total_wt'] = $selectedProduct['total_price_tax_incl'];
|
||||
$product['price_wt'] = $selectedProduct['unit_price_tax_incl'];
|
||||
$product['price_wt'] = $selectedProduct['total_price_tax_incl'] / $product['cart_quantity'];
|
||||
$product['price'] = $selectedProduct['total_price_tax_excl'] / $product['cart_quantity'];
|
||||
$product['id_hotel'] = $selectedProduct['id_hotel'];
|
||||
$orderPackage[$id_address][$selectedProduct['id_hotel']]['product_list'][] = $product;
|
||||
if (!isset($orderPackage[$id_address][$selectedProduct['id_hotel']]['id_hotel'])) {
|
||||
|
||||
@@ -78,6 +78,31 @@ class CartCustomerGuestDetailCore extends ObjectModel
|
||||
if (!trim($this->phone) || !Validate::isPhoneNumber($this->phone)) {
|
||||
$isValid = false;
|
||||
}
|
||||
|
||||
$className = 'CartCustomerGuestDetail';
|
||||
$rules = call_user_func(array($className, 'getValidationRules'), $className);
|
||||
|
||||
if (isset($rules['size']['firstname'])) {
|
||||
if (Tools::strlen(trim($this->firstname)) > $rules['size']['firstname']) {
|
||||
$isValid = false;
|
||||
}
|
||||
}
|
||||
if (isset($rules['size']['lastname'])) {
|
||||
if (Tools::strlen(trim($this->lastname)) > $rules['size']['lastname']) {
|
||||
$isValid = false;
|
||||
}
|
||||
}
|
||||
if (isset($rules['size']['email'])) {
|
||||
if (Tools::strlen(trim($this->email)) > $rules['size']['email']) {
|
||||
$isValid = false;
|
||||
}
|
||||
}
|
||||
if (isset($rules['size']['phone'])) {
|
||||
if (Tools::strlen(trim($this->phone)) > $rules['size']['phone']) {
|
||||
$isValid = false;
|
||||
}
|
||||
}
|
||||
|
||||
return $isValid;
|
||||
}
|
||||
}
|
||||
@@ -294,6 +294,13 @@ class CartRuleCore extends ObjectModel
|
||||
return array();
|
||||
}
|
||||
|
||||
// Remove cart rule that does not match the id_customer
|
||||
foreach ($result as $key => $cart_rule) {
|
||||
if ($cart_rule['id_customer'] && $cart_rule['id_customer'] != $id_customer) {
|
||||
unset($result[$key]);
|
||||
}
|
||||
}
|
||||
|
||||
// Remove cart rule that does not match the customer groups
|
||||
$customerGroups = Customer::getGroupsStatic($id_customer);
|
||||
|
||||
@@ -1154,6 +1161,18 @@ class CartRuleCore extends ObjectModel
|
||||
$previous_reduction_amount = $prorata * $previous_reduction_amount * (1 + $cart_average_vat_rate);
|
||||
}
|
||||
|
||||
// First we convert the voucher value to the default currency
|
||||
$previousCartRuleCurrency = new Currency($this->reduction_currency);
|
||||
|
||||
if ($previous_reduction_amount == 0 || $previousCartRuleCurrency->conversion_rate == 0) {
|
||||
$previous_reduction_amount = 0;
|
||||
} else {
|
||||
$previous_reduction_amount /= $previousCartRuleCurrency->conversion_rate;
|
||||
}
|
||||
|
||||
// Then we convert the voucher value in the default currency into the cart currency
|
||||
$previous_reduction_amount *= $context->currency->conversion_rate;
|
||||
$previous_reduction_amount = Tools::ps_round($previous_reduction_amount, _PS_PRICE_COMPUTE_PRECISION_);
|
||||
$current_cart_amount = max($current_cart_amount - (float)$previous_reduction_amount, 0);
|
||||
}
|
||||
|
||||
|
||||
@@ -89,8 +89,9 @@ class CookieCore
|
||||
$this->_path = '/'.$this->_path;
|
||||
}
|
||||
$this->_path = rawurlencode($this->_path);
|
||||
$this->_path = str_replace('%2F', '/', $this->_path);
|
||||
$this->_path = str_replace('%7E', '~', $this->_path);
|
||||
$search = array('%2F', '%7E', '%28', '%29', '%2B', '%26');
|
||||
$replace = array('/', '~', '(', ')', '+', '&');
|
||||
$this->_path = str_replace($search, $replace, $this->_path);
|
||||
$this->_domain = $this->getDomain($shared_urls);
|
||||
$this->_sameSite = Configuration::get('PS_COOKIE_SAMESITE');
|
||||
$this->_name = 'QloApps-'.md5(($this->_standalone ? '' : _PS_VERSION_).$name.$this->_domain);
|
||||
|
||||
@@ -135,6 +135,9 @@ class CustomerCore extends ObjectModel
|
||||
|
||||
public $groupBox;
|
||||
|
||||
const STATUS_BANNED = 1;
|
||||
const STATUS_DELETED = 2;
|
||||
|
||||
protected $webserviceParameters = array(
|
||||
'fields' => array(
|
||||
'id_default_group' => array('xlink_resource' => 'groups'),
|
||||
@@ -179,7 +182,7 @@ class CustomerCore extends ObjectModel
|
||||
'id_risk' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedInt', 'copy_post' => false),
|
||||
'max_payment_days' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedInt', 'copy_post' => false),
|
||||
'active' => array('type' => self::TYPE_BOOL, 'validate' => 'isBool', 'copy_post' => false),
|
||||
'deleted' => array('type' => self::TYPE_BOOL, 'validate' => 'isBool', 'copy_post' => false),
|
||||
'deleted' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedInt', 'copy_post' => false),
|
||||
'note' => array('type' => self::TYPE_HTML, 'validate' => 'isCleanHtml', 'size' => 65000, 'copy_post' => false),
|
||||
'is_guest' => array('type' => self::TYPE_BOOL, 'validate' => 'isBool', 'copy_post' => false),
|
||||
'id_shop' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId', 'copy_post' => false),
|
||||
@@ -294,21 +297,37 @@ class CustomerCore extends ObjectModel
|
||||
}
|
||||
|
||||
/**
|
||||
* Return customers list
|
||||
* Returns a list of customers.
|
||||
*
|
||||
* @param null|bool $only_active Returns only active customers when true
|
||||
* @return array Customers
|
||||
* @param null|bool $active Optional. Filter customers by their active status. If null, no filter is applied.
|
||||
* @param null|bool $deleted Optional. Filter customers by their deleted status. If null, no filter is applied.
|
||||
* @param null|bool $havingAddress Optional. Filter customers having|not having address. If true, only customers having an address are returned.
|
||||
* If false, only customers without an address are returned. If null, no filter is applied.
|
||||
* @return array List of customers matching the specified criteria.
|
||||
*/
|
||||
public static function getCustomers($only_active = null)
|
||||
public static function getCustomers($active = null, $deleted = null, $havingAddress = null)
|
||||
{
|
||||
$sql = 'SELECT `id_customer`, `email`, `firstname`, `lastname`
|
||||
FROM `'._DB_PREFIX_.'customer`
|
||||
WHERE 1 '.Shop::addSqlRestriction(Shop::SHARE_CUSTOMER).
|
||||
($only_active ? ' AND `active` = 1' : '').'
|
||||
ORDER BY `id_customer` ASC';
|
||||
$sqlSelect = 'SELECT c.`id_customer`, c.`email`, c.`firstname`, c.`lastname`';
|
||||
$sqlFrom = 'FROM `'._DB_PREFIX_.'customer` c';
|
||||
$sqlJoin = '';
|
||||
$sqlWhere = 'WHERE 1 '.Shop::addSqlRestriction(Shop::SHARE_CUSTOMER).
|
||||
(!is_null($active) ? ' AND c.`active` = '.(int) $active: ' ' ).
|
||||
(!is_null($deleted) ? ' AND c.`deleted` = '.(int) $deleted : ' ');
|
||||
$sqlOrderBy = 'ORDER BY c.`id_customer` ASC';
|
||||
$sqlGroupBy = 'GROUP BY c.`id_customer`';
|
||||
|
||||
if (!is_null($havingAddress)) {
|
||||
$sqlJoin .= ' LEFT JOIN `'._DB_PREFIX_.'address` a
|
||||
ON a.`id_customer` = c.`id_customer` AND a.`deleted`=0';
|
||||
$sqlWhere .= (($havingAddress) ? ' AND a.`id_address` IS NOT NULL': ' AND a.`id_address` IS NULL');
|
||||
}
|
||||
|
||||
$sql = $sqlSelect .' '. $sqlFrom.' '.$sqlJoin.' '.$sqlWhere.' '.$sqlGroupBy.' '.$sqlOrderBy;
|
||||
|
||||
return Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS($sql);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return customer instance from its e-mail (optionnaly check password)
|
||||
*
|
||||
@@ -951,4 +970,5 @@ class CustomerCore extends ObjectModel
|
||||
$sql_filter .= Shop::addSqlRestriction(Shop::SHARE_CUSTOMER, 'main');
|
||||
return parent::getWebserviceObjectList($sql_join, $sql_filter, $sql_sort, $sql_limit);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -140,14 +140,15 @@ class CustomerThreadCore extends ObjectModel
|
||||
return Db::getInstance()->executeS($sql);
|
||||
}
|
||||
|
||||
public static function getIdCustomerThreadByEmailAndIdOrder($email, $id_order)
|
||||
public static function getIdCustomerThreadByEmailAndIdOrder($email, $id_order, $id_contact = false)
|
||||
{
|
||||
return Db::getInstance()->getValue('
|
||||
SELECT cm.id_customer_thread
|
||||
FROM '._DB_PREFIX_.'customer_thread cm
|
||||
WHERE cm.email = \''.pSQL($email).'\'
|
||||
AND cm.id_shop = '.(int)Context::getContext()->shop->id.'
|
||||
AND cm.id_order = '.(int)$id_order
|
||||
AND cm.id_order = '.(int)$id_order.' '.
|
||||
(($id_contact) ? ' AND cm.id_contact='.(int) $id_contact : ' ')
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ class GenderCore extends ObjectModel
|
||||
'type' => array('type' => self::TYPE_INT, 'required' => true),
|
||||
|
||||
/* Lang fields */
|
||||
'name' => array('type' => self::TYPE_STRING, 'lang' => true, 'validate' => 'isString', 'required' => true, 'size' => 20),
|
||||
'name' => array('type' => self::TYPE_STRING, 'lang' => true, 'validate' => 'isCatalogName', 'required' => true, 'size' => 20),
|
||||
),
|
||||
);
|
||||
|
||||
|
||||
@@ -19,23 +19,15 @@
|
||||
* @license https://store.webkul.com/license.html
|
||||
*/
|
||||
|
||||
class MaintenanceAccessCore extends ObjectModel
|
||||
class MaintenanceAccessCore extends ObjectModel
|
||||
{
|
||||
|
||||
public $id_maintenance_access;
|
||||
public $ip_address;
|
||||
public $email;
|
||||
public $date_add;
|
||||
const USERNAME_ATTEMPTS_PER_QUARTER_HOUR = 3;
|
||||
const IP_ATTEMPTS_QUARTER_HOUR = 12;
|
||||
const USERNAME_ATTEMPTS_PER_HOUR = 6;
|
||||
const IP_ATTEMPTS_PER_HOUR = 24;
|
||||
const QUARTER_HOUR = 60*15;
|
||||
const HOUR = 60*60;
|
||||
|
||||
/**
|
||||
* @see ObjectModel::$definition
|
||||
*/
|
||||
const LOGIN_ATTEMPTS_WINDOW = 30; /* in minutes */
|
||||
|
||||
public static $definition = array(
|
||||
'table' => 'maintenance_access',
|
||||
'primary' => 'id_maintenance_access',
|
||||
@@ -46,51 +38,40 @@ class MaintenanceAccessCore extends ObjectModel
|
||||
),
|
||||
);
|
||||
|
||||
public function cleanData()
|
||||
public function removeFailedAttempts($email, $ipAddress)
|
||||
{
|
||||
$time = (time() - (self::HOUR*2));
|
||||
Db::getInstance()->execute(
|
||||
'DELETE FROM `' . _DB_PREFIX_ .'maintenance_access`
|
||||
WHERE `date_add` < "' . pSQL(date("Y-m-d H:i:s", $time)) . '"'
|
||||
'DELETE FROM `' . _DB_PREFIX_ .'maintenance_access` ma
|
||||
WHERE (ma.`email` = "'.pSQL($email).'" AND ma.`ip_address` = "'.pSQL($ipAddress).'")'
|
||||
);
|
||||
}
|
||||
|
||||
public function getUserFailedCount($time, $email=false, $ip_address=false, $attempts)
|
||||
public function getFailedAttemptsCount($email, $ipAddress)
|
||||
{
|
||||
$sql = "SELECT COUNT(`id_maintenance_access`) FROM `". _DB_PREFIX_ ."maintenance_access` WHERE `date_add` > '"
|
||||
. pSQL(date('Y-m-d H:i:s', $time)) ."'";
|
||||
$sql = 'SELECT COUNT(ma.`id_maintenance_access`)
|
||||
FROM `'._DB_PREFIX_.'maintenance_access` ma
|
||||
WHERE (ma.`email` = "'.pSQL($email).'" OR ma.`ip_address` = "'.pSQL($ipAddress).'")
|
||||
AND TIMESTAMPDIFF(
|
||||
MINUTE,
|
||||
ma.`date_add`,
|
||||
(
|
||||
SELECT MAX(ma.`date_add`)
|
||||
FROM `'._DB_PREFIX_.'maintenance_access` ma
|
||||
WHERE (ma.`email` = "'.pSQL($email).'" OR ma.`ip_address` = "'.pSQL($ipAddress).'")
|
||||
AND TIMESTAMPDIFF(MINUTE, ma.`date_add`, NOW()) < '.(int) MaintenanceAccess::LOGIN_ATTEMPTS_WINDOW.'
|
||||
)
|
||||
) < '.(int) MaintenanceAccess::LOGIN_ATTEMPTS_WINDOW;
|
||||
|
||||
if ($email) {
|
||||
$sql .= " AND `email` = '".pSQL($email)."'";
|
||||
}
|
||||
|
||||
if ($ip_address) {
|
||||
$sql .= " AND `ip_address` = '".pSQL($ip_address)."'";
|
||||
}
|
||||
|
||||
return Db::getInstance()->getValue($sql) >= $attempts;
|
||||
return Db::getInstance()->getValue($sql);
|
||||
}
|
||||
|
||||
public function checkLimit($email)
|
||||
public function getLastAttempt($email, $ipAddress)
|
||||
{
|
||||
$has_error = false;
|
||||
$minutes_ago = time() - self::QUARTER_HOUR;
|
||||
$hours_ago = time() - self::HOUR;
|
||||
$ip_address = Tools::getRemoteAddr();
|
||||
|
||||
$has_error |= $this->getUserFailedCount(
|
||||
$minutes_ago, $email, false, self::USERNAME_ATTEMPTS_PER_QUARTER_HOUR
|
||||
)? true : $has_error;
|
||||
$has_error |= $this->getUserFailedCount(
|
||||
$minutes_ago, false, $ip_address, self::IP_ATTEMPTS_QUARTER_HOUR
|
||||
)? true : $has_error;
|
||||
$has_error |= $this->getUserFailedCount(
|
||||
$hours_ago, $email, false, self::USERNAME_ATTEMPTS_PER_HOUR
|
||||
)? true : $has_error;
|
||||
$has_error |= $this->getUserFailedCount(
|
||||
$hours_ago, false, $ip_address, self::IP_ATTEMPTS_PER_HOUR
|
||||
)? true : $has_error;
|
||||
|
||||
return $has_error;
|
||||
return Db::getInstance()->getRow(
|
||||
'SELECT *
|
||||
FROM `'._DB_PREFIX_.'maintenance_access` ma
|
||||
WHERE (ma.`email` = "'.pSQL($email).'" OR ma.`ip_address` = "'.pSQL($ipAddress).'")
|
||||
ORDER BY ma.`date_add` DESC'
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -72,9 +72,11 @@ class NotificationCore
|
||||
SELECT SQL_CALC_FOUND_ROWS o.`id_order`, o.`id_customer`, o.`total_paid`, o.`id_currency`, o.`date_upd`, c.`firstname`, c.`lastname`
|
||||
FROM `'._DB_PREFIX_.'orders` as o
|
||||
LEFT JOIN `'._DB_PREFIX_.'customer` as c ON (c.`id_customer` = o.`id_customer`)
|
||||
WHERE `id_order` > '.(int)$id_last_element.
|
||||
Shop::addSqlRestriction(false, 'o').'
|
||||
ORDER BY `id_order` DESC
|
||||
LEFT JOIN '._DB_PREFIX_.'htl_booking_detail hbd ON (hbd.id_order = o.id_order)
|
||||
WHERE o.`id_order` > '.(int)$id_last_element.
|
||||
Shop::addSqlRestriction(false, 'o'). HotelBranchInformation::addHotelRestriction(false, 'hbd').'
|
||||
GROUP BY o.`id_order`
|
||||
ORDER BY o.`id_order` DESC
|
||||
LIMIT 5';
|
||||
break;
|
||||
|
||||
|
||||
@@ -33,6 +33,7 @@ abstract class PaymentModuleCore extends Module
|
||||
public $currencies = true;
|
||||
public $currencies_mode = 'checkbox';
|
||||
public $payment_type = OrderPayment::PAYMENT_TYPE_REMOTE_PAYMENT;
|
||||
public $validateOrderAmount = true;
|
||||
|
||||
public function install()
|
||||
{
|
||||
@@ -162,7 +163,7 @@ abstract class PaymentModuleCore extends Module
|
||||
*/
|
||||
public function validateOrder($id_cart, $id_order_state, $amount_paid, $payment_method = 'Unknown',
|
||||
$message = null, $extra_vars = array(), $currency_special = null, $dont_touch_amount = false,
|
||||
$secure_key = false, Shop $shop = null)
|
||||
$secure_key = false, Shop $shop = null, $send_mails = true)
|
||||
{
|
||||
if (self::DEBUG_MODE) {
|
||||
PrestaShopLogger::addLog('PaymentModule::validateOrder - Function called', 1, null, 'Cart', (int)$id_cart, true);
|
||||
@@ -418,8 +419,7 @@ abstract class PaymentModuleCore extends Module
|
||||
// If webservice order request then no need to impose equal amounts(total cart and sent amount) condition
|
||||
if ($order_status->logable
|
||||
&& number_format($cart_total_paid, _PS_PRICE_COMPUTE_PRECISION_) != number_format($amount_paid, _PS_PRICE_COMPUTE_PRECISION_)
|
||||
&& $this->name != 'wsorder'
|
||||
&& $this->name != 'bo_order'
|
||||
&& ($this->validateOrderAmount)
|
||||
) {
|
||||
// if customer is paying full payment amount
|
||||
$id_order_state = Configuration::get('PS_OS_ERROR');
|
||||
@@ -684,24 +684,25 @@ abstract class PaymentModuleCore extends Module
|
||||
if ($voucher->add()) {
|
||||
// If the voucher has conditions, they are now copied to the new voucher
|
||||
CartRule::copyConditions($cart_rule['obj']->id, $voucher->id);
|
||||
|
||||
$params = array(
|
||||
'{voucher_amount}' => Tools::displayPrice($voucher->reduction_amount, $this->context->currency, false),
|
||||
'{voucher_num}' => $voucher->code,
|
||||
'{firstname}' => $this->context->customer->firstname,
|
||||
'{lastname}' => $this->context->customer->lastname,
|
||||
'{id_order}' => $order->reference,
|
||||
'{order_name}' => $order->getUniqReference()
|
||||
);
|
||||
Mail::Send(
|
||||
(int)$order->id_lang,
|
||||
'voucher',
|
||||
sprintf(Mail::l('New voucher for your order %s', (int)$order->id_lang), $order->reference),
|
||||
$params,
|
||||
$this->context->customer->email,
|
||||
$this->context->customer->firstname.' '.$this->context->customer->lastname,
|
||||
null, null, null, null, _PS_MAIL_DIR_, false, (int)$order->id_shop
|
||||
);
|
||||
if ($send_mails) {
|
||||
$params = array(
|
||||
'{voucher_amount}' => Tools::displayPrice($voucher->reduction_amount, $this->context->currency, false),
|
||||
'{voucher_num}' => $voucher->code,
|
||||
'{firstname}' => $this->context->customer->firstname,
|
||||
'{lastname}' => $this->context->customer->lastname,
|
||||
'{id_order}' => $order->reference,
|
||||
'{order_name}' => $order->getUniqReference()
|
||||
);
|
||||
Mail::Send(
|
||||
(int)$order->id_lang,
|
||||
'voucher',
|
||||
sprintf(Mail::l('New voucher for your order %s', (int)$order->id_lang), $order->reference),
|
||||
$params,
|
||||
$this->context->customer->email,
|
||||
$this->context->customer->firstname.' '.$this->context->customer->lastname,
|
||||
null, null, null, null, _PS_MAIL_DIR_, false, (int)$order->id_shop
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1050,10 +1051,12 @@ abstract class PaymentModuleCore extends Module
|
||||
// Set the order status
|
||||
$new_history = new OrderHistory();
|
||||
$new_history->id_order = (int)$order->id;
|
||||
|
||||
$new_history->changeIdOrderState((int)$id_order_state, $order, true);
|
||||
|
||||
$new_history->addWithemail(true, $extra_vars);
|
||||
if ($send_mails) {
|
||||
$new_history->addWithemail(true, $extra_vars);
|
||||
} else {
|
||||
$new_history->add(true);
|
||||
}
|
||||
|
||||
// Switch to back order if needed
|
||||
$objHotelBookingDetail = new HotelBookingDetail();
|
||||
@@ -1089,7 +1092,11 @@ abstract class PaymentModuleCore extends Module
|
||||
$history = new OrderHistory();
|
||||
$history->id_order = (int)$order->id;
|
||||
$history->changeIdOrderState($id_order_state, $order, true);
|
||||
$history->addWithemail();
|
||||
if ($send_mails) {
|
||||
$history->addWithemail();
|
||||
} else {
|
||||
$history->add();
|
||||
}
|
||||
}
|
||||
|
||||
unset($order_detail);
|
||||
@@ -1098,7 +1105,11 @@ abstract class PaymentModuleCore extends Module
|
||||
$order = new Order((int)$order->id);
|
||||
|
||||
// Send an e-mail to customer (one order = one email)
|
||||
if ($id_order_state != Configuration::get('PS_OS_ERROR') && $id_order_state != Configuration::get('PS_OS_CANCELED') && $this->context->customer->id) {
|
||||
if ($id_order_state != Configuration::get('PS_OS_ERROR')
|
||||
&& $id_order_state != Configuration::get('PS_OS_CANCELED')
|
||||
&& $this->context->customer->id
|
||||
&& $send_mails
|
||||
) {
|
||||
$invoice = new Address($order->id_address_invoice);
|
||||
$delivery = new Address($order->id_address_delivery);
|
||||
$delivery_state = $delivery->id_state ? new State($delivery->id_state) : false;
|
||||
@@ -1327,9 +1338,7 @@ abstract class PaymentModuleCore extends Module
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($idHotel
|
||||
&& Validate::isLoadedObject($objHotel = new HotelBranchInformation($idHotel))
|
||||
) {
|
||||
if ($idHotel && Validate::isLoadedObject($objHotel = new HotelBranchInformation($idHotel))) {
|
||||
if (Configuration::get('PS_ORDER_CONF_MAIL_TO_HOTEL_MANAGER')){
|
||||
// If order currenct state is overbooking, the send overbooking email or send order confirmation email
|
||||
if ($isOverBookingStatus) {
|
||||
|
||||
@@ -5369,7 +5369,7 @@ class ProductCore extends ObjectModel
|
||||
|
||||
$currentPosition = $this->getPositionInCategory();
|
||||
|
||||
if ($currentPosition && isset($result[$currentPosition])) {
|
||||
if ($currentPosition !== false && isset($result[$currentPosition])) {
|
||||
$save = $result[$currentPosition];
|
||||
unset($result[$currentPosition]);
|
||||
array_splice($result, (int)$position, 0, $save);
|
||||
|
||||
@@ -3437,14 +3437,9 @@ exit;
|
||||
$post_data .= '&method=listing&action=install-modules';
|
||||
$post_data .= defined('_PS_HOST_MODE_') ? '-od' : '';
|
||||
break;
|
||||
case 'catalog-recommendation':
|
||||
$protocols[] = 'http';
|
||||
$post_data .= '&method=content&action=catalogRecommendation';
|
||||
$post_data .= defined('_PS_HOST_MODE_') ? '-od' : '';
|
||||
break;
|
||||
case 'dashboard-recommendation':
|
||||
$protocols[] = 'http';
|
||||
$post_data .= '&method=content&action=dashboardRecommendation';
|
||||
case 'recommendation':
|
||||
$post_data .= '&method=recommendation&controller=';
|
||||
$post_data .= (isset($params['controller']) ? $params['controller'] : Context::getContext()->controller->controller_name);
|
||||
$post_data .= defined('_PS_HOST_MODE_') ? '-od' : '';
|
||||
break;
|
||||
case 'check-version':
|
||||
|
||||
@@ -233,7 +233,7 @@ class ValidateCore
|
||||
*/
|
||||
public static function isPrice($price)
|
||||
{
|
||||
return preg_match('/^[0-9]{1,10}(\.[0-9]{1,9})?$/', $price);
|
||||
return preg_match('/^[0-9]{1,10}(\.[0-9]{1,})?$/', $price);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -244,7 +244,7 @@ class ValidateCore
|
||||
*/
|
||||
public static function isNegativePrice($price)
|
||||
{
|
||||
return preg_match('/^[-]?[0-9]{1,10}(\.[0-9]{1,9})?$/', $price);
|
||||
return preg_match('/^[-]?[0-9]{1,10}(\.[0-9]{1,})?$/', $price);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -364,7 +364,7 @@ class ValidateCore
|
||||
*/
|
||||
public static function isCityName($city)
|
||||
{
|
||||
return preg_match(Tools::cleanNonUnicodeSupport('/^[^!<>;?=+@#"°{}_$%]*$/u'), $city);
|
||||
return preg_match(Tools::cleanNonUnicodeSupport('/^\p{L}+[^!<>;?=+@#"°{}_$%]*$/u'), $city);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
2
classes/cache/Cache.php
vendored
2
classes/cache/Cache.php
vendored
@@ -502,7 +502,7 @@ abstract class CacheCore
|
||||
$this->_deleteMulti($invalidKeys);
|
||||
|
||||
if ($keyToKeep) {
|
||||
$this->sql_tables_cached[$table][$keyToKeep] = $toKeep ?? null;
|
||||
$this->sql_tables_cached[$table][$keyToKeep] = isset($toKeep) ? $toKeep : null;
|
||||
}
|
||||
}
|
||||
$this->adjustTableCacheSize = false;
|
||||
|
||||
@@ -409,6 +409,9 @@ class AdminControllerCore extends Controller
|
||||
const QLO_SEARCH_TYPE_MODULE = 7;
|
||||
const QLO_SEARCH_TYPE_HOTEL = 8;
|
||||
|
||||
/** @var string path for recomendation content */
|
||||
const RECOMMENDATION_CONTENT_FILE_PATH = '';
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
global $timer_start;
|
||||
@@ -838,13 +841,13 @@ class AdminControllerCore extends Controller
|
||||
$this->ensureListIdDefinition();
|
||||
|
||||
$prefix = $this->getCookieFilterPrefix();
|
||||
|
||||
$filters = array();
|
||||
if (isset($this->list_id)) {
|
||||
foreach ($_POST as $key => $value) {
|
||||
if ($value === '') {
|
||||
unset($this->context->cookie->{$prefix.$key});
|
||||
} elseif (stripos($key, $this->list_id.'Filter_') === 0) {
|
||||
$this->context->cookie->{$prefix.$key} = !is_array($value) ? $value : json_encode($value);
|
||||
$filters[$prefix.$key] = !is_array($value) ? $value : json_encode($value);
|
||||
} elseif (stripos($key, 'submitFilter') === 0) {
|
||||
$this->context->cookie->$key = !is_array($value) ? $value : json_encode($value);
|
||||
}
|
||||
@@ -852,7 +855,7 @@ class AdminControllerCore extends Controller
|
||||
|
||||
foreach ($_GET as $key => $value) {
|
||||
if (stripos($key, $this->list_id.'Filter_') === 0) {
|
||||
$this->context->cookie->{$prefix.$key} = !is_array($value) ? $value : json_encode($value);
|
||||
$filters[$prefix.$key] = !is_array($value) ? $value : json_encode($value);
|
||||
} elseif (stripos($key, 'submitFilter') === 0) {
|
||||
$this->context->cookie->$key = !is_array($value) ? $value : json_encode($value);
|
||||
}
|
||||
@@ -860,65 +863,36 @@ class AdminControllerCore extends Controller
|
||||
if ($value === '' || $value == $this->_defaultOrderBy) {
|
||||
unset($this->context->cookie->{$prefix.$key});
|
||||
} else {
|
||||
$this->context->cookie->{$prefix.$key} = $value;
|
||||
$filters[$prefix.$key] = $value;
|
||||
}
|
||||
} elseif (stripos($key, $this->list_id.'Orderway') === 0 && Validate::isOrderWay($value)) {
|
||||
if ($value === '' || $value == $this->_defaultOrderWay) {
|
||||
unset($this->context->cookie->{$prefix.$key});
|
||||
} else {
|
||||
$this->context->cookie->{$prefix.$key} = $value;
|
||||
$filters[$prefix.$key] = $value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$filters = $this->context->cookie->getFamily($prefix.$this->list_id.'Filter_');
|
||||
$definition = false;
|
||||
if (isset($this->className) && $this->className) {
|
||||
$definition = ObjectModel::getDefinition($this->className);
|
||||
if (empty($filters)) {
|
||||
$filters = $this->context->cookie->getFamily($prefix.$this->list_id.'Filter_');
|
||||
}
|
||||
|
||||
foreach ($filters as $key => $value) {
|
||||
/* Extracting filters from $_POST on key filter_ */
|
||||
if ($value != null && !strncmp($key, $prefix.$this->list_id.'Filter_', 7 + Tools::strlen($prefix.$this->list_id))) {
|
||||
$key_org = $key;
|
||||
$key = Tools::substr($key, 7 + Tools::strlen($prefix.$this->list_id));
|
||||
/* Table alias could be specified using a ! eg. alias!field */
|
||||
$tmp_tab = explode('!', $key);
|
||||
$filter = count($tmp_tab) > 1 ? $tmp_tab[1] : $tmp_tab[0];
|
||||
|
||||
if ($field = $this->filterToField($key, $filter)) {
|
||||
$type = (array_key_exists('filter_type', $field) ? $field['filter_type'] : (array_key_exists('type', $field) ? $field['type'] : false));
|
||||
if ((($type == 'date' || $type == 'datetime' || $type == 'range') || ($type == 'select' && (isset($field['multiple']) && $field['multiple'])))
|
||||
&& is_string($value)
|
||||
) {
|
||||
$value = json_decode($value, true);
|
||||
$key_org = $key;
|
||||
$key = Tools::substr($key, 7 + Tools::strlen($prefix.$this->list_id));
|
||||
/* Table alias could be specified using a ! eg. alias!field */
|
||||
$tmp_tab = explode('!', $key);
|
||||
$filter = count($tmp_tab) > 1 ? $tmp_tab[1] : $tmp_tab[0];
|
||||
if ($field = $this->filterToField($key, $filter)) {
|
||||
$type = (array_key_exists('filter_type', $field) ? $field['filter_type'] : (array_key_exists('type', $field) ? $field['type'] : false));
|
||||
if (($type == 'date' || $type == 'datetime' || $type == 'range')) {
|
||||
if (is_string($value)) {
|
||||
$filter_value = json_decode($value, true);
|
||||
}
|
||||
$key = isset($tmp_tab[1]) ? $tmp_tab[0].'.`'.$tmp_tab[1].'`' : '`'.$tmp_tab[0].'`';
|
||||
|
||||
// as in database 0 means position 1 in the renderlist
|
||||
if (isset($field['position']) && Validate::isInt($value)) {
|
||||
$value -= 1;
|
||||
}
|
||||
|
||||
// Assignment by reference
|
||||
if (array_key_exists('tmpTableFilter', $field)) {
|
||||
$sql_filter = & $this->_tmpTableFilter;
|
||||
} elseif (array_key_exists('havingFilter', $field)) {
|
||||
$sql_filter = & $this->_filterHaving;
|
||||
} else {
|
||||
$sql_filter = & $this->_filter;
|
||||
}
|
||||
|
||||
if (is_array($value)) {
|
||||
if ($type == 'select' && (isset($field['multiple']) && $field['multiple']) && isset($field['operator'])) {
|
||||
if ($field['operator'] == 'and') {
|
||||
$sql_filter .= ' AND '.pSQL($key).' IN ('.pSQL(implode(',', $value)).')';
|
||||
$this->_filterHaving .= ' AND COUNT(DISTINCT '.pSQL($key).') = '.(int) count($value);
|
||||
} elseif ($field['operator'] == 'or') {
|
||||
$sql_filter .= ' AND '.pSQL($key).' IN ('.pSQL(implode(',', $value)).')';
|
||||
}
|
||||
} elseif ($type == 'range') {
|
||||
if (is_array($filter_value)) {
|
||||
if ($type == 'range') {
|
||||
// set validation type
|
||||
if (isset($field['validation']) && $field['validation'] && method_exists('Validate', $field['validation'])) {
|
||||
$validation = $field['validation'];
|
||||
@@ -926,57 +900,120 @@ class AdminControllerCore extends Controller
|
||||
$validation = 'isUnsignedInt';
|
||||
}
|
||||
|
||||
if (isset($value[0]) && ($value[0] !== '' || $value[0] === 0)) {
|
||||
if (!Validate::$validation($value[0])) {
|
||||
$this->errors[] = Tools::displayError('The \'From\' value is invalid');
|
||||
} else {
|
||||
$sql_filter .= ' AND '.pSQL($key).' >= '.pSQL($value[0]);
|
||||
if (isset($filter_value[0]) && ($filter_value[0] !== '' || $filter_value[0] === 0)) {
|
||||
if (!Validate::$validation($filter_value[0])) {
|
||||
$this->errors[] = sprintf(Tools::displayError('The %s field \'From\' value is invalid'), $field['title']);
|
||||
}
|
||||
}
|
||||
if (isset($value[1]) && ($value[1] !== '' || $value[1] === 0)) {
|
||||
if (!Validate::$validation($value[1])) {
|
||||
$this->errors[] = Tools::displayError('The \'To\' value is invalid');
|
||||
} elseif ((isset($value[0]) && ($value[0] !== '' || $value[0] === 0)) && $value[0] > $value[1]) {
|
||||
$this->errors[] = Tools::displayError('The \'To\' value cannot be less than \'From\' value');
|
||||
} else {
|
||||
$sql_filter .= ' AND '.pSQL($key).' <= '.pSQL($value[1]);
|
||||
if (isset($filter_value[1]) && ($filter_value[1] !== '' || $filter_value[1] === 0)) {
|
||||
if (!Validate::$validation($filter_value[1])) {
|
||||
$this->errors[] = sprintf(Tools::displayError('The %s field \'To\' value is invalid'), $field['title']);
|
||||
} elseif ((isset($filter_value[0]) && ($filter_value[0] !== '' || $filter_value[0] === 0)) && $filter_value[0] > $filter_value[1]) {
|
||||
$this->errors[] = sprintf(Tools::displayError('The %s field \'To\' value cannot be less than \'From\' value'), $field['title']);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (isset($value[0]) && !empty($value[0])) {
|
||||
if (!Validate::isDate($value[0])) {
|
||||
$this->errors[] = Tools::displayError('The \'From\' date format is invalid (YYYY-MM-DD)');
|
||||
} else {
|
||||
$sql_filter .= ' AND '.pSQL($key).' >= \''.pSQL(Tools::dateFrom($value[0])).'\'';
|
||||
if (isset($filter_value[0]) && !empty($filter_value[0])) {
|
||||
if (!Validate::isDate($filter_value[0])) {
|
||||
$this->errors[] = sprintf(Tools::displayError('The %s field \'From\' date format is invalid (YYYY-MM-DD)'), $field['title']);
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($value[1]) && !empty($value[1])) {
|
||||
if (!Validate::isDate($value[1])) {
|
||||
$this->errors[] = Tools::displayError('The \'To\' date format is invalid (YYYY-MM-DD)');
|
||||
} elseif (isset($value[0]) && !empty($value[0]) && strtotime($value[0]) > strtotime($value[1])) {
|
||||
$this->errors[] = Tools::displayError('The \'To\' date cannot be earlier than \'From\' date');
|
||||
} else {
|
||||
$sql_filter .= ' AND '.pSQL($key).' <= \''.pSQL(Tools::dateTo($value[1])).'\'';
|
||||
if (isset($filter_value[1]) && !empty($filter_value[1])) {
|
||||
if (!Validate::isDate($filter_value[1])) {
|
||||
$this->errors[] = sprintf(Tools::displayError('The %s field \'To\' date format is invalid (YYYY-MM-DD)'), $field['title']);
|
||||
} elseif (isset($filter_value[0]) && !empty($filter_value[0]) && strtotime($filter_value[0]) > strtotime($filter_value[1])) {
|
||||
$this->errors[] = sprintf(Tools::displayError('The %s field \'To\' date cannot be earlier than \'From\' date'), $field['title']);
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$sql_filter .= ' AND ';
|
||||
$check_key = ($key == $this->identifier || $key == '`'.$this->identifier.'`');
|
||||
$alias = ($definition && !empty($definition['fields'][$filter]['shop'])) ? 'sa' : 'a';
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($type == 'int' || $type == 'bool') {
|
||||
$sql_filter .= (($check_key || $key == '`active`') ? $alias.'.' : '').pSQL($key).' = '.(int)$value.' ';
|
||||
} elseif ($type == 'decimal') {
|
||||
$sql_filter .= ($check_key ? $alias.'.' : '').pSQL($key).' = '.(float)$value.' ';
|
||||
} elseif ($type == 'select') {
|
||||
$sql_filter .= ($check_key ? $alias.'.' : '').pSQL($key).' = \''.pSQL($value).'\' ';
|
||||
} elseif ($type == 'price') {
|
||||
$value = (float)str_replace(',', '.', $value);
|
||||
$sql_filter .= ($check_key ? $alias.'.' : '').pSQL($key).' = '.pSQL(trim($value)).' ';
|
||||
} else {
|
||||
$sql_filter .= ($check_key ? $alias.'.' : '').pSQL($key).' LIKE \'%'.pSQL(trim($value)).'%\' ';
|
||||
if (empty($this->errors)) {
|
||||
$definition = false;
|
||||
if (isset($this->className) && $this->className) {
|
||||
$definition = ObjectModel::getDefinition($this->className);
|
||||
}
|
||||
if ($filters) {
|
||||
foreach ($filters as $key => $value) {
|
||||
$this->context->cookie->$key = $value;
|
||||
|
||||
/* Extracting filters from $_POST on key filter_ */
|
||||
if ($value != null && !strncmp($key, $prefix.$this->list_id.'Filter_', 7 + Tools::strlen($prefix.$this->list_id))) {
|
||||
$key_org = $key;
|
||||
$key = Tools::substr($key, 7 + Tools::strlen($prefix.$this->list_id));
|
||||
/* Table alias could be specified using a ! eg. alias!field */
|
||||
$tmp_tab = explode('!', $key);
|
||||
$filter = count($tmp_tab) > 1 ? $tmp_tab[1] : $tmp_tab[0];
|
||||
|
||||
if ($field = $this->filterToField($key, $filter)) {
|
||||
$type = (array_key_exists('filter_type', $field) ? $field['filter_type'] : (array_key_exists('type', $field) ? $field['type'] : false));
|
||||
if ((($type == 'date' || $type == 'datetime' || $type == 'range') || ($type == 'select' && (isset($field['multiple']) && $field['multiple'])))
|
||||
&& is_string($value)
|
||||
) {
|
||||
$value = json_decode($value, true);
|
||||
}
|
||||
$key = isset($tmp_tab[1]) ? $tmp_tab[0].'.`'.$tmp_tab[1].'`' : '`'.$tmp_tab[0].'`';
|
||||
|
||||
// as in database 0 means position 1 in the renderlist
|
||||
if (isset($field['position']) && Validate::isInt($value)) {
|
||||
$value -= 1;
|
||||
}
|
||||
|
||||
// Assignment by reference
|
||||
if (array_key_exists('tmpTableFilter', $field)) {
|
||||
$sql_filter = & $this->_tmpTableFilter;
|
||||
} elseif (array_key_exists('havingFilter', $field)) {
|
||||
$sql_filter = & $this->_filterHaving;
|
||||
} else {
|
||||
$sql_filter = & $this->_filter;
|
||||
}
|
||||
|
||||
if (is_array($value)) {
|
||||
if ($type == 'select' && (isset($field['multiple']) && $field['multiple']) && isset($field['operator'])) {
|
||||
if ($field['operator'] == 'and') {
|
||||
$sql_filter .= ' AND '.pSQL($key).' IN ('.pSQL(implode(',', $value)).')';
|
||||
$this->_filterHaving .= ' AND COUNT(DISTINCT '.pSQL($key).') = '.(int) count($value);
|
||||
} elseif ($field['operator'] == 'or') {
|
||||
$sql_filter .= ' AND '.pSQL($key).' IN ('.pSQL(implode(',', $value)).')';
|
||||
}
|
||||
} elseif ($type == 'range') {
|
||||
|
||||
if (isset($value[0]) && ($value[0] !== '' || $value[0] === 0)) {
|
||||
$sql_filter .= ' AND '.pSQL($key).' >= '.pSQL($value[0]);
|
||||
}
|
||||
if (isset($value[1]) && ($value[1] !== '' || $value[1] === 0)) {
|
||||
$sql_filter .= ' AND '.pSQL($key).' <= '.pSQL($value[1]);
|
||||
}
|
||||
} else {
|
||||
if (isset($value[0]) && !empty($value[0])) {
|
||||
$sql_filter .= ' AND '.pSQL($key).' >= \''.pSQL(Tools::dateFrom($value[0])).'\'';
|
||||
}
|
||||
if (isset($value[1]) && !empty($value[1])) {
|
||||
$sql_filter .= ' AND '.pSQL($key).' <= \''.pSQL(Tools::dateTo($value[1])).'\'';
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$sql_filter .= ' AND ';
|
||||
$check_key = ($key == $this->identifier || $key == '`'.$this->identifier.'`');
|
||||
$alias = ($definition && !empty($definition['fields'][$filter]['shop'])) ? 'sa' : 'a';
|
||||
|
||||
if ($type == 'int' || $type == 'bool') {
|
||||
$sql_filter .= (($check_key || $key == '`active`') ? $alias.'.' : '').pSQL($key).' = '.(int)$value.' ';
|
||||
} elseif ($type == 'decimal') {
|
||||
$sql_filter .= ($check_key ? $alias.'.' : '').pSQL($key).' = '.(float)$value.' ';
|
||||
} elseif ($type == 'select') {
|
||||
$sql_filter .= ($check_key ? $alias.'.' : '').pSQL($key).' = \''.pSQL($value).'\' ';
|
||||
} elseif ($type == 'price') {
|
||||
$value = (float)str_replace(',', '.', $value);
|
||||
$sql_filter .= ($check_key ? $alias.'.' : '').pSQL($key).' = '.pSQL(trim($value)).' ';
|
||||
} else {
|
||||
$sql_filter .= ($check_key ? $alias.'.' : '').pSQL($key).' LIKE \'%'.pSQL(trim($value)).'%\' ';
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -986,7 +1023,7 @@ class AdminControllerCore extends Controller
|
||||
|
||||
public function processListVisibility()
|
||||
{
|
||||
$listFieldsVisibility = Tools::getValue('list_fields_visibility');
|
||||
$listFieldsVisibility = Tools::getValue('list_fields_visibility', array()); // To set optional list empty in case none is selected
|
||||
$controller = 'list_visibility_'.$this->context->controller->className;
|
||||
$this->context->cookie->$controller = json_encode($listFieldsVisibility);
|
||||
|
||||
@@ -1039,7 +1076,7 @@ class AdminControllerCore extends Controller
|
||||
if ($this->filter && $this->action != 'reset_filters') {
|
||||
$this->processFilter();
|
||||
}
|
||||
if (isset($_POST) && count($_POST) && (int)Tools::getValue('submitFilter'.$this->list_id) || Tools::isSubmit('submitReset'.$this->list_id)) {
|
||||
if (empty($this->errors) && isset($_POST) && count($_POST) && (int)Tools::getValue('submitFilter'.$this->list_id) || Tools::isSubmit('submitReset'.$this->list_id)) {
|
||||
$this->setRedirectAfter(self::$currentIndex.'&token='.$this->token.(Tools::isSubmit('submitFilter'.$this->list_id) ? '&submitFilter'.$this->list_id.'='.(int)Tools::getValue('submitFilter'.$this->list_id) : '').(isset($_GET['id_'.$this->list_id]) ? '&id_'.$this->list_id.'='.(int)$_GET['id_'.$this->list_id] : ''));
|
||||
}
|
||||
|
||||
@@ -2310,6 +2347,7 @@ class AdminControllerCore extends Controller
|
||||
public function ajaxProcessRefreshModuleList($force_reload_cache = false)
|
||||
{
|
||||
$this->status = Module::refreshModuleList($force_reload_cache);
|
||||
$this->ajaxDie(json_encode(array('status' => $this->status)));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -3989,17 +4027,65 @@ class AdminControllerCore extends Controller
|
||||
public function ajaxProcessGetRecommendationContent()
|
||||
{
|
||||
$response = array('success' => false);
|
||||
if (isset($this->context->cookie->{$this->controller_name.'_closed'}) && $this->context->cookie->{$this->controller_name.'_closed'}) {
|
||||
$response['success'] = true;
|
||||
} else {
|
||||
if (method_exists($this, 'getRecommendationContent')) {
|
||||
if ($content = $this->getRecommendationContent()) {
|
||||
$response['success'] = true;
|
||||
$response['content'] = $content;
|
||||
if ($this->context->controller->getRecommendationFilePath()) {
|
||||
$response = $this->getRecommendationContent();
|
||||
}
|
||||
$this->context->cookie->write();
|
||||
$this->ajaxDie(json_encode($response));
|
||||
}
|
||||
|
||||
public function getRecommendationContent()
|
||||
{
|
||||
$content = array(
|
||||
'success' => false,
|
||||
'cache' => true,
|
||||
'html' => ''
|
||||
);
|
||||
|
||||
if ($recommendationContent = $this->updateRecommendationContent()) {
|
||||
$content['cache'] = false;
|
||||
}
|
||||
if (file_exists(_PS_ROOT_DIR_.$this->context->controller->getRecommendationFilePath())) {
|
||||
$content['success'] = true;
|
||||
if (!isset($this->context->cookie->{$this->controller_name.'_closed'}) || !$this->context->cookie->{$this->controller_name.'_closed'}) {
|
||||
$content['html'] = file_get_contents(_PS_ROOT_DIR_.$this->context->controller->getRecommendationFilePath());
|
||||
}
|
||||
}
|
||||
|
||||
return $content;
|
||||
}
|
||||
|
||||
public function updateRecommendationContent()
|
||||
{
|
||||
if (!Tools::isFresh($this->context->controller->getRecommendationFilePath(), _TIME_1_DAY_, false)) {
|
||||
if ($recommendationContent = Tools::addonsRequest(
|
||||
'recommendation',
|
||||
array('controller' => $this->context->controller->controller_name)
|
||||
)) {
|
||||
$recommendationContent = json_decode($recommendationContent, true);
|
||||
if (!isset($this->context->cookie->{$this->context->controller->controller_name.'_key'})) {
|
||||
$this->context->cookie->{$this->context->controller->controller_name.'_key'} = '';
|
||||
}
|
||||
if ($this->context->cookie->{$this->context->controller->controller_name.'_key'} != $recommendationContent['key']) {
|
||||
unset($this->context->cookie->{$this->context->controller->controller_name.'_closed'});
|
||||
}
|
||||
$this->context->cookie->{$this->context->controller->controller_name.'_key'} = $recommendationContent['key'];
|
||||
if (isset($recommendationContent['success']) && $recommendationContent['success']) {
|
||||
@file_put_contents(
|
||||
_PS_ROOT_DIR_.$this->context->controller->getRecommendationFilePath(),
|
||||
$recommendationContent['html']
|
||||
);
|
||||
} elseif (file_exists(_PS_ROOT_DIR_.$this->context->controller->getRecommendationFilePath())) {
|
||||
unlink(_PS_ROOT_DIR_.$this->context->controller->getRecommendationFilePath());
|
||||
}
|
||||
return $recommendationContent;
|
||||
} else {
|
||||
if (file_exists(_PS_ROOT_DIR_.$this->context->controller->getRecommendationFilePath())) {
|
||||
unlink(_PS_ROOT_DIR_.$this->context->controller->getRecommendationFilePath());
|
||||
}
|
||||
}
|
||||
}
|
||||
$this->ajaxDie(json_encode($response));
|
||||
return false;
|
||||
}
|
||||
|
||||
public function ajaxProcessRecommendationClosed()
|
||||
@@ -4009,6 +4095,11 @@ class AdminControllerCore extends Controller
|
||||
$this->ajaxDie(json_encode($response));
|
||||
}
|
||||
|
||||
public function getRecommendationFilePath()
|
||||
{
|
||||
return static::RECOMMENDATION_CONTENT_FILE_PATH;
|
||||
}
|
||||
|
||||
/**
|
||||
* Save list visible columns
|
||||
*
|
||||
|
||||
@@ -776,6 +776,7 @@ class FrontControllerCore extends Controller
|
||||
}
|
||||
|
||||
if (Tools::isSubmit('SubmitLogin')
|
||||
&& !Configuration::get('PS_SHOP_ENABLE')
|
||||
&& Configuration::get('PS_ALLOW_EMP')
|
||||
&& !Context::getContext()->cookie->enable_maintenance_view
|
||||
) {
|
||||
@@ -812,56 +813,102 @@ class FrontControllerCore extends Controller
|
||||
|
||||
protected function processLogin($email, $passwd)
|
||||
{
|
||||
$result = false;
|
||||
$objMaintenanceAccess = new MaintenanceAccess();
|
||||
$remoteIpAddress = Tools::getRemoteAddr();
|
||||
$maxAttempts = Configuration::get('PS_ALLOW_EMP_MAX_ATTEMPTS');
|
||||
|
||||
/* Check fields validity */
|
||||
if (empty($email)) {
|
||||
$this->errors[] = Tools::displayError('Email is empty.');
|
||||
} elseif (!Validate::isEmail($email)) {
|
||||
$this->errors[] = Tools::displayError('Invalid email address.');
|
||||
}
|
||||
if ($maxAttempts) {
|
||||
$objMaintenanceAccess = new MaintenanceAccess();
|
||||
$attemptsCount = $objMaintenanceAccess->getFailedAttemptsCount($email, $remoteIpAddress); // does not include the current one
|
||||
if ($attemptsCount >= $maxAttempts) {
|
||||
if ($lastAttempt = $objMaintenanceAccess->getLastAttempt($email, $remoteIpAddress)) {
|
||||
$minutesElapsed = (int) ((time() - strtotime($lastAttempt['date_add'])) / 60);
|
||||
|
||||
if (empty($passwd)) {
|
||||
$this->errors[] = Tools::displayError('The password field is blank.');
|
||||
} elseif (!Validate::isPasswd($passwd)) {
|
||||
$this->errors[] = Tools::displayError('Invalid password.');
|
||||
}
|
||||
|
||||
if ($objMaintenanceAccess->checkLimit($email)) {
|
||||
$this->errors[] =Tools::displayError('You have exceeded the limit of login attempts, please try after some time');
|
||||
if ($minutesElapsed <= MaintenanceAccess::LOGIN_ATTEMPTS_WINDOW) {
|
||||
$minutesLeft = MaintenanceAccess::LOGIN_ATTEMPTS_WINDOW - $minutesElapsed;
|
||||
if ($minutesLeft > 1) {
|
||||
$this->errors[] = Tools::displayError(sprintf('You have reached the limit of login attempts, please try after %d minutes.', $minutesLeft));
|
||||
} elseif ($minutesLeft == 1) {
|
||||
$this->errors[] = Tools::displayError(sprintf('You have reached the limit of login attempts, please try after %d minute.', $minutesLeft));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!count($this->errors)) {
|
||||
// Find employee
|
||||
$this->context->employee = new Employee();
|
||||
$is_employee_loaded = $this->context->employee->getByEmail($email, $passwd);
|
||||
$employee_associated_shop = $this->context->employee->getAssociatedShops();
|
||||
if (!$is_employee_loaded) {
|
||||
$this->errors[] = Tools::displayError('The Employee does not exist, or the password provided is incorrect.');
|
||||
$this->context->employee->logout();
|
||||
} elseif (empty($employee_associated_shop) && !$this->context->employee->isSuperAdmin()) {
|
||||
$this->errors[] = Tools::displayError('This employee does not manage the shop anymore (Either the shop has been deleted or permissions have been revoked).');
|
||||
$this->context->employee->logout();
|
||||
} else {
|
||||
// Update cookie
|
||||
$cookie = Context::getContext()->cookie;
|
||||
$cookie->enable_maintenance_view = $this->context->employee->id;
|
||||
$cookie->remote_addr = ip2long(Tools::getRemoteAddr());
|
||||
$cookie->write();
|
||||
if (empty($email)) {
|
||||
$this->errors[] = Tools::displayError('The Email address field is blank.');
|
||||
} elseif (!Validate::isEmail($email)) {
|
||||
$this->errors[] = Tools::displayError('Invalid Email address.');
|
||||
}
|
||||
if (count($this->errors)) {
|
||||
$this->context->smarty->assign('errors', $this->errors);
|
||||
$objMaintenanceAccess->email = $email;
|
||||
$objMaintenanceAccess->ip_address = Tools::getRemoteAddr();
|
||||
$objMaintenanceAccess->save();
|
||||
|
||||
if (empty($passwd)) {
|
||||
$this->errors[] = Tools::displayError('The Password field is blank.');
|
||||
} elseif (!Validate::isPasswd($passwd)) {
|
||||
$this->errors[] = Tools::displayError('Invalid Password.');
|
||||
}
|
||||
|
||||
if (!count($this->errors)) {
|
||||
// Find employee
|
||||
$this->context->employee = new Employee();
|
||||
$is_employee_loaded = $this->context->employee->getByEmail($email, $passwd);
|
||||
$employee_associated_shop = $this->context->employee->getAssociatedShops();
|
||||
|
||||
if (!$is_employee_loaded) {
|
||||
$this->errors[] = Tools::displayError('The employee does not exist, or the password provided is incorrect.');
|
||||
$this->context->employee->logout();
|
||||
} elseif (empty($employee_associated_shop) && !$this->context->employee->isSuperAdmin()) {
|
||||
$this->errors[] = Tools::displayError('This employee does not manage the website anymore (either the website has been deleted or permissions have been revoked).');
|
||||
$this->context->employee->logout();
|
||||
} else {
|
||||
// Login successful
|
||||
// Update cookie
|
||||
$cookie = Context::getContext()->cookie;
|
||||
$cookie->enable_maintenance_view = $this->context->employee->id;
|
||||
$cookie->remote_addr = ip2long($remoteIpAddress);
|
||||
$cookie->write();
|
||||
|
||||
// Reset attempts count on successful login
|
||||
$objMaintenanceAccess->removeFailedAttempts($email, $remoteIpAddress);
|
||||
}
|
||||
|
||||
if (count($this->errors)) {
|
||||
// Save only if attempts limit is set
|
||||
if ($maxAttempts) {
|
||||
$objMaintenanceAccess = new MaintenanceAccess();
|
||||
$objMaintenanceAccess->email = $email;
|
||||
$objMaintenanceAccess->ip_address = $remoteIpAddress;
|
||||
$objMaintenanceAccess->save();
|
||||
|
||||
if ($attemptsCount < $maxAttempts) {
|
||||
$attemptsLeft = $maxAttempts - $attemptsCount - 1;
|
||||
|
||||
if ($attemptsLeft > 0) {
|
||||
if ($attemptsLeft > 1) {
|
||||
$this->errors[] = Tools::displayError(sprintf('%d attempts left.', ($maxAttempts - $attemptsCount - 1)));
|
||||
} else {
|
||||
$this->errors[] = Tools::displayError(sprintf('%d attempt left.', ($maxAttempts - $attemptsCount - 1)));
|
||||
}
|
||||
} else {
|
||||
if (MaintenanceAccess::LOGIN_ATTEMPTS_WINDOW > 1) {
|
||||
$this->errors[] = Tools::displayError(sprintf('You have reached the limit of login attempts, please try after %d minutes.', MaintenanceAccess::LOGIN_ATTEMPTS_WINDOW));
|
||||
} else {
|
||||
$this->errors[] = Tools::displayError(sprintf('You have reached the limit of login attempts, please try after %d minute.', MaintenanceAccess::LOGIN_ATTEMPTS_WINDOW));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$this->context->smarty->assign('errors', $this->errors);
|
||||
} else {
|
||||
Tools::redirect('index.php');
|
||||
}
|
||||
} else {
|
||||
Tools::redirect('index.php');
|
||||
$this->context->smarty->assign('errors', $this->errors);
|
||||
}
|
||||
} else {
|
||||
$this->context->smarty->assign('errors', $this->errors);
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -337,7 +337,7 @@ class HelperListCore extends Helper
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($this->fields_list as $key => $params) {
|
||||
foreach ($this->fields_list as $key => $field) {
|
||||
if (isset($field['optional']) && $field['optional']) {
|
||||
$this->fields_optional[$key] = $field;
|
||||
}
|
||||
@@ -733,8 +733,8 @@ class HelperListCore extends Helper
|
||||
}
|
||||
if (isset($field['optional']) && $field['optional']) {
|
||||
$this->fields_optional[$key] = $field;
|
||||
if ((empty($list_visibility) && isset($field['visible_default']) && $field['visible_default'])
|
||||
|| $list_visibility && in_array($key , $list_visibility)
|
||||
if ((!is_array($list_visibility) && isset($field['visible_default']) && $field['visible_default'])
|
||||
|| ($list_visibility && in_array($key , $list_visibility))
|
||||
) {
|
||||
$this->fields_optional[$key]['selected'] = true;
|
||||
}
|
||||
|
||||
@@ -382,6 +382,23 @@ class HelperTreeHotelsCore extends TreeCore
|
||||
$this->addAction($expand_all);
|
||||
|
||||
if ($this->useCheckBox()) {
|
||||
if ($this->useBulkActions()) {
|
||||
$check_all = new TreeToolbarLink(
|
||||
'Check All',
|
||||
'#',
|
||||
'checkAllAssociatedHotels($(\'#'.$this->getId().'\'));return false;',
|
||||
'icon-check-sign');
|
||||
$check_all->setAttribute('id', 'check-all-'.$this->getId());
|
||||
$uncheck_all = new TreeToolbarLink(
|
||||
'Uncheck All',
|
||||
'#',
|
||||
'uncheckAllAssociatedHotels($(\'#'.$this->getId().'\'));return false;',
|
||||
'icon-check-empty');
|
||||
$uncheck_all->setAttribute('id', 'uncheck-all-'.$this->getId());
|
||||
$this->addAction($check_all);
|
||||
$this->addAction($uncheck_all);
|
||||
}
|
||||
|
||||
$this->setNodeFolderTemplate('tree_node_hotel_folder_checkbox.tpl');
|
||||
$this->setNodeItemTemplate('tree_node_hotel_item_checkbox.tpl');
|
||||
$this->setAttribute('use_checkbox', $this->useCheckBox());
|
||||
|
||||
@@ -77,6 +77,7 @@ abstract class ModuleGraphCore extends Module
|
||||
if (is_callable(array($this, 'setDayValues'))) {
|
||||
$this->setDayValues($layers);
|
||||
}
|
||||
$this->_titles['x'][] = $this->l('Time');
|
||||
}
|
||||
// If the granularity is inferior to 1 month
|
||||
// @TODO : change to manage 28 to 31 days
|
||||
@@ -110,6 +111,7 @@ abstract class ModuleGraphCore extends Module
|
||||
if (is_callable(array($this, 'setMonthValues'))) {
|
||||
$this->setMonthValues($layers);
|
||||
}
|
||||
$this->_titles['x'][] = $this->l('Date');
|
||||
}
|
||||
// If the granularity is less than 1 year
|
||||
elseif (strtotime('-1 year', strtotime($this->_employee->stats_date_to)) < strtotime($this->_employee->stats_date_from)) {
|
||||
@@ -141,6 +143,7 @@ abstract class ModuleGraphCore extends Module
|
||||
if (is_callable(array($this, 'setYearValues'))) {
|
||||
$this->setYearValues($layers);
|
||||
}
|
||||
$this->_titles['x'][] = $this->l('Month');
|
||||
}
|
||||
// If the granularity is greater than 1 year
|
||||
else {
|
||||
@@ -163,6 +166,7 @@ abstract class ModuleGraphCore extends Module
|
||||
if (is_callable(array($this, 'setAllTimeValues'))) {
|
||||
$this->setAllTimeValues($layers);
|
||||
}
|
||||
$this->_titles['x'][] = $this->l('Year');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -210,7 +214,7 @@ abstract class ModuleGraphCore extends Module
|
||||
if (isset($this->_values[$key])) {
|
||||
// We don't want strings to be divided. Example: product name
|
||||
if (is_numeric($this->_values[$key])) {
|
||||
$this->_csv .= $this->_values[$key] / (($datas['type'] == 'pie') ? $total : 1);
|
||||
$this->_csv .= $this->_values[$key] * 100 / (($datas['type'] == 'pie') ? $total : 1) . '%';
|
||||
} else {
|
||||
$this->_csv .= $this->_values[$key];
|
||||
}
|
||||
@@ -220,7 +224,7 @@ abstract class ModuleGraphCore extends Module
|
||||
} else {
|
||||
// We don't want strings to be divided. Example: product name
|
||||
if (is_numeric($this->_values[$i][$key])) {
|
||||
$this->_csv .= $this->_values[$i][$key] / (($datas['type'] == 'pie') ? $total : 1);
|
||||
$this->_csv .= $this->_values[$i][$key] * 100 / (($datas['type'] == 'pie') ? $total : 1) . '%';
|
||||
} else {
|
||||
$this->_csv .= $this->_values[$i][$key];
|
||||
}
|
||||
|
||||
@@ -153,7 +153,10 @@ abstract class ModuleGridCore extends Module
|
||||
protected function csvExport($datas)
|
||||
{
|
||||
$this->_sort = $datas['defaultSortColumn'];
|
||||
$this->setLang(Context::getContext()->language->id);
|
||||
$context = Context::getContext();
|
||||
$this->setLang($context->language->id);
|
||||
$this->setEmployee($context->employee->id);
|
||||
|
||||
if (isset($datas['option'])) {
|
||||
$this->setOption($datas['option'], $layers);
|
||||
}
|
||||
|
||||
@@ -797,8 +797,9 @@ class OrderCore extends ObjectModel
|
||||
|
||||
public function getTaxesAverageUsed()
|
||||
{
|
||||
// @todo should use order table to get tax average
|
||||
return Cart::getTaxesAverageUsed((int)$this->id_cart);
|
||||
$cart = new Cart((int) $this->id_cart);
|
||||
|
||||
return $cart->getAverageProductsTaxRate() * 100;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1804,7 +1805,7 @@ class OrderCore extends ObjectModel
|
||||
SELECT opd.`amount` as `real_paid_amount`, opd.*, op.*
|
||||
FROM `'._DB_PREFIX_.'order_payment_detail` opd
|
||||
INNER JOIN `'._DB_PREFIX_.'order_payment` op ON (opd.`id_order_payment` = op.`id_order_payment`)
|
||||
WHERE `id_order` = '.$this->id
|
||||
WHERE `id_order` = '.(int) $this->id
|
||||
);
|
||||
}
|
||||
|
||||
@@ -2630,9 +2631,12 @@ class OrderCore extends ObjectModel
|
||||
* Order::ORDER_COMPLETE_REFUND_FLAG for complete refunded and
|
||||
* Order::ORDER_COMPLETE_CANCELLATION_FLAG for completely cancelled and
|
||||
* Order::ORDER_COMPLETE_CANCELLATION_OR_REFUND_REQUEST_FLAG for all rooms are either cancelled or requested for refunded
|
||||
*
|
||||
* @param integer includeCheckIn = 1: If you want to get result for rooms that are refunded or cancelled Or Checkin/Checkout. Send $action = 0
|
||||
*
|
||||
* @return boolean: true if order has been completely refunded as per requested parameters or false
|
||||
*/
|
||||
public function hasCompletelyRefunded($action = 0)
|
||||
public function hasCompletelyRefunded($action = 0, $includeCheckIn = 0)
|
||||
{
|
||||
$objHotelBooking = new HotelBookingdetail();
|
||||
if ($orderBookings = $objHotelBooking->getOrderCurrentDataByOrderId($this->id)) {
|
||||
@@ -2657,11 +2661,18 @@ class OrderCore extends ObjectModel
|
||||
} elseif ($action == Order::ORDER_COMPLETE_CANCELLATION_OR_REFUND_REQUEST_FLAG) {
|
||||
foreach ($orderBookings as $booking) {
|
||||
if (!$booking['is_refunded']) {
|
||||
if (!OrderReturn::getOrdersReturnDetail($this->id, 0, $booking['id'])) {
|
||||
// If booking refund request is created and request is completed but booking is not refunded then return false
|
||||
if ($bookingRefundDetail = OrderReturn::getOrdersReturnDetail($this->id, 0, $booking['id'])) {
|
||||
$bookingRefundDetail = reset($bookingRefundDetail);
|
||||
if ($bookingRefundDetail['refunded']) {
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
// Default process to check if order is fully refunded or cancelled or not
|
||||
} else {
|
||||
@@ -2669,6 +2680,16 @@ class OrderCore extends ObjectModel
|
||||
$uniqueRefundedBookings = array_unique(array_column($orderBookings, 'is_refunded'));
|
||||
if (count($uniqueRefundedBookings) == 1 && $uniqueRefundedBookings[0] == 1) {
|
||||
return true;
|
||||
} elseif ($includeCheckIn) {
|
||||
foreach ($orderBookings as $booking) {
|
||||
if ($booking['is_refunded'] == 0
|
||||
&& !OrderReturn::getOrdersReturnDetail($this->id, 0, $booking['id'])
|
||||
&& $booking['id_status'] == HotelBookingDetail::STATUS_ALLOTED
|
||||
) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2687,4 +2708,138 @@ class OrderCore extends ObjectModel
|
||||
{
|
||||
$this->transaction_id = $transactionId;
|
||||
}
|
||||
|
||||
/**
|
||||
* Validate and change order status
|
||||
* @return array of status, errors, has_mail_error(if order status is changes but mail error occurs while sending mail)
|
||||
*/
|
||||
public function ChangeOrderStatus()
|
||||
{
|
||||
$result = array();
|
||||
$result['status'] = false;
|
||||
$result['has_mail_error'] = false;
|
||||
$result['errors'] = array();
|
||||
$objNewOrderState = new OrderState(Tools::getValue('id_order_state'));
|
||||
if (!Validate::isLoadedObject($objNewOrderState)) {
|
||||
$result['errors'][] = Tools::displayError('The new order status is invalid.');
|
||||
} else {
|
||||
$objHotelBooking = new HotelBookingDetail();
|
||||
$objCurrentOrderState = $this->getCurrentOrderState();
|
||||
|
||||
if ($objCurrentOrderState->id == Configuration::get('PS_OS_REFUND')) {
|
||||
$result['errors'][] = Tools::displayError('Order status can not be changed once order status is set to Refunded.');
|
||||
} elseif ($objCurrentOrderState->id == Configuration::get('PS_OS_CANCELED')) {
|
||||
$result['errors'][] = Tools::displayError('Order status can not be changed once order status is set to Cancelled.');
|
||||
} elseif (in_array($objNewOrderState->id, array (Configuration::get('PS_OS_OVERBOOKING_PAID'), Configuration::get('PS_OS_OVERBOOKING_UNPAID'), Configuration::get('PS_OS_OVERBOOKING_PARTIAL_PAID')))) {
|
||||
if (!$objHotelBooking->getOverbookedRooms($this->id)) {
|
||||
$result['errors'][] = Tools::displayError('Order status can not be changed to any overbooking status as there are no overbooked rooms in the order.');
|
||||
}
|
||||
} elseif ($objNewOrderState->id == Configuration::get('PS_OS_REFUND')
|
||||
&& !$this->hasCompletelyRefunded(Order::ORDER_COMPLETE_REFUND_FLAG)
|
||||
) {
|
||||
$result['errors'][] = Tools::displayError('Order status can not be set to Refunded until all bookings in the order are completely refunded.');
|
||||
} elseif ($objNewOrderState->id == Configuration::get('PS_OS_CANCELED')
|
||||
&& !$this->hasCompletelyRefunded(Order::ORDER_COMPLETE_CANCELLATION_FLAG)
|
||||
) {
|
||||
$result['errors'][] = Tools::displayError('Order status can not be set to Cancelled until all bookings in the order are cancelled.');
|
||||
} elseif ($objCurrentOrderState->id == Configuration::get('PS_OS_ERROR') && !($objNewOrderState->id == Configuration::get('PS_OS_ERROR'))) {
|
||||
// All rooms must be available before changing status from Payment Error to Other status in which rooms are getting blocked again
|
||||
if ($orderBookings = $objHotelBooking->getOrderCurrentDataByOrderId($this->id)) {
|
||||
foreach ($orderBookings as $orderBooking) {
|
||||
// If booking is refunded then no need to check inventory
|
||||
if ($bookingRefundDetail = OrderReturn::getOrdersReturnDetail($this->id, 0, $orderBooking['id'])) {
|
||||
$bookingRefundDetail = reset($bookingRefundDetail);
|
||||
}
|
||||
|
||||
// $bookingRefundDetail['id_customization'] is 1 for only refunded request completed and refunded bookings
|
||||
if (($bookingRefundDetail && $bookingRefundDetail['refunded'] && $orderBooking['is_refunded'] && $bookingRefundDetail['id_customization'])
|
||||
|| ($orderBooking['is_cancelled'] && $orderBooking['is_refunded'])
|
||||
) {
|
||||
continue;
|
||||
} else {
|
||||
// if inventory is available for that booking
|
||||
$bookingParams = array(
|
||||
'date_from' => $orderBooking['date_from'],
|
||||
'date_to' => $orderBooking['date_to'],
|
||||
'hotel_id' => $orderBooking['id_hotel'],
|
||||
'id_room_type' => $orderBooking['id_product'],
|
||||
'only_search_data' => 1
|
||||
);
|
||||
|
||||
$objHotelBookingDetail = new HotelBookingDetail($orderBooking['id']);
|
||||
if ($searchRoomsInfo = $objHotelBooking->getBookingData($bookingParams)) {
|
||||
if (isset($searchRoomsInfo['rm_data'][$orderBooking['id_product']]['data']['available'])
|
||||
&& $searchRoomsInfo['rm_data'][$orderBooking['id_product']]['data']['available']
|
||||
) {
|
||||
$availableRoomsInfo = $searchRoomsInfo['rm_data'][$orderBooking['id_product']]['data']['available'];
|
||||
if ($roomIdsAvailable = array_column($availableRoomsInfo, 'id_room')) {
|
||||
// Check If room is still there in the available rooms list
|
||||
if (!in_array($orderBooking['id_room'], $roomIdsAvailable)) {
|
||||
$result['errors'][] = Tools::displayError('You can not change the order status as some rooms are not available now in this order. You can reallocate/swap rooms with other rooms to make rooms available and then change the order status.');
|
||||
|
||||
break;
|
||||
} else {
|
||||
$objHotelBookingDetail->is_refunded = 0;
|
||||
$objHotelBookingDetail->save();
|
||||
}
|
||||
} else {
|
||||
$result['errors'][] = Tools::displayError('You can not change the order status as some rooms are not available now in this order. You can reallocate/swap rooms with other rooms to make rooms available and then change the order status.');
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$result['errors'][] = Tools::displayError('You can not change the order status as some rooms are not available now in this order. You can reallocate/swap rooms with other rooms to make rooms available and then change the order status.');
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} elseif ($objCurrentOrderState->id == $objNewOrderState->id) {
|
||||
$result['errors'][] = Tools::displayError('The order has already been assigned this status.');
|
||||
}
|
||||
}
|
||||
|
||||
if (!count($result['errors'])) {
|
||||
// Create new OrderHistory
|
||||
$context = Context::getContext();
|
||||
$history = new OrderHistory();
|
||||
$history->id_order = $this->id;
|
||||
$history->id_employee = (int)$context->employee->id;
|
||||
|
||||
$useExistingsPayment = false;
|
||||
if (!$this->hasInvoice()) {
|
||||
$useExistingsPayment = true;
|
||||
}
|
||||
$history->changeIdOrderState((int)$objNewOrderState->id, $this, $useExistingsPayment);
|
||||
|
||||
// Save all changes
|
||||
$templateVars = array();
|
||||
if ($history->add(true)) {
|
||||
if (!$history->sendEmail($this, $templateVars)) {
|
||||
// if an error occurred while sending an email the set has_mail_error to true
|
||||
$result['has_mail_error'] = true;
|
||||
$result['errors'][] = Tools::displayError('We were unable to send an email to the customer while changing order status.');
|
||||
}
|
||||
|
||||
// synchronizes quantities if needed..
|
||||
if (Configuration::get('PS_ADVANCED_STOCK_MANAGEMENT')) {
|
||||
foreach ($this->getProducts() as $product) {
|
||||
if (StockAvailable::dependsOnStock($product['product_id'])) {
|
||||
StockAvailable::synchronize($product['product_id'], (int)$product['id_shop']);
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$result['errors'][] = Tools::displayError('An error occurred while changing order status.');
|
||||
}
|
||||
}
|
||||
|
||||
// if no errors then return status true
|
||||
if (!count($result['errors'])) {
|
||||
$result['status'] = true;
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34,12 +34,12 @@ class OrderCustomerGuestDetailCore extends ObjectModel
|
||||
'table' => 'order_customer_guest_detail',
|
||||
'primary' => 'id_order_customer_guest_detail',
|
||||
'fields' => array(
|
||||
'id_order' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId'),
|
||||
'id_order' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId', 'required' => true),
|
||||
'id_gender' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId'),
|
||||
'firstname' => array('type' => self::TYPE_STRING, 'validate' => 'isName', 'size' => 32),
|
||||
'lastname' => array('type' => self::TYPE_STRING, 'validate' => 'isName', 'size' => 32),
|
||||
'email' => array('type' => self::TYPE_STRING, 'validate' => 'isEmail', 'size' => 128),
|
||||
'phone' => array('type' => self::TYPE_STRING, 'validate' => 'isPhoneNumber', 'size' => 32),
|
||||
'firstname' => array('type' => self::TYPE_STRING, 'validate' => 'isName', 'size' => 32, 'required' => true),
|
||||
'lastname' => array('type' => self::TYPE_STRING, 'validate' => 'isName', 'size' => 32, 'required' => true),
|
||||
'email' => array('type' => self::TYPE_STRING, 'validate' => 'isEmail', 'size' => 128, 'required' => true),
|
||||
'phone' => array('type' => self::TYPE_STRING, 'validate' => 'isPhoneNumber', 'size' => 32, 'required' => true),
|
||||
'date_add' => array('type' => self::TYPE_DATE, 'validate' => 'isDate'),
|
||||
'date_upd' => array('type' => self::TYPE_DATE, 'validate' => 'isDate'),
|
||||
),
|
||||
@@ -53,22 +53,4 @@ class OrderCustomerGuestDetailCore extends ObjectModel
|
||||
WHERE `id_order` = '.(int)$id_order
|
||||
);
|
||||
}
|
||||
|
||||
public function validateGuestInfo()
|
||||
{
|
||||
$isValid = true;
|
||||
if (!trim($this->firstname) || !Validate::isName($this->firstname)) {
|
||||
$isValid = false;
|
||||
}
|
||||
if (!trim($this->lastname) || !Validate::isName($this->lastname)) {
|
||||
$isValid = false;
|
||||
}
|
||||
if (!trim($this->email) || !Validate::isEmail($this->email)) {
|
||||
$isValid = false;
|
||||
}
|
||||
if (!trim($this->phone) || !Validate::isPhoneNumber($this->phone)) {
|
||||
$isValid = false;
|
||||
}
|
||||
return $isValid;
|
||||
}
|
||||
}
|
||||
@@ -857,4 +857,103 @@ class OrderDetailCore extends ObjectModel
|
||||
|
||||
return $wholesale_price;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param OrderDetail $order_detail
|
||||
* @param int $qty_cancel_product
|
||||
* @param bool $delete
|
||||
*/
|
||||
public function reinjectQuantity($order_detail, $qty_cancel_product, $delete = false)
|
||||
{
|
||||
$errors = array();
|
||||
$context = Context::getContext();
|
||||
// Reinject product
|
||||
$reinjectable_quantity = (int)$order_detail->product_quantity - (int)$order_detail->product_quantity_reinjected;
|
||||
$quantity_to_reinject = $qty_cancel_product > $reinjectable_quantity ? $reinjectable_quantity : $qty_cancel_product;
|
||||
// @since 1.5.0 : Advanced Stock Management
|
||||
$product_to_inject = new Product($order_detail->product_id, false, (int)$context->language->id, (int)$order_detail->id_shop);
|
||||
|
||||
$product = new Product($order_detail->product_id, false, (int)$context->language->id, (int)$order_detail->id_shop);
|
||||
|
||||
if (Configuration::get('PS_ADVANCED_STOCK_MANAGEMENT') && $product->advanced_stock_management && $order_detail->id_warehouse != 0) {
|
||||
$manager = StockManagerFactory::getManager();
|
||||
$movements = StockMvt::getNegativeStockMvts(
|
||||
$order_detail->id_order,
|
||||
$order_detail->product_id,
|
||||
$order_detail->product_attribute_id,
|
||||
$quantity_to_reinject
|
||||
);
|
||||
$left_to_reinject = $quantity_to_reinject;
|
||||
foreach ($movements as $movement) {
|
||||
if ($left_to_reinject > $movement['physical_quantity']) {
|
||||
$quantity_to_reinject = $movement['physical_quantity'];
|
||||
}
|
||||
|
||||
$left_to_reinject -= $quantity_to_reinject;
|
||||
if (Pack::isPack((int)$product->id)) {
|
||||
// Gets items
|
||||
if ($product->pack_stock_type == 1 || $product->pack_stock_type == 2 || ($product->pack_stock_type == 3 && Configuration::get('PS_PACK_STOCK_TYPE') > 0)) {
|
||||
$products_pack = Pack::getItems((int)$product->id, (int)Configuration::get('PS_LANG_DEFAULT'));
|
||||
// Foreach item
|
||||
foreach ($products_pack as $product_pack) {
|
||||
if ($product_pack->advanced_stock_management == 1) {
|
||||
$manager->addProduct(
|
||||
$product_pack->id,
|
||||
$product_pack->id_pack_product_attribute,
|
||||
new Warehouse($movement['id_warehouse']),
|
||||
$product_pack->pack_quantity * $quantity_to_reinject,
|
||||
null,
|
||||
$movement['price_te'],
|
||||
true
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($product->pack_stock_type == 0 || $product->pack_stock_type == 2 ||
|
||||
($product->pack_stock_type == 3 && (Configuration::get('PS_PACK_STOCK_TYPE') == 0 || Configuration::get('PS_PACK_STOCK_TYPE') == 2))) {
|
||||
$manager->addProduct(
|
||||
$order_detail->product_id,
|
||||
$order_detail->product_attribute_id,
|
||||
new Warehouse($movement['id_warehouse']),
|
||||
$quantity_to_reinject,
|
||||
null,
|
||||
$movement['price_te'],
|
||||
true
|
||||
);
|
||||
}
|
||||
} else {
|
||||
$manager->addProduct(
|
||||
$order_detail->product_id,
|
||||
$order_detail->product_attribute_id,
|
||||
new Warehouse($movement['id_warehouse']),
|
||||
$quantity_to_reinject,
|
||||
null,
|
||||
$movement['price_te'],
|
||||
true
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
$id_product = $order_detail->product_id;
|
||||
if ($delete) {
|
||||
$order_detail->delete();
|
||||
}
|
||||
StockAvailable::synchronize($id_product);
|
||||
} elseif ($order_detail->id_warehouse == 0) {
|
||||
StockAvailable::updateQuantity(
|
||||
$order_detail->product_id,
|
||||
$order_detail->product_attribute_id,
|
||||
$quantity_to_reinject,
|
||||
$order_detail->id_shop
|
||||
);
|
||||
|
||||
if ($delete) {
|
||||
$order_detail->delete();
|
||||
}
|
||||
} else {
|
||||
$errors[] = Tools::displayError('This product cannot be re-stocked.');
|
||||
}
|
||||
|
||||
return $errors;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -449,7 +449,7 @@ class OrderHistoryCore extends ObjectModel
|
||||
);
|
||||
|
||||
if ($idHotel = HotelBookingDetail::getIdHotelByIdOrder($order->id)) {
|
||||
$objHotelBranchInformation = new HotelBranchInformation($idHotel, $order->id_lang);
|
||||
$objHotelBranchInformation = new HotelBranchInformation($idHotel);
|
||||
$fields = array_merge(
|
||||
$objHotelBranchInformation->getFields(),
|
||||
$objHotelBranchInformation->getFieldsLang()[$order->id_lang],
|
||||
|
||||
@@ -177,9 +177,18 @@ class OrderReturnCore extends ObjectModel
|
||||
return (int)($data['total']);
|
||||
}
|
||||
|
||||
public function getOrderRefundRequestedBookings($idOrder, $idOrderReturn = 0, $onlyBookingIds = 0, $customerView = 0)
|
||||
/**
|
||||
* Get order refund requested bookings
|
||||
* @param integer $idOrder
|
||||
* @param integer $idOrderReturn
|
||||
* @param integer $onlyBookingIds
|
||||
* @param integer $customerView
|
||||
* @param integer $skipReqCompletedNonRefunded: send 1 if you want to skip refund request completed but non-refunded booking
|
||||
* @return array of refund requested bookings
|
||||
*/
|
||||
public function getOrderRefundRequestedBookings($idOrder, $idOrderReturn = 0, $onlyBookingIds = 0, $customerView = 0, $skipReqCompletedNonRefunded = 0)
|
||||
{
|
||||
$sql = 'SELECT hbd.*, ord.* FROM `'._DB_PREFIX_.'order_return` orr';
|
||||
$sql = 'SELECT hbd.*, ord.*, orr.`state` as id_return_state FROM `'._DB_PREFIX_.'order_return` orr';
|
||||
$sql .= ' LEFT JOIN `'._DB_PREFIX_.'order_return_detail` ord ON (orr.`id_order_return` = ord.`id_order_return`)';
|
||||
$sql .= ' LEFT JOIN `'._DB_PREFIX_.'htl_booking_detail` hbd ON (hbd.`id` = ord.`id_htl_booking`)';
|
||||
$sql .= ' WHERE orr.`id_order` = '.(int)$idOrder;
|
||||
@@ -189,79 +198,92 @@ class OrderReturnCore extends ObjectModel
|
||||
}
|
||||
|
||||
if ($returnDetails = Db::getInstance()->executeS($sql)) {
|
||||
if ($customerView) {
|
||||
$returnsCustView = array();
|
||||
}
|
||||
|
||||
$objOrder = new Order($idOrder);
|
||||
$objBookingDemands = new HotelBookingDemands();
|
||||
$objRoomTypeServiceProductOrderDetail = new RoomTypeServiceProductOrderDetail();
|
||||
|
||||
foreach ($returnDetails as $key => &$bookingRow) {
|
||||
if ($skipReqCompletedNonRefunded) {
|
||||
$objReturnState = new OrderReturnState($bookingRow['id_return_state']);
|
||||
if ($objReturnState->refunded && !$bookingRow['is_refunded']) {
|
||||
unset($returnDetails[$key]);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
if (!$onlyBookingIds) {
|
||||
$bookingRow['extra_service_total_paid_amount'] = 0;
|
||||
$bookingRow['extra_service_total_price_tax_incl'] = 0;
|
||||
$bookingRow['room_paid_amount'] = 0;
|
||||
if ($bookingRow['total_price_tax_incl'] > 0) {
|
||||
if ($objOrder->total_paid_real > 0) {
|
||||
$bookingRow['room_paid_amount'] = ($objOrder->total_paid_real*$bookingRow['total_price_tax_incl'])/$objOrder->total_paid_tax_incl;
|
||||
}
|
||||
}
|
||||
$roomSelectedDemands = $objBookingDemands->getRoomTypeBookingExtraDemands(
|
||||
$idOrder,
|
||||
$bookingRow['id_product'],
|
||||
$bookingRow['id_room'],
|
||||
$bookingRow['date_from'],
|
||||
$bookingRow['date_to'],
|
||||
0
|
||||
);
|
||||
if (count($roomSelectedDemands)) {
|
||||
foreach ($roomSelectedDemands as $demand) {
|
||||
if ($demand['total_price_tax_incl'] > 0) {
|
||||
if ($objOrder->total_paid_real > 0) {
|
||||
$bookingRow['extra_service_total_paid_amount'] += ($objOrder->total_paid_real*$demand['total_price_tax_incl'])/$objOrder->total_paid_tax_incl;
|
||||
}
|
||||
$bookingRow['extra_service_total_price_tax_incl'] += $demand['total_price_tax_incl'];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($roomSelectedServices = $objRoomTypeServiceProductOrderDetail->getSelectedServicesForRoom(
|
||||
$bookingRow['id_htl_booking']
|
||||
)) {
|
||||
if (count($roomSelectedServices['additional_services'])) {
|
||||
foreach ($roomSelectedServices['additional_services'] as $service) {
|
||||
if ($service['total_price_tax_incl'] > 0) {
|
||||
if ($objOrder->total_paid_real > 0) {
|
||||
$bookingRow['extra_service_total_paid_amount'] += ($objOrder->total_paid_real*$service['total_price_tax_incl'])/$objOrder->total_paid_tax_incl;
|
||||
}
|
||||
$bookingRow['extra_service_total_price_tax_incl'] += $service['total_price_tax_incl'];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($customerView) {
|
||||
$dateJoin = $bookingRow['id_product'].'_'.strtotime($bookingRow['date_from']).strtotime($bookingRow['date_to']);
|
||||
if (isset($returnsCustView[$dateJoin]['num_rooms'])) {
|
||||
$returnsCustView[$dateJoin]['num_rooms'] += 1;
|
||||
$returnsCustView[$dateJoin]['refunded_amount'] += $bookingRow['refunded_amount'];
|
||||
$returnsCustView[$dateJoin]['total_price_tax_incl'] += $bookingRow['total_price_tax_incl'];
|
||||
$returnsCustView[$dateJoin]['total_paid_amount'] += $bookingRow['total_paid_amount'];
|
||||
} else {
|
||||
unset($bookingRow['id_room']);
|
||||
unset($bookingRow['room_num']);
|
||||
unset($bookingRow['id_htl_booking']);
|
||||
$returnsCustView[$dateJoin] = $bookingRow;
|
||||
$returnsCustView[$dateJoin]['num_rooms'] = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($onlyBookingIds) {
|
||||
return array_column($returnDetails, 'id_htl_booking');
|
||||
}
|
||||
|
||||
if ($customerView) {
|
||||
$returnsCustView = array();
|
||||
}
|
||||
|
||||
$objBookingDemands = new HotelBookingDemands();
|
||||
$objRoomTypeServiceProductOrderDetail = new RoomTypeServiceProductOrderDetail();
|
||||
$objOrder = new Order($idOrder);
|
||||
foreach ($returnDetails as &$bookingRow) {
|
||||
$bookingRow['extra_service_total_paid_amount'] = 0;
|
||||
$bookingRow['extra_service_total_price_tax_incl'] = 0;
|
||||
$bookingRow['room_paid_amount'] = 0;
|
||||
if ($bookingRow['total_price_tax_incl'] > 0) {
|
||||
if ($objOrder->total_paid_real > 0) {
|
||||
$bookingRow['room_paid_amount'] = ($objOrder->total_paid_real*$bookingRow['total_price_tax_incl'])/$objOrder->total_paid_tax_incl;
|
||||
}
|
||||
}
|
||||
$roomSelectedDemands = $objBookingDemands->getRoomTypeBookingExtraDemands(
|
||||
$idOrder,
|
||||
$bookingRow['id_product'],
|
||||
$bookingRow['id_room'],
|
||||
$bookingRow['date_from'],
|
||||
$bookingRow['date_to'],
|
||||
0
|
||||
);
|
||||
if (count($roomSelectedDemands)) {
|
||||
foreach ($roomSelectedDemands as $demand) {
|
||||
if ($demand['total_price_tax_incl'] > 0) {
|
||||
if ($objOrder->total_paid_real > 0) {
|
||||
$bookingRow['extra_service_total_paid_amount'] += ($objOrder->total_paid_real*$demand['total_price_tax_incl'])/$objOrder->total_paid_tax_incl;
|
||||
}
|
||||
$bookingRow['extra_service_total_price_tax_incl'] += $demand['total_price_tax_incl'];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($roomSelectedServices = $objRoomTypeServiceProductOrderDetail->getSelectedServicesForRoom(
|
||||
$bookingRow['id_htl_booking']
|
||||
)) {
|
||||
if (count($roomSelectedServices['additional_services'])) {
|
||||
foreach ($roomSelectedServices['additional_services'] as $service) {
|
||||
if ($service['total_price_tax_incl'] > 0) {
|
||||
if ($objOrder->total_paid_real > 0) {
|
||||
$bookingRow['extra_service_total_paid_amount'] += ($objOrder->total_paid_real*$service['total_price_tax_incl'])/$objOrder->total_paid_tax_incl;
|
||||
}
|
||||
$bookingRow['extra_service_total_price_tax_incl'] += $service['total_price_tax_incl'];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($customerView) {
|
||||
$dateJoin = $bookingRow['id_product'].'_'.strtotime($bookingRow['date_from']).strtotime($bookingRow['date_to']);
|
||||
if (isset($returnsCustView[$dateJoin]['num_rooms'])) {
|
||||
$returnsCustView[$dateJoin]['num_rooms'] += 1;
|
||||
$returnsCustView[$dateJoin]['refunded_amount'] += $bookingRow['refunded_amount'];
|
||||
$returnsCustView[$dateJoin]['total_price_tax_incl'] += $bookingRow['total_price_tax_incl'];
|
||||
$returnsCustView[$dateJoin]['total_paid_amount'] += $bookingRow['total_paid_amount'];
|
||||
} else {
|
||||
unset($bookingRow['id_room']);
|
||||
unset($bookingRow['room_num']);
|
||||
unset($bookingRow['id_htl_booking']);
|
||||
$returnsCustView[$dateJoin] = $bookingRow;
|
||||
$returnsCustView[$dateJoin]['num_rooms'] = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($customerView) {
|
||||
return $returnsCustView;
|
||||
}
|
||||
}
|
||||
|
||||
return $returnDetails;
|
||||
}
|
||||
|
||||
@@ -297,8 +319,21 @@ class OrderReturnCore extends ObjectModel
|
||||
return $data;
|
||||
}
|
||||
|
||||
public static function getOrdersReturnDetail($idOrder, $idOrderReturn = 0, $idHtlBooking = 0, $idLang = 0)
|
||||
{
|
||||
/**
|
||||
* @param $idOrder
|
||||
* @param int $idOrderReturn
|
||||
* @param int $idHtlBooking
|
||||
* @param int $idLang
|
||||
* @param int $orderByLatestRequest : If you want to return request with in the Desc order of refund requests
|
||||
* @return array
|
||||
*/
|
||||
public static function getOrdersReturnDetail(
|
||||
$idOrder,
|
||||
$idOrderReturn = 0,
|
||||
$idHtlBooking = 0,
|
||||
$idLang = 0,
|
||||
$orderByLatestRequest = 1
|
||||
) {
|
||||
if (!$idLang) {
|
||||
$idLang = Context::getContext()->language->id;
|
||||
}
|
||||
@@ -316,6 +351,10 @@ class OrderReturnCore extends ObjectModel
|
||||
$sql .= ' AND ord.`id_htl_booking` = '.(int)$idHtlBooking;
|
||||
}
|
||||
|
||||
if ($orderByLatestRequest) {
|
||||
$sql .= ' ORDER BY orr.`id_order_return` DESC';
|
||||
}
|
||||
|
||||
return Db::getInstance()->executeS($sql);
|
||||
}
|
||||
|
||||
@@ -449,8 +488,8 @@ class OrderReturnCore extends ObjectModel
|
||||
'{order_reference}' => $objOrder->reference,
|
||||
'{order_date}' => date('Y-m-d h:i:s', strtotime($objOrder->date_add)),
|
||||
'{refunded_amount}' => Tools::displayPrice($this->refunded_amount, new Currency($objOrder->id_currency)),
|
||||
'{payment_mode}' => $this->payment_mode,
|
||||
'{id_transaction}' => $this->id_transaction,
|
||||
'{payment_mode}' => $this->payment_mode ? $this->payment_mode : '--',
|
||||
'{id_transaction}' => $this->id_transaction ? $this->id_transaction : '--',
|
||||
);
|
||||
|
||||
// if mail is true for the customer then send mail to customer with selected template
|
||||
@@ -480,7 +519,7 @@ class OrderReturnCore extends ObjectModel
|
||||
Mail::Send(
|
||||
(int)$idLang,
|
||||
$objOrderReturnState->customer_template,
|
||||
$objOrderReturnState->name,
|
||||
sprintf(Mail::l('Refund %s', (int)$idLang), $objOrderReturnState->name),
|
||||
$data,
|
||||
$objCustomer->email,
|
||||
$objCustomer->firstname.' '.$objCustomer->lastname,
|
||||
@@ -523,7 +562,7 @@ class OrderReturnCore extends ObjectModel
|
||||
Mail::Send(
|
||||
(int)$idLang,
|
||||
$objOrderReturnState->admin_template,
|
||||
$objOrderReturnState->name,
|
||||
sprintf(Mail::l('Refund %s', (int)$idLang), $objOrderReturnState->name),
|
||||
$data,
|
||||
$superAdminEmployee['email'],
|
||||
$superAdminEmployee['firstname'].' '.$superAdminEmployee['lastname'],
|
||||
@@ -553,7 +592,7 @@ class OrderReturnCore extends ObjectModel
|
||||
Mail::Send(
|
||||
(int)$idLang,
|
||||
$objOrderReturnState->admin_template,
|
||||
$objOrderReturnState->name,
|
||||
sprintf(Mail::l('Refund %s', (int)$idLang), $objOrderReturnState->name),
|
||||
$data,
|
||||
$objHotel->email,
|
||||
null,
|
||||
@@ -585,7 +624,7 @@ class OrderReturnCore extends ObjectModel
|
||||
Mail::Send(
|
||||
(int)$idLang,
|
||||
$objOrderReturnState->admin_template,
|
||||
$objOrderReturnState->name,
|
||||
sprintf(Mail::l('Refund %s', (int)$idLang), $objOrderReturnState->name),
|
||||
$data,
|
||||
$empl['email'],
|
||||
$empl['firstname'].' '.$empl['lastname'],
|
||||
|
||||
@@ -30,9 +30,15 @@ class OrderReturnDetailCore extends ObjectModel
|
||||
public $refunded_amount;
|
||||
|
||||
public $id_order_detail;
|
||||
|
||||
// Used to manage refunded or refunde denied bookings in a refund request : 1 for only refunded request completed and refunded bookings
|
||||
public $id_customization;
|
||||
public $product_quantity;
|
||||
|
||||
const REFUND_REQUEST_STATUS_LATEST = 1;
|
||||
const REFUND_REQUEST_STATUS_PENDING = 2;
|
||||
const REFUND_REQUEST_STATUS_COMPLETED = 3;
|
||||
|
||||
/**
|
||||
* @see ObjectModel::$definition
|
||||
*/
|
||||
|
||||
@@ -822,7 +822,9 @@ class HTMLTemplateInvoiceCore extends HTMLTemplate
|
||||
*/
|
||||
protected function getTemplateByCountry($iso_country)
|
||||
{
|
||||
$file = Configuration::get('PS_INVOICE_MODEL');
|
||||
// $file = Configuration::get('PS_INVOICE_MODEL');
|
||||
// @todo redesign invoice template for b2b, for now we have ony one template design.
|
||||
$file = 'invoice';
|
||||
|
||||
// try to fetch the iso template
|
||||
$template = $this->getTemplate($file.'.'.$iso_country);
|
||||
|
||||
@@ -104,6 +104,7 @@ class TaxRulesTaxManagerCore implements TaxManagerInterface
|
||||
AND tr.`id_country` = '.(int)$this->address->id_country.'
|
||||
AND tr.`id_tax_rules_group` = '.(int)$this->type.'
|
||||
AND tr.`id_state` IN (0, '.(int)$this->address->id_state.')
|
||||
AND tr.`id_tax` !=0
|
||||
AND (\''.pSQL($postcode).'\' BETWEEN tr.`zipcode_from` AND tr.`zipcode_to`
|
||||
OR (tr.`zipcode_to` = 0 AND tr.`zipcode_from` IN(0, \''.pSQL($postcode).'\')))
|
||||
ORDER BY tr.`zipcode_from` DESC, tr.`zipcode_to` DESC, tr.`id_state` DESC, tr.`id_country` DESC');
|
||||
|
||||
@@ -26,5 +26,6 @@ class WebserviceOrderCore extends PaymentModule
|
||||
public function __construct()
|
||||
{
|
||||
$this->displayName = $this->l('Order from API');
|
||||
$this->validateOrderAmount = false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,2 +1,10 @@
|
||||
Order deny,allow
|
||||
Deny from all
|
||||
# Apache 2.2
|
||||
<IfModule !mod_authz_core.c>
|
||||
Order deny,allow
|
||||
Deny from all
|
||||
</IfModule>
|
||||
|
||||
# Apache 2.4
|
||||
<IfModule mod_authz_core.c>
|
||||
Require all denied
|
||||
</IfModule>
|
||||
|
||||
@@ -1,2 +1,10 @@
|
||||
Order deny,allow
|
||||
Deny from all
|
||||
# Apache 2.2
|
||||
<IfModule !mod_authz_core.c>
|
||||
Order deny,allow
|
||||
Deny from all
|
||||
</IfModule>
|
||||
|
||||
# Apache 2.4
|
||||
<IfModule mod_authz_core.c>
|
||||
Require all denied
|
||||
</IfModule>
|
||||
|
||||
@@ -112,18 +112,43 @@ class AdminAddressesControllerCore extends AdminController
|
||||
|
||||
public function renderForm()
|
||||
{
|
||||
$customerField =array(
|
||||
'type' => 'text_customer',
|
||||
'label' => $this->l('Customer'),
|
||||
'name' => 'id_customer',
|
||||
'required' => false,
|
||||
);
|
||||
if ($this->loadObject(true)
|
||||
&& !$this->object->id
|
||||
&& !Tools::getValue('liteDisplaying')
|
||||
) {
|
||||
$customerEmails = array(array(
|
||||
'email' => $this->l('Select Customer'),
|
||||
'id_customer' => 0,
|
||||
'id_address'=> 0
|
||||
));
|
||||
$customerEmails = array_merge($customerEmails, Customer::getCustomers(null, 0, 0));
|
||||
$customerField = array(
|
||||
'type' => 'select',
|
||||
'label' => $this->l('Customer'),
|
||||
'name' => 'id_customer',
|
||||
'required' => true,
|
||||
'class' => 'chosen',
|
||||
'options' => array(
|
||||
'query' => $customerEmails,
|
||||
'id' => 'id_customer',
|
||||
'name' => 'email'
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
$this->fields_form = array(
|
||||
'legend' => array(
|
||||
'title' => $this->l('Addresses'),
|
||||
'icon' => 'icon-envelope-alt'
|
||||
),
|
||||
'input' => array(
|
||||
array(
|
||||
'type' => 'text_customer',
|
||||
'label' => $this->l('Customer'),
|
||||
'name' => 'id_customer',
|
||||
'required' => false,
|
||||
),
|
||||
$customerField,
|
||||
array(
|
||||
'type' => 'text',
|
||||
'label' => $this->l('Identification Number'),
|
||||
@@ -191,9 +216,8 @@ class AdminAddressesControllerCore extends AdminController
|
||||
}
|
||||
|
||||
$this->tpl_form_vars = array(
|
||||
'customer' => isset($customer) ? $customer : null,
|
||||
'tokenCustomer' => isset($token_customer) ? $token_customer : null,
|
||||
'back_url' => urldecode(Tools::getValue('back'))
|
||||
'customer' => (isset($customer) && ($this->object->id || Tools::getValue('liteDisplaying'))) ? $customer : null,
|
||||
'tokenCustomer' => isset($token_customer) ? $token_customer : null
|
||||
);
|
||||
|
||||
// Order address fields depending on country format
|
||||
@@ -503,7 +527,7 @@ class AdminAddressesControllerCore extends AdminController
|
||||
return $out;
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* Method called when an ajax request is made
|
||||
* @see AdminController::postProcess()
|
||||
*/
|
||||
|
||||
@@ -411,7 +411,7 @@ class AdminCartRulesControllerCore extends AdminController
|
||||
$ruleGroupId,
|
||||
$ruleId,
|
||||
Tools::getValue('product_rule_'.$ruleGroupId.'_'.$ruleId.'_type'),
|
||||
Tools::getValue('product_rule_select_'.$ruleGroupId.'_'.$ruleId)
|
||||
Tools::getValue('product_rule_select_'.$ruleGroupId.'_'.$ruleId, array())
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -486,6 +486,7 @@ class AdminCartRulesControllerCore extends AdminController
|
||||
ON (p.`id_product` = hrt.`id_product`)
|
||||
LEFT JOIN `'._DB_PREFIX_.'htl_branch_info_lang` hbl
|
||||
ON (hrt.`id_hotel` = hbl.`id` AND hbl.`id_lang` = '.(int)Context::getContext()->language->id.Shop::addSqlRestrictionOnLang('pl').')
|
||||
WHERE p.`booking_product` = 1
|
||||
ORDER BY name');
|
||||
foreach ($results as $row) {
|
||||
if($row['hotel_name']) {
|
||||
|
||||
@@ -42,11 +42,11 @@ class AdminCartsControllerCore extends AdminController
|
||||
$this->allow_export = true;
|
||||
$this->_orderWay = 'DESC';
|
||||
$this->context = Context::getContext();
|
||||
|
||||
$this->_select = 'CONCAT(c.`firstname`, \' \', c.`lastname`) `customer`, a.id_cart total,
|
||||
TIME_TO_SEC(TIMEDIFF(\''.pSQL(date('Y-m-d H:i:00', time())).'\', a.`date_add`)) AS `time_diff`,
|
||||
IFNULL(GROUP_CONCAT(o.`id_order`), 0) AS `ids_order`,
|
||||
IF (IFNULL(o.id_order, \''.$this->l('Non ordered cart').'\') = \''.$this->l('Non ordered cart').'\', IF(TIME_TO_SEC(TIMEDIFF(\''.pSQL(date('Y-m-d H:i:00', time())).'\', a.`date_add`)) > 86400, \''.$this->l('Abandoned cart').'\', \''.$this->l('Non ordered cart').'\'), GROUP_CONCAT(o.`id_order`)) AS filter_ids_order,
|
||||
|
||||
IFNULL(GROUP_CONCAT(DISTINCT o.`id_order`), 0) AS `ids_order`,
|
||||
IF (IFNULL(o.id_order, \''.$this->l('Non ordered cart').'\') = \''.$this->l('Non ordered cart').'\', IF(TIME_TO_SEC(TIMEDIFF(\''.pSQL(date('Y-m-d H:i:00', time())).'\', a.`date_add`)) > '._TIME_1_DAY_.', \''.$this->l('Abandoned cart').'\', \''.$this->l('Non ordered cart').'\'), GROUP_CONCAT(DISTINCT o.`id_order`)) AS filter_ids_order,
|
||||
IF(o.id_order, 1, 0) badge_success, IF(o.id_order, 0, 1) badge_danger, IF(co.id_guest, 1, 0) id_guest';
|
||||
$this->_join = 'LEFT JOIN '._DB_PREFIX_.'customer c ON (c.id_customer = a.id_customer)
|
||||
LEFT JOIN '._DB_PREFIX_.'currency cu ON (cu.id_currency = a.id_currency)
|
||||
@@ -54,10 +54,6 @@ class AdminCartsControllerCore extends AdminController
|
||||
LEFT JOIN `'._DB_PREFIX_.'connections` co ON (a.id_guest = co.id_guest AND TIME_TO_SEC(TIMEDIFF(\''.pSQL(date('Y-m-d H:i:00', time())).'\', co.`date_add`)) < 1800)';
|
||||
$this->_group = ' GROUP BY a.`id_cart`';
|
||||
|
||||
if (Tools::getValue('action') == 'filterOnlyAbandonedCarts') {
|
||||
$this->_filterHaving = ' AND `ids_order` = 0 AND `time_diff` > 86400';
|
||||
}
|
||||
|
||||
$this->fields_list = array(
|
||||
'id_cart' => array(
|
||||
'title' => $this->l('ID'),
|
||||
@@ -96,7 +92,7 @@ class AdminCartsControllerCore extends AdminController
|
||||
'type' => 'bool',
|
||||
'havingFilter' => true,
|
||||
'class' => 'fixed-width-xs',
|
||||
'icon' => array(0 => 'icon-', 1 => 'icon-user')
|
||||
'callback' => 'getOnlineStatus',
|
||||
)
|
||||
);
|
||||
$this->shopLinkType = 'shop';
|
||||
@@ -117,10 +113,32 @@ class AdminCartsControllerCore extends AdminController
|
||||
}
|
||||
|
||||
parent::__construct();
|
||||
|
||||
$this->list_no_link = true;
|
||||
}
|
||||
|
||||
public function postProcess()
|
||||
{
|
||||
if (Tools::getValue('action') == 'filterOnlyAbandonedCarts') {
|
||||
$this->processResetFilters();
|
||||
$this->context->cookie->{'submitFilter'.$this->table} = true;
|
||||
$prefix = $this->getCookieFilterPrefix();
|
||||
$this->context->cookie->{$prefix.$this->table.'Filter_filter_ids_order'} = $this->l('Abandoned cart');
|
||||
if (($dateFrom = Tools::getValue('date_from'))
|
||||
&& ($dateTo = Tools::getValue('date_to'))
|
||||
&& strtotime($dateTo) >= strtotime($dateFrom)
|
||||
) {
|
||||
//Updating the date format of the filter dates to the required format.
|
||||
$dateFrom = date('Y-m-d', strtotime($dateFrom));
|
||||
$dateTo = date('Y-m-d', strtotime($dateTo));
|
||||
$this->context->cookie->{$prefix.$this->table.'Filter_'.$this->fields_list['date_add']['filter_key']} = json_encode(array($dateFrom, $dateTo));
|
||||
}
|
||||
|
||||
$this->redirect_after = $this->context->link->getAdminLink('AdminCarts');
|
||||
}
|
||||
|
||||
parent::postProcess();
|
||||
}
|
||||
|
||||
public function getOrderColumn($idsOrder, $tr)
|
||||
{
|
||||
$smartyVars = array();
|
||||
@@ -129,7 +147,7 @@ class AdminCartsControllerCore extends AdminController
|
||||
$smartyVars['type'] = 'orders';
|
||||
$smartyVars['ids_order'] = $idsOrder;
|
||||
} else {
|
||||
if ($tr['time_diff'] > 86400) {
|
||||
if ($tr['time_diff'] > _TIME_1_DAY_) {
|
||||
$smartyVars['type'] = 'abandoned';
|
||||
} else {
|
||||
$smartyVars['type'] = 'non_orderd';
|
||||
@@ -143,6 +161,11 @@ class AdminCartsControllerCore extends AdminController
|
||||
return $tpl->fetch();
|
||||
}
|
||||
|
||||
public function getOnlineStatus($status)
|
||||
{
|
||||
return $status ? $this->l('Yes') : $this->l('No');
|
||||
}
|
||||
|
||||
public function initPageHeaderToolbar()
|
||||
{
|
||||
if (empty($this->display)) {
|
||||
@@ -184,7 +207,7 @@ class AdminCartsControllerCore extends AdminController
|
||||
$date_from = date(Context::getContext()->language->date_format_lite, strtotime('-2 day'));
|
||||
$date_to = date(Context::getContext()->language->date_format_lite, strtotime('-1 day'));
|
||||
$helper->subtitle = sprintf($this->l('From %s to %s', null, null, false), $date_from, $date_to);
|
||||
$helper->href = $this->context->link->getAdminLink('AdminCarts').'&action=filterOnlyAbandonedCarts';
|
||||
$helper->href = $this->context->link->getAdminLink('AdminCarts').'&action=filterOnlyAbandonedCarts&date_from='.$date_from.'&date_to='.$date_to;
|
||||
$helper->source = $this->context->link->getAdminLink('AdminStats').'&ajax=1&action=getKpi&kpi=abandoned_cart';
|
||||
$kpis[] = $helper;
|
||||
|
||||
|
||||
@@ -85,6 +85,7 @@ class AdminCmsContentControllerCore extends AdminController
|
||||
|
||||
public function initContent()
|
||||
{
|
||||
$this->loadObject(true);
|
||||
$this->initTabModuleList();
|
||||
$this->renderPageHeaderToolbar();
|
||||
|
||||
@@ -151,8 +152,9 @@ class AdminCmsContentControllerCore extends AdminController
|
||||
|
||||
if (Tools::getValue('addcms') !== false) {
|
||||
$this->toolbar_title[] = $this->l('Add new');
|
||||
} elseif ($id_cms_page) {
|
||||
$cms_page = new CMS($id_cms_page);
|
||||
} elseif ($id_cms_page
|
||||
&& Validate::isLoadedObject($cms_page = new CMS($id_cms_page))
|
||||
) {
|
||||
$this->toolbar_title[] = sprintf($this->l('Edit: %s'), $cms_page->meta_title[$this->context->employee->id_lang]);
|
||||
}
|
||||
} else {
|
||||
|
||||
@@ -50,9 +50,9 @@ class AdminCustomerPreferencesControllerCore extends AdminController
|
||||
|
||||
$this->fields_options = array(
|
||||
'general' => array(
|
||||
'title' => $this->l('General'),
|
||||
'icon' => 'icon-cogs',
|
||||
'fields' => array(
|
||||
'title' => $this->l('General'),
|
||||
'icon' => 'icon-cogs',
|
||||
'fields' => array(
|
||||
'PS_REGISTRATION_PROCESS_TYPE' => array(
|
||||
'title' => $this->l('Registration process type'),
|
||||
'hint' => $this->l('The "Only account creation" registration option allows the customer to register faster, and create his/her address later.'),
|
||||
@@ -121,6 +121,15 @@ class AdminCustomerPreferencesControllerCore extends AdminController
|
||||
'cast' => 'intval',
|
||||
'type' => 'bool'
|
||||
),
|
||||
),
|
||||
'submit' => array(
|
||||
'title' => $this->l('Save'),
|
||||
),
|
||||
),
|
||||
'customer_kpi' => array(
|
||||
'title' => $this->l('Customer KPI configuration'),
|
||||
'icon' => 'icon-cogs',
|
||||
'fields' => array(
|
||||
'PS_KPI_FREQUENT_CUSTOMER_NB_ORDERS' => array(
|
||||
'title' => $this->l('Number of orders to use to calculate frequent customers'),
|
||||
'hint' => $this->l('Set the number of orders to use to calculate frequent customers.'),
|
||||
@@ -157,8 +166,10 @@ class AdminCustomerPreferencesControllerCore extends AdminController
|
||||
'class' => 'fixed-width-xl',
|
||||
),
|
||||
),
|
||||
'submit' => array('title' => $this->l('Save')),
|
||||
),
|
||||
'submit' => array(
|
||||
'title' => $this->l('Save'),
|
||||
),
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -170,6 +170,11 @@ class AdminCustomersControllerCore extends AdminController
|
||||
'type' => 'datetime',
|
||||
'search' => false,
|
||||
'havingFilter' => true
|
||||
),
|
||||
'deleted' => array(
|
||||
'title' => $this->l('Banned'),
|
||||
'type' => 'bool',
|
||||
'displayed' => false,
|
||||
)
|
||||
));
|
||||
|
||||
@@ -218,6 +223,12 @@ class AdminCustomersControllerCore extends AdminController
|
||||
}
|
||||
|
||||
parent::postProcess();
|
||||
// Added this to check if the filter for the banned(deleted) is used, since $this->delete = true will not display the deleted customers.
|
||||
$prefix = $this->getCookieFilterPrefix();
|
||||
$filters = $this->context->cookie->getFamily($prefix.$this->table.'Filter_');
|
||||
if (isset($filters[$prefix.$this->table.'Filter_deleted']) && $filters[$prefix.$this->table.'Filter_deleted'] == 1) {
|
||||
$this->deleted = false;
|
||||
}
|
||||
}
|
||||
|
||||
public function initContent()
|
||||
@@ -509,7 +520,7 @@ class AdminCustomersControllerCore extends AdminController
|
||||
);
|
||||
|
||||
// if we add a customer via fancybox (ajax), it's a customer and he doesn't need to be added to the visitor and guest groups
|
||||
if (Tools::isSubmit('addcustomer') && Tools::isSubmit('submitFormAjax')) {
|
||||
if (Tools::isSubmit('submitFormAjax')) {
|
||||
$visitor_group = Configuration::get('PS_UNIDENTIFIED_GROUP');
|
||||
$guest_group = Configuration::get('PS_GUEST_GROUP');
|
||||
foreach ($groups as $key => $g) {
|
||||
@@ -739,6 +750,9 @@ class AdminCustomersControllerCore extends AdminController
|
||||
$helper->color = 'color4';
|
||||
$helper->title = $this->l('New Customers', null, null, false);
|
||||
$nbDaysNewCustomers = Validate::isUnsignedInt(Configuration::get('PS_KPI_NEW_CUSTOMERS_NB_DAYS')) ? Configuration::get('PS_KPI_NEW_CUSTOMERS_NB_DAYS') : 30;
|
||||
$date_from = date('Y-m-d', strtotime('-'.$nbDaysNewCustomers.' day'));
|
||||
$date_to = date('Y-m-d');
|
||||
$helper->href = $this->context->link->getAdminLink('AdminCustomers').'&customerFilter_date_add[]='.$date_from.'&customerFilter_date_add[]='.$date_to;
|
||||
$helper->subtitle = sprintf($this->l('%d Days', null, null, false), (int) $nbDaysNewCustomers);
|
||||
$helper->source = $this->context->link->getAdminLink('AdminStats').'&ajax=1&action=getKpi&kpi=total_new_customers';
|
||||
$helper->tooltip = $this->l('The total number of new customers who registered in given period of time.', null, null, false);
|
||||
@@ -750,6 +764,7 @@ class AdminCustomersControllerCore extends AdminController
|
||||
$helper->color = 'color2';
|
||||
$helper->title = $this->l('Banned Customers', null, null, false);
|
||||
$helper->subtitle = $this->l('All Time', null, null, false);
|
||||
$helper->href = $this->context->link->getAdminLink('AdminCustomers').'&customerFilter_deleted=1';
|
||||
$helper->source = $this->context->link->getAdminLink('AdminStats').'&ajax=1&action=getKpi&kpi=total_banned_customers';
|
||||
$helper->tooltip = $this->l('The total number of banned customers.', null, null, false);
|
||||
$kpis[] = $helper;
|
||||
@@ -958,8 +973,8 @@ class AdminCustomersControllerCore extends AdminController
|
||||
// If customer is going to be deleted permanently then if customer has orders the change this customer as an anonymous customer
|
||||
if (Validate::isLoadedObject($objCustomer = $this->loadObject())) {
|
||||
if ($this->delete_mode == 'real' && Order::getCustomerOrders($objCustomer->id, true)) {
|
||||
$objCustomer->email = 'anonymous'.'-'.$objCustomer->id.'@'.Tools::getShopDomain();
|
||||
$objCustomer->deleted = 1;
|
||||
$objCustomer->email = 'anonymous'.'-'.$objCustomer->id.'@'.Tools::link_rewrite(Configuration::get('PS_SHOP_NAME')).'_anonymous.com';
|
||||
$objCustomer->deleted = Customer::STATUS_DELETED;
|
||||
if (!$objCustomer->update()) {
|
||||
$this->errors[] = Tools::displayError('Some error ocurred while deleting the Customer');
|
||||
return;
|
||||
@@ -1000,7 +1015,7 @@ class AdminCustomersControllerCore extends AdminController
|
||||
// check if customer has orders for email change else customer will be deleted
|
||||
if (Order::getCustomerOrders($objCustomer->id, true)) {
|
||||
$objCustomer->email = 'anonymous'.'-'.$objCustomer->id.'@'.Tools::getShopDomain();
|
||||
$objCustomer->deleted = 1;
|
||||
$objCustomer->deleted = Customer::STATUS_DELETED;
|
||||
if ($objCustomer->update()) {
|
||||
// unset the customer which is processed
|
||||
// not processed customers will be deleted with default process if no errors are there
|
||||
@@ -1040,37 +1055,48 @@ class AdminCustomersControllerCore extends AdminController
|
||||
$this->redirect_after = false;
|
||||
}
|
||||
// Check that the new email is not already in use
|
||||
$customer_email = strval(Tools::getValue('email'));
|
||||
$customer_email = trim(strval(Tools::getValue('email')));
|
||||
$customer = new Customer();
|
||||
if (Validate::isEmail($customer_email)) {
|
||||
$customer->getByEmail($customer_email);
|
||||
}
|
||||
if ($customer->id) {
|
||||
$this->errors[] = Tools::displayError('An account already exists for this email address:').' '.$customer_email;
|
||||
if ($customer->id) {
|
||||
$this->errors[] = Tools::displayError('An account already exists for this email address:').' '.$customer_email;
|
||||
$this->display = 'edit';
|
||||
return $customer;
|
||||
} elseif (Customer::customerExists($customer_email, false, true)) {
|
||||
$this->errors[] = Tools::displayError('The email is already associated with a banned account. Please use a different one.');
|
||||
$this->display = 'edit';
|
||||
} elseif (trim(Tools::getValue('passwd')) == '') {
|
||||
$this->validateRules();
|
||||
$this->errors[] = Tools::displayError('Password can not be empty.');
|
||||
$this->display = 'edit';
|
||||
} elseif ($customer = parent::processAdd()) {
|
||||
$this->context->smarty->assign('new_customer', $customer);
|
||||
return $customer;
|
||||
}
|
||||
} else {
|
||||
$this->errors[] = Tools::displayError('Invalid email address.');
|
||||
$this->display = 'edit';
|
||||
return $customer;
|
||||
} elseif (trim(Tools::getValue('passwd')) == '') {
|
||||
$this->validateRules();
|
||||
$this->errors[] = Tools::displayError('Password can not be empty.');
|
||||
$this->display = 'edit';
|
||||
} elseif ($customer = parent::processAdd()) {
|
||||
$this->context->smarty->assign('new_customer', $customer);
|
||||
return $customer;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
public function processUpdate()
|
||||
{
|
||||
if (Validate::isLoadedObject($this->object)) {
|
||||
$customer_email = strval(Tools::getValue('email'));
|
||||
$customer_email = trim(strval(Tools::getValue('email')));
|
||||
|
||||
// check if e-mail already used
|
||||
if ($customer_email != $this->object->email) {
|
||||
$customer = new Customer();
|
||||
if (Validate::isEmail($customer_email)) {
|
||||
$customer->getByEmail($customer_email);
|
||||
} else {
|
||||
$this->errors[] = Tools::displayError('Invalid email address.');
|
||||
}
|
||||
|
||||
if (($customer->id) && ($customer->id != (int)$this->object->id)) {
|
||||
$this->errors[] = Tools::displayError('An account already exists for this email address:').' '.$customer_email;
|
||||
}
|
||||
@@ -1289,4 +1315,41 @@ class AdminCustomersControllerCore extends AdminController
|
||||
die('ok');
|
||||
}
|
||||
}
|
||||
|
||||
public function ajaxProcessVerifyCustomerEmail()
|
||||
{
|
||||
$response = array('status' => true);
|
||||
$idCustomer = Tools::getValue('id_customer', 0);
|
||||
if (($email = trim(strval(Tools::getValue('email'))))
|
||||
&& ($idCustomerByEmail = Customer::customerExists($email, true, false))
|
||||
&& (Validate::isLoadedObject($objCustomer = new Customer($idCustomerByEmail)))
|
||||
&& $idCustomerByEmail != $idCustomer // the admin is trying to add/update the account
|
||||
) {
|
||||
$response['status'] = false;
|
||||
if ($objCustomer->deleted) {
|
||||
$response['msg'] = Tools::displayError('This email is already associated with a banned account. Please use a different one.');
|
||||
} else {
|
||||
$response['msg'] = Tools::displayError('An account already exists for this email address.');
|
||||
}
|
||||
}
|
||||
|
||||
$this->ajaxDie(json_encode($response));
|
||||
}
|
||||
|
||||
public function setMedia()
|
||||
{
|
||||
parent::setMedia();
|
||||
if ($this->loadObject(true)
|
||||
&& ($this->display == 'edit' || $this->display == 'add')
|
||||
) {
|
||||
$idCustomer = $this->object->id ? $this->object->id : 0;
|
||||
Media::addJSDef(
|
||||
array(
|
||||
'customer_controller_url' => self::$currentIndex.'&token='.$this->token,
|
||||
'id_customer' => $idCustomer
|
||||
)
|
||||
);
|
||||
$this->addJS(_PS_JS_DIR_.'admin/customers.js');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
class AdminDashboardControllerCore extends AdminController
|
||||
{
|
||||
|
||||
const DASHBOARD_RECOMMENDATION_CONTENT = '/cache/dashboard_recommendation.html';
|
||||
const RECOMMENDATION_CONTENT_FILE_PATH = '/cache/dashboard_recommendation.html';
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
@@ -502,15 +502,4 @@ class AdminDashboardControllerCore extends AdminController
|
||||
|
||||
die(json_encode($return));
|
||||
}
|
||||
|
||||
public function getRecommendationContent()
|
||||
{
|
||||
if (!Tools::isFresh(self::DASHBOARD_RECOMMENDATION_CONTENT, _TIME_1_DAY_, false)) {
|
||||
@file_put_contents(_PS_ROOT_DIR_.self::DASHBOARD_RECOMMENDATION_CONTENT, Tools::addonsRequest('dashboard-recommendation'));
|
||||
}
|
||||
if (file_exists(_PS_ROOT_DIR_.self::DASHBOARD_RECOMMENDATION_CONTENT)) {
|
||||
return Tools::file_get_contents(_PS_ROOT_DIR_.self::DASHBOARD_RECOMMENDATION_CONTENT);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -452,10 +452,9 @@ class AdminFeaturesControllerCore extends AdminController
|
||||
$this->initToolbar();
|
||||
$this->initPageHeaderToolbar();
|
||||
if ($this->display == 'edit' || $this->display == 'add') {
|
||||
if (!$this->loadObject(true)) {
|
||||
return;
|
||||
if ($this->loadObject(true)) {
|
||||
$this->content .= $this->renderForm();
|
||||
}
|
||||
$this->content .= $this->renderForm();
|
||||
} elseif ($this->display == 'view') {
|
||||
// Some controllers use the view action without an object
|
||||
if ($this->className) {
|
||||
|
||||
@@ -77,7 +77,7 @@ class AdminGendersControllerCore extends AdminController
|
||||
'list' => array(
|
||||
0 => $this->l('Male'),
|
||||
1 => $this->l('Female'),
|
||||
2 => $this->l('Neutral')
|
||||
2 => $this->l('Other')
|
||||
),
|
||||
'filter_key' => 'a!type',
|
||||
'callback' => 'displayGenderType',
|
||||
@@ -145,7 +145,7 @@ class AdminGendersControllerCore extends AdminController
|
||||
array(
|
||||
'id' => 'type_neutral',
|
||||
'value' => 2,
|
||||
'label' => $this->l('Neutral')
|
||||
'label' => $this->l('Other')
|
||||
)
|
||||
)
|
||||
),
|
||||
|
||||
@@ -175,7 +175,7 @@ class AdminLocalizationControllerCore extends AdminController
|
||||
|
||||
if (($iso_localization_pack = Tools::getValue('iso_localization_pack')) && Validate::isFileName($iso_localization_pack)) {
|
||||
if (Tools::getValue('download_updated_pack') == '1' || defined('_PS_HOST_MODE_')) {
|
||||
$pack = @Tools::file_get_contents(_PS_API_URL_.'/localization/'.$version.'/'.$iso_localization_pack.'.xml');
|
||||
$pack = @Tools::file_get_contents(_QLO_API_URL_.'/localization/'.$version.'/'.$iso_localization_pack.'.xml');
|
||||
} else {
|
||||
$pack = false;
|
||||
}
|
||||
@@ -226,7 +226,7 @@ class AdminLocalizationControllerCore extends AdminController
|
||||
$localizations_pack = false;
|
||||
$this->tpl_option_vars['options_content'] = $this->renderOptions();
|
||||
|
||||
$xml_localization = Tools::simplexml_load_file(_PS_API_URL_.'/rss/localization.xml');
|
||||
$xml_localization = Tools::simplexml_load_file(_QLO_API_URL_.'/xml/localization.xml');
|
||||
if (!$xml_localization) {
|
||||
$localization_file = _PS_ROOT_DIR_.'/localization/localization.xml';
|
||||
if (file_exists($localization_file)) {
|
||||
@@ -248,7 +248,7 @@ class AdminLocalizationControllerCore extends AdminController
|
||||
}
|
||||
|
||||
if (!$localizations_pack) {
|
||||
return $this->displayWarning($this->l('Cannot connect to '._PS_API_URL_));
|
||||
return $this->displayWarning($this->l('Cannot connect to '._QLO_API_URL_));
|
||||
}
|
||||
|
||||
// Add local localization .xml files to the list if they are not already there
|
||||
|
||||
@@ -54,7 +54,16 @@ class AdminMaintenanceControllerCore extends AdminController
|
||||
'validation' => 'isBool',
|
||||
'cast' => 'intval',
|
||||
'type' => 'bool',
|
||||
'class' => "hello"
|
||||
'form_group_class' => (Tools::getValue('PS_SHOP_ENABLE', Configuration::get('PS_SHOP_ENABLE'))) ? 'collapse' : '',
|
||||
),
|
||||
'PS_ALLOW_EMP_MAX_ATTEMPTS' => array(
|
||||
'title' => $this->l('Maximum Login Attempts'),
|
||||
'validation' => 'isUnsignedInt',
|
||||
'cast' => 'intval',
|
||||
'type' => 'text',
|
||||
'class' => 'fixed-width-xl',
|
||||
'desc' => sprintf($this->l('Set the number of maximum login attempts allowed in %d minutes. Set to 0 to disable this feature.'), MaintenanceAccess::LOGIN_ATTEMPTS_WINDOW),
|
||||
'form_group_class' => ((Tools::getValue('PS_SHOP_ENABLE', Configuration::get('PS_SHOP_ENABLE'))) || !(Tools::getValue('PS_ALLOW_EMP', Configuration::get('PS_ALLOW_EMP')))) ? ' collapse' : '',
|
||||
),
|
||||
'PS_MAINTENANCE_IP' => array(
|
||||
'title' => $this->l('Maintenance IP'),
|
||||
@@ -69,9 +78,44 @@ class AdminMaintenanceControllerCore extends AdminController
|
||||
);
|
||||
}
|
||||
|
||||
public function postProcess()
|
||||
{
|
||||
if (Tools::isSubmit('submitOptionsconfiguration')) {
|
||||
$shopEnable = Tools::getValue('PS_SHOP_ENABLE');
|
||||
$allowEmp = Tools::getValue('PS_ALLOW_EMP');
|
||||
$allowEmpMaxAttempts = trim(Tools::getValue('PS_ALLOW_EMP_MAX_ATTEMPTS'));
|
||||
$maintenanceIp = trim(Tools::getValue('PS_MAINTENANCE_IP'));
|
||||
|
||||
// validations
|
||||
if (!$shopEnable && $allowEmp) {
|
||||
if ($allowEmpMaxAttempts == '') {
|
||||
$this->errors[] = $this->l('Maximum Login Attempts is a required field.');
|
||||
} elseif (!Validate::isUnsignedInt($allowEmpMaxAttempts)) {
|
||||
$this->errors[] = $this->l('Maximum Login Attempts is invalid. Please enter a value greater than or equal to 0.');
|
||||
}
|
||||
}
|
||||
|
||||
// update values
|
||||
if (!count($this->errors)) {
|
||||
Configuration::updateValue('PS_SHOP_ENABLE', $shopEnable);
|
||||
Configuration::updateValue('PS_MAINTENANCE_IP', $maintenanceIp);
|
||||
|
||||
if (!$shopEnable) {
|
||||
Configuration::updateValue('PS_ALLOW_EMP', $allowEmp);
|
||||
|
||||
if ($allowEmp) {
|
||||
Configuration::updateValue('PS_ALLOW_EMP_MAX_ATTEMPTS', $allowEmpMaxAttempts);
|
||||
}
|
||||
}
|
||||
|
||||
Tools::redirectAdmin(self::$currentIndex.'&token='.$this->token.'&conf=6');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function setMedia()
|
||||
{
|
||||
parent::setMedia();
|
||||
$this->addJS(_PS_JS_DIR_.'maintenance.js');
|
||||
$this->addJS(_PS_JS_DIR_.'/admin/maintenance.js');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@ class AdminModulesCatalogControllerCore extends AdminController
|
||||
|
||||
public $modules;
|
||||
|
||||
const CATALOG_RECOMMENDATION_CONTENT = '/cache/catalog_recommendation.html';
|
||||
const RECOMMENDATION_CONTENT_FILE_PATH = '/cache/catalog_recommendation.html';
|
||||
|
||||
const ELEMENT_TYPE_MODULE = 1;
|
||||
const ELEMENT_TYPE_THEME = 2;
|
||||
@@ -240,17 +240,6 @@ class AdminModulesCatalogControllerCore extends AdminController
|
||||
);
|
||||
}
|
||||
|
||||
public function getRecommendationContent()
|
||||
{
|
||||
if (!Tools::isFresh(self::CATALOG_RECOMMENDATION_CONTENT, _TIME_1_DAY_, false)) {
|
||||
@file_put_contents(_PS_ROOT_DIR_.self::CATALOG_RECOMMENDATION_CONTENT, Tools::addonsRequest('catalog-recommendation'));
|
||||
}
|
||||
if (file_exists(_PS_ROOT_DIR_.self::CATALOG_RECOMMENDATION_CONTENT)) {
|
||||
return Tools::file_get_contents(_PS_ROOT_DIR_.self::CATALOG_RECOMMENDATION_CONTENT);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public function sortList(&$list, $type)
|
||||
{
|
||||
|
||||
|
||||
@@ -186,19 +186,17 @@ class AdminNormalProductsControllerCore extends AdminController
|
||||
|
||||
$id_shop = Shop::isFeatureActive() && Shop::getContext() == Shop::CONTEXT_SHOP? (int)$this->context->shop->id : 'a.id_shop_default';
|
||||
$this->_join .= ' JOIN `'._DB_PREFIX_.'product_shop` sa ON (a.`id_product` = sa.`id_product` AND sa.id_shop = '.$id_shop.')
|
||||
LEFT JOIN `'._DB_PREFIX_.'htl_room_type` hrt ON (a.`id_product` = hrt.`id_product`)
|
||||
LEFT JOIN `'._DB_PREFIX_.'htl_branch_info` hb ON (hrt.`id_hotel` = hb.`id`)
|
||||
LEFT JOIN `'._DB_PREFIX_.'htl_branch_info_lang` hbl ON (hb.`id` = hbl.`id` AND b.`id_lang` = hbl.`id_lang`)
|
||||
LEFT JOIN `'._DB_PREFIX_.'category_lang` cl ON ('.$alias.'.`id_category_default` = cl.`id_category` AND b.`id_lang` = cl.`id_lang` AND cl.id_shop = '.$id_shop.')
|
||||
LEFT JOIN `'._DB_PREFIX_.'shop` shop ON (shop.id_shop = '.$id_shop.')
|
||||
LEFT JOIN `'._DB_PREFIX_.'image_shop` image_shop ON (image_shop.`id_product` = a.`id_product` AND image_shop.`cover` = 1 AND image_shop.id_shop = '.$id_shop.')
|
||||
LEFT JOIN `'._DB_PREFIX_.'image` i ON (i.`id_image` = image_shop.`id_image`)
|
||||
LEFT JOIN `'._DB_PREFIX_.'product_download` pd ON (pd.`id_product` = a.`id_product` AND pd.`active` = 1)
|
||||
LEFT JOIN `'._DB_PREFIX_.'htl_room_type_service_product` rsp ON (rsp.`id_product` = a.`id_product`)
|
||||
LEFT JOIN `'._DB_PREFIX_.'address` aa ON (aa.`id_hotel` = hb.`id`)';
|
||||
LEFT JOIN `'._DB_PREFIX_.'htl_room_type` hrt ON (rsp.`id_element` = hrt.`id_product` AND rsp.`element_type` = '.(int)RoomTypeServiceProduct::WK_ELEMENT_TYPE_ROOM_TYPE.')
|
||||
'.HotelBranchInformation::addHotelRestriction(false, 'hrt');
|
||||
|
||||
$this->_select .= ' IF(a.`auto_add_to_cart`, "'.$this->l('Yes').'", "'.$this->l('No').'") as auto_added, IF(a.`auto_add_to_cart`, 1, 0) as badge_success, IF(a.`show_at_front`, "'.$this->l('Yes').'", "'.$this->l('No').'") as show_at_front_txt, IF(a.`price_calculation_method` = '.(int)Product::PRICE_CALCULATION_METHOD_PER_DAY.', "'.$this->l('Per Day').'", "'.$this->l('Per Booking').'") as price_calculation_method_txt, (SELECT COUNT(hri.`id`) FROM `'._DB_PREFIX_.'htl_room_information` hri WHERE hri.`id_product` = a.`id_product`) as num_rooms, ';
|
||||
$this->_select .= ' COUNT(rsp.`id_product`) as products_associated, hrt.`adults`, hrt.`children`, hb.`id` as id_hotel, aa.`city`, hbl.`hotel_name`, ';
|
||||
$this->_select .= ' COUNT(hrt.`id_product`) as products_associated, ';
|
||||
$this->_select .= 'shop.`name` AS `shopname`, a.`id_shop_default`, ';
|
||||
$this->_select .= $alias_image.'.`id_image` AS `id_image`, cl.`name` AS `name_category`, '.$alias.'.`price`, 0 AS `price_final`, a.`is_virtual`, pd.`nb_downloadable`, sav.`quantity` AS `sav_quantity`, '.$alias.'.`active`, IF(sav.`quantity`<=0, 1, 0) AS `badge_danger`';
|
||||
|
||||
@@ -210,7 +208,6 @@ class AdminNormalProductsControllerCore extends AdminController
|
||||
// show the list of the product according to the booking or service products
|
||||
$this->_where .= ' AND a.`booking_product` = 0';
|
||||
|
||||
$this->_use_found_rows = false;
|
||||
$this->_group = 'GROUP BY a.`id_product`';
|
||||
|
||||
$this->fields_list = array();
|
||||
@@ -280,7 +277,7 @@ class AdminNormalProductsControllerCore extends AdminController
|
||||
$idServiceCategory = Configuration::get('PS_SERVICE_CATEGORY');
|
||||
$this->objLocationsCategory = new Category($idServiceCategory, $this->context->language->id);
|
||||
$nestedCategories = Category::getNestedCategories($idServiceCategory);
|
||||
if ($nestedCategories) {
|
||||
if (isset($nestedCategories[$idServiceCategory]['children']) && $nestedCategories[$idServiceCategory]['children']) {
|
||||
foreach ($nestedCategories[$idServiceCategory]['children'] as $childCategory) {
|
||||
$this->buildCategoryOptions($childCategory);
|
||||
}
|
||||
@@ -1395,7 +1392,10 @@ class AdminNormalProductsControllerCore extends AdminController
|
||||
parent::postProcess();
|
||||
}
|
||||
|
||||
if ($this->display == 'edit' || $this->display == 'add') {
|
||||
if (in_array($this->display, array('add', 'edit'))
|
||||
&& $this->tabAccess[$this->display] == '1'
|
||||
&& $this->loadObject(true)
|
||||
) {
|
||||
$this->addJqueryUI(array(
|
||||
'ui.core',
|
||||
'ui.widget'
|
||||
@@ -2817,9 +2817,7 @@ class AdminNormalProductsControllerCore extends AdminController
|
||||
}
|
||||
|
||||
// let's calculate this once for all
|
||||
if (!Validate::isLoadedObject($this->object) && Tools::getValue('id_product')) {
|
||||
$this->errors[] = 'Unable to load object';
|
||||
} else {
|
||||
if ($this->loadObject(true)) {
|
||||
$this->_displayDraftWarning($this->object->active);
|
||||
|
||||
// if there was an error while saving, we don't want to lose posted data
|
||||
@@ -2994,7 +2992,7 @@ class AdminNormalProductsControllerCore extends AdminController
|
||||
->setUseSearch(false)
|
||||
->setFullTree(0)
|
||||
->setSelectedCategories($categories)
|
||||
->setUseBulkActions(false);
|
||||
->setUseBulkActions(true);
|
||||
|
||||
$data->assign(array('default_category' => $default_category,
|
||||
'selected_cat_ids' => implode(',', array_keys($selected_cat)),
|
||||
@@ -3079,7 +3077,7 @@ class AdminNormalProductsControllerCore extends AdminController
|
||||
} else {
|
||||
$address->id_country = (int)$address_infos['id_country'];
|
||||
$address->id_state = (int)$address_infos['id_state'];
|
||||
$address->zipcode = $address_infos['postcode'];
|
||||
$address->postcode = $address_infos['postcode'];
|
||||
}
|
||||
$tax_rules_groups = TaxRulesGroup::getTaxRulesGroups(true);
|
||||
$tax_rates = array(
|
||||
@@ -3510,7 +3508,7 @@ class AdminNormalProductsControllerCore extends AdminController
|
||||
->setRoomsOnly(false)
|
||||
->setSelectedHotels($selectedElements['hotels'])
|
||||
->setSelectedRoomTypes($selectedElements['room_types'])
|
||||
->setUseBulkActions(false)
|
||||
->setUseBulkActions(true)
|
||||
->setAccessedHotels(HotelBranchInformation::getProfileAccessedHotels($this->context->employee->id_profile, 1, 0));
|
||||
|
||||
$data->assign('hotel_tree', $tree->render());
|
||||
|
||||
@@ -82,6 +82,7 @@ class AdminOrderPreferencesControllerCore extends AdminController
|
||||
)
|
||||
);
|
||||
|
||||
$maxOrderDate = Tools::getValue('MAX_GLOBAL_BOOKING_DATE', Configuration::get('MAX_GLOBAL_BOOKING_DATE'));
|
||||
$this->fields_options = array(
|
||||
'order_restrict' => array(
|
||||
'title' => $this->l('Order Restrict'),
|
||||
@@ -92,11 +93,13 @@ class AdminOrderPreferencesControllerCore extends AdminController
|
||||
'hint' => $this->l('Maximum date of check-out for which rooms of your hotels can be booked.'),
|
||||
'type' => 'text',
|
||||
'id' => 'max_global_book_date',
|
||||
'auto_value' => false,
|
||||
'value' => date('d-m-Y', strtotime($maxOrderDate)),
|
||||
'class' => 'fixed-width-xxl readonly',
|
||||
),
|
||||
'GLOBAL_PREPARATION_TIME' => array(
|
||||
'title' => $this->l('Preparation time'),
|
||||
'hint' => $this->l('Number of days required to prepare a room for a guest\'s stay. For example, if you set this value to 3 and someone is booking on 2nd of March he can only book rooms for dates from and after 3 days, i.e, 5th of March.'),
|
||||
'title' => $this->l('Minimum booking offset'),
|
||||
'hint' => $this->l('The minimum booking offset is the minimum number of days before the check-in date that a guest must book a room. For example, if you set this value to 3 and someone is booking on 2nd of March he can only book rooms for dates from and after 3 days, i.e, 5th of March.'),
|
||||
'desc' => $this->l('Set to 0 to disable this feature.'),
|
||||
'type' => 'text',
|
||||
'class' => 'fixed-width-xl',
|
||||
@@ -329,6 +332,7 @@ class AdminOrderPreferencesControllerCore extends AdminController
|
||||
$this->errors[] = Tools::displayError('Please assign a valid CMS page for Terms and Conditions.');
|
||||
}
|
||||
|
||||
$_POST['MAX_GLOBAL_BOOKING_DATE'] = date('Y-m-d', strtotime(Tools::getValue('MAX_GLOBAL_BOOKING_DATE')));
|
||||
$maxGlobalBookingDate = Tools::getValue('MAX_GLOBAL_BOOKING_DATE');
|
||||
$globalPreparationTime = Tools::getValue('GLOBAL_PREPARATION_TIME');
|
||||
$maxGlobalBookingDateFormatted = date('Y-m-d', strtotime($maxGlobalBookingDate));
|
||||
@@ -342,9 +346,9 @@ class AdminOrderPreferencesControllerCore extends AdminController
|
||||
}
|
||||
|
||||
if ($globalPreparationTime === '') {
|
||||
$this->errors[] = Tools::displayError('Field \'Preparation time\' can not be empty.');
|
||||
$this->errors[] = Tools::displayError('Field \'Minimum booking offset\' can not be empty.');
|
||||
} elseif ($globalPreparationTime !== '0' && !Validate::isUnsignedInt($globalPreparationTime)) {
|
||||
$this->errors[] = Tools::displayError('Field \'Preparation time\' is invalid.');
|
||||
$this->errors[] = Tools::displayError('Field \'Minimum booking offset\' is invalid.');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user