-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #135 from PrestaShop/dev
Release 2.4.2
- Loading branch information
Showing
39 changed files
with
361 additions
and
603 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,61 +2,6 @@ name: Build | |
on: [push, pull_request] | ||
|
||
jobs: | ||
deploy: | ||
name: build dependencies & create artifact | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/[email protected] | ||
- name: Install composer dependencies | ||
run: composer install --no-dev -o | ||
- name: Clean-up project | ||
uses: PrestaShopCorp/[email protected] | ||
- name: Prepare auto-index tool | ||
run: | | ||
composer global require prestashop/autoindex | ||
- name: Generate index.php | ||
run: | | ||
~/.composer/vendor/bin/autoindex | ||
- name: Create & upload artifact | ||
uses: actions/upload-artifact@v1 | ||
with: | ||
name: ${{ github.event.repository.name }} | ||
path: ../ | ||
update_release_draft: | ||
runs-on: ubuntu-latest | ||
needs: [deploy] | ||
if: github.event_name == 'push' && github.event.ref == 'refs/heads/master' | ||
steps: | ||
- name: Download artifact | ||
uses: actions/download-artifact@v1 | ||
with: | ||
name: ${{ github.event.repository.name }} | ||
- id: release_info | ||
uses: toolmantim/release-drafter@v5 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Prepare for Release | ||
run: | | ||
cd ${{ github.event.repository.name }} | ||
zip -r ${{ github.event.repository.name }}.zip ${{ github.event.repository.name }} | ||
- name: Clean existing assets | ||
shell: bash | ||
run: | | ||
curl -fsSL https://github.com/github/hub/raw/master/script/get | bash -s 2.14.1 | ||
assets=`bin/hub api -t repos/${{ github.repository }}/releases/${{ steps.release_info.outputs.id }}/assets | awk '/\].url/ { print $2 }'` | ||
for asset in $assets | ||
do | ||
bin/hub api -X DELETE $asset | ||
done | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Publish to GitHub Release | ||
uses: actions/[email protected] | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ steps.release_info.outputs.upload_url }} | ||
asset_path: ./${{ github.event.repository.name }}/${{ github.event.repository.name }}.zip | ||
asset_name: ${{ github.event.repository.name }}.zip | ||
asset_content_type: application/zip | ||
build-and-release-draft: | ||
name: Build & Release draft | ||
uses: PrestaShop/.github/.github/workflows/build-release.yml@master |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,21 @@ | ||
<?php | ||
/** | ||
* 2007-2020 PrestaShop. | ||
* Copyright since 2007 PrestaShop SA and Contributors | ||
* PrestaShop is an International Registered Trademark & Property of PrestaShop SA | ||
* | ||
* NOTICE OF LICENSE | ||
* | ||
* This source file is subject to the Academic Free License 3.0 (AFL-3.0) | ||
* that is bundled with this package in the file LICENSE.txt. | ||
* This source file is subject to the Academic Free License version 3.0 | ||
* that is bundled with this package in the file LICENSE.md. | ||
* It is also available through the world-wide-web at this URL: | ||
* https://opensource.org/licenses/AFL-3.0 | ||
* 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 [email protected] 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 <[email protected]> | ||
* @copyright 2007-2020 PrestaShop SA | ||
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0) | ||
* International Registered Trademark & Property of PrestaShop SA | ||
* @author PrestaShop SA and Contributors <[email protected]> | ||
* @copyright Since 2007 PrestaShop SA and Contributors | ||
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License version 3.0 | ||
*/ | ||
class MailAlert extends ObjectModel | ||
{ | ||
|
@@ -170,16 +164,16 @@ public static function getMailAlerts($id_customer, $id_lang, Shop $shop = null) | |
public static function sendCustomerAlert($id_product, $id_product_attribute) | ||
{ | ||
$link = new Link(); | ||
$context = Context::getContext()->cloneContext(); | ||
$context = Context::getContext(); | ||
$id_product = (int) $id_product; | ||
$id_product_attribute = (int) $id_product_attribute; | ||
$customers = self::getCustomers($id_product, $id_product_attribute); | ||
$current_shop = $context->shop->id; | ||
$customers = self::getCustomers($id_product, $id_product_attribute, $current_shop); | ||
|
||
foreach ($customers as $customer) { | ||
$id_shop = (int) $customer['id_shop']; | ||
$id_lang = (int) $customer['id_lang']; | ||
$context->shop->id = $id_shop; | ||
$context->language->id = $id_lang; | ||
|
||
$product = new Product($id_product, false, $id_lang, $id_shop); | ||
$product_name = Product::getProductName($product->id, $id_product_attribute, $id_lang); | ||
|
@@ -255,6 +249,7 @@ public static function sendCustomerAlert($id_product, $id_product_attribute) | |
$id_shop | ||
); | ||
} | ||
$context->shop->id = $current_shop; | ||
} | ||
|
||
/* | ||
|
@@ -306,13 +301,17 @@ public static function getProductAttributeCombination($id_product_attribute, $id | |
|
||
/* | ||
* Get customers waiting for alert on the specified product/product attribute | ||
* in shop `$id_shop` and if the shop group shares the stock in all shops of the shop group | ||
*/ | ||
public static function getCustomers($id_product, $id_product_attribute) | ||
public static function getCustomers($id_product, $id_product_attribute, $id_shop) | ||
{ | ||
$sql = ' | ||
SELECT id_customer, customer_email, id_shop, id_lang | ||
FROM `' . _DB_PREFIX_ . self::$definition['table'] . '` | ||
WHERE `id_product` = ' . (int) $id_product . ' AND `id_product_attribute` = ' . (int) $id_product_attribute; | ||
SELECT mc.id_customer, mc.customer_email, mc.id_shop, mc.id_lang | ||
FROM `' . _DB_PREFIX_ . self::$definition['table'] . '` mc | ||
INNER JOIN `' . _DB_PREFIX_ . 'shop` s on s.id_shop = mc.id_shop | ||
INNER JOIN `' . _DB_PREFIX_ . 'shop_group` sg on s.id_shop_group = sg.id_shop_group and (s.id_shop = ' . (int) $id_shop . ' or sg.share_stock = 1) | ||
INNER JOIN `' . _DB_PREFIX_ . 'shop` s2 on s2.id_shop = mc.id_shop and s2.id_shop = ' . (int) $id_shop . ' | ||
WHERE mc.`id_product` = ' . (int) $id_product . ' AND mc.`id_product_attribute` = ' . (int) $id_product_attribute; | ||
|
||
return Db::getInstance((bool) _PS_USE_SQL_SLAVE_)->executeS($sql); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,27 @@ | ||
{ | ||
"name": "prestashop/ps_emailalerts", | ||
"description": "PrestaShop module ps_emailalerts", | ||
"homepage": "https://github.com/PrestaShop/ps_emailalerts", | ||
"license": "AFL-3.0", | ||
"authors": [ | ||
{ | ||
"name": "PrestaShop SA", | ||
"email": "[email protected]" | ||
} | ||
], | ||
"require": { | ||
"php": ">=5.6" | ||
}, | ||
"require-dev": { | ||
"prestashop/php-dev-tools": "^3.16" | ||
}, | ||
"config": { | ||
"platform": { | ||
"php": "5.6.0" | ||
"name": "prestashop/ps_emailalerts", | ||
"description": "PrestaShop module ps_emailalerts", | ||
"homepage": "https://github.com/PrestaShop/ps_emailalerts", | ||
"license": "AFL-3.0", | ||
"authors": [ | ||
{ | ||
"name": "PrestaShop SA", | ||
"email": "[email protected]" | ||
} | ||
], | ||
"require": { | ||
"php": ">=5.6" | ||
}, | ||
"preferred-install": "dist", | ||
"prepend-autoloader": false | ||
}, | ||
"type": "prestashop-module" | ||
} | ||
"require-dev": { | ||
"prestashop/php-dev-tools": "^3.16" | ||
}, | ||
"config": { | ||
"platform": { | ||
"php": "5.6.0" | ||
}, | ||
"preferred-install": "dist", | ||
"prepend-autoloader": false | ||
}, | ||
"type": "prestashop-module", | ||
"author": "PrestaShop" | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,21 @@ | ||
<?php | ||
/** | ||
* 2007-2020 PrestaShop. | ||
* Copyright since 2007 PrestaShop SA and Contributors | ||
* PrestaShop is an International Registered Trademark & Property of PrestaShop SA | ||
* | ||
* NOTICE OF LICENSE | ||
* | ||
* This source file is subject to the Academic Free License 3.0 (AFL-3.0) | ||
* that is bundled with this package in the file LICENSE.txt. | ||
* This source file is subject to the Academic Free License version 3.0 | ||
* that is bundled with this package in the file LICENSE.md. | ||
* It is also available through the world-wide-web at this URL: | ||
* https://opensource.org/licenses/AFL-3.0 | ||
* 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 [email protected] 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 <[email protected]> | ||
* @copyright 2007-2020 PrestaShop SA | ||
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0) | ||
* International Registered Trademark & Property of PrestaShop SA | ||
* @author PrestaShop SA and Contributors <[email protected]> | ||
* @copyright Since 2007 PrestaShop SA and Contributors | ||
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License version 3.0 | ||
*/ | ||
|
||
/** | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,21 @@ | ||
<?php | ||
/** | ||
* 2007-2020 PrestaShop. | ||
* Copyright since 2007 PrestaShop SA and Contributors | ||
* PrestaShop is an International Registered Trademark & Property of PrestaShop SA | ||
* | ||
* NOTICE OF LICENSE | ||
* | ||
* This source file is subject to the Academic Free License 3.0 (AFL-3.0) | ||
* that is bundled with this package in the file LICENSE.txt. | ||
* This source file is subject to the Academic Free License version 3.0 | ||
* that is bundled with this package in the file LICENSE.md. | ||
* It is also available through the world-wide-web at this URL: | ||
* https://opensource.org/licenses/AFL-3.0 | ||
* 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 [email protected] 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 <[email protected]> | ||
* @copyright 2007-2020 PrestaShop SA | ||
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0) | ||
* International Registered Trademark & Property of PrestaShop SA | ||
* @author PrestaShop SA and Contributors <[email protected]> | ||
* @copyright Since 2007 PrestaShop SA and Contributors | ||
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License version 3.0 | ||
*/ | ||
|
||
/** | ||
|
@@ -95,7 +89,7 @@ public function processAdd() | |
} elseif (Validate::isEmail((string) Tools::getValue('customer_email'))) { | ||
$customer_email = (string) Tools::getValue('customer_email'); | ||
$customer = $context->customer->getByEmail($customer_email); | ||
$id_customer = (isset($customer->id) && ($customer->id != null)) ? (int) $customer->id : null; | ||
$id_customer = (isset($customer->id) && ($customer->id != null)) ? (int) $customer->id : 0; | ||
} else { | ||
exit(json_encode( | ||
[ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,21 @@ | ||
<?php | ||
/** | ||
* 2007-2020 PrestaShop. | ||
* Copyright since 2007 PrestaShop SA and Contributors | ||
* PrestaShop is an International Registered Trademark & Property of PrestaShop SA | ||
* | ||
* NOTICE OF LICENSE | ||
* | ||
* This source file is subject to the Academic Free License 3.0 (AFL-3.0) | ||
* that is bundled with this package in the file LICENSE.txt. | ||
* This source file is subject to the Academic Free License version 3.0 | ||
* that is bundled with this package in the file LICENSE.md. | ||
* It is also available through the world-wide-web at this URL: | ||
* https://opensource.org/licenses/AFL-3.0 | ||
* 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 [email protected] 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 <[email protected]> | ||
* @copyright 2007-2020 PrestaShop SA | ||
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0) | ||
* International Registered Trademark & Property of PrestaShop SA | ||
* @author PrestaShop SA and Contributors <[email protected]> | ||
* @copyright Since 2007 PrestaShop SA and Contributors | ||
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License version 3.0 | ||
*/ | ||
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); | ||
header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,21 @@ | ||
<?php | ||
/** | ||
* 2007-2020 PrestaShop. | ||
* Copyright since 2007 PrestaShop SA and Contributors | ||
* PrestaShop is an International Registered Trademark & Property of PrestaShop SA | ||
* | ||
* NOTICE OF LICENSE | ||
* | ||
* This source file is subject to the Academic Free License 3.0 (AFL-3.0) | ||
* that is bundled with this package in the file LICENSE.txt. | ||
* This source file is subject to the Academic Free License version 3.0 | ||
* that is bundled with this package in the file LICENSE.md. | ||
* It is also available through the world-wide-web at this URL: | ||
* https://opensource.org/licenses/AFL-3.0 | ||
* 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 [email protected] 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 <[email protected]> | ||
* @copyright 2007-2020 PrestaShop SA | ||
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0) | ||
* International Registered Trademark & Property of PrestaShop SA | ||
* @author PrestaShop SA and Contributors <[email protected]> | ||
* @copyright Since 2007 PrestaShop SA and Contributors | ||
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License version 3.0 | ||
*/ | ||
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); | ||
header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); | ||
|
Oops, something went wrong.