diff --git a/.all-contributorsrc b/.all-contributorsrc new file mode 100644 index 00000000..1089e530 --- /dev/null +++ b/.all-contributorsrc @@ -0,0 +1,367 @@ +{ + "projectName": "firegento-magesetup", + "projectOwner": "firegento", + "repoType": "github", + "repoHost": "https://github.com", + "files": [ + "README.md" + ], + "imageSize": 100, + "commit": true, + "commitConvention": "none", + "contributors": [ + { + "login": "avstudnitz", + "name": "Andreas von Studnitz", + "avatar_url": "https://avatars1.githubusercontent.com/u/662059?v=4", + "profile": "http://www.integer-net.de/agentur/andreas-von-studnitz/", + "contributions": [ + "code" + ] + }, + { + "login": "therouv", + "name": "Rouven Alexander Rieker", + "avatar_url": "https://avatars3.githubusercontent.com/u/393419?v=4", + "profile": "https://rouven.io/", + "contributions": [ + "code" + ] + }, + { + "login": "riconeitzel", + "name": "Rico Neitzel", + "avatar_url": "https://avatars2.githubusercontent.com/u/930706?v=4", + "profile": "http://www.riconeitzel.de/", + "contributions": [ + "code" + ] + }, + { + "login": "sylvainraye", + "name": "Sylvain Rayé", + "avatar_url": "https://avatars2.githubusercontent.com/u/1337461?v=4", + "profile": "https://www.diglin.com/", + "contributions": [ + "code" + ] + }, + { + "login": "sprankhub", + "name": "Simon Sprankel", + "avatar_url": "https://avatars1.githubusercontent.com/u/930199?v=4", + "profile": "https://www.simonsprankel.com/", + "contributions": [ + "code" + ] + }, + { + "login": "mklooss", + "name": "Mathis Klooß", + "avatar_url": "https://avatars0.githubusercontent.com/u/710748?v=4", + "profile": "http://www.mage-profis.de/", + "contributions": [ + "code" + ] + }, + { + "login": "Schrank", + "name": "Fabian Blechschmidt", + "avatar_url": "https://avatars1.githubusercontent.com/u/379680?v=4", + "profile": "http://www.fabian-blechschmidt.de/", + "contributions": [ + "code" + ] + }, + { + "login": "sreichel", + "name": "sv3n", + "avatar_url": "https://avatars1.githubusercontent.com/u/5022236?v=4", + "profile": "https://magento.stackexchange.com/users/46249/sv3n", + "contributions": [ + "code" + ] + }, + { + "login": "cphilipp", + "name": "Christian Philipp", + "avatar_url": "https://avatars1.githubusercontent.com/u/2188398?v=4", + "profile": "https://github.com/cphilipp", + "contributions": [ + "code" + ] + }, + { + "login": "tobi-pb", + "name": "Tobias Vogt", + "avatar_url": "https://avatars1.githubusercontent.com/u/940631?v=4", + "profile": "http://www.webguys.de/", + "contributions": [ + "code" + ] + }, + { + "login": "winkelsdorf", + "name": "Frederik Winkelsdorf", + "avatar_url": "https://avatars0.githubusercontent.com/u/1413291?v=4", + "profile": "https://github.com/winkelsdorf", + "contributions": [ + "code" + ] + }, + { + "login": "jwittorf", + "name": "Julian", + "avatar_url": "https://avatars3.githubusercontent.com/u/2085721?v=4", + "profile": "https://twitter.com/sirawesome_", + "contributions": [ + "code" + ] + }, + { + "login": "grossmann", + "name": "Martin Grossmann", + "avatar_url": "https://avatars3.githubusercontent.com/u/1866724?v=4", + "profile": "http://www.multichannelsystems.com/", + "contributions": [ + "code" + ] + }, + { + "login": "gfobe", + "name": "Gerhard Fobe", + "avatar_url": "https://avatars3.githubusercontent.com/u/1615283?v=4", + "profile": "https://www.gerhard-fobe.de/", + "contributions": [ + "code" + ] + }, + { + "login": "benmarks", + "name": "Ben Marks", + "avatar_url": "https://avatars1.githubusercontent.com/u/2141138?v=4", + "profile": "http://twitter.com/benmarks", + "contributions": [ + "code" + ] + }, + { + "login": "mpaepper", + "name": "Marc Päpper", + "avatar_url": "https://avatars0.githubusercontent.com/u/4135790?v=4", + "profile": "https://www.paepper.com/", + "contributions": [ + "code" + ] + }, + { + "login": "kkrieger85", + "name": "Kevin Krieger", + "avatar_url": "https://avatars2.githubusercontent.com/u/4435523?v=4", + "profile": "https://github.com/kkrieger85", + "contributions": [ + "code", + "doc" + ] + }, + { + "login": "Vinai", + "name": "Vinai Kopp", + "avatar_url": "https://avatars0.githubusercontent.com/u/72463?v=4", + "profile": "http://vinaikopp.com/", + "contributions": [ + "code" + ] + }, + { + "login": "EliasKotlyar", + "name": "Elias Kotlyar", + "avatar_url": "https://avatars0.githubusercontent.com/u/9529505?v=4", + "profile": "https://github.com/EliasKotlyar", + "contributions": [ + "code" + ] + }, + { + "login": "tkn98", + "name": "Tom Klingenberg", + "avatar_url": "https://avatars2.githubusercontent.com/u/10513307?v=4", + "profile": "https://github.com/tkn98", + "contributions": [ + "code" + ] + }, + { + "login": "skrollme", + "name": "Sebastian K", + "avatar_url": "https://avatars2.githubusercontent.com/u/1336659?v=4", + "profile": "https://github.com/skrollme", + "contributions": [ + "code" + ] + }, + { + "login": "rengaw83", + "name": "Michael Wagner", + "avatar_url": "https://avatars1.githubusercontent.com/u/5131653?v=4", + "profile": "http://solidbox.de/", + "contributions": [ + "code" + ] + }, + { + "login": "renepenner", + "name": "René Penner", + "avatar_url": "https://avatars2.githubusercontent.com/u/98465?v=4", + "profile": "https://wambo-agency.com/", + "contributions": [ + "code" + ] + }, + { + "login": "nickw108", + "name": "Nick Weisser", + "avatar_url": "https://avatars2.githubusercontent.com/u/58966?v=4", + "profile": "https://www.openstream.ch/", + "contributions": [ + "code" + ] + }, + { + "login": "mautz-et-tong", + "name": "Andreas Mautz", + "avatar_url": "https://avatars2.githubusercontent.com/u/12797503?v=4", + "profile": "https://webvisum.de/", + "contributions": [ + "code" + ] + }, + { + "login": "matiaso", + "name": "Matias Orlando", + "avatar_url": "https://avatars1.githubusercontent.com/u/261406?v=4", + "profile": "http://www.magento-saigon.com/", + "contributions": [ + "code" + ] + }, + { + "login": "mam08ixo", + "name": "Christoph Aßmann", + "avatar_url": "https://avatars0.githubusercontent.com/u/1771622?v=4", + "profile": "https://github.com/mam08ixo", + "contributions": [ + "code" + ] + }, + { + "login": "klein0r", + "name": "Matthias Kleine", + "avatar_url": "https://avatars2.githubusercontent.com/u/1959049?v=4", + "profile": "https://mkleine.de/", + "contributions": [ + "code" + ] + }, + { + "login": "jg-development", + "name": "Jan Gantzert", + "avatar_url": "https://avatars1.githubusercontent.com/u/6112739?v=4", + "profile": "https://github.com/jg-development", + "contributions": [ + "code" + ] + }, + { + "login": "easyMaxi", + "name": "easyMaxi", + "avatar_url": "https://avatars3.githubusercontent.com/u/965733?v=4", + "profile": "https://github.com/easyMaxi", + "contributions": [ + "code" + ] + }, + { + "login": "dsdata", + "name": "Daniel Sasse", + "avatar_url": "https://avatars3.githubusercontent.com/u/927446?v=4", + "profile": "https://github.com/dsdata", + "contributions": [ + "code" + ] + }, + { + "login": "dmanners", + "name": "David Manners", + "avatar_url": "https://avatars2.githubusercontent.com/u/1572836?v=4", + "profile": "http://davidmanners.de/", + "contributions": [ + "code" + ] + }, + { + "login": "daniel-rose", + "name": "Daniel Rose", + "avatar_url": "https://avatars1.githubusercontent.com/u/489806?v=4", + "profile": "https://www.xing.com/profile/Daniel_Rose16", + "contributions": [ + "code" + ] + }, + { + "login": "crysix", + "name": "Christian Hinz", + "avatar_url": "https://avatars1.githubusercontent.com/u/12525017?v=4", + "profile": "http://www.christian-hinz.de/", + "contributions": [ + "code" + ] + }, + { + "login": "cmuench", + "name": "Christian Münch", + "avatar_url": "https://avatars2.githubusercontent.com/u/211294?v=4", + "profile": "https://muench.dev/", + "contributions": [ + "code" + ] + }, + { + "login": "ckressibucherTIM", + "name": "ckressibucherTIM", + "avatar_url": "https://avatars2.githubusercontent.com/u/3985914?v=4", + "profile": "https://github.com/ckressibucherTIM", + "contributions": [ + "code" + ] + }, + { + "login": "borriglione", + "name": "André Herrn", + "avatar_url": "https://avatars2.githubusercontent.com/u/465544?v=4", + "profile": "https://github.com/borriglione", + "contributions": [ + "code" + ] + }, + { + "login": "bastianccm", + "name": "Bastian", + "avatar_url": "https://avatars1.githubusercontent.com/u/1145424?v=4", + "profile": "https://github.com/bastianccm", + "contributions": [ + "code" + ] + }, + { + "login": "JumpLink", + "name": "Pascal Garber", + "avatar_url": "https://avatars2.githubusercontent.com/u/1073989?v=4", + "profile": "https://www.jumplink.eu/", + "contributions": [ + "code" + ] + } + ], + "contributorsPerLine": 7 +} diff --git a/.travis.yml b/.travis.yml index 714e151b..7a404bcb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,10 +1,8 @@ language: php sudo: false +dist: trusty php: - - 5.3 - - 5.4 - - 5.5 - 5.6 - 7.0 @@ -19,41 +17,11 @@ env: - MAGENTO_VERSION="magento-mirror-1.9.2.4" - MAGENTO_VERSION="magento-mirror-1.9.3.0" - MAGENTO_VERSION="magento-mirror-1.9.3.1" + - MAGENTO_VERSION="magento-mirror-1.9.3.8" matrix: fast_finish: true exclude: - # Newer Magento versions uses newer PHP versions - - php: 5.3 - env: MAGENTO_VERSION="magento-mirror-1.9.0.1" - - - php: 5.3 - env: MAGENTO_VERSION="magento-mirror-1.9.1.1" - - - php: 5.3 - env: MAGENTO_VERSION="magento-mirror-1.9.2.1" - - - php: 5.3 - env: MAGENTO_VERSION="magento-mirror-1.9.2.2" - - - php: 5.3 - env: MAGENTO_VERSION="magento-mirror-1.9.2.3" - - - php: 5.3 - env: MAGENTO_VERSION="magento-mirror-1.9.2.4" - - - php: 5.3 - env: MAGENTO_VERSION="magento-mirror-1.9.3.0" - - - php: 5.3 - env: MAGENTO_VERSION="magento-mirror-1.9.3.1" - - # Old Magento Versions are not officially supported to run with PHP 5.5 - - php: 5.5 - env: MAGENTO_VERSION="magento-mirror-1.6.2.0" - - php: 5.5 - env: MAGENTO_VERSION="magento-mirror-1.7.0.2" - # Old Magento Versions are not officially supported to run with PHP 5.6 - php: 5.6 env: MAGENTO_VERSION="magento-mirror-1.6.2.0" diff --git a/README.markdown b/README.markdown deleted file mode 100644 index 3e3b58a1..00000000 --- a/README.markdown +++ /dev/null @@ -1,79 +0,0 @@ -FireGento_MageSetup -=================== -MageSetup configures a shop for a national market. It's the international variant and successor of [GermanSetup](https://github.com/firegento/firegento-germansetup). - -Currently supported countries: Austria, France, Germany, Italy, Russia, Switzerland, United Kingdom. More to follow. - -Build Status ------------- -* Latest Release: [![Master Branch](https://travis-ci.org/firegento/firegento-magesetup.png?branch=master)](https://travis-ci.org/firegento/firegento-magesetup) -* Development Branch: [![Development Branch](https://travis-ci.org/firegento/firegento-magesetup.png?branch=development)](https://travis-ci.org/firegento/firegento-magesetup) - -Facts ------ -- Version: check [config.xml](https://github.com/firegento/firegento-magesetup/blob/master/src/app/code/community/FireGento/MageSetup/etc/config.xml) -- Extension key: FireGento_MageSetup -- [Extension on GitHub](https://github.com/firegento/firegento-magesetup/) -- Composer name: `firegento/magesetup` on [packages.firegento.com](http://packages.firegento.com/) - -Description ------------ -Central features of MageSetup are: - -* Setting of important configuration settings -* Predefined tax settings and tax classes for shipping from several countries to worldwide destinations -* Assign new tax classes to all products (configurable) -* Creation of email templates based on the local language pack. Legal texts can be added to some templates automatically. -* Creation and Activation of Checkout Agreements. Agreements can be shown at customer registration instead of or additional to the checkout. They can be required or not. -* Creation of default CMS pages like imprint, terms and conditions, privacy, shipping, payment methods. -* Create email templates, cms pages and blocks as well as checkout agreements for store views with a different language as well -* Possibility to add tax and/or shipping info to all prices -* Automatical generation of meta data to products -* Saving of every status change of newsletter subscriptions -* Presets are configurable via xml files for every country seperately -* Many more, see the [full list of features](https://github.com/firegento/firegento-magesetup/blob/development/docs/features/features.md) including several screenshots. - -Requirements ------------- -- PHP >= 5.3.0 - -Compatibility -------------- -- Magento >= 1.6 - -Installation ------------- -Please create the desired websites and store views as well as install any language packs before running MageSetup. - -Copy all files from the src/ folder to your magento directory in order to install the MageSetup module. -After you have installed the module, you should clear the cache and log off from admin panel. When you log on again, you should see the following hint: - - MageSetup has been installed. Click here to set up your pages, blocks, emails and tax settings. - -If you don't see that hint, please check that the configuration setting **System -> Configuration -> Developer -> Template Settings -> Allow Symlinks** is enabled. - -On the linked page, you can make the desired settings and then click "Run MageSetup" on the top or bottom right. The adjustments will be made. - -Support -------- -If you encounter any problems or bugs, please create an issue on [GitHub](https://github.com/firegento/firegento-magesetup/issues). - -Contribution ------------- -Any contribution to the development of MageSetup is highly welcome. The best possibility to provide any code is to open a [pull request on GitHub](https://help.github.com/articles/using-pull-requests). - -Please also see have a look at our [contribution guide](https://github.com/firegento/firegento-magesetup/blob/development/docs/contribute/contribute.md) for this extension and our [general contribution process](https://github.com/firegento/coding-guidelines/blob/master/guidelines/05_CONTRIBUTIONS.md) for FireGento extensions. - -Developer ---------- -FireGento Team -* Website: [http://firegento.com](http://firegento.com) -* Twitter: [@firegento](https://twitter.com/firegento) - -Licence -------- -[GNU General Public License, version 3 (GPLv3)](http://opensource.org/licenses/gpl-3.0) - -Copyright ---------- -(c) 2013-2015 FireGento Team diff --git a/README.md b/README.md new file mode 100644 index 00000000..2d56f113 --- /dev/null +++ b/README.md @@ -0,0 +1,149 @@ + +[![All Contributors](https://img.shields.io/badge/all_contributors-39-orange.svg?style=flat-square)](#contributors-) + +# FireGento_MageSetup + +MageSetup configures a shop for a national market. It's the international variant and successor of [GermanSetup](https://github.com/firegento/firegento-germansetup). + +Currently supported countries: Austria, France, Germany, Italy, Russia, Switzerland, United Kingdom. More to follow. + +## Build Status + +* Latest Release: [![Master Branch](https://travis-ci.org/firegento/firegento-magesetup.png?branch=master)](https://travis-ci.org/firegento/firegento-magesetup) +* Development Branch: [![Development Branch](https://travis-ci.org/firegento/firegento-magesetup.png?branch=development)](https://travis-ci.org/firegento/firegento-magesetup) + +## Facts + +- Version: check [config.xml](https://github.com/firegento/firegento-magesetup/blob/master/src/app/code/community/FireGento/MageSetup/etc/config.xml) +- Extension key: FireGento_MageSetup +- [Extension on GitHub](https://github.com/firegento/firegento-magesetup/) +- Composer name: `firegento/magesetup` on [packages.firegento.com](http://packages.firegento.com/) + +## Description + +Central features of MageSetup are: + +* Setting of important configuration settings +* Predefined tax settings and tax classes for shipping from several countries to worldwide destinations +* Assign new tax classes to all products (configurable) +* Creation of email templates based on the local language pack. Legal texts can be added to some templates automatically. +* Creation and Activation of Checkout Agreements. Agreements can be shown at customer registration instead of or additional to the checkout. They can be required or not. +* Creation of default CMS pages like imprint, terms and conditions, privacy, shipping, payment methods. +* Create email templates, cms pages and blocks as well as checkout agreements for store views with a different language as well +* Possibility to add tax and/or shipping info to all prices +* Automatical generation of meta data to products +* Saving of every status change of newsletter subscriptions +* Presets are configurable via xml files for every country seperately +* Many more, see the [full list of features](https://github.com/firegento/firegento-magesetup/blob/development/docs/features/features.md) including several screenshots. + +## Requirements + +- PHP >= 5.3.0 + +## Compatibility + +- Magento >= 1.6 + +## Installation + +Please create the desired websites and store views as well as install any language packs before running MageSetup. + +Copy all files from the src/ folder to your magento directory in order to install the MageSetup module. +After you have installed the module, you should clear the cache and log off from admin panel. When you log on again, you should see the following hint: + + MageSetup has been installed. Click here to set up your pages, blocks, emails and tax settings. + +If you don't see that hint, please check that the configuration setting **System -> Configuration -> Developer -> Template Settings -> Allow Symlinks** is enabled. + +On the linked page, you can make the desired settings and then click "Run MageSetup" on the top or bottom right. The adjustments will be made. + +## Support + +If you encounter any problems or bugs, please create an issue on [GitHub](https://github.com/firegento/firegento-magesetup/issues). + +## Contribution + +Any contribution to the development of MageSetup is highly welcome. The best possibility to provide any code is to open a [pull request on GitHub](https://help.github.com/articles/using-pull-requests). + +Please also see have a look at our [contribution guide](https://github.com/firegento/firegento-magesetup/blob/development/docs/contribute/contribute.md) for this extension and our [general contribution process](https://github.com/firegento/coding-guidelines/blob/master/guidelines/05_CONTRIBUTIONS.md) for FireGento extensions. + +## Contributors ✨ + +Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)): + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Andreas von Studnitz

💻

Rouven Alexander Rieker

💻

Rico Neitzel

💻

Sylvain Rayé

💻

Simon Sprankel

💻

Mathis Klooß

💻

Fabian Blechschmidt

💻

sv3n

💻

Christian Philipp

💻

Tobias Vogt

💻

Frederik Winkelsdorf

💻

Julian

💻

Martin Grossmann

💻

Gerhard Fobe

💻

Ben Marks

💻

Marc Päpper

💻

Kevin Krieger

💻 📖

Vinai Kopp

💻

Elias Kotlyar

💻

Tom Klingenberg

💻

Sebastian K

💻

Michael Wagner

💻

René Penner

💻

Nick Weisser

💻

Andreas Mautz

💻

Matias Orlando

💻

Christoph Aßmann

💻

Matthias Kleine

💻

Jan Gantzert

💻

easyMaxi

💻

Daniel Sasse

💻

David Manners

💻

Daniel Rose

💻

Christian Hinz

💻

Christian Münch

💻

ckressibucherTIM

💻

André Herrn

💻

Bastian

💻

Pascal Garber

💻
+ + + + + +This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome! + +## Developer + +FireGento Team +* Website: [http://firegento.com](http://firegento.com) +* Twitter: [@firegento](https://twitter.com/firegento) + +## Licence + +[GNU General Public License, version 3 (GPLv3)](http://opensource.org/licenses/gpl-3.0) + +## Copyright + +(c) 2013-2020 FireGento Team diff --git a/src/app/code/community/FireGento/MageSetup/Block/Imprint/Field.php b/src/app/code/community/FireGento/MageSetup/Block/Imprint/Field.php index b1235b90..d3f943c3 100644 --- a/src/app/code/community/FireGento/MageSetup/Block/Imprint/Field.php +++ b/src/app/code/community/FireGento/MageSetup/Block/Imprint/Field.php @@ -35,17 +35,41 @@ class FireGento_MageSetup_Block_Imprint_Field extends FireGento_MageSetup_Block_ */ protected function _toHtml() { - if ($this->getValue() == 'email') { - $isFrontend = ($this->getLayout()->getArea() === 'frontend'); - $isCheckout = ($this->getRequest()->getActionName() === 'placeOrder'); - // protect email address in frontend but not when placing order where it is used to // send order confirmation mails (which might include imprint's mail address, i.e. // in the withdrawal form) - return $this->getEmail($isFrontend && !$isCheckout); + $useAntiSpam = $this->_shouldUseMailAntiSpam(); + + return $this->getEmail($useAntiSpam); } return $this->getData($this->getValue()); } + + protected function _shouldUseMailAntiSpam() + { + /** @var Mage_Core_Controller_Varien_Action $action */ + $action = Mage::app()->getFrontController()->getData('action'); + $fullActionName = $action->getFullActionName(); + // when order mails are sent via the admin panel + $excludedFullActionNames = ['adminhtml_sales_order_email']; + if (in_array($fullActionName, $excludedFullActionNames, true)) { + return false; + } + + $isFrontend = ($this->getLayout()->getArea() === 'frontend'); + $actionName = $this->getRequest()->getActionName(); + $excludedActionNames = [ + // used by the standard checkout + 'saveOrder', + // used by PayPal Express + 'placeOrder' + ]; + if ($isFrontend && in_array($actionName, $excludedActionNames, true)) { + return false; + } + + return true; + } } diff --git a/src/app/code/community/FireGento/MageSetup/Helper/Contacts.php b/src/app/code/community/FireGento/MageSetup/Helper/Contacts.php index 48cd9609..8260f6ab 100644 --- a/src/app/code/community/FireGento/MageSetup/Helper/Contacts.php +++ b/src/app/code/community/FireGento/MageSetup/Helper/Contacts.php @@ -22,6 +22,7 @@ class FireGento_MageSetup_Helper_Contacts extends Mage_Core_Helper_Abstract { const XML_PATH_ACCEPT_AGREEMENT = 'contacts/contacts/accept_agreement'; + const XML_PATH_REQUIRED_USER_CONTACT_METHOD = 'contacts/contacts/required_user_contact_method'; /** @var string $_moduleName Module name */ protected $_moduleName = 'FireGento_MageSetup'; @@ -30,4 +31,26 @@ public function isAcceptAgreement() { return Mage::getStoreConfig(self::XML_PATH_ACCEPT_AGREEMENT); } + + /** + * check config if telephone is required + * Hint: on GDPR only email OR telephone can be required + * + * @return bool - telephone is required + */ + public function isTelephoneRequired() + { + return Mage::getStoreConfigFlag(self::XML_PATH_REQUIRED_USER_CONTACT_METHOD); + } + + /** + * check config if email is required + * Hint: on GDPR only email OR telephone can be required + * + * @return bool - emaile is required + */ + public function isEmailRequired() + { + return !$this->isTelephoneRequired(); + } } diff --git a/src/app/code/community/FireGento/MageSetup/Model/Consent.php b/src/app/code/community/FireGento/MageSetup/Model/Consent.php new file mode 100644 index 00000000..3b3dd945 --- /dev/null +++ b/src/app/code/community/FireGento/MageSetup/Model/Consent.php @@ -0,0 +1,38 @@ + + * @copyright 2013-2015 FireGento Team (http://www.firegento.com) + * @license http://opensource.org/licenses/gpl-3.0 GNU General Public License, version 3 (GPLv3) + */ + +/** + * Config class + * + * @category FireGento + * @package FireGento_MageSetup + * @author FireGento Team + */ +class FireGento_MageSetup_Model_Consent extends Mage_Core_Model_Abstract +{ + const CONSENT_TYPE_CONTACTFORM = 'contactform'; + const CONSENT_TYPE_NEWSLETTER = 'newsletter'; + + protected function _construct() + { + $this->_init('magesetup/consent'); + } +} \ No newline at end of file diff --git a/src/app/code/community/FireGento/MageSetup/Model/Observer.php b/src/app/code/community/FireGento/MageSetup/Model/Observer.php index 9cc78532..fa46c179 100644 --- a/src/app/code/community/FireGento/MageSetup/Model/Observer.php +++ b/src/app/code/community/FireGento/MageSetup/Model/Observer.php @@ -290,14 +290,16 @@ public function addOptionsForAgreements(Varien_Event_Observer $observer) 'options' => Mage::getSingleton('magesetup/source_revocationProductType')->getOptionArray(), )); - $fieldset->addField('position', 'text', array( - 'label' => $helper->__('Position'), - 'title' => $helper->__('Position'), - 'name' => 'position', - 'value' => '0', - 'required' => true, - 'class' => 'validate-zero-or-greater', - )); + if (!$fieldset->getElements()->searchById('position')) { + $fieldset->addField('position', 'text', array( + 'label' => $helper->__('Position'), + 'title' => $helper->__('Position'), + 'name' => 'position', + 'value' => '0', + 'required' => true, + 'class' => 'validate-zero-or-greater', + )); + } Mage::dispatchEvent('magesetup_adminhtml_checkout_agreement_edit_form', array( 'form' => $form, diff --git a/src/app/code/community/FireGento/MageSetup/Model/Resource/Consent.php b/src/app/code/community/FireGento/MageSetup/Model/Resource/Consent.php new file mode 100644 index 00000000..c4848e38 --- /dev/null +++ b/src/app/code/community/FireGento/MageSetup/Model/Resource/Consent.php @@ -0,0 +1,35 @@ + + * @copyright 2013-2018 FireGento Team (http://www.firegento.com) + * @license http://opensource.org/licenses/gpl-3.0 GNU General Public License, version 3 (GPLv3) + */ + +/** + * Consent Resource Model + * + * @category FireGento + * @package FireGento_MageSetup + * @author FireGento Team + */ +class FireGento_MageSetup_Model_Resource_Consent extends Mage_Core_Model_Resource_Db_Abstract +{ + protected function _construct() + { + $this->_init('magesetup/consent', 'consent_id'); + } +} diff --git a/src/app/code/community/FireGento/MageSetup/Model/Resource/Consent/Collection.php b/src/app/code/community/FireGento/MageSetup/Model/Resource/Consent/Collection.php new file mode 100644 index 00000000..1ac6b568 --- /dev/null +++ b/src/app/code/community/FireGento/MageSetup/Model/Resource/Consent/Collection.php @@ -0,0 +1,35 @@ + + * @copyright 2013-2018 FireGento Team (http://www.firegento.com) + * @license http://opensource.org/licenses/gpl-3.0 GNU General Public License, version 3 (GPLv3) + */ + +/** + * Consent Resource Collection Model + * + * @category FireGento + * @package FireGento_MageSetup + * @author FireGento Team + */ +class FireGento_MageSetup_Model_Resource_Consent_Collection extends Mage_Core_Model_Resource_Db_Collection_Abstract +{ + public function _construct() + { + $this->_init('magesetup/consent'); + } +} diff --git a/src/app/code/community/FireGento/MageSetup/Model/Source/Contacts/RequiredUserContactMethod.php b/src/app/code/community/FireGento/MageSetup/Model/Source/Contacts/RequiredUserContactMethod.php new file mode 100644 index 00000000..b6da2eab --- /dev/null +++ b/src/app/code/community/FireGento/MageSetup/Model/Source/Contacts/RequiredUserContactMethod.php @@ -0,0 +1,69 @@ + + * @copyright 2013-2015 FireGento Team (http://www.firegento.com) + * @license http://opensource.org/licenses/gpl-3.0 GNU General Public License, version 3 (GPLv3) + */ + +/** + * Source model for attribute "required_user_contact_method" + * + * @category FireGento + * @package FireGento_MageSetup + * @author FireGento Team + */ +class FireGento_MageSetup_Model_Source_Contacts_RequiredUserContactMethod +{ + const REQUIRED_FIELD_EMAIL = 0; + const REQUIRED_FIELD_TELEPHONE = 1; + + /** + * Options getter + * + * @return array required_user_contact_method types as option array + */ + public function toOptionArray() + { + $helper = Mage::helper('magesetup'); + + return array( + array( + 'value' => self::REQUIRED_FIELD_EMAIL, + 'label' => $helper->__('Email') + ), + array( + 'value' => self::REQUIRED_FIELD_TELEPHONE, + 'label' => $helper->__('Telephone') + ), + ); + } + + /** + * Retrieve all required_user_contact_method fields as option hash + * + * @return array required_user_contact_method types as option hash + */ + public function getOptionArray() + { + $options = array(); + foreach ($this->toOptionArray() as $option) { + $options[$option['value']] = $option['label']; + } + + return $options; + } +} diff --git a/src/app/code/community/FireGento/MageSetup/etc/config.xml b/src/app/code/community/FireGento/MageSetup/etc/config.xml index 35a39b4f..d81f4b99 100644 --- a/src/app/code/community/FireGento/MageSetup/etc/config.xml +++ b/src/app/code/community/FireGento/MageSetup/etc/config.xml @@ -21,7 +21,7 @@ - 2.4.2 + 2.6.0 @@ -56,6 +56,9 @@ newsletter_subscriber_status
+ + consent
+
diff --git a/src/app/code/community/FireGento/MageSetup/etc/system.xml b/src/app/code/community/FireGento/MageSetup/etc/system.xml index 11f00831..429f29d2 100644 --- a/src/app/code/community/FireGento/MageSetup/etc/system.xml +++ b/src/app/code/community/FireGento/MageSetup/etc/system.xml @@ -496,10 +496,9 @@ - + - - + This setting is required by German law due to a ruling by OLG Köln from 11.03.2016 select adminhtml/system_config_source_yesno contacts/system_config_backend_links @@ -508,6 +507,16 @@ 1 1 + + + Because of GDPR only email OR telephone can be required. Please choose here. + select + magesetup/source_contacts_requiredUserContactMethod + 30 + 1 + 1 + 1 + diff --git a/src/app/code/community/FireGento/MageSetup/sql/magesetup_setup/mysql4-upgrade-2.4.2-2.4.3.php b/src/app/code/community/FireGento/MageSetup/sql/magesetup_setup/mysql4-upgrade-2.4.2-2.4.3.php new file mode 100644 index 00000000..1d15df77 --- /dev/null +++ b/src/app/code/community/FireGento/MageSetup/sql/magesetup_setup/mysql4-upgrade-2.4.2-2.4.3.php @@ -0,0 +1,77 @@ + + * @copyright 2013-2018 FireGento Team (http://www.firegento.com) + * @license http://opensource.org/licenses/gpl-3.0 GNU General Public License, version 3 (GPLv3) + */ +/** + * @category FireGento + * @package FireGento_MageSetup + * @author FireGento Team + */ + +$installer = $this; + +$installer->startSetup(); + +if (version_compare(Mage::getVersion(), '1.6', '<')) { + $installer->run(" + DROP TABLE IF EXISTS `{$installer->getTable('magesetup/consent')}`; + CREATE TABLE `{$installer->getTable('magesetup/consent')}` ( + `consent_id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'ID', + `ip` VARCHAR(45) NOT NULL COMMENT 'IP address of user doing the consent', + `date` DATETIME NOT NULL COMMENT 'time of consent', + `consent_user` VARCHAR(255) NOT NULL COMMENT 'user doing the consent', + `consent_type` VARCHAR(255) NOT NULL COMMENT 'area of consent (e.g. contactform or newsletter)', + `consent` VARCHAR(5) NOT NULL COMMENT 'separate saved consent for lawyer', + PRIMARY KEY (`consent_id`) + ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='MageSetup consent table'; + "); + +} else { + $consentTable = $installer->getTable('magesetup/consent'); + if ($installer->getConnection()->isTableExists($consentTable)) { + $installer->getConnection()->dropTable($consentTable); + } + + $consentTable = $installer->getConnection()->newTable($consentTable) + ->addColumn('consent_id', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array( + 'identity' => true, + 'unsigned' => true, + 'nullable' => false, + 'primary' => true, + ), 'id of consent') + ->addColumn('ip', Varien_Db_Ddl_Table::TYPE_VARCHAR, 45, array( + 'nullable' => true, + ), 'IP address of user doing the consent') + ->addColumn('date', Varien_Db_Ddl_Table::TYPE_DATETIME, null, array( + 'nullable' => false, + ), 'time of consent') + ->addColumn('consent_user', Varien_Db_Ddl_Table::TYPE_VARCHAR, null, array( + 'nullable' => false, + ), 'user doing the consent') + ->addColumn('consent_type', Varien_Db_Ddl_Table::TYPE_VARCHAR, 255, array( + 'nullable' => false, + ), 'area of consent (e.g. contactform or newsletter)') + ->addColumn('consent', Varien_Db_Ddl_Table::TYPE_TINYINT, 5, array( + 'unsigned' => true, + 'nullable' => false, + ), 'separate saved consent for lawyer'); + $installer->getConnection()->createTable($consentTable); +} + +$installer->endSetup(); \ No newline at end of file diff --git a/src/app/design/frontend/base/default/template/magesetup/contacts/form.phtml b/src/app/design/frontend/base/default/template/magesetup/contacts/form.phtml index e052cb6a..65dea140 100644 --- a/src/app/design/frontend/base/default/template/magesetup/contacts/form.phtml +++ b/src/app/design/frontend/base/default/template/magesetup/contacts/form.phtml @@ -18,7 +18,7 @@ */ ?>
getMessagesBlock()->toHtml() ?>
-
+

__('Contact Us') ?>

@@ -27,22 +27,22 @@
  • - +
    - +
    - +
    - +
  • - +
    - +
  • diff --git a/src/app/design/frontend/rwd/default/template/magesetup/contacts/form.phtml b/src/app/design/frontend/rwd/default/template/magesetup/contacts/form.phtml new file mode 100644 index 00000000..07f60bda --- /dev/null +++ b/src/app/design/frontend/rwd/default/template/magesetup/contacts/form.phtml @@ -0,0 +1,100 @@ + + * @copyright FireGento Team (http://www.firegento.com) + * @license http://opensource.org/licenses/gpl-3.0 GNU General Public License, version 3 (GPLv3) + */ +?> +
    getMessagesBlock()->toHtml() ?>
    +
    +

    __('Contact Us') ?>

    +
    + +
    +

    __('Contact Information') ?>

    +

    __('* Required Fields') ?>

    +
      +
    • +
      + +
      + +
      +
      +
      + +
      + +
      +
      +
    • +
    • + +
      + +
      +
    • +
    • + +
      + +
      +
    • + isAcceptAgreement()): ?> +
    • +
      + +
      + + quoteEscape(Mage::helper('contacts')->__('Notice')); ?>: + + quoteEscape(Mage::helper('contacts')->__('You can revoke this agreement at any time and for the future by sending an e-mail to %s.', Mage::getStoreConfig('contacts/email/recipient_email'))); ?> +
    • + +
    +
    +
    + + +
    +
  • + diff --git a/src/app/locale/de_DE/FireGento_MageSetup.csv b/src/app/locale/de_DE/FireGento_MageSetup.csv index 2b3ed4eb..fcc2eac3 100644 --- a/src/app/locale/de_DE/FireGento_MageSetup.csv +++ b/src/app/locale/de_DE/FireGento_MageSetup.csv @@ -48,6 +48,7 @@ "MageSetup: Email Templates have been created.","MageSetup: Email-Vorlagen wurden erfolgreich angelegt." "MageSetup: Tax Settings have been created.","MageSetup: Steuereinstellungen wurden erfolgreich angelegt." "MageSetup: Product Tax Classes have been updated.","MageSetup: Produktsteuerklassen wurden aktualisiert." +"MageSetup: Customer Tax Classes have been updated.","MageSetup: Kundensteuerklassen wurden aktualisiert." "MageSetup: System Config Settings have been updated.","MageSetup: Einstellungen in der Systemkonfiguration wurden aktualisiert." "Imprint","Impressum" @@ -162,9 +163,13 @@ "MagentoConnect","MagentoConnect" "Bank Information","Bankverbindung" +"Enable Checkbox To Accept Agreement","Abfrage aktivieren, ob Daten gespeichert werden dürfen" "I agree that my contact details are saved permanently for allocation and any further queries.","Ich willige ein, dass meine Angaben zur Kontaktaufnahme und Zuordnung für eventuelle Rückfragen dauerhaft gespeichert werden." "Notice","Hinweis" "You can revoke this agreement at any time and for the future by sending an e-mail to %s.","Diese Einwilligung können Sie jederzeit mit Wirkung für die Zukunft widerrufen, indem Sie eine E-Mail an %s schicken." "Please accept the agreement or call us.","Bitte erklären Sie Ihre Einwilligung oder kontaktieren Sie uns telefonisch." "This setting is required by German law due a ruling by OLG Köln from 11.03.2016","Diese Einstellung ist erforderlich nach deutschem Gesetz auf Grund eines Urteils vom OLG Köln vom 11.03.2016" "Agreement accepted","Einwilligung erteilt" +"Required field for contact to user.","Pflichtfeld für Kontaktaufnahme mit Nutzer." +"Because of GDPR only email OR telephone can be required. Please choose here.","Aufgrund der DSGVO können nur E-Mail ODER Telefon Pflichtfeld sein. Bitte hier wählen." +"Agreement accepted","Einwilligung erteilt" diff --git a/src/app/locale/en_US/FireGento_MageSetup.csv b/src/app/locale/en_US/FireGento_MageSetup.csv index 3f1c1487..e216f8f3 100644 --- a/src/app/locale/en_US/FireGento_MageSetup.csv +++ b/src/app/locale/en_US/FireGento_MageSetup.csv @@ -155,9 +155,12 @@ "MagentoConnect","MagentoConnect" "Bank Information","Bank Information" +"Enable Checkbox To Accept Agreement","Enable Checkbox To Accept Agreement" "I agree that my contact details are saved permanently for allocation and any further queries.","I agree that my contact details are saved permanently for allocation and any further queries." "Notice","Notice" "You can revoke this agreement at any time and for the future by sending an e-mail to %s.","You can revoke this agreement at any time and for the future by sending an e-mail to %s." "Please accept the agreement or call us by phone.","Please accept the agreement or call us." "This setting is required by German law due a ruling by OLG Köln from 11.03.2016","This setting is required by German law due a ruling by OLG Köln from 11.03.2016" -"Agreement accepted","Agreement accepted" \ No newline at end of file +"Agreement accepted","Agreement accepted" +"Required field for contact to user.","Required field for contact to user." +"Because of GDPR only email OR telephone can be required. Choose here.","Because of GDPR only email OR telephone can be required. Choose here."