diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000000000000000000000000000000000000..9ab59b180fb670006ac910a2bc4524a1376dcea0 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,15 @@ + +# Ignore developer files when exporting +.gitattributes export-ignore +.gitignore export-ignore +.gitlab-ci.yml export-ignore +.phive export-ignore +captainhook.json export-ignore +phpcs.xml.dist export-ignore +phpstan-baseline.neon export-ignore +phpstan.dist.neon export-ignore +phpunit.dist.xml export-ignore +tests export-ignore + +# Explicitly set file type and line endings for PHP files, improves git diff output +*.php text eol=lf diff=php \ No newline at end of file diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..b9f7c5c4723a7ff60166164bae8afaeec189067a --- /dev/null +++ b/.gitignore @@ -0,0 +1,8 @@ + +tools/ + +phpstan.neon + +.phpunit.result.cache + +phpunit.xml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index b8d20acb6c365ad8036a7b36d47dabd876d08efa..b5a64b401e554341447c74d7cf93a89ac95a3fdb 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,3 +1,17 @@ include: - - project: 'quiqqer/stabilization/semantic-release' - file: '/ci-templates/.gitlab-ci.yml' + - component: dev.quiqqer.com/quiqqer/stabilization/ci-cd-components/quiqqer-package-bundle/quiqqer-package-bundle@main + +# Remove the entire phpunit-php8.1 block, to allow PHPUnit to run on PHP 8.1 in your pipeline +phpunit-php8.1: + rules: + - when: never + +# Remove the entire phpunit-php8.2 block, to allow PHPUnit to run on PHP 8.2 in your pipeline +phpunit-php8.2: + rules: + - when: never + +# Remove the entire phpunit-php8.3 block, to allow PHPUnit to run on PHP 8.3 in your pipeline +phpunit-php8.3: + rules: + - when: never \ No newline at end of file diff --git a/.phive/phars.xml b/.phive/phars.xml new file mode 100644 index 0000000000000000000000000000000000000000..7877fd4b0f51842b205534cdbd99b037ddb2831b --- /dev/null +++ b/.phive/phars.xml @@ -0,0 +1,8 @@ +<?xml version="1.0" encoding="UTF-8"?> +<phive xmlns="https://phar.io/phive"> + <phar name="phpstan" version="^1.11.5" installed="1.11.5" location="./tools/phpstan" copy="false"/> + <phar name="phpunit" version="^10.5.20" installed="10.5.20" location="./tools/phpunit" copy="false"/> + <phar name="phpcs" version="^3.10.1" installed="3.10.1" location="./tools/phpcs" copy="false"/> + <phar name="phpcbf" version="^3.10.1" installed="3.10.1" location="./tools/phpcbf" copy="false"/> + <phar name="captainhook" version="^5.23.3" installed="5.23.3" location="./tools/captainhook" copy="false"/> +</phive> diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000000000000000000000000000000000000..4a69a59b440e5beec561eca1e341509bd5a18688 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,3 @@ +# Contributing + +This package follows the [QUIQQER contribution guidelines](https://dev.quiqqer.com/quiqqer/stabilization/documentation/-/wikis/home). \ No newline at end of file diff --git a/bin/css/buttons.css b/bin/css/buttons.css index a3bf5c884fc3242ab7fa9af9ccf237934360ca55..714138ae5bc0a062e43c72ce05e644eb81ea75e2 100644 --- a/bin/css/buttons.css +++ b/bin/css/buttons.css @@ -28,16 +28,11 @@ a.qui-button, float: none; /* qui-button reset */ } -button > .fa, -.btn > .fa { +button > .fa:not(:only-child), +.btn > .fa:not(:only-child) { margin-right: .75rem; } -button.loading > .fa, -.btn.loading > .fa { - margin-right: 0; -} - /*****************************/ /* button primary & standard */ /*****************************/ diff --git a/bin/css/form.css b/bin/css/form.css index 13d4bf8ba1e8d0ee04754355db388c4f1d5e933a..e9222466487ca1ce01dfcbd034e1735e515012e9 100644 --- a/bin/css/form.css +++ b/bin/css/form.css @@ -21,7 +21,6 @@ select { background-image: url("../images/arrow-select.svg"); background-position: calc(100% - 10px) center; background-repeat: no-repeat; - background-size: 20px auto; background-size: 8px; height: 40px; padding-bottom: 0; @@ -58,6 +57,28 @@ textarea:focus { border-color: #a9a8a5; } +/* disabled */ +:is( + input:where(:not([type])), + [type='text'], + [type='email'], + [type='url'], + [type='password'], + [type='number'], + [type='date'], + [type='datetime-local'], + [type='month'], + [type='search'], + [type='tel'], + [type='time'], + [type='week'], + [multiple], + textarea, + select +):where([disabled]) { + opacity: 0.6; +} + /* iOs input search fix */ input[type="search"] { -webkit-appearance: none; diff --git a/bin/css/frontend-users.css b/bin/css/frontend-users.css index 629acd054308d2ca0bb6a525f770252ed8e880e6..4c5250fc7d21d855c276508b3e575ad7da48be08 100644 --- a/bin/css/frontend-users.css +++ b/bin/css/frontend-users.css @@ -11,7 +11,7 @@ /* simple user info */ /********************/ .quiqqer-fupc-userinfo { - border: 1px solid #ddd; + border: var(--_qui-cologne-theme-border-width) solid var(--_qui-cologne-theme-border-color); border-radius: 5px; margin-bottom: 1em; background: #fff; @@ -21,67 +21,33 @@ background: url("../images/brushed_alu.png"); } -.quiqqer-frontendUsers-profile-container { - display: flex; - margin-bottom: 2rem; - margin-top: 2rem; -} - -.quiqqer-frontendUsers-controls-profile .quiqqer-frontendUsers-controls-profile-categories { - padding-right: 20px; -} - -.quiqqer-frontendUsers-controls-profile .quiqqer-frontendUsers-controls-profile-categoryContent { - padding-left: 20px; -} - -@media (max-width: 768px) { - .quiqqer-frontendUsers-controls-profile .quiqqer-frontendUsers-controls-profile-categories { - padding: 0; - width: 100%; - } - - .quiqqer-frontendUsers-controls-profile .quiqqer-frontendUsers-controls-profile-categoryContent { - padding-left: 0; - } +/***********/ +/* Profile */ +/***********/ +.quiqqer-frontendUsers-controls-profile { + --qui-frontend-users-profile__radius: 0; + --qui-frontend-users-profile__sidebar-width: 360px; + --qui-frontend-users-profile__content-maxWidth: 700px; + --qui-frontend-users-profile__sidebar-nav-item-outline--hover: none; + --qui-frontend-users-profile__sidebar-nav-item-bg-color--hover: transparent; } /*****************/ /* category menu */ /*****************/ .quiqqer-fupc-category { - margin-bottom: 2em; -} - -.quiqqer-fupc-category:last-child { - margin-bottom: 0; + /*margin-bottom: 2em;*/ } .quiqqer-fupc-category-header { line-height: 30px; } -.quiqqer-fupc-category .quiqqer-fupc-category-header { - border-bottom: 1px solid #ddd; - cursor: pointer; - font-size: 1.5em; - line-height: 30px; -} - -.quiqqer-fu-profile-categories-category-items { - clear: both; - float: left; - width: 100%; -} - .quiqqer-fupc-category-items-item { - border: 1px solid #ddd; - border-bottom: none; + border-top: var(--_qui-cologne-theme-border-width) solid var(--_qui-cologne-theme-border-color); + border-left: var(--_qui-cologne-theme-border-width) solid var(--_qui-cologne-theme-border-color); + border-right: var(--_qui-cologne-theme-border-width) solid var(--_qui-cologne-theme-border-color); clear: both; - color: #333; - display: flex; - float: left; - line-height: 40px; overflow: hidden; padding: 5px 0; position: relative; @@ -89,26 +55,13 @@ width: 100%; } -.quiqqer-fupc-category.quiqqer-fupc-category--open .quiqqer-fupc-category-header { - border-bottom: none !important; -} - -.quiqqer-fupc-category--open .quiqqer-fupc-category-items-item { - background: #fff; -} - -.quiqqer-fupc-category .quiqqer-fu-profile-categories-category-items .quiqqer-fupc-category-items-item--active, -.quiqqer-fupc-category .quiqqer-fu-profile-categories-category-items .quiqqer-fupc-category-items-item:hover { - background: #fff; -} - -.quiqqer-fupc-category--open .quiqqer-fupc-category-items-item:last-child { - border-bottom: 1px solid #ddd; +.quiqqer-fupc-category-items-item:last-child { + border-bottom: var(--_qui-cologne-theme-border-width) solid var(--_qui-cologne-theme-border-color); border-bottom-left-radius: 5px; border-bottom-right-radius: 5px; } -.quiqqer-fupc-category--open .quiqqer-fupc-category-items-item:first-child { +.quiqqer-fupc-category-items-item:first-child { border-top-left-radius: 5px; border-top-right-radius: 5px; } @@ -122,45 +75,21 @@ width: 0; } -.quiqqer-fu-profile-categories-category-items .quiqqer-fupc-category-items-item--active, -.quiqqer-fu-profile-categories-category-items .quiqqer-fupc-category-items-item:hover { - background: none; -} - -.quiqqer-fu-profile-categories-category-items .quiqqer-fupc-category-items-item--active:before, -.quiqqer-fu-profile-categories-category-items .quiqqer-fupc-category-items-item:hover:before { +.quiqqer-fupc-category-items-item[data-active]:before, +.quiqqer-fupc-category-items-item:is(:hover, :focus):before { width: 4px; } .quiqqer-fupc-category-items-item .fa { line-height: 40px; + width: 40px; } /***********/ /* address */ /***********/ -.quiqqer-frontend-users-address header, -.quiqqer-frontendUsers-userdata-section header { - padding: 20px 0; -} - -.quiqqer-frontend-users-address header h2, -.quiqqer-frontendUsers-userdata-section header h2 { - padding-bottom: 0; -} - -.quiqqer-frontend-users-address-edit .qui-select, -.quiqqer-frontend-users-address-edit .qui-select .drop-icon { - height: 40px; -} - -.quiqqer-frontend-users-address-edit .qui-select .text { - line-height: 40px; -} - .quiqqer-frontendUsers-userdata-invoiceaddress { border-bottom: 1px solid rgba(0, 0, 0, 0.1); - float: left; margin-bottom: 20px; padding-bottom: 20px; width: 100%; @@ -172,72 +101,10 @@ margin-right: 10px; } -.quiqqer-frontend-users-address-list-entry { - border: 1px solid #ddd; - background: #fff; -} - -.quiqqer-frontendUsers-controls-profile-categoryContent .quiqqer-frontend-users-address-list-entry-buttons button { - width: inherit; - margin-bottom: 0; -} - -.cologne-main .quiqqer-frontendUsers-userdata-address h2, -.cologne-main .quiqqer-frontendUsers-userdata-invoiceaddress h2, -.cologne-main .quiqqer-frontendUsers-userdata-invoiceaddress header, -.cologne-main .quiqqer-frontendUsers-controls-profile-changepassword h2, -.cologne-main .quiqqer-frontendUsers-controls-profile-deleteaccount h2 { - margin-top: 0; - padding-top: 0; -} - -@media (max-width: 768px) { - .quiqqer-frontendUsers-controls-profile-categories-mobile { - margin-bottom: 2em; - } - - .quiqqer-frontend-users-address-list .quiqqer-frontend-users-address-list-entry { - width: 100%; - } - - .quiqqer-frontend-users-address-list .quiqqer-frontend-users-address-list-entry:nth-child(even) { - margin-left: 0; - } - - .quiqqer-frontend-users-address-list .quiqqer-frontend-users-address-list-entry:nth-child(odd) { - margin-right: 0; - } -} - -/* email */ -.quiqqer-frontendUsers-userdata-address-additional .quiqqer-frontendUsers-userdata-email input { - float: left; - width: calc(100% - 70px); - margin-right: 10px; -} - -.quiqqer-frontendUsers-userdata-email .quiqqer-frontendUsers-userdata-email-edit { - line-height: 40px; - border-width: 1px; - border-radius: 0.25rem; -} - -@media screen and (max-width: 767px) { - .cologne-main .quiqqer-frontendUsers-controls-profile-control label { - margin-bottom: 10px; - } -} - -/**********/ -/* Avatar */ -/**********/ -.quiqqer-frontendUsers-userAvatar-gravatar { - margin: 1.5rem 0; -} - /******************/ /* profile orders */ /******************/ +/* hide top pagination */ .quiqqer-order-profile-orders .quiqqer-order-profile-orders-pagination:first-child { display: none; } @@ -245,20 +112,26 @@ /*****************/ /* Login control */ /*****************/ -.quiqqer-fu-login-container, -.quiqqer-fu-registrationSignUp { +:where(.loginAndRegister) .quiqqer-fu-login-container, +:where(.loginAndRegister) .quiqqer-fu-registrationSignUp { padding: 1.5rem 2rem; } -.quiqqer-fu-login-container { +:where(.loginAndRegister) .quiqqer-fu-login-container { background: #f8f8f8; - border: 1px solid #ddd; + border: var(--_qui-cologne-theme-border-width) solid var(--_qui-cologne-theme-border-color); max-width: 400px; position: relative; width: 100%; } -.quiqqer-frontendUsers-login .quiqqer-fu-login-container { +.loginAndRegister .quiqqer-fu-login-container-width { + width: 100%; + max-width: 400px; + margin-inline: auto; +} + +:where(.loginAndRegister) .quiqqer-frontendUsers-login .quiqqer-fu-login-container { background: none; border: none; margin: 0 auto; @@ -266,7 +139,7 @@ } @media screen and (max-width: 767px) { - .quiqqer-fu-registrationSignUp { + :where(.loginAndRegister) .quiqqer-fu-registrationSignUp { padding: 0; } } @@ -278,10 +151,11 @@ background: none; border: none; color: inherit; - float: right; margin-top: 1rem; padding: 0; position: initial; + width: 100%; + text-align: right; } .quiqqer-fu-login-container .quiqqer-fu-login-forget-password-reset [type="submit"] { @@ -317,8 +191,7 @@ } .loginAndRegister .quiqqer-fu-login-forget-password-reset { - padding: 1.5rem 2rem; - background: #f8f8f8; + padding-inline: 2rem; } .quiqqer-fu-registrationSignUp-terms-text [name="decline"] { diff --git a/bin/css/mini-basket.css b/bin/css/mini-basket.css index 62be613be80c3b6809a3ad75dcaa78a9a2f53787..783dff8dd47922ccebd0a9f4b7a9e1a18b7725c6 100644 --- a/bin/css/mini-basket.css +++ b/bin/css/mini-basket.css @@ -11,6 +11,7 @@ max-height: calc(100vh - 130px); /* header height + top bar height */ padding: 0 !important; width: 350px; + top: calc(var(--_qui-cologne-header-height, 100px) - 1px) !important; /* -1 because of border width */ } .quiqqer-order-basket-small-container > .qui-control { diff --git a/bin/css/order.css b/bin/css/order.css index b4e912fc188eebd52b61d24c5ec38823e80178c3..69c34c0e5c8304c5bec7d2d2507cffa2801c48d1 100644 --- a/bin/css/order.css +++ b/bin/css/order.css @@ -8,6 +8,15 @@ padding: 0; } +/* bad button design in this template... */ +.quiqqer-order-ordering-nobody-tabs-main__item .quiqqer-fu-login-forget-password-reset [name="cancel"], +.quiqqer-order-ordering-nobody-tabs-main__item .quiqqer-fu-login-forget-password-reset [name="cancel"]:is(:hover, :focus, :active) { + width: 100%; + background-color: transparent; + color: inherit; + border: none; +} + /****************/ /* step: basket */ /****************/ @@ -69,6 +78,21 @@ th.quiqqer-order-basket-articles-header-price { width: 60px; } +.quiqqer-order-basket-articles-header-image { + width: var(--_qui-order-basket-articles-image-width); +} + +.quiqqer-order-basket-articles-article-image { + width: var(--_qui-order-basket-articles-image-width); + text-align: center; +} + +.quiqqer-order-basket-articles-article-image__img { + width: var(--_qui-order-basket-articles-image-width); + height: var(--_qui-order-basket-articles-image-height); + object-fit: contain; +} + .quiqqer-order-basket-articles-article-quantity { text-align: center; width: 100px; @@ -122,18 +146,28 @@ td.quiqqer-order-basket-articles-article-remove button:hover { .quiqqer-shoppingCart-basket-end, .quiqqer-order-basket-end { + --gap: 1.5rem; + background: #f8f8f8; border: 1px solid #ddd; - clear: both; margin-top: 20px; - min-height: 90px; padding: 20px; position: relative; width: 100%; + display: flex; + flex-direction: column; + gap: var(--gap); +} + +.quiqqer-order-basket-end > *:not(:first-child, :only-child) { + border-top: var(--_qui-cologne-theme-border-width) solid var(--_qui-cologne-theme-border-color); + padding-top: var(--gap); } @media screen and (max-width: 767px) { - .quiqqer-shoppingCart-basket-end, .quiqqer-order-basket-end { + .quiqqer-shoppingCart-basket-end, + .quiqqer-order-basket-end { + --gap: 1rem; padding: 10px; } } @@ -193,45 +227,7 @@ td.quiqqer-order-basket-articles-article-remove button:hover { border-bottom: 3px double #999999; } -/* coupons */ -.quiqqer-coupons-couponcodeinput-title { - display: none; -} - -input.quiqqer-coupons-couponcodeinput-input:hover, -input.quiqqer-coupons-couponcodeinput-input:focus, -input.quiqqer-coupons-couponcodeinput-input:active { - background: #fff; - border-color: #28a745; -} - -.btn.quiqqer-coupons-couponcodeinput-btn { - background: #fff; - border-color: #28a745; - color: #28a745; -} - -.btn.quiqqer-coupons-couponcodeinput-btn:hover, -.btn.quiqqer-coupons-couponcodeinput-btn:active { - background: #28a745; - color: #fff; -} - @media screen and (max-width: 767px) { - .quiqqer-coupons-couponcodeinput { - flex-wrap: wrap; - } - - .quiqqer-coupons-couponcodeinput label { - margin: 0 0 1rem 0; - width: 100%; - } - - .quiqqer-coupons-couponcodeinput input, - .btn.quiqqer-coupons-couponcodeinput-btn { - width: 100%; - } - .quiqqer-order-basket-articles-article td:before { font-weight: bold; } @@ -348,43 +344,6 @@ input.quiqqer-coupons-couponcodeinput-input:active { .quiqqer-order-ordering-buttons a { width: 100%; } - - .quiqqer-order-basket-end { - height: inherit; - padding: 1rem; - text-align: center; - } - - .quiqqer-order-basket-end > * { - display: inline-block; - float: none !important; - margin: 0 !important; - width: 100%; - } - - .quiqqer-order-basket-end > * + * { - margin-top: 20px !important; - } - - .quiqqer-payment-paypal-express { - padding: 1rem 0; - } - - .quiqqer-order-basket-end .quiqqer-coupons-couponcodeinput { - flex-direction: column; - padding: 0; - text-align: left; - } - - .quiqqer-order-basket-end .quiqqer-coupons-couponcodeinput input { - margin-bottom: 1rem; - width: 100%; - } - - .quiqqer-coupons-couponcodeinput label span { - display: block; - padding: 5px 10px; - } } /******************/ @@ -439,6 +398,17 @@ table.articles-article { vertical-align: top; } +.articles-article-image { + width: var(--_qui-order-basket-articles-image-width); + text-align: center; +} + +.articles-article-image__img { + width: var(--_qui-order-articles-image-width); + height: var(--_qui-order-articles-image-height); + object-fit: contain; +} + td.articles-article-information { text-align: left; } @@ -514,7 +484,7 @@ th.articles-article-header-information { padding: 10px; } -.articles-sum { +:where(.quiqqer-order-step-checkout-article) .articles-sum { background: #f8f8f8; border: 1px solid #ddd; float: right; diff --git a/bin/css/style.css b/bin/css/style.css index a184fee7d9a121ce5f66d7144607513708dd4a90..4bcf1f4cb3f7785ec946c5b017dcacfdb1cbe5c7 100644 --- a/bin/css/style.css +++ b/bin/css/style.css @@ -747,7 +747,7 @@ a.toTop:before { border-bottom: 1px solid #ddd; box-shadow: 0 0 20px 0 rgba(57, 57, 57, 0); display: flex; - height: 100px; + height: var(--_qui-cologne-header-height, 100px); justify-content: space-between; left: 0; position: relative; @@ -758,8 +758,9 @@ a.toTop:before { } .cologne-header-fixed { + --_qui-cologne-header-height: 60px; + box-shadow: 0 0 20px 0 rgba(57, 57, 57, 0.2); - height: 60px; position: fixed; z-index: 100; /* Because of the search dropdown */ } @@ -927,6 +928,7 @@ a.toTop:before { .cologne-main { margin-top: 1rem; + margin-bottom: 1rem; width: 100%; } @@ -1522,6 +1524,12 @@ a.toTop:before { .cologne-login-dialog .qui-window-popup-content { padding: 20px 40px; + display: grid; + grid-template-areas: + 'logo' + 'body' + 'reset'; + grid-template-rows: auto 1fr; } .quiqqer-frontendUsers-loginWindow .quiqqer-frontendUsers-login { @@ -1614,11 +1622,12 @@ a.toTop:before { /* sing up / registration in link */ .login-popup-create-account-wrapper { - bottom: 10px; - left: 0; - position: absolute; text-align: center; width: 100%; + grid-area: reset; + margin-top: 1rem; + z-index: 1; + position: relative; } /*************************/ diff --git a/bin/css/user-orders.css b/bin/css/user-orders.css deleted file mode 100644 index 2ab49d78eb12c65ebd3678326d71c334c0dddcde..0000000000000000000000000000000000000000 --- a/bin/css/user-orders.css +++ /dev/null @@ -1,198 +0,0 @@ -section.quiqqer-order-profile-orders-order { - margin-bottom: 2em; -} - -.quiqqer-order-profile-orders-order-header-orderId { - float: left; - position: relative; - width: 25%; -} - -.quiqqer-order-profile-orders-order-header-date, -.quiqqer-order-profile-orders-order-header-total, -.quiqqer-order-profile-orders-order-header-addressInvoice, -.quiqqer-order-profile-orders-order-header-addressDelivery, -.quiqqer-order-profile-orders-order-header-orderId { - padding: 0 10px; -} - -.quiqqer-order-profile-orders-order-header-date { - padding-left: 0; -} - -.quiqqer-order-profile-orders-order-header-orderId { - padding-right: 0; -} - -.quiqqer-order-profile-orders-order-header-date > span:first-child, -.quiqqer-order-profile-orders-order-header-total > span:first-child, -.quiqqer-order-profile-orders-order-header-addressInvoice > span:first-child, -.quiqqer-order-profile-orders-order-header-addressDelivery > span:first-child, -.quiqqer-order-profile-orders-order-header-orderId > span:first-child { - display: block; -} - -/** - 1. avoid !important and increase the specificity (not good) - 2. set address position at the bottom line 100% height + 10px padding of "header" - */ -.quiqqer-order-profile-orders-order-header-addressInvoice address:is(address) { /* 1 */ - top: calc(100% + 10px); /* 2 */ -} - -.quiqqer-order-profile-orders-order-header-addressInvoice span { - align-items: center; - display: flex; - max-width: 100%; -} - -.quiqqer-order-profile-orders-order-header-addressInvoice > span > span { - display: block; - max-width: 100%; - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; -} - -.quiqqer-order-profile-orders-order-header-addressInvoice .fa { - margin-left: 5px; -} - -.quiqqer-order-profile-orders-order-articles { - background: #fff; -} - -.quiqqer-order-profile-orders-order-articles-article { - border-bottom: 1px dashed #ddd; - padding: 2em 0; -} - -.quiqqer-order-profile-orders-order-articles-article:last-child { - border-bottom: none; -} - -.quiqqer-order-profile-orders-order-articles-article { - align-items: start; - border-bottom: 1px dashed #ddd; - display: grid; - grid-column-gap: 20px; - grid-template-columns: 25% auto; - grid-template-rows: auto; - justify-items: start; - padding: 2em 0; -} - -.quiqqer-order-profile-orders-order-articles-image { - align-items: flex-start; - align-self: start; - border-right: 1px dashed #ddd; - display: flex; - grid-row: 1 / 5; - justify-content: center; - padding: 20px; - width: 100%; -} - -.quiqqer-order-profile-orders-order-articles-information { - padding-top: 0 !important; -} - -.quiqqer-order-profile-orders-order-articles-title { - color: inherit; - font-size: 1.75em; -} - -.quiqqer-order-profile-orders-order-articles-description { - margin: 5px 0; - color: #9ba3ad; -} - -.quiqqer-order-profile-orders-order-articles-price { - font-size: 1.2em; - font-weight: 500; - padding-bottom: 10px; -} - -.quiqqer-order-profile-orders-order-articles-rebuy { - align-self: end; -} - -/**********/ -/* footer */ -/**********/ -.quiqqer-order-profile-orders-order footer { - display: flex; - justify-content: space-between; -} - -.quiqqer-order-profile-orders-order footer .quiqqer-order-profile-orders-order-footer-paymentType { - margin-top: 0; -} - -.quiqqer-order-profile-orders-order-footer-rightWrapper { - display: flex; - align-items: center; -} - -@media (max-width: 768px) { - /***********************/ - /* article list header */ - /***********************/ - .quiqqer-order-profile-orders-order-header-date, .quiqqer-order-profile-orders-order-header-total, .quiqqer-order-profile-orders-order-header-addressInvoice, .quiqqer-order-profile-orders-order-header-addressDelivery, .quiqqer-order-profile-orders-order-header-orderId { - padding: 0; - margin-bottom: 10px; - } - - .quiqqer-order-profile-orders-order-header-orderId { - margin: 0 !important; - } - - .quiqqer-order-profile-orders-order-header-date > span:first-child, .quiqqer-order-profile-orders-order-header-total > span:first-child, .quiqqer-order-profile-orders-order-header-addressInvoice > span:first-child, .quiqqer-order-profile-orders-order-header-addressDelivery > span:first-child, .quiqqer-order-profile-orders-order-header-orderId > span:first-child { - padding-right: 5px; - } - - /****************/ - /* article list */ - /****************/ - .quiqqer-order-profile-orders-order-articles-article { - display: block; - padding: 3em 0; - } - - .quiqqer-order-profile-orders-order-articles-image { - border-bottom: 1px dashed #ddd; - border-right: none; - float: none !important; - margin: 0 0 20px 0; - } - - .quiqqer-order-profile-orders-order-articles-price { - padding-top: 10px; - } - - .quiqqer-order-profile-orders-order-articles-rebuy{ - display: block; - margin: 0 auto; - max-width: 340px; - width: 100%; - } - - /**********/ - /* footer */ - /**********/ - .quiqqer-order-profile-orders-order footer { - display: block; - } - - .quiqqer-order-profile-orders-order footer .quiqqer-order-profile-orders-order-footer-rightWrapper .btn { - padding-left: 3px; - padding-right: 3px; - } -} - -/****************/ -/* Invoice list */ -/****************/ -.quiqqer-invoice-profile-invoices-table-invoice { - background: #fff; -} \ No newline at end of file diff --git a/bin/css/variables.css b/bin/css/variables.css index 9cc5728744d16da5d5e48d308ceab9d4faca83d4..77e5b4f3da49bf468ee7a6e997226c6966b82bd1 100644 --- a/bin/css/variables.css +++ b/bin/css/variables.css @@ -16,4 +16,16 @@ /* background */ --bg-primary: #ddd; --bg-secondary: #f5f5f5; + + --_qui-cologne-header-height: 100px; + --_qui-template-scrollMarginTop: var(--qui-template-scrollMarginTop, var(--_qui-cologne-header-height)); + + --_qui-cologne-theme-border-color: var(--qui-cologne-theme-border-color, #ddd); + --_qui-cologne-theme-border-width: var(--qui-cologne-theme-border-width, 1px); + + /* ecoyn / ecommerce */ + --_qui-order-basket-articles-image-width: var(--qui-order-basket-articles-image-width, 100px); + --_qui-order-basket-articles-image-height: var(--qui-order-basket-articles-image-height, 100px); + --_qui-order-articles-image-width: var(--qui-order-articles-image-width, 100px); + --_qui-order-articles-image-height: var(--qui-order-articles-image-height, 100px); } \ No newline at end of file diff --git a/bin/javascript/init.js b/bin/javascript/init.js index 6b17cc4a84e1e3cb0202551634739cf99d82363b..aa506c199442aa2d27c95d8eb67b178263e01bc1 100644 --- a/bin/javascript/init.js +++ b/bin/javascript/init.js @@ -343,7 +343,7 @@ window.addEvent('domready', function () { 'package/quiqqer/order/bin/frontend/controls/basket/Button' ], function (Basket) { new Basket({ - open : BASKET_OPEN.toInt(), + action : BASKET_ACTION, events: { onCreate: function (Basket) { var BasketNode = Basket.getElm(), @@ -364,7 +364,7 @@ window.addEvent('domready', function () { new Element('span', { 'class': 'quiqqer-order-basketButton-quantity quiqqer-order-basketButton-batch-custom', - html : '0' + html : '<span class="fa fa-spinner fa-spin"></span>' }).inject(BasketNode); if (BASKET_STYLE && BASKET_STYLE === 'full') { diff --git a/captainhook.json b/captainhook.json new file mode 100644 index 0000000000000000000000000000000000000000..3702e1a358868bedd5ff4c7eae40bb1abb589267 --- /dev/null +++ b/captainhook.json @@ -0,0 +1,13 @@ +{ + "pre-commit": { + "enabled": true, + "actions": [ + { + "action": "\\CaptainHook\\App\\Hook\\PHP\\Action\\Linting" + }, + { + "action": "composer test" + } + ] + } +} \ No newline at end of file diff --git a/composer.json b/composer.json index 0c520071e471dca7d75e5ef83c2533e8702e38f6..a553c1629b6c3b9e98a69f9b0b0f92f72796d868 100644 --- a/composer.json +++ b/composer.json @@ -1,38 +1,81 @@ { - "name": "quiqqer/template-cologne", - "type": "quiqqer-template", - "description": "The QUIQQER Cologne E-Commerce Template", - "license": "GPLv3", - "authors": [ - { - "name": "Henning Leutz", - "email": "support@pcsg.de", - "homepage": "https://www.pcsg.de", - "role": "Developer" + "name": "quiqqer/template-cologne", + "type": "quiqqer-template", + "description": "The QUIQQER Cologne E-Commerce Template", + "license": "GPLv3", + "authors": [ + { + "name": "Henning Leutz", + "email": "support@pcsg.de", + "homepage": "https://www.pcsg.de", + "role": "Developer" + } + ], + "support": { + "email": "support@pcsg.de", + "url": "https://www.pcsg.de" + }, + "require": { + "php": "^8.1", + "quiqqer/core": "^2", + "quiqqer/erp": "^3", + "quiqqer/products": "^2", + "quiqqer/order": "^2.7.24", + "quiqqer/product-bricks": "^2", + "quiqqer/frontend-users": "^2", + "quiqqer/menu": "^3", + "quiqqer/sitetypes": "^2", + "quiqqer/unsemantic": "^2", + "quiqqer-asset/fastclick": "^1", + "quiqqer/tooltips": "^2", + "quiqqer/currency": "^2", + "quiqqer/smarty4": "^2.0.7" + }, + "autoload": { + "psr-4": { + "QUI\\TemplateCologne\\": "src/QUI/TemplateCologne" + } + }, + "scripts": { + "test": [ + "@dev:lint", + "@dev:phpunit" + ], + "dev:phpunit": "./tools/phpunit", + "dev:lint": [ + "@dev:lint:phpstan", + "@dev:lint:style" + ], + "dev:lint:phpstan": "./tools/phpstan", + "dev:lint:style": "./tools/phpcs", + "dev:lint:style:fix": "./tools/phpcbf", + "dev:init": [ + "@dev:init:check-requirements", + "@dev:init:tools", + "@dev:init:git-hooks" + ], + "dev:init:check-requirements": [ + "which composer > /dev/null || (echo 'Error: composer has to be globally installed'; exit 1)", + "which phive > /dev/null || (echo 'Error: PHIVE has to be globally installed'; exit 1)" + ], + "dev:init:tools": "phive install --temporary", + "dev:init:git-hooks": "./tools/captainhook install --only-enabled --force" + }, + "scripts-aliases": { + "test": [ + "dev:test" + ] + }, + "scripts-descriptions": { + "test": "Runs linting, static analysis, and unit tests.", + "dev:phpunit": "Run PHPUnit test suites", + "dev:lint": "Run PHPStan and code style check", + "dev:lint:phpstan": "Run PHPStan", + "dev:lint:style": "Run code style check (PHP_CodeSniffer)", + "dev:lint:style:fix": "Try to fix code style errors automatically", + "dev:init": "Initialize the developer tooling (tools and git hooks)", + "dev:init:check-requirements": "Check if the necessary requirements are met", + "dev:init:tools": "Install all developer tools (requires PHIVE)", + "dev:init:git-hooks": "Install all git hooks (may require tools to be installed)" } - ], - "support": { - "email": "support@pcsg.de", - "url": "https://www.pcsg.de" - }, - "require": { - "php": "^8.1", - "quiqqer/core": "^2", - "quiqqer/erp": "^3", - "quiqqer/products": "^2", - "quiqqer/order": "^2", - "quiqqer/product-bricks": "^2", - "quiqqer/frontend-users": "^2", - "quiqqer/menu": "^3", - "quiqqer/sitetypes": "^2", - "quiqqer/unsemantic": "^2", - "quiqqer-asset/fastclick": "^1", - "quiqqer/tooltips": "^2", - "quiqqer/currency": "^2" - }, - "autoload": { - "psr-4": { - "QUI\\TemplateCologne\\": "src/QUI/TemplateCologne" - } - } -} +} \ No newline at end of file diff --git a/events.xml b/events.xml index 10127fc14b8d3f3db37daae9c3a27d812f10e683..8551c67a5be2a654d2fde4d736fa542214e9b837 100644 --- a/events.xml +++ b/events.xml @@ -1,5 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <events> + <event on="onSmartyInit" fire="\QUI\TemplateCologne\EventHandler::onSmartyInit"/> <event on="onProjectConfigSave" fire="\QUI\TemplateCologne\EventHandler::onProjectConfigSave"/> <event on="onSiteSave" fire="\QUI\TemplateCologne\EventHandler::onSiteSave"/> <event on="onQuiqqer::products::product::buttons::end" diff --git a/index.html b/index.html index 055e04b41aabb06637c2c3d0ce738c007b1c4150..145eb88feaa2b6cb738da274e8ad0836ed6ed69b 100644 --- a/index.html +++ b/index.html @@ -10,16 +10,16 @@ {$Template->getHeader()} <script> - var BASKET_STYLE = "{$basketStyle}"; - var BASKET_OPEN = "{$basketOpen}"; - var INITAL_BASKET_PRICE = "{$initialBasketPrice}"; - var COUNT_LANGUAGES = "{$countLanguages}"; - var SHOW_CATEGORY_MENU = "{$showCategoryMenu}"; - var REGISTER_URL = "{$registerSiteUrl}"; - var SHOW_MENU_AFTER_SCROLL_POS = "{$showNavAfterScroll}"; // The number of pixels from top which the menu will be displayed. - var SHOW_MENU_SMOOTH = "{$showMenuSmooth}"; // if true menu slides from top (animation) - var SET_MENU_POS_BACK_ON_INIT = !!"{$setMenuPosBackOnInit}"; // if true menu slides from top (animation) - var SCROLL_OFFSET = 80; + const BASKET_STYLE = "{$basketStyle}"; + const BASKET_ACTION = "{$basketAction}"; + const INITAL_BASKET_PRICE = "{$initialBasketPrice}"; + const COUNT_LANGUAGES = "{$countLanguages}"; + const SHOW_CATEGORY_MENU = "{$showCategoryMenu}"; + const REGISTER_URL = "{$registerSiteUrl}"; + const SHOW_MENU_AFTER_SCROLL_POS = "{$showNavAfterScroll}"; // The number of pixels from top which the menu will be displayed. + const SHOW_MENU_SMOOTH = "{$showMenuSmooth}"; // if true menu slides from top (animation) + const SET_MENU_POS_BACK_ON_INIT = !!"{$setMenuPosBackOnInit}"; // if true menu slides from top (animation) + const SCROLL_OFFSET = 80; </script> {fetch template="template/head/styles.html" Template=$Template} diff --git a/index.php b/index.php index a49e56fec0764332379ba4b0900bd272e4185675..85536cdeca290224e4afa6ec85c32a8559c8a9c5 100644 --- a/index.php +++ b/index.php @@ -1,5 +1,14 @@ <?php +/** + * cologne template file + * + * @var QUI\Projects\Project $Project + * @var QUI\Projects\Site $Site + * @var QUI\Interfaces\Template\EngineInterface $Engine + * @var QUI\Template $Template + **/ + /** * Emotion */ @@ -13,7 +22,7 @@ $templateSettings = QUI\TemplateCologne\Utils::getConfig([ 'Project' => $Project, 'Template' => $Template, - 'Site' => $Site + 'Site' => $Site ]); /** @@ -37,7 +46,7 @@ $independentMenuId = $Project->getConfig('templateCologne.settings.menuId'); if ($enableIndependentMenu && $independentMenuId) { - $menuParams['menuId'] = $enableIndependentMenu; + $menuParams['menuId'] = $independentMenuId; $menuParams['showFirstLevelIcons'] = $Project->getConfig('templateCologne.settings.showFirstLevelIcons'); $menuParams['showStart'] = false; } @@ -93,7 +102,7 @@ /* user avatar */ $Avatar = new QUI\FrontendUsers\Controls\UserIcon([ 'showLogout' => false, // template cologne use own logout popup (see bin/javascript/init.js) - 'User' => QUI::getUserBySession() + 'User' => QUI::getUserBySession() ]); /* product page - for layouts */ @@ -134,7 +143,7 @@ $registerSite = $Project->getSites([ 'where' => [ 'type' => [ - 'type' => 'IN', + 'type' => 'IN', 'value' => $registerSiteTypes ] ], diff --git a/layout/leftSidebar.html b/layout/leftSidebar.html index 01330cb69496f6c283a5df5385963bb24c89e58f..550431a281a04641f68b01774b3c5b21433393db 100644 --- a/layout/leftSidebar.html +++ b/layout/leftSidebar.html @@ -9,7 +9,7 @@ {if !empty( $prefixContentBricks )} {foreach from=$prefixContentBricks item=Brick} - {assign var=classes value=\QUI\TemplateCologne\Utils::convertBrickCSSClass($Brick->getAttribute('classes'))} + {assign var=classes value=QUI\TemplateCologne\Utils::convertBrickCSSClass($Brick->getAttribute('classes'))} <section class="template-brick-container template-brick-contentPrefix brick-id-{$Brick->getAttribute('id')} {$classes}"> @@ -63,7 +63,7 @@ {if !empty( $suffixContentBricks )} {foreach from=$suffixContentBricks item=Brick} - {assign var=classes value=\QUI\TemplateCologne\Utils::convertBrickCSSClass($Brick->getAttribute('classes'))} + {assign var=classes value=QUI\TemplateCologne\Utils::convertBrickCSSClass($Brick->getAttribute('classes'))} <section class="template-brick-container template-brick-contentSuffix brick-id-{$Brick->getAttribute('id')} {$classes}"> <div class="template-grid-row"> diff --git a/layout/noSidebar.html b/layout/noSidebar.html index 05b7c799c95eed67c4efc7dcfc04419ee80bf3cf..5c5e7afc273e118dc0eeaa656170d6255dad0a10 100644 --- a/layout/noSidebar.html +++ b/layout/noSidebar.html @@ -6,7 +6,7 @@ <div class="main-no-sidebar"> {if !empty( $prefixContentBricks )} {foreach from=$prefixContentBricks item=Brick} - {assign var=classes value=\QUI\TemplateCologne\Utils::convertBrickCSSClass($Brick->getAttribute('classes'))} + {assign var=classes value=QUI\TemplateCologne\Utils::convertBrickCSSClass($Brick->getAttribute('classes'))} <section class="template-brick-container template-brick-contentPrefix brick-id-{$Brick->getAttribute('id')} {$classes}"> <div class="template-grid-row"> @@ -58,7 +58,7 @@ {if !empty( $suffixContentBricks )} {foreach from=$suffixContentBricks item=Brick} - {assign var=classes value=\QUI\TemplateCologne\Utils::convertBrickCSSClass($Brick->getAttribute('classes'))} + {assign var=classes value=QUI\TemplateCologne\Utils::convertBrickCSSClass($Brick->getAttribute('classes'))} <section class="template-brick-container template-brick-contentSuffix brick-id-{$Brick->getAttribute('id')} {$classes}"> <div class="template-grid-row"> diff --git a/layout/noSidebarThin.html b/layout/noSidebarThin.html index 7eb71872aa80c259bc4669181b614b1ed8296ab6..c79001895bc003d0c76ea6d9fe522f65e72ad7e9 100644 --- a/layout/noSidebarThin.html +++ b/layout/noSidebarThin.html @@ -7,7 +7,7 @@ <div class="main-no-sidebar-thin"> {if !empty( $prefixContentBricks )} {foreach from=$prefixContentBricks item=Brick} - {assign var=classes value=\QUI\TemplateCologne\Utils::convertBrickCSSClass($Brick->getAttribute('classes'))} + {assign var=classes value=QUI\TemplateCologne\Utils::convertBrickCSSClass($Brick->getAttribute('classes'))} <section class="template-brick-container template-brick-contentPrefix brick-id-{$Brick->getAttribute('id')} {$classes}"> <div class="template-grid-row"> @@ -58,7 +58,7 @@ {if !empty( $suffixContentBricks )} {foreach from=$suffixContentBricks item=Brick} - {assign var=classes value=\QUI\TemplateCologne\Utils::convertBrickCSSClass($Brick->getAttribute('classes'))} + {assign var=classes value=QUI\TemplateCologne\Utils::convertBrickCSSClass($Brick->getAttribute('classes'))} <section class="template-brick-container template-brick-contentSuffix brick-id-{$Brick->getAttribute('id')} {$classes}"> <div class="template-grid-row"> diff --git a/layout/rightSidebar.html b/layout/rightSidebar.html index db226d4df02896b77588c73d2705f0c84babaafc..30e9a590e4a7d1f7f25220a934751a837e174fa6 100644 --- a/layout/rightSidebar.html +++ b/layout/rightSidebar.html @@ -10,7 +10,7 @@ {if !empty( $prefixContentBricks )} {foreach from=$prefixContentBricks item=Brick} - {assign var=classes value=\QUI\TemplateCologne\Utils::convertBrickCSSClass($Brick->getAttribute('classes'))} + {assign var=classes value=QUI\TemplateCologne\Utils::convertBrickCSSClass($Brick->getAttribute('classes'))} <section class="template-brick-container template-brick-contentPrefix brick-id-{$Brick->getAttribute('id')} {$classes}"> <div class="template-grid-row"> @@ -62,7 +62,7 @@ {if !empty( $suffixContentBricks )} {foreach from=$suffixContentBricks item=Brick} - {assign var=classes value=\QUI\TemplateCologne\Utils::convertBrickCSSClass($Brick->getAttribute('classes'))} + {assign var=classes value=QUI\TemplateCologne\Utils::convertBrickCSSClass($Brick->getAttribute('classes'))} <section class="template-brick-container template-brick-contentSuffix brick-id-{$Brick->getAttribute('id')} {$classes}"> <div class="template-grid-row"> diff --git a/layout/startPage.html b/layout/startPage.html index 672b17c7bf9f8f8f1f4304f29ce4b4c6a4eac70a..76256d82bb70abb625e0c291553120ed69e5ccba 100644 --- a/layout/startPage.html +++ b/layout/startPage.html @@ -6,7 +6,7 @@ <div class="main-start-page"> {if !empty( $prefixContentBricks )} {foreach from=$prefixContentBricks item=Brick} - {assign var=classes value=\QUI\TemplateCologne\Utils::convertBrickCSSClass($Brick->getAttribute('classes'))} + {assign var=classes value=QUI\TemplateCologne\Utils::convertBrickCSSClass($Brick->getAttribute('classes'))} <section class="template-brick-container template-brick-contentPrefix brick-id-{$Brick->getAttribute('id')} {$classes}"> <div class="template-grid-row"> @@ -59,7 +59,7 @@ {if !empty( $suffixContentBricks )} {foreach from=$suffixContentBricks item=Brick} - {assign var=classes value=\QUI\TemplateCologne\Utils::convertBrickCSSClass($Brick->getAttribute('classes'))} + {assign var=classes value=QUI\TemplateCologne\Utils::convertBrickCSSClass($Brick->getAttribute('classes'))} <section class="template-brick-container template-brick-contentSuffix brick-id-{$Brick->getAttribute('id')} {$classes}"> <div class="template-grid-row"> diff --git a/locale.xml b/locale.xml index 8b106bf679acf6449961f41b31e7a8360496b0db..7b129ba8125f5170109a793ec5018cb77693638a 100644 --- a/locale.xml +++ b/locale.xml @@ -500,22 +500,35 @@ <en><![CDATA[Compact (only icon)]]></en> </locale> - <!-- basket open --> - <locale name="settings.shop.basketOpen"> - <de><![CDATA[Aktion bei Klick auf Warenkorb]]></de> - <en><![CDATA[What should happen when the user clicks on the shopping cart?]]></en> - </locale> - <locale name="settings.shop.basketOpen.nothing"> - <de><![CDATA[Bestellprozes nicht öffnen]]></de> - <en><![CDATA[Do not open order process]]></en> + <locale name="settings.shop.order.basket.showImages"> + <de><![CDATA[Produktbilder im Warenkorb anzeigen]]></de> + <en><![CDATA[Show product images in basket]]></en> + </locale> + <locale name="settings.shop.order.basket.showImages.desc"> + <de><![CDATA[Wenn aktiviert, werden in Warenkorb und Bestellung die Produktbilder angezeigt.]]></de> + <en><![CDATA[If the option ist enabled, the product images are displayed in the shopping basket and order.]]></en> + </locale> + + <!-- basket action --> + <locale name="settings.shop.basketAction"> + <de><![CDATA[Aktion bei Klick auf Warenkorb-Icon]]></de> + <en><![CDATA[Shopping card action on click]]></en> + </locale> + <locale name="settings.shop.basketAction.desc"> + <de><![CDATA[Diese Option gilt nur für Desktop Ansicht. Auf mobilen Geräten wird immer zu der Bestellseite geleitet.]]></de> + <en><![CDATA[This option only applies to desktop view. On mobile devices it will always be redirected to the order process page.]]></en> + </locale> + <locale name="settings.shop.basketAction.openSmallBasket"> + <de><![CDATA[Kleinen Warenkorb öffnen]]></de> + <en><![CDATA[Open small basket]]></en> </locale> - <locale name="settings.shop.basketOpen.window"> - <de><![CDATA[Bestellprozes in einem Fenster öffnen]]></de> - <en><![CDATA[Open order process in a popup]]></en> + <locale name="settings.shop.basketAction.openOrderProcessUrl"> + <de><![CDATA[Bestellseite öffnen]]></de> + <en><![CDATA[Open order process page]]></en> </locale> - <locale name="settings.shop.basketOpen.page"> - <de><![CDATA[Zu Bestellprozess-Seite leiten]]></de> - <en><![CDATA[Go to order page]]></en> + <locale name="settings.shop.basketAction.openOrderProcess"> + <de><![CDATA[Bestellung in einem Popup Fenster öffnen]]></de> + <en><![CDATA[Open order process in a popup]]></en> </locale> <!-- hide empty fields --> <locale name="settings.shop.hideEmptyFields"> diff --git a/phpcs.xml.dist b/phpcs.xml.dist new file mode 100644 index 0000000000000000000000000000000000000000..d48084fbdc86a2dbfb78dd89ab2e0b0ff2322ba7 --- /dev/null +++ b/phpcs.xml.dist @@ -0,0 +1,23 @@ +<?xml version="1.0"?> +<ruleset> + <!-- Use PSR-12 ruleset --> + <rule ref="PSR12"/> + + <!-- Only scan *.php files --> + <arg name="extensions" value="php"/> + + <!-- Ignore warnings --> + <arg name="warning-severity" value="0"/> + + <!-- Process 64 (or number of CPU cores) files in parallel --> + <arg name="parallel" value="64"/> + + <!-- Output relative file paths, by setting the current folder as the basepath --> + <arg name="basepath" value="."/> + + <!-- Show colored output --> + <arg name="colors"/> + + <!-- Scan everything in the current folder --> + <file>.</file> +</ruleset> diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon new file mode 100644 index 0000000000000000000000000000000000000000..1339890a6e72c75d6ae49a176d1046f0c370282f --- /dev/null +++ b/phpstan-baseline.neon @@ -0,0 +1,2 @@ +parameters: + ignoreErrors: \ No newline at end of file diff --git a/phpstan.dist.neon b/phpstan.dist.neon new file mode 100644 index 0000000000000000000000000000000000000000..dc33bb4eaabd6fab16696f6e9ea5b43071cfdf84 --- /dev/null +++ b/phpstan.dist.neon @@ -0,0 +1,11 @@ +includes: + - phpstan-baseline.neon + +parameters: + level: 5 + paths: + - src + - ajax + bootstrapFiles: + - tests/phpstan-bootstrap.php + tipsOfTheDay: false diff --git a/phpunit.dist.xml b/phpunit.dist.xml new file mode 100644 index 0000000000000000000000000000000000000000..f6c7becf0c12757beb871a9333e2d81e02aa7cae --- /dev/null +++ b/phpunit.dist.xml @@ -0,0 +1,8 @@ +<?xml version="1.0" encoding="UTF-8"?> +<phpunit bootstrap="tests/phpunit-bootstrap.php"> + <testsuites> + <testsuite name="Tests"> + <directory>tests/</directory> + </testsuite> + </testsuites> +</phpunit> diff --git a/quiqqer/quiqqer/lib/templates/mail/body.html b/quiqqer/core/src/templates/mail/body.html similarity index 100% rename from quiqqer/quiqqer/lib/templates/mail/body.html rename to quiqqer/core/src/templates/mail/body.html diff --git a/quiqqer/quiqqer/lib/templates/mail/footer.html b/quiqqer/core/src/templates/mail/footer.html similarity index 100% rename from quiqqer/quiqqer/lib/templates/mail/footer.html rename to quiqqer/core/src/templates/mail/footer.html diff --git a/quiqqer/quiqqer/lib/templates/mail/header.html b/quiqqer/core/src/templates/mail/header.html similarity index 100% rename from quiqqer/quiqqer/lib/templates/mail/header.html rename to quiqqer/core/src/templates/mail/header.html diff --git a/quiqqer/quiqqer/lib/templates/mail/meta.html b/quiqqer/core/src/templates/mail/meta.html similarity index 100% rename from quiqqer/quiqqer/lib/templates/mail/meta.html rename to quiqqer/core/src/templates/mail/meta.html diff --git a/quiqqer/faq/types/category.html b/quiqqer/faq/types/category.html index dffa9454835d7876595023fa8007c5b81332bc3f..ae7c9f1347a6822b382956555c1dbd75f38ce6af 100644 --- a/quiqqer/faq/types/category.html +++ b/quiqqer/faq/types/category.html @@ -6,28 +6,14 @@ {* Template: default*} {if $faqTemplate == 'default'} - {if $offset} - {* - This CSS is used to scroll the page down a bit when accessed with a # in the url. - By doing this the menu no longer hides the linked content. - *} - <style type="text/css"> - :target::before { - content: ''; - display: block; - height: {$offset}px; - margin-top: -{$offset}px; - } - </style> - {/if} - - <section itemscope itemtype="http://schema.org/ItemList" + <section itemscope itemtype="https://schema.org/ItemList" class="content-template quiqqer-faq clear-fix cologne-quiqqer-faq" data-qui="package/quiqqer/faq/bin/Category" data-qui-options-offset="{$offset}" + {if $offset}style="--_qui-faq-scrollOffset: var(--qui-faq-scrollOffset, {$offset}px);"{/if} > {if count($entries)} - <ul class="quiqqer-faq-list" id="faqList" name="faqList"> + <ul class="quiqqer-faq-list" id="faqList"> {foreach $entries as $Faq} <li> <a href="{url site=$Site}#faq{$Faq->getId()}"> @@ -40,7 +26,7 @@ {/if} {foreach $entries as $Faq} - <article id="faq{$Faq->getId()}" class="clear-fix"> + <article id="faq{$Faq->getId()}" class="quiqqer-faq__entry"> <header> <h2><span class="fa fa-file-text"></span> {$Faq->getAttribute('title')}</h2> </header> @@ -65,6 +51,10 @@ {/if} {/foreach} + + {if $faqStructuredData} + {$faqStructuredData} + {/if} </section> {/if} diff --git a/quiqqer/frontend-users/src/QUI/FrontendUsers/Controls/Profile.html b/quiqqer/frontend-users/src/QUI/FrontendUsers/Controls/Profile.html index 171be08ad675a35234fb4c90c5693fa60269e054..97ec34219646155d2153a7f58c9eb9889db76800 100644 --- a/quiqqer/frontend-users/src/QUI/FrontendUsers/Controls/Profile.html +++ b/quiqqer/frontend-users/src/QUI/FrontendUsers/Controls/Profile.html @@ -1,76 +1,87 @@ {if !$Category} -<p> - {locale group="quiqqer/frontend-users" var="profile.no_categories_available"} -</p> + <div class="quiqqer-frontendUsers-controls-profile__noCategoriesInfo"> + <p> + {locale group="quiqqer/frontend-users" var="profile.no_categories_available"} + </p> + </div> {else} + <div class="quiqqer-frontendUsers-controls-profile__sidebar"> + {if $this->getAttribute('menu')} + <div class="quiqqer-frontendUsers-controls-profile-categories"> -{if $this->getAttribute('menu')} -<div class="quiqqer-frontendUsers-controls-profile-categories"> - - <div class="quiqqer-fupc-userinfo"> - {control control="QUI\TemplateCologne\Controls\SimpleUserInfo" assign=SimpleUserInfo} - {$SimpleUserInfo->create()} - </div> + <div class="quiqqer-fupc-userinfo"> + {control control="QUI\TemplateCologne\Controls\SimpleUserInfo" assign=SimpleUserInfo} + {$SimpleUserInfo->create()} + </div> - {foreach $categories as $category} - <div class="quiqqer-fupc-category quiqqer-fupc-category--open" - data-category="{$category.name}" - > - <div class="quiqqer-fupc-category-header"> - {$category.title} - </div> - <div class="quiqqer-fu-profile-categories-category-items"> - {foreach $category.items as $setting} + {foreach $categories as $category} + <div class="quiqqer-fupc-category" + data-category="{$category.name}" + data-name="nav-category" + data-open="1" + > + <div class="quiqqer-fupc-category-header" data-name="header"> + <span class="quiqqer-fupc-category-header__text">{$category.title}</span> + <span class="fa-solid fa-angle-right quiqqer-fupc-category-header__icon" data-name="opener"></span> + </div> + <div class="quiqqer-fu-profile-categories-category-items"> + {foreach $category.items as $setting} + {assign var=active value=false} + {if $currentCategory == $category.name && $currentSetting == $setting.name} + {assign var=active value=true} + {/if} + <a href="{$Site->getUrlRewritten()}/{$category.name}/{$setting.name}" + class="quiqqer-fupc-category-items-item" + {if $active}data-active{/if} + data-name="nav-category-item" + data-setting="{$setting.name}" + > + {if $setting.icon} + <span class="fa-fw quiqqer-fupc-category-items-item-icon {$setting.icon}"></span> + {/if} + <span>{$setting.title}</span> + </a> + {/foreach} + </div> + </div> + {/foreach} + </div> + {/if} - {assign var=active value=""} - {if $currentCategory == $category.name && $currentSetting == $setting.name} - {assign var=active value=" quiqqer-fupc-category-items-item--active"} - {/if} - <a href="{$Site->getUrlRewritten()}/{$category.name}/{$setting.name}" - class="quiqqer-fupc-category-items-item{$active}" - data-setting="{$setting.name}" - > - {if $setting.icon} - <span class="quiqqer-fupc-category-items-item-icon {$setting.icon}"></span> - {/if} - <span>{$setting.title}</span> - </a> - {/foreach} - </div> + {* mobile categories *} + <form action="" method="post" class="quiqqer-frontendUsers-controls-profile-categories-mobile"> + <label class="quiqqer-frontendUsers-controls-profile-categories-mobile-label"> + <select name="profile-categories-mobile"> + {foreach $categories as $category} + <optgroup label="{$category.title}"> + {foreach $category.items as $setting} + {assign var=active value=""} + {if $currentCategory == $category.name && $currentSetting == $setting.name} + {assign var=active value="selected"} + {/if} + <option value="{$category.name}:{$setting.name}" {$active}> + {$setting.title} + </option> + {/foreach} + </optgroup> + {/foreach} + </select> + </label> + </form> </div> - {/foreach} -</div> -{/if} - -<form action="" method="post"> - <label class="quiqqer-frontendUsers-controls-profile-categories-mobile"> - <select name="profile-categories"> - {foreach $categories as $category} - <optgroup label="{$category.title}"> - {foreach $category.items as $setting} - {assign var=active value=""} - {if $currentCategory== $category.name} - {assign var=active value=" selected"} - {/if} - <option value="{$category.name}:{$setting.name}"{$active}> - {$setting.title} - </option> - {/foreach} - </optgroup> - {/foreach} - </select> - </label> -</form> -<form class="quiqqer-frontendUsers-controls-profile-categoryContent" - method="post" - action="" - data-category="{$currentCategory}" - data-setting="{$currentSetting}" -> - <div class="quiqqer-frontendUsers-controls-profile-categoryContentAnimation"> - {$Category->create()} - <input type="hidden" name="profile-save" value="1"> + <div class="quiqqer-frontendUsers-controls-profile__content"> + <form class="quiqqer-frontendUsers-controls-profile-categoryContent" + data-name="form" + method="post" + action="" + data-category="{$currentCategory}" + data-setting="{$currentSetting}" + > + <div class="quiqqer-frontendUsers-controls-profile-categoryContentAnimation" data-name="content-animated"> + {$Category->create()} + <input type="hidden" name="profile-save" value="1"> + </div> + </form> </div> -</form> {/if} \ No newline at end of file diff --git a/quiqqer/order/src/QUI/ERP/Order/Controls/Basket/Basket.html b/quiqqer/order/src/QUI/ERP/Order/Controls/Basket/Basket.html new file mode 100644 index 0000000000000000000000000000000000000000..8414d1f68fb53922608a6efd655680e32fd06004 --- /dev/null +++ b/quiqqer/order/src/QUI/ERP/Order/Controls/Basket/Basket.html @@ -0,0 +1,254 @@ +{template_event name="quiqqer::order::basket::begin" Basket=$Basket} + +{if $Products->count()} +<table class="quiqqer-order-basket-articles"> + <thead> + <tr class="quiqqer-order-basket-articles-header"> + <th class="quiqqer-order-basket-articles-header-pos" + title="{locale group='quiqqer/erp' var='article.list.articles.header.pos'}" + > + {locale group="quiqqer/erp" var="article.list.articles.header.pos"} + </th> + {if QUI\TemplateCologne\Utils::getSetting('order.basket.showImages')} + <th class="quiqqer-order-basket-articles-header-image" + title="{locale group='quiqqer/erp' var='article.list.articles.header.image'}" + > + {locale group="quiqqer/erp" var="article.list.articles.header.image"} + </th> + {/if} + <th class="quiqqer-order-basket-articles-header-information" + title="{locale group='quiqqer/erp' var='article.list.articles.header.description'}" + > + {locale group="quiqqer/erp" var="article.list.articles.header.description"} + </th> + <th class="quiqqer-order-basket-articles-header-quantity" + title="{locale group='quiqqer/erp' var='article.list.articles.header.quantity'}" + > + {locale group="quiqqer/erp" var="article.list.articles.header.quantity"} + </th> + <th class="quiqqer-order-basket-articles-unitPrice" + title="{locale group='quiqqer/erp' var='article.list.articles.header.unitprice'}" + > + {locale group="quiqqer/erp" var="article.list.articles.header.unitprice"} + </th> + <th class="quiqqer-order-basket-articles-header-price" + title="{locale group='quiqqer/erp' var='article.list.articles.header.price'}" + > + {locale group="quiqqer/erp" var="article.list.articles.header.price"} + </th> + {if $this->getAttribute('editable')} + <th class="quiqqer-order-basket-articles-header-action"></th> + {/if} + </tr> + </thead> + <tbody> + {assign var=pos value=1} + {foreach $products as $product} + <tr class="quiqqer-order-basket-articles-article" data-pos="{$pos}"> + <td class="quiqqer-order-basket-articles-article-pos" + data-label="{locale group='quiqqer/erp' var='article.list.articles.header.pos'}" + > + {$pos} + </td> + {if QUI\TemplateCologne\Utils::getSetting('order.basket.showImages')} + <td class="quiqqer-order-basket-articles-article-image" + data-label="{locale group='quiqqer/erp' var='article.list.articles.header.image'}" + > + {image src=$product.imageSrc width=300 height=300 class="quiqqer-order-basket-articles-article-image__img"} + </td> + {/if} + <td class="quiqqer-order-basket-articles-article-data" + data-label="{locale group='quiqqer/erp' var='article.list.articles.header.description'}" + > + <div class="quiqqer-order-basket-articles-article-title">{$product.title}</div> + <div class="quiqqer-order-basket-articles-article-description"> + {$product.description} + </div> + + <ul class="quiqqer-order-basket-articles-article-fields"> + {foreach $product.attributes as $attribute} + <li class="quiqqer-order-basket-articles-article-fields-field"> + <span>{$attribute.title}:</span> + <span>{$this->getValueText($attribute.valueText)}</span> + </li> + {/foreach} + </ul> + + {if $showArticleNumber && !empty($product.productNo)} + <div class="quiqqer-order-basket-articles-article-productno"> + {locale group="quiqqer/order" var="basket.articles.articleNo"} {$product.productNo} + </div> + {/if} + </td> + <td class="quiqqer-order-basket-articles-article-quantity" + data-label="{locale group='quiqqer/erp' var='article.list.articles.header.quantity'}" + > + {assign var=maxQuantity value=""} + {assign var=maxQuantityAttr value=""} + {if isset($product.maximumQuantity) && $product.maximumQuantity && $product.maximumQuantity !== true} + {assign var=maxQuantityAttr value=" max='{$product.maximumQuantity}'"} + {assign var=maxQuantity value=(int)$product.maximumQuantity} + {/if} + + {if $Utils->isBasketProductEditable($product) && $this->getAttribute('editable') && $maxQuantity != 1} + <label> + <input type="number" + name="quantity" + min="0" + value="{$product.quantity}" + {$maxQuantityAttr} + /> + </label> + {else} + <div class="quiqqer-order-basket-articles-article-quantity-value"> + {$product.quantity} + </div> + {/if} + </td> + <td class="quiqqer-order-basket-articles-article-price" + data-label="{locale group='quiqqer/erp' var='article.list.articles.header.unitprice'}" + > + {if !isset($product.displayPrice) || $product.displayPrice} + {$product.price} + {/if} + </td> + <td class="quiqqer-order-basket-articles-article-sum" + data-label="{locale group='quiqqer/erp' var='article.list.articles.header.price'}" + > + {if !isset($product.displayPrice) || $product.displayPrice} + <span>{$product.sum}</span> + {/if} + + {if !isset($product.hasOfferPrice) || $product.hasOfferPrice} + <span class="offer-original-price"> + {$product.originalPrice} + </span> + {/if} + </td> + {if $this->getAttribute('editable')} + <td class="quiqqer-order-basket-articles-article-remove"> + <button type="button"> + <span class="fa fa-trash"></span> + </button> + </td> + {/if} + </tr> + {assign var=pos value=$pos+1} + {/foreach} + </tbody> +</table> + +{template_event name="quiqqer::order::basket::middle" Basket=$Basket} + +<table class="quiqqer-order-basket-total"> + <tr class="quiqqer-order-basket-total-subSum"> + <td class="quiqqer-order-basket-total-firstCell"> + <span class="quiqqer-order-basket-total-subSum-text"> + {locale group="quiqqer/order" var="control.order.overview.subSum"} + </span> + </td> + <td class="quiqqer-order-basket-total-secondCell"> + <span class="quiqqer-order-basket-total-subSum-value"> + {$data.subSum} + </span> + </td> + </tr> + + {foreach $data.attributes as $attribute} + <tr> + <td> + {$attribute.title} {if !empty($attribute.valueText)}({$attribute.valueText}){/if} + </td> + <td> + {$attribute.value} + </td> + </tr> + {/foreach} + + {if count($data.attributes)} + <tr> + <td colspan="2"><br/></td> + </tr> + {/if} + + {foreach $data.vat as $vat} + <tr> + <td> + {$vat.text} + </td> + <td> + {$vat.value} + </td> + </tr> + {/foreach} + + + {if isset($data.grandTotalFactors) && count($data.grandTotalFactors)} + <tr class="quiqqer-order-basket-total-grandSubSum"> + <td class="quiqqer-order-basket-total-firstCell"> + <span class="quiqqer-order-basket-total-grandSubSum-text"> + {locale group="quiqqer/order" var="control.order.overview.grandSubSum"} + </span> + </td> + <td class="quiqqer-order-basket-total-secondCell"> + <span class="quiqqer-order-basket-total-grandSubSum-value"> + {$data.grandSubSum} + </span> + </td> + </tr> + {foreach $data.grandTotalFactors as $attribute} + <tr> + <td> + {$attribute.title} {if !empty($attribute.valueText) && $attribute.valueText !== + '-'}({$attribute.valueText}){/if} + </td> + <td> + {$attribute.value} + </td> + </tr> + {/foreach} + {/if} + + + {if count($data.attributes)} + <tr> + <td colspan="2"><br/></td> + </tr> + {/if} + <tr class="quiqqer-order-basket-total-sum"> + <td> + <span class="quiqqer-order-basket-total-sum-text"> + {locale group="quiqqer/order" var="control.order.overview.sum"} + </span> + </td> + <td> + <span class="quiqqer-order-basket-total-sum-value"> + {$data.sum} + </span> + </td> + </tr> +</table> + +{elseif $this->isGuest() && $this->isLoading()} +<div class="quiqqer-order-basket-isLoading"> + <div class="quiqqer-order-basket-isLoading__inner"> + <span class="fa fa-circle-notch fa-spin"></span> + </div> +</div> +{else} +<div class="quiqqer-order-basket-isEmpty"> + <div class="quiqqer-order-basket-isEmpty__iconContainer"> + <div class="decorative-element"> + <div class="decorative-element__line decorative-element__line--1 animation"></div> + <div class="decorative-element__line decorative-element__line--2 animation"></div> + <div class="decorative-element__line decorative-element__line--3 animation"></div> + </div> + <i class="fa-solid fa-cart-shopping quiqqer-order-basket-isEmpty__icon animation"></i> + </div> + <div class="quiqqer-order-basket-isEmpty__text animation"> + {locale group="quiqqer/order" var="message.basket.is.empty"} + </div> +</div> +{/if} + +{template_event name="quiqqer::order::basket::end" Basket=$Basket} diff --git a/quiqqer/order/src/QUI/ERP/Order/FrontendUsers/Controls/UserOrders.Order.html b/quiqqer/order/src/QUI/ERP/Order/FrontendUsers/Controls/UserOrders.Order.html deleted file mode 100644 index 49f018d1d96cac09af9b544848536e6f61537183..0000000000000000000000000000000000000000 --- a/quiqqer/order/src/QUI/ERP/Order/FrontendUsers/Controls/UserOrders.Order.html +++ /dev/null @@ -1,87 +0,0 @@ -<section class="quiqqer-order-profile-orders-order"> - <header> - <div class="quiqqer-order-profile-orders-order-header-date"> - <span class="text-muted text-small">{locale group="quiqqer/order" var="control.profile.orders.order.date"}</span> - <span>{$Order->getCreateDate()}</span> - </div> - - <div class="quiqqer-order-profile-orders-order-header-total"> - <span class="text-muted text-small">{locale group="quiqqer/order" var="control.profile.orders.order.total"}</span> - <span>{$order.calculations.display_sum}</span> - </div> - - <div class="quiqqer-order-profile-orders-order-header-addressInvoice"> - <span class="text-muted text-small">{locale group="quiqqer/order" var="control.profile.orders.order.invoiceAddress"}</span> - {if $Invoice} - {assign var=Customer value=$Invoice->getCustomer()} - {else} - {assign var=Customer value=$Order->getCustomer()} - {/if} - - {assign var=Address value=$Customer->getAddress()} - {$Address->render(['tel' => false, 'mail' => false])} - <span> - <span>{$Address->getName()}</span> - <span class="fa fa-angle-down"></span> - </span> - </div> - - <div class="quiqqer-order-profile-orders-order-header-orderId"> - <span class="text-muted text-small">{locale group="quiqqer/order" var="control.profile.orders.order.orderNo"}</span> - <a href="{$Utils->getOrderUrl($Project, $Order)}" - target="_blank" - data-hash="{$Order->getHash()}" - title="{locale group='quiqqer/order' var='control.order.details.title'}" - > - {$Order->getId()} - </a> - </div> - </header> - - <div class="quiqqer-order-profile-orders-order-articles"> - {foreach $articles as $Article} - {$this->renderArticle($Article)} - {/foreach} - </div> - - <footer> - <div class="quiqqer-order-profile-orders-order-footer-leftWrapper"> - {if $Payment} - <div class="quiqqer-order-profile-orders-order-footer-paymentType"> - <span class="text-muted text-small">{locale group="quiqqer/order" var="control.profile.orders.order.paymentMethod"}:</span> - <span>{$Payment->getTitle()}</span> - </div> - {/if} - - {if isset($orderStatus)} - <div class="quiqqer-order-profile-orders-order-footer-orderStatus"> - <span class="text-muted text-small">{locale group="quiqqer/order" var="control.profile.orders.order.orderStatus"}:</span> - <span>{$orderStatus}</span> - </div> - {/if} - - {if !empty($shippingStatus)} - <div class="quiqqer-order-profile-orders-order-footer-shipping"> - <span class="text-muted text-small">{locale group="quiqqer/shipping" var="control.profile.orders.shipping"}:</span> - <span>{$shippingStatus}</span> - </div> - {/if} - </div> - - <div class="quiqqer-order-profile-orders-order-footer-rightWrapper"> - {if $Order->isPosted() && $Order->getInvoiceType() === 'QUI\ERP\Accounting\Invoice\Invoice'} - <a href="{$Order->getAttribute('downloadLink')}" target="_blank" - class="btn btn-link-dark"> - <span class="fa fa-file-pdf-o"></span> - <span>{locale group="quiqqer/order" var="control.profile.orders.order.invoice"}</span> - </a> - {else if !$Order->isSuccessful()} - <a href="{$orderUrl}" target="_blank" - class="btn btn-link-dark"> - <span class="fa fa-shopping-basket"></span> - <span>{locale group="quiqqer/order" var="control.profile.orders.order.continuePayment"}</span> - </a> - {/if} - </div> - </footer> -</section> diff --git a/quiqqer/products/src/QUI/ERP/Products/Controls/Category/ProductListDetails.html b/quiqqer/products/src/QUI/ERP/Products/Controls/Category/ProductListDetails.html index 5d4512556fa0a530d0a4aee710e2eaf8d2408a57..770df2cf286a0c4f5b2f6c14c316492201d8d889 100644 --- a/quiqqer/products/src/QUI/ERP/Products/Controls/Category/ProductListDetails.html +++ b/quiqqer/products/src/QUI/ERP/Products/Controls/Category/ProductListDetails.html @@ -42,7 +42,7 @@ {/if} {if $Project->getConfig('templateCologne.settings.categoryShowStock')} - {assign var=ShippingTimeFrontendView value=\QUI\TemplateCologne\Utils::getShippingTimeFrontendView($Product->getId())} + {assign var=ShippingTimeFrontendView value=QUI\TemplateCologne\Utils::getShippingTimeFrontendView($Product->getId())} {if $ShippingTimeFrontendView} <div class="cologne-productList-product-details-content-shippingTime"> {$ShippingTimeFrontendView->create()} diff --git a/quiqqer/products/src/QUI/ERP/Products/Controls/Category/ProductListGallery.html b/quiqqer/products/src/QUI/ERP/Products/Controls/Category/ProductListGallery.html index 38f84d0d3483627e259783f59e58f1077b220b2f..c1d5c724413a24cd031951993871c68c8829d362 100644 --- a/quiqqer/products/src/QUI/ERP/Products/Controls/Category/ProductListGallery.html +++ b/quiqqer/products/src/QUI/ERP/Products/Controls/Category/ProductListGallery.html @@ -36,7 +36,7 @@ </div> {if $Project->getConfig('templateCologne.settings.categoryShowStock')} - {assign var=ShippingTimeFrontendView value=\QUI\TemplateCologne\Utils::getShippingTimeFrontendView($Product->getId())} + {assign var=ShippingTimeFrontendView value=QUI\TemplateCologne\Utils::getShippingTimeFrontendView($Product->getId())} {if $ShippingTimeFrontendView} <div class="cologne-products-productGallery-products-product-price-shippingTime"> {$ShippingTimeFrontendView->create()} diff --git a/quiqqer/products/src/QUI/ERP/Products/Controls/Category/ProductListList.html b/quiqqer/products/src/QUI/ERP/Products/Controls/Category/ProductListList.html index 050380ea1ff62d5a9ab53ed10ff3dedad0b4d4a7..67133125fdbd0da2ab172702026a924a117f9efb 100644 --- a/quiqqer/products/src/QUI/ERP/Products/Controls/Category/ProductListList.html +++ b/quiqqer/products/src/QUI/ERP/Products/Controls/Category/ProductListList.html @@ -16,7 +16,7 @@ </div> {if $Project->getConfig('templateCologne.settings.categoryShowStock')} - {assign var=ShippingTimeFrontendView value=\QUI\TemplateCologne\Utils::getShippingTimeFrontendView($Product->getId())} + {assign var=ShippingTimeFrontendView value=QUI\TemplateCologne\Utils::getShippingTimeFrontendView($Product->getId())} {if $ShippingTimeFrontendView} <div class="quiqqer-productList-product-list-text-shippingTime"> {$ShippingTimeFrontendView->create()} diff --git a/quiqqer/products/src/QUI/ERP/Products/Controls/Products/Product.html b/quiqqer/products/src/QUI/ERP/Products/Controls/Products/Product.html index 8842cc5a4102fa5eeb80ccdbb10cf467094f995d..1adeb7c6a2570c0cab69732aa87298e87b7417ae 100644 --- a/quiqqer/products/src/QUI/ERP/Products/Controls/Products/Product.html +++ b/quiqqer/products/src/QUI/ERP/Products/Controls/Products/Product.html @@ -69,12 +69,12 @@ {/foreach} {assign var=ShippingTimeFrontendView - value=\QUI\TemplateCologne\Utils::getShippingTimeFrontendView($Product->getId())} + value=QUI\TemplateCologne\Utils::getShippingTimeFrontendView($Product->getId())} {if $ShippingTimeFrontendView} {$ShippingTimeFrontendView->create()} {/if} - {assign var=StockFrontendView value=\QUI\TemplateCologne\Utils::getStockFrontendView($Product->getId())} + {assign var=StockFrontendView value=QUI\TemplateCologne\Utils::getStockFrontendView($Product->getId())} {if $StockFrontendView} {$StockFrontendView->create()} {/if} diff --git a/quiqqer/products/src/QUI/ERP/Products/Controls/Products/ProductVariant.html b/quiqqer/products/src/QUI/ERP/Products/Controls/Products/ProductVariant.html index 22ca1931ee078443700f88765bfd9a6d915f30fc..f8cb2e9f42d4db52a69213ff5a03ab190a5eac4f 100644 --- a/quiqqer/products/src/QUI/ERP/Products/Controls/Products/ProductVariant.html +++ b/quiqqer/products/src/QUI/ERP/Products/Controls/Products/ProductVariant.html @@ -52,12 +52,12 @@ {/foreach} {assign var=ShippingTimeFrontendView - value=\QUI\TemplateCologne\Utils::getShippingTimeFrontendView($Product->getId())} + value=QUI\TemplateCologne\Utils::getShippingTimeFrontendView($Product->getId())} {if $ShippingTimeFrontendView} {$ShippingTimeFrontendView->create()} {/if} - {assign var=StockFrontendView value=\QUI\TemplateCologne\Utils::getStockFrontendView($Product->getId())} + {assign var=StockFrontendView value=QUI\TemplateCologne\Utils::getStockFrontendView($Product->getId())} {if $StockFrontendView} {$StockFrontendView->create()} {/if} diff --git a/settings.xml b/settings.xml index 6700b587f0a5cc330e88aad7d6b3f8b41300a202..36dacb1d26bd18c4f35f0db144ac5a984da19160 100644 --- a/settings.xml +++ b/settings.xml @@ -36,9 +36,13 @@ <type><![CDATA[string]]></type> <defaultvalue>full</defaultvalue> </conf> - <conf name="basketOpen"> - <type><![CDATA[integer]]></type> - <defaultvalue>2</defaultvalue> + <conf name="order.basket.showImages"> + <type><![CDATA[bool]]></type> + <defaultvalue>1</defaultvalue> + </conf> + <conf name="basketAction"> + <type><![CDATA[string]]></type> + <defaultvalue>openSmallBasket</defaultvalue> </conf> <conf name="hideEmptyFields"> <type><![CDATA[bool]]></type> @@ -437,27 +441,48 @@ </option> </select> - <!-- basket open (nothing order window, order page)--> - <select conf="templateCologne.settings.basketOpen"> + <input conf="templateCologne.settings.order.basket.showImages" type="checkbox"> + <text> + <locale group="quiqqer/template-cologne" + var="settings.shop.order.basket.showImages" + /> + </text> + <description> + <locale group="quiqqer/template-cologne" + var="settings.shop.order.basket.showImages.desc" + /> + </description> + </input> + + + + + <!-- basket action (openSmallBasket, openOrderProcessUrl, openOrderProcess (qui popup))--> + <select conf="templateCologne.settings.basketAction"> <text> <locale group="quiqqer/template-cologne" - var="settings.shop.basketOpen" + var="settings.shop.basketAction" /> </text> + <description> + <locale group="quiqqer/template-cologne" + var="settings.shop.basketAction.desc" + /> + </description> - <option value="0"> + <option value="openSmallBasket"> <locale group="quiqqer/template-cologne" - var="settings.shop.basketOpen.nothing" + var="settings.shop.basketAction.openSmallBasket" /> </option> - <option value="1"> + <option value="openOrderProcessUrl"> <locale group="quiqqer/template-cologne" - var="settings.shop.basketOpen.window" + var="settings.shop.basketAction.openOrderProcessUrl" /> </option> - <option value="2"> + <option value="openOrderProcess"> <locale group="quiqqer/template-cologne" - var="settings.shop.basketOpen.page" + var="settings.shop.basketAction.openOrderProcess" /> </option> </select> diff --git a/src/QUI/TemplateCologne/Controls/Menu/Categories.php b/src/QUI/TemplateCologne/Controls/Menu/Categories.php index eadc91cc168a063974d3fb9c43f8414610144ae3..ab3af91956ac264d5c19a97af0b18dfb6e191153 100644 --- a/src/QUI/TemplateCologne/Controls/Menu/Categories.php +++ b/src/QUI/TemplateCologne/Controls/Menu/Categories.php @@ -72,10 +72,14 @@ public function getBody(): string } $cache = EventHandler::menuCacheName() . '/megaMenu/'; + $cachePah = ''; + + if (method_exists($this->getSite(), 'getCachePath')) { + $cachePah = $this->getSite()->getCachePath(); + } $cache .= md5( - $this->getSite()->getCachePath() . - serialize($this->getAttributes()) + $cachePah . serialize($this->getAttributes()) ); try { diff --git a/src/QUI/TemplateCologne/EventHandler.php b/src/QUI/TemplateCologne/EventHandler.php index f34b098703a955a3a6216b818ef4a37440793d26..f7544fbb2fd7b685232102259f5d8a6d8c36ca07 100644 --- a/src/QUI/TemplateCologne/EventHandler.php +++ b/src/QUI/TemplateCologne/EventHandler.php @@ -7,6 +7,7 @@ namespace QUI\TemplateCologne; use QUI; +use Smarty; use QUI\ERP\Products\Product\ViewFrontend; use QUI\Smarty\Collector; @@ -71,4 +72,17 @@ public static function onQuiqqerProductsProductButtonsEnd( </div>' ); } + + /** + * Event: on smarty init + * + * @param Smarty $Smarty + * @return void + */ + public static function onSmartyInit(Smarty $Smarty): void + { + $Smarty->registerClass('QUI\TemplateCologne\Utils', '\QUI\TemplateCologne\Utils'); + $Smarty->registerClass('QUI\Bricks\Manager', '\QUI\Bricks\Manager'); + $Smarty->registerClass('QUI\ERP\Products\Utils\Products', '\QUI\ERP\Products\Utils\Products'); + } } diff --git a/src/QUI/TemplateCologne/Utils.php b/src/QUI/TemplateCologne/Utils.php index f0fc42ba72615cb104959ad084175c380d9f88c2..14d62f549aa728608fa92730fd1a180459768fca 100644 --- a/src/QUI/TemplateCologne/Utils.php +++ b/src/QUI/TemplateCologne/Utils.php @@ -11,8 +11,8 @@ use QUI\ERP\Shipping\Shipping; use QUI\ERP\StockManagement\StockManager; use QUI\Projects\Project; -use QUI\Projects\Site; use QUI\TemplateCologne\Controls\Payments; +use ReflectionClass; use function class_exists; use function count; @@ -32,7 +32,7 @@ class Utils * @throws QUI\Exception * */ - public static function getAvatar(mixed $User): QUI\Projects\Media\Image|bool + public static function getAvatar(mixed $User): QUI\Projects\Media\Image | bool { if (!$User instanceof QUI\Interfaces\Users\User) { throw new QUI\Exception([ @@ -73,15 +73,10 @@ public static function getAvatar(mixed $User): QUI\Projects\Media\Image|bool * @return array|bool|object|string * @throws QUI\Exception */ - public static function getConfig(array $params): object|array|bool|string + public static function getConfig(array $params): object | array | bool | string { - /** @var $Site Site */ $Site = $params['Site']; - - /* @var $Project Project */ $Project = $params['Project']; - - /* @var $Project QUI\Template */ $Template = $params['Template']; $cacheName = md5($Site->getId() . $Project->getName() . $Project->getLang()); @@ -237,13 +232,10 @@ public static function getConfig(array $params): object|array|bool|string } // basket open - $basketOpen = 2; + $basketAction = $Project->getConfig('templateCologne.settings.basketAction'); - switch ($Project->getConfig('templateCologne.settings.basketOpen')) { - case '0': - case '1': - case '2': - $basketOpen = $Project->getConfig('templateCologne.settings.basketOpen'); + if (!in_array($basketAction, ['openSmallBasket', 'openOrderProcessUrl', 'openOrderProcess'])) { + $basketAction = 'openSmallBasket'; } $settingsCSS = include 'settings.css.php'; @@ -355,7 +347,7 @@ public static function getConfig(array $params): object|array|bool|string $config['siteType'] = $siteType; $config['pageCustomClass'] = $pageCustomClass; $config['basketStyle'] = $basketStyle; - $config['basketOpen'] = $basketOpen; + $config['basketAction'] = $basketAction; $config['showCategoryMenu'] = $showCategoryMenu; $config['homeLink'] = $homeLink; $config['homeLinkText'] = $homeLinkText; @@ -602,7 +594,7 @@ private static function getPredefinedFooter(Project $Project): array * * @return false|QUI\ERP\Products\Field\View */ - public static function getShippingTimeFrontendView(int $productId) + public static function getShippingTimeFrontendView(int $productId): bool | QUI\ERP\Products\Field\View { try { $Product = QUI\ERP\Products\Handler\Products::getProduct($productId); @@ -612,7 +604,7 @@ public static function getShippingTimeFrontendView(int $productId) return false; } - if (QUI::getPackageManager()->isInstalled('quiqqer/stock-management')) { + if (class_exists('QUI\ERP\StockManagement\StockManager')) { return StockManager::getShippingTimeFrontendViewByProduct($Product); } @@ -620,6 +612,16 @@ public static function getShippingTimeFrontendView(int $productId) return false; } + if (!class_exists('QUI\ERP\Shipping\Shipping')) { + return false; + } + + $reflection = new ReflectionClass(Shipping::class); + + if (!$reflection->hasConstant('PRODUCT_FIELD_SHIPPING_TIME')) { + return false; + } + try { $ShippingField = $Product->getField(Shipping::PRODUCT_FIELD_SHIPPING_TIME); } catch (\Exception $Exception) { @@ -659,6 +661,10 @@ public static function getStockFrontendView(int $productId) return false; } + if (!class_exists('QUI\ERP\StockManagement\StockManager')) { + return false; + } + try { $Product = QUI\ERP\Products\Handler\Products::getProduct($productId); $StockField = $Product->getField(StockManager::PRODUCT_FIELD_STOCK); @@ -668,7 +674,6 @@ public static function getStockFrontendView(int $productId) return false; } - /** @var QUI\ERP\StockManagement\Products\Fields\StockView $StockView */ $StockView = $StockField->getFrontendView(); if (method_exists($StockView, 'setProduct')) { @@ -699,4 +704,38 @@ public static function convertBrickCSSClass(array $classes): string return $text; } + + /** + * Get template setting for given string. + * By passing setting name you can omit template prefix setting name ("templateCologne.settings.") + * + * Usage: + * QUI\TemplateCologne\Utils::getSettings('homeLink'); + * or + * QUI\TemplateCologne\Utils::getSettings('templateCologne.settings.homeLink'); + * + * @param string $settingName + * @return bool|array|int|string + */ + public static function getSetting(string $settingName): bool | array | int | string + { + if (empty($settingName)) { + return false; + } + + $a = strpos($settingName, 'templateCologne.settings.'); + if (!str_contains($settingName, 'templateCologne.settings.')) { + $settingName = 'templateCologne.settings.' . $settingName; + } + + try { + $Project = QUI::getRewrite()->getProject(); + + return $Project->getConfig($settingName); + } catch (\Exception $Exception) { + QUI\System\Log::writeException($Exception); + + return ''; + } + } } diff --git a/src/QUI/TemplateCologne/settings.css.php b/src/QUI/TemplateCologne/settings.css.php index 9953e255331aedca58a2bcb56ac9c9359ea10e9e..965553d6978bce1e0f686addb2030a79c0e7dcda 100644 --- a/src/QUI/TemplateCologne/settings.css.php +++ b/src/QUI/TemplateCologne/settings.css.php @@ -1,4 +1,12 @@ <?php +/** + * cologne template file + * + * @var QUI\Projects\Project $Project + * @var QUI\Projects\Site $Site + * @var QUI\Interfaces\Template\EngineInterface $Engine + * @var QUI\Template $Template + **/ $largeSpacing = $Site->getAttribute('templateCologne.largeSpacing'); $headerImagePosition = $Project->getConfig('templateCologne.settings.headerImagePosition'); @@ -7,7 +15,6 @@ ob_start(); ?> - <?php if ($largeSpacing) { ?> /* more spacing */ .page-content-header, diff --git a/template/head/styles.html b/template/head/styles.html index 2a1952737c404af4029d7e28ca2c129a6630eb6a..9a0379881bec11c9b7aafe045cb76ae2d8805f0a 100644 --- a/template/head/styles.html +++ b/template/head/styles.html @@ -13,7 +13,6 @@ <link rel="stylesheet" href="{$Template->getTemplateUrl('bin/css/products.css')}"/> <link rel="stylesheet" href="{$Template->getTemplateUrl('bin/css/frontend-users.css')}"/> <link rel="stylesheet" href="{$Template->getTemplateUrl('bin/css/order.css')}"/> -<link rel="stylesheet" href="{$Template->getTemplateUrl('bin/css/user-orders.css')}"/> <link rel="stylesheet" href="{$Template->getTemplateUrl('bin/css/controls.css')}"/> <link rel="stylesheet" href="{$Template->getTemplateUrl('bin/css/mini-basket.css')}"/> <link rel="stylesheet" href="{$Template->getTemplateUrl('bin/css/product-bricks.css')}"/> diff --git a/template/menu/menuSuffix.html b/template/menu/menuSuffix.html index 5f7f6b32c9121dc08784540080a07792aaf11386..248a899f455c3967195c406d2085f9163be3bd8b 100644 --- a/template/menu/menuSuffix.html +++ b/template/menu/menuSuffix.html @@ -10,14 +10,18 @@ <button disabled class="quiqqer-order-basketButton button--callToAction tpl-btn basket-style-{$basketStyle}" style="float: right;"><span class="quiqqer-order-basketButton-icon-custom"><span class="fa fa-shopping-basket"></span></span><span - class="quiqqer-order-basketButton-quantity quiqqer-order-basketButton-batch-custom">0</span></button> + class="quiqqer-order-basketButton-quantity quiqqer-order-basketButton-batch-custom"> + <span class="fa fa-spinner fa-spin"></span> + </span></button> {else} <button disabled class="quiqqer-order-basketButton button--callToAction tpl-btn basket-style-full" style="float: right;"> <span class="quiqqer-order-basketButton-icon-custom"> <span class="fa fa-shopping-basket"></span> </span> - <span class="quiqqer-order-basketButton-quantity quiqqer-order-basketButton-batch-custom">0</span> + <span class="quiqqer-order-basketButton-quantity quiqqer-order-basketButton-batch-custom"> + <span class="fa fa-spinner fa-spin"></span> + </span> <span class="quiqqer-order-basketButton-sum"> {*$InitialBasketPrice->getDisplayPrice()*} {$initialBasketPrice} diff --git a/template/page.html b/template/page.html index ba86b13999e9cb774a79886fb8183eba571136fd..6af211ab19eafb1b8c2de83556c27d6790d350e3 100644 --- a/template/page.html +++ b/template/page.html @@ -25,7 +25,7 @@ {assign var=brickNoPadding value="brick-no-spacing"} {/if} - {assign var=classes value=\QUI\TemplateCologne\Utils::convertBrickCSSClass($Brick->getAttribute('classes'))} + {assign var=classes value=QUI\TemplateCologne\Utils::convertBrickCSSClass($Brick->getAttribute('classes'))} <section class="template-brick-container template-brick-headerSuffix brick-id-{$Brick->getAttribute('id')} {$classes}"> <div class="template-grid-container template-grid-row {$brickFullWidth} {$brickNoPadding}"> @@ -54,7 +54,7 @@ {assign var=brickNoPadding value="brick-no-spacing"} {/if} - {assign var=classes value=\QUI\TemplateCologne\Utils::convertBrickCSSClass($Brick->getAttribute('classes'))} + {assign var=classes value=QUI\TemplateCologne\Utils::convertBrickCSSClass($Brick->getAttribute('classes'))} <section class="template-brick-container template-brick-footerPrefix brick-id-{$Brick->getAttribute('id')} {$classes}"> <div class="template-grid-container template-grid-row {$brickFullWidth} {$brickNoPadding}"> diff --git a/template/topBar.html b/template/topBar.html index 0098f71dc3fa225f8cc33c06a95f61be75eb70ae..3c6d4878b1baddb3ec0ab2a816ce34c3c4e2119e 100644 --- a/template/topBar.html +++ b/template/topBar.html @@ -24,7 +24,7 @@ {/if} {* END language & currency switch *} - <span class="cologne-header-control-user"> + <div class="cologne-header-control-user"> {if $User->getId()} {$Avatar->create()} {else} @@ -34,6 +34,6 @@ <span class="cologne-header-control-user-loader"> <span class="fa fa-pulse fa-circle-o-notch"></span> </span> - </span> + </div> </div> </div> \ No newline at end of file diff --git a/tests/phpstan-bootstrap.php b/tests/phpstan-bootstrap.php new file mode 100644 index 0000000000000000000000000000000000000000..b61ff4b8300a965e0f46025ba64745a22b118e74 --- /dev/null +++ b/tests/phpstan-bootstrap.php @@ -0,0 +1,13 @@ +<?php + +if (!defined('QUIQQER_SYSTEM')) { + define('QUIQQER_SYSTEM', true); +} + +if (!defined('QUIQQER_AJAX')) { + define('QUIQQER_AJAX', true); +} + +putenv("QUIQQER_OTHER_AUTOLOADERS=KEEP"); + +require_once __DIR__ . '/../../../../bootstrap.php'; diff --git a/tests/phpunit-bootstrap.php b/tests/phpunit-bootstrap.php new file mode 100644 index 0000000000000000000000000000000000000000..eca92fd67bed8ae4ec424ed82d300119d792f042 --- /dev/null +++ b/tests/phpunit-bootstrap.php @@ -0,0 +1,11 @@ +<?php + +if (!defined('QUIQQER_SYSTEM')) { + define('QUIQQER_SYSTEM', true); +} + +if (!defined('QUIQQER_AJAX')) { + define('QUIQQER_AJAX', true); +} + +require_once __DIR__ . '/../../../../bootstrap.php';