Skip to content

Commit

Permalink
Merge branch 'develop' into patch-booking
Browse files Browse the repository at this point in the history
  • Loading branch information
shreesh-webkul committed Oct 4, 2024
2 parents 53b6b12 + 7a30604 commit bf71e89
Show file tree
Hide file tree
Showing 38 changed files with 399 additions and 313 deletions.
Binary file added admin/themes/default/img/loader.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion admin/themes/default/sass/partials/_chosen.sass
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ $chosen-focus-box-shadow: 0 1px 1px rgba(0, 0, 0, .075) inset, 0 0 8px rgba(82,
$chosen-focus-transition: border linear .2s, box-shadow linear .2s
$chosen-height: $input-height-base
$chosen-multi-height: $input-height-base + 6px
$chosen-sprite-path: '../img/chosen-sprite.png'
$chosen-sprite-path: '#{$img-path}/chosen-sprite.png'

.chosen-select
width: 100%
Expand Down
22 changes: 11 additions & 11 deletions admin/themes/default/sass/partials/_select2.scss
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ Version: 3.4.6 Timestamp: Sat Mar 22 22:30:15 EDT 2014
text-decoration: none;

border: 0;
background: url('../img/select2.png') right top no-repeat;
background: url('#{$img-path}/select2.png') right top no-repeat;
cursor: pointer;
outline: 0;
}
Expand Down Expand Up @@ -182,7 +182,7 @@ Version: 3.4.6 Timestamp: Sat Mar 22 22:30:15 EDT 2014
display: block;
width: 100%;
height: 100%;
background: url('../img/select2.png') no-repeat 0 1px;
background: url('#{$img-path}/select2.png') no-repeat 0 1px;
}

.select2-search {
Expand Down Expand Up @@ -215,17 +215,17 @@ Version: 3.4.6 Timestamp: Sat Mar 22 22:30:15 EDT 2014
-webkit-box-shadow: none;
box-shadow: none;

background: #fff url('../img/select2.png') no-repeat 100% -22px;
background: url('../img/select2.png') no-repeat 100% -22px;
background: #fff url('#{$img-path}/select2.png') no-repeat 100% -22px;
background: url('#{$img-path}/select2.png') no-repeat 100% -22px;
}

.select2-drop.select2-drop-above .select2-search input {
margin-top: 4px;
}

.select2-search input.select2-active {
background: #fff url('../img/select2-spinner.gif') no-repeat 100%;
background: url('../img/select2-spinner.gif') no-repeat 100%;
background: #fff url('#{$img-path}/select2-spinner.gif') no-repeat 100%;
background: url('#{$img-path}/select2-spinner.gif') no-repeat 100%;
}

.select2-container-active .select2-choice,
Expand Down Expand Up @@ -369,7 +369,7 @@ disabled look for disabled choices in the results dropdown
}

.select2-more-results.select2-active {
background: #f4f4f4 url('../img/select2-spinner.gif') no-repeat 100%;
background: #f4f4f4 url('#{$img-path}/select2-spinner.gif') no-repeat 100%;
}

.select2-more-results {
Expand Down Expand Up @@ -456,7 +456,7 @@ html[dir="rtl"] .select2-container-multi .select2-choices li
}

.select2-container-multi .select2-choices .select2-search-field input.select2-active {
background: #fff url('../img/select2-spinner.gif') no-repeat 100% !important;
background: #fff url('#{$img-path}/select2-spinner.gif') no-repeat 100% !important;
}

.select2-default {
Expand Down Expand Up @@ -512,7 +512,7 @@ html[dir="rtl"] .select2-container-multi .select2-choices .select2-search-choice

font-size: 1px;
outline: none;
background: url('../img/select2.png') right top no-repeat;
background: url('#{$img-path}/select2.png') right top no-repeat;
}
html[dir="rtl"] .select2-search-choice-close {
right: auto;
Expand Down Expand Up @@ -590,7 +590,7 @@ html[dir="rtl"] .select2-search-choice-close {
.select2-search-choice-close,
.select2-container .select2-choice abbr,
.select2-container .select2-choice .select2-arrow b {
background-image: url('../img/select2x2.png') !important;
background-image: url('#{$img-path}/select2x2.png') !important;
background-repeat: no-repeat !important;
background-size: 60px 40px !important;
}
Expand All @@ -607,7 +607,7 @@ html[dir="rtl"] .select2-search-choice-close {
}

.form-control .select2-choice .select2-arrow {
border-radius: 0 2px 2px 0;
border-radius: 0 2px 2px 0;
}

.form-control.select2-container {
Expand Down
2 changes: 1 addition & 1 deletion admin/themes/default/sass/partials/_tinymce.sass
Original file line number Diff line number Diff line change
Expand Up @@ -1210,7 +1210,7 @@ i.mce-i-resize
opacity: .6
filter: alpha(opacity = 60)
zoom: 1
background: white url('img/loader.gif') no-repeat center center
background: white url('#{$img-path}/loader.gif') no-repeat center center

.mce-i-none
width: 16px
Expand Down
7 changes: 2 additions & 5 deletions admin/themes/default/template/controllers/login/header.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,11 @@
{/if}
{/foreach}
{/if}
{foreach from=$js_files item=js_uri}
<script type="text/javascript" src="{$js_uri}"></script>
{/foreach}
<script type="text/javascript" src="../js/admin/login.js?v={$smarty.const._PS_VERSION_|escape:'html':'UTF-8'}"></script>

{if (isset($js_def) && count($js_def) || isset($js_files) && count($js_files))}
{include file=$smarty.const._PS_ALL_THEMES_DIR_|cat:"javascript.tpl"}
{/if}
<script type="text/javascript" src="../js/admin/login.js?v={$smarty.const._PS_VERSION_|escape:'html':'UTF-8'}"></script>

</head>
<body class="ps_back-office bootstrap">
<div id="login">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@
function afterDeleteProductImage(data)
{
data = $.parseJSON(data);
if (data)
if (data.status)
{
cover = 0;
id = data.content.id;
Expand All @@ -265,6 +265,8 @@
if (parseInt($("#countImage").html()) <= 1)
$('#caption_selection').addClass('hidden');
} else if (data.error) {
showErrorMessage(data.error);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@
function afterDeleteProductImage(data)
{
data = $.parseJSON(data);
if (data)
if (data.status)
{
cover = 0;
id = data.content.id;
Expand All @@ -265,6 +265,8 @@
if (parseInt($("#countImage").html()) <= 1)
$('#caption_selection').addClass('hidden');
} else if (data.error) {
showErrorMessage(data.error);
}
}
Expand Down
30 changes: 24 additions & 6 deletions admin/themes/default/template/helpers/tree/tree.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
{if isset($use_checkbox) && $use_checkbox == true}
function checkAll($tree)
{
$tree.find(":input[type=checkbox]").each(
$tree.find(":input[type=checkbox]:not([hidden])").each(
function()
{
$(this).prop("checked", true);
Expand All @@ -53,7 +53,7 @@
function uncheckAll($tree)
{
$tree.find(":input[type=checkbox]").each(
$tree.find(":input[type=checkbox]:not([hidden])").each(
function()
{
$(this).prop("checked", false);
Expand All @@ -64,7 +64,8 @@
{/if}
{if isset($use_search) && $use_search == true}
$("#{$id|escape:'html':'UTF-8'}-search").bind("typeahead:selected", function(obj, datum) {
$("#{$id|escape:'html':'UTF-8'}").find(":input").each(
var suffix = '{if isset($use_checkbox) && $use_checkbox == true}[]{/if}';
$("#{$id|escape:'html':'UTF-8'}").find('[name="'+datum.input_name + suffix + '"]:input').each(
function()
{
if ($(this).val() == datum.value)
Expand All @@ -78,6 +79,15 @@
$(this).show();
$(this).prev().find('.icon-folder-close').removeClass('icon-folder-close').addClass('icon-folder-open');
});
{if isset($auto_select_children) && $auto_select_children == true}
if ($(this).closest('.tree-item').length == 0) {
$(this).closest('.tree-folder').find(':input[type=checkbox]').each(function(){
$(this).prop('checked', true);
$(this).parent().addClass('tree-selected');
});
}
{/if}
}
}
);
Expand All @@ -86,7 +96,7 @@
{if isset($auto_select_children) && $auto_select_children == true}
$('#{$id|escape:'html':'UTF-8'}').find(':input[type=checkbox]').on('click', function(){
if ($(this).closest('.tree-item').length ==0) {
if ($(this).closest('.tree-item').length == 0) {
if ($(this).is(":checked")) {
$(this).closest('.tree-folder').find(':input[type=checkbox]').each(function(){
$(this).prop('checked', true);
Expand All @@ -111,9 +121,13 @@
});
{/if}
$(document).ready(function () {
var tree = $("#{$id|escape:'html':'UTF-8'}").tree('collapseAll');
function startTree() {
if (typeof $.fn.tree === 'undefined') {
setTimeout(startTree, 100);
return;
}
var tree = $("#{$id|escape:'html':'UTF-8'}").tree('collapseAll');
if ($("#{$id|escape:'html':'UTF-8'}").find(":input:checked").length > 1)
$('#expand-all-{$id|escape:'html':'UTF-8'}').hide();
Expand All @@ -127,6 +141,10 @@
$(this).prev().find('.icon-folder-close').removeClass('icon-folder-close').addClass('icon-folder-open');
});
});
}
$(document).ready(function () {
startTree();
});
{/block}
</script>
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*}
<li class="tree-folder">
<li class="tree-folder" {if isset($node['hidden']) && $node['hidden'] == true} hidden="hidden"{/if}>
<span class="tree-folder-name">
<i class="icon-folder-close"></i>
<label class="tree-toggler">{$node['name']|escape:'html':'UTF-8'}</label>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*}
<li class="tree-folder">
<li class="tree-folder" {if isset($node['hidden']) && $node['hidden'] == true} hidden="hidden"{/if}>
<span class="tree-folder-name{if isset($node['disabled']) && $node['disabled'] == true} tree-folder-name-disable{/if}">
{if !isset($selectable) || $selectable}
<input type="checkbox" name="{$node['input_name']}[]" value="{$node['value']}"{if isset($node['selected']) && $node['selected'] == true} checked="checked"{/if}{if isset($node['disabled']) && $node['disabled'] == true} disabled="disabled"{/if} />
<input type="checkbox" name="{$node['input_name']}[]" value="{$node['value']}"{if isset($node['selected']) && $node['selected'] == true} checked="checked"{/if}{if isset($node['disabled']) && $node['disabled'] == true} disabled="disabled"{/if} {if isset($node['hidden']) && $node['hidden'] == true} hidden="hidden"{/if}/>
{/if}
<i class="icon-folder-close"></i>
<label class="tree-toggler">{if isset($node['name'])}{$node['name']|escape:'html':'UTF-8'}{/if}{if isset($node['selected_childs']) && (int)$node['selected_childs'] > 0} {l s='(%s selected)' sprintf=$node['selected_childs']}{/if}</label>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*}
<li class="tree-folder">
<li class="tree-folder" {if isset($node['hidden']) && $node['hidden'] == true} hidden="hidden"{/if}>
<span class="tree-folder-name{if isset($node['disabled']) && $node['disabled'] == true} tree-folder-name-disable{/if}">
{if !isset($selectable) || $selectable}
<input type="radio" name="{$node['input_name']}" value="{$node['value']}"{if isset($node['selected']) && $node['selected'] == true} checked="checked"{/if}{if isset($node['disabled']) && $node['disabled'] == true} disabled="disabled"{/if} />
<input type="radio" name="{$node['input_name']}" value="{$node['value']}"{if isset($node['selected']) && $node['selected'] == true} checked="checked"{/if}{if isset($node['disabled']) && $node['disabled'] == true} disabled="disabled"{/if} {if isset($node['hidden']) && $node['hidden'] == true} hidden="hidden"{/if}/>
{/if}
<i class="icon-folder-close"></i>
<label class="tree-toggler">{$node['name']|escape:'html':'UTF-8'}</label>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
* International Registered Trademark & Property of PrestaShop SA
*}

<li class="tree-item">
<li class="tree-item" {if isset($node['hidden']) && $node['hidden'] == true} hidden="hidden"{/if}>
<span class="tree-item-name">
<i class="tree-dot"></i>
<label class="tree-toggler">{$node['name']}</label>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*}
<li class="tree-item{if isset($node['disabled']) && $node['disabled'] == true} tree-item-disable{/if}">
<li class="tree-item{if isset($node['disabled']) && $node['disabled'] == true} tree-item-disable{/if}" {if isset($node['hidden']) && $node['hidden'] == true} hidden="hidden"{/if}>
<span class="tree-item-name{if isset($node['disabled']) && $node['disabled'] == true} tree-item-name-disable{/if}">
<input type="checkbox" name="{$node['input_name']}[]" value="{$node['value']}"{if isset($node['selected']) && $node['selected'] == true} checked="checked"{/if}{if isset($node['disabled']) && $node['disabled'] == true} disabled="disabled"{/if} />
<input type="checkbox" name="{$node['input_name']}[]" value="{$node['value']}"{if isset($node['selected']) && $node['selected'] == true} checked="checked"{/if}{if isset($node['disabled']) && $node['disabled'] == true} disabled="disabled"{/if} {if isset($node['hidden']) && $node['hidden'] == true} hidden="hidden"{/if} />
<i class="tree-dot"></i>
<label class="tree-toggler">{$node['name']}</label>
</span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*}
<li class="tree-item{if isset($node['disabled']) && $node['disabled'] == true} tree-item-disable{/if}">
<li class="tree-item{if isset($node['disabled']) && $node['disabled'] == true} tree-item-disable{/if}" {if isset($node['hidden']) && $node['hidden'] == true} hidden="hidden"{/if}>
<span class="tree-item-name">
<input type="radio" name="{$node['input_name']}" value="{$node['value']}"{if isset($node['selected']) && $node['selected'] == true} checked="checked"{/if}{if isset($node['disabled']) && $node['disabled'] == true} disabled="disabled"{/if} />
<input type="radio" name="{$node['input_name']}" value="{$node['value']}"{if isset($node['selected']) && $node['selected'] == true} checked="checked"{/if}{if isset($node['disabled']) && $node['disabled'] == true} disabled="disabled"{/if} {if isset($node['hidden']) && $node['hidden'] == true} hidden="hidden"{/if} />
<i class="tree-dot"></i>
<label class="tree-toggler">{$node['name']}</label>
</span>
Expand Down
2 changes: 1 addition & 1 deletion classes/CartRule.php
Original file line number Diff line number Diff line change
Expand Up @@ -565,7 +565,7 @@ public function checkValidity(Context $context, $alreadyInCart = false, $display
return (!$display_error) ? false : Tools::displayError('This voucher has expired');
}
if (!$alreadyInCart && $context->cart->getOrderTotal(true, Cart::BOTH) <= 0) {
return (!$display_error) ? false : Tools::displayError('You cannot add more vouchers. Please remove an existing voucher before applying a new one.');
return (!$display_error) ? false : Tools::displayError('You cannot add more vouchers since the booking amount has already reached zero. Please remove an existing voucher before adding a new one.');
}

if ($context->cart->id_customer) {
Expand Down
2 changes: 1 addition & 1 deletion classes/controller/AdminController.php
Original file line number Diff line number Diff line change
Expand Up @@ -1027,7 +1027,7 @@ public function processFilter()
public function processListVisibility()
{
$listFieldsVisibility = Tools::getValue('list_fields_visibility', array()); // To set optional list empty in case none is selected
$controller = 'list_visibility_'.$this->context->controller->className;
$controller = 'list_visibility_'.$this->context->controller->controller_name;
$this->context->cookie->$controller = json_encode($listFieldsVisibility);

return true;
Expand Down
2 changes: 1 addition & 1 deletion classes/helper/HelperList.php
Original file line number Diff line number Diff line change
Expand Up @@ -726,7 +726,7 @@ public function displayListHeader()
}

// get selected fields to display
$list_visibility = json_decode($this->context->cookie->{'list_visibility_'.$this->context->controller->className});
$list_visibility = json_decode($this->context->cookie->{'list_visibility_'.$this->context->controller->controller_name});
foreach ($this->fields_list as $key => $field) {
if (!(isset($field['search']) && $field['search'] === false)) {
$has_search_field = true;
Expand Down
8 changes: 4 additions & 4 deletions controllers/admin/AdminCartRulesController.php
Original file line number Diff line number Diff line change
Expand Up @@ -601,15 +601,15 @@ public function getProductRuleDisplay($product_rule_group_id, $product_rule_id,
$products['selected'] = HotelBranchInformation::filterDataByHotelAccess(
$products['selected'],
$this->context->employee->id_profile,
0,
1,
false,
'id',
1
);
$products['unselected'] = HotelBranchInformation::filterDataByHotelAccess(
$products['unselected'],
$this->context->employee->id_profile,
0,
1,
false,
'id',
1
);
Context::getContext()->smarty->assign('product_rule_itemlist', $products);
Expand Down
2 changes: 1 addition & 1 deletion controllers/admin/AdminEmployeesController.php
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ public function initPageHeaderToolbar()
{
parent::initPageHeaderToolbar();

if (empty($this->display)) {
if (empty($this->display) || $this->display == 'list') {
$this->page_header_toolbar_btn['new_employee'] = array(
'href' => self::$currentIndex.'&addemployee&token='.$this->token,
'desc' => $this->l('Add new employee', null, null, false),
Expand Down
2 changes: 1 addition & 1 deletion controllers/admin/AdminImagesController.php
Original file line number Diff line number Diff line change
Expand Up @@ -823,7 +823,7 @@ public function initMoveImages()

public function initPageHeaderToolbar()
{
if (empty($this->display)) {
if (empty($this->display) || $this->display == 'list') {
$this->page_header_toolbar_btn['new_image_type'] = array(
'href' => self::$currentIndex.'&addimage_type&token='.$this->token,
'desc' => $this->l('Add new image type', null, null, false),
Expand Down
2 changes: 1 addition & 1 deletion controllers/admin/AdminLocalizationController.php
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ public function postProcess()
}

if (Tools::isSubmit('submitLocalizationPack')) {
$version = str_replace('.', '', _PS_VERSION_);
$version = str_replace('.', '', _QLOAPPS_VERSION_);
$version = substr($version, 0, 2);

if (($iso_localization_pack = Tools::getValue('iso_localization_pack')) && Validate::isFileName($iso_localization_pack)) {
Expand Down
2 changes: 1 addition & 1 deletion controllers/admin/AdminMetaController.php
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ public function __construct()

public function initPageHeaderToolbar()
{
if (empty($this->display)) {
if (empty($this->display) || $this->display == 'list') {
$this->page_header_toolbar_btn['new_meta'] = array(
'href' => self::$currentIndex.'&addmeta&token='.$this->token,
'desc' => $this->l('Add a new page', null, null, false),
Expand Down
Loading

0 comments on commit bf71e89

Please sign in to comment.