Skip to content

Commit

Permalink
Version 2.2.1
Browse files Browse the repository at this point in the history
  • Loading branch information
luigifab committed Feb 2, 2022
1 parent e9a5b82 commit 95ea78c
Show file tree
Hide file tree
Showing 16 changed files with 63 additions and 34 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ To display delivery times, you must edit your template with:

## Copyright and Credits

- Current version: 2.2.0 (01/01/2022)
- Current version: 2.2.1 (02/02/2022)
- Compatibility: OpenMage 19.x / 20.x / 21.x, PHP 7.2 / 7.3 / 7.4 / 8.0 / 8.1
- Client compatibility: Firefox 36+, Chrome 32+, Opera 19+, Edge 16+, Safari 9+
- Translations: English (en), French (fr-FR/fr-CA), German (de), Italian (it), Portuguese (pt-PT/pt-BR), Spanish (es) / Chinese (zh), Czech (cs), Dutch (nl), Greek (el), Hungarian (hu), Japanese (ja), Polish (pl), Romanian (ro), Russian (ru), Slovak (sk), Turkish (tr), Ukrainian (uk)
Expand Down
12 changes: 8 additions & 4 deletions src/app/code/community/Kyrena/Shippingmax/Helper/Data.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
/**
* Created V/12/04/2019
* Updated J/23/12/2021
* Updated M/25/01/2022
*
* Copyright 2019-2022 | Fabrice Creuzot <fabrice~cellublue~com>
* Copyright 2019-2022 | Jérôme Siau <jerome~cellublue~com>
Expand Down Expand Up @@ -45,8 +45,8 @@ public function formatDate($date = null, $format = Zend_Date::DATETIME_LONG, $sh
return str_replace($object->date($date)->toString(Zend_Date::TIMEZONE), '', $object->date($date)->toString($format));
}

public function getHumanEmailAddress(string $email) {
return $this->escapeEntities(str_replace(['<', '>', ',', '"'], ['(', ')', ', ', ''], $email));
public function getHumanEmailAddress($email) {
return empty($email) ? '' : $this->escapeEntities(str_replace(['<', '>', ',', '"'], ['(', ')', ', ', ''], $email));
}

public function getHumanDuration($start, $end = null) {
Expand Down Expand Up @@ -312,7 +312,11 @@ public function getCarrierCountries(string $code, $storeId = null) {
$allCountries = array_filter(explode(',', Mage::getStoreConfig('general/country/allow', $storeId)));
$selCountries = Mage::getStoreConfig('carriers/'.$code.'/specificcountry', $storeId);
$selCountries = empty($selCountries) ? [] : array_filter(explode(',', $selCountries));
$countries = empty($selCountries) ? $allCountries : array_intersect($allCountries, $selCountries);

if ($code == 'shippingmax_storelocator')
$allCountries = Mage::getResourceModel('directory/country_collection')->getColumnValues('country_id');

$countries = empty($selCountries) ? $allCountries : array_intersect($allCountries, $selCountries);

$config = Mage::getStoreConfig('carriers/'.$code.((strpos($code, 'owebiashipping') === false) ? '/owebia_config' : '/config'), $storeId);
if (mb_stripos($config, '"shipto"') !== false) {
Expand Down
5 changes: 2 additions & 3 deletions src/app/code/community/Kyrena/Shippingmax/Model/Observer.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
/**
* Created V/12/04/2019
* Updated S/11/12/2021
* Updated D/26/12/2021
*
* Copyright 2019-2022 | Fabrice Creuzot <fabrice~cellublue~com>
* Copyright 2019-2022 | Jérôme Siau <jerome~cellublue~com>
Expand Down Expand Up @@ -237,7 +237,6 @@ public function hideConfig(Varien_Event_Observer $observer) {
}

// CRON shippingmax_update_files
// toutes les heures, oui mais on s'assure aussi que le fichier a expiré
public function updateFullFiles($cron = null) {

$app = Mage::app();
Expand Down Expand Up @@ -321,7 +320,7 @@ public function updateFullFiles($cron = null) {
}

if (is_object($cron)) {
$cron->setData('messages', implode("\n", $msg));
$cron->setData('messages', 'memory: '.((int) (memory_get_peak_usage(true) / 1024 / 1024)).' M'."\n".implode("\n", $msg));
if ($hasError) // pour le statut du cron
Mage::throwException('At least one error occurred while downloading files.'."\n\n".$cron->getData('messages')."\n\n");
}
Expand Down
4 changes: 2 additions & 2 deletions src/app/code/community/Kyrena/Shippingmax/etc/config.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
* Created V/12/04/2019
* Updated J/09/12/2021
* Updated J/27/01/2022
*
* Copyright 2019-2022 | Fabrice Creuzot <fabrice~cellublue~com>
* Copyright 2019-2022 | Jérôme Siau <jerome~cellublue~com>
Expand All @@ -21,7 +21,7 @@
<config>
<modules>
<Kyrena_Shippingmax>
<version>2.2.0</version>
<version>2.2.1</version>
</Kyrena_Shippingmax>
</modules>
<global>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* Created V/12/04/2019
* Updated M/07/09/2021
* Updated M/25/01/2022
*
* Copyright 2019-2022 | Fabrice Creuzot <fabrice~cellublue~com>
* Copyright 2019-2022 | Jérôme Siau <jerome~cellublue~com>
Expand Down Expand Up @@ -39,6 +39,7 @@ var shippingmax = new (function () {
if (document.getElementById('shippingmaxDialog'))
return;

this.scroll = window.pageYOffset;
var data = document.createElement('div');
data.innerHTML =
'<div id="shippingmaxDialog" onclick="shippingmax.close(event);">' +
Expand All @@ -48,9 +49,18 @@ var shippingmax = new (function () {
'</div>' +
'</div>';

this.scroll = window.pageYOffset;
document.querySelector('body').appendChild(data.firstChild);
document.querySelector('body').classList.add('no-scroll');
document.addEventListener('keydown', shippingmax.keyClose);
};

this.keyClose = function (ev) {

if (ev.keyCode === 27) {
console.log('shippingmax.map - esc/keyClose');
ev.preventDefault();
shippingmax.close(true);
}
};

this.close = function (ev) {
Expand All @@ -65,6 +75,7 @@ var shippingmax = new (function () {
if (ev === true) {
document.getElementById('shippingmaxDialog').remove();
document.querySelector('body').classList.remove('no-scroll');
document.removeEventListener('keydown', shippingmax.keyClose);
window.scrollTo(0, shippingmax.scroll);
}
};
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

16 changes: 9 additions & 7 deletions src/skin/frontend/base/default/css/kyrena/shippingmax/map.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* Created V/12/04/2019
* Updated V/24/12/2021
* Updated M/04/01/2022
*
* Copyright 2019-2022 | Fabrice Creuzot <fabrice~cellublue~com>
* Copyright 2019-2022 | Mickaël Vang <mickael~cellublue~com>
Expand Down Expand Up @@ -890,7 +890,6 @@ button {
height: 40px;
margin-left: 15px;

cursor: pointer;
user-select: none;
-ms-user-select: none;
-moz-user-select: none;
Expand Down Expand Up @@ -1030,13 +1029,20 @@ button {
flex-direction: column;
align-items: flex-start;
padding-right: 36px;
cursor: pointer;

.small {
display: inline;
}
}

&.multi + .toggle-list {
cursor: pointer;
}

&.single label {
cursor: default;
}

&.multi li:hover .country-item {
background-color: #eaedfd !important;
}
Expand Down Expand Up @@ -1069,10 +1075,6 @@ button {
}
}

&.single label {
cursor: default;
}

label {
display: inline-block;
width: 100%;
Expand Down
Loading

0 comments on commit 95ea78c

Please sign in to comment.