Skip to content

Commit

Permalink
close #104
Browse files Browse the repository at this point in the history
  • Loading branch information
Christian Proske committed May 3, 2022
1 parent 2330d3b commit 928c609
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
5 changes: 3 additions & 2 deletions Bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ public function boot(Dispatcher $dispatcher): void
parent::boot($dispatcher);

if (!Shop::isFrontend()) {
if ($authorized = Shop::Container()->getDB()->executeQuery('SELECT kId FROM xplugin_ws5_mollie_orders WHERE cStatus = "authorized" AND dCreated > DATE_SUB(NOW(), INTERVAL 30 DAY)', ReturnType::AFFECTED_ROWS)) {
$notificationSetting = self::Plugin('ws5_mollie')->getConfig()->getValue("notifications");
if (in_array($notificationSetting, ['Y', 'A']) && $authorized = Shop::Container()->getDB()->executeQuery('SELECT kId FROM xplugin_ws5_mollie_orders WHERE cStatus = "authorized" AND dCreated > DATE_SUB(NOW(), INTERVAL 30 DAY)', ReturnType::AFFECTED_ROWS)) {
Notification::getInstance()->add(
NotificationEntry::TYPE_WARNING,
'Mollie Authorized Orders',
Expand All @@ -46,7 +47,7 @@ public function boot(Dispatcher $dispatcher): void
);
}

if ($errors = Shop::Container()->getDB()->executeQuery('SELECT kId FROM xplugin_ws5_mollie_queue WHERE cError IS NOT NULL AND dCreated > DATE_SUB(NOW(), INTERVAL 30 DAY);', ReturnType::AFFECTED_ROWS)) {
if (in_array($notificationSetting, ['Y', 'Q']) && $errors = Shop::Container()->getDB()->executeQuery('SELECT kId FROM xplugin_ws5_mollie_queue WHERE cError IS NOT NULL AND dCreated > DATE_SUB(NOW(), INTERVAL 30 DAY);', ReturnType::AFFECTED_ROWS)) {
Notification::getInstance()->add(
NotificationEntry::TYPE_DANGER,
'Mollie Queue with Errors',
Expand Down
15 changes: 14 additions & 1 deletion info.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<XMLVersion>102</XMLVersion>
<ShopVersion>5.0.0</ShopVersion>
<PluginID>ws5_mollie</PluginID>
<CreateDate>2021-12-06</CreateDate>
<CreateDate>2022-05-03</CreateDate>
<Version>1.3.5</Version>
<ExsID>689388c6-9f04-4648-b516-e67d96b0dc1d</ExsID>
<Install>
Expand Down Expand Up @@ -197,6 +197,19 @@
</SelectboxOptions>
</Setting>

<Setting type="selectbox" initialValue="Y" sort="100" conf="Y">
<Name>Mitteilungen (Glocke)</Name>
<Description>
<![CDATA[Welche Infos sollen in den Mitteilungen erschienen?]]></Description>
<ValueName>notifications</ValueName>
<SelectboxOptions>
<Option sort="1" value="Y">Queue &amp; Authorized</Option>
<Option sort="2" value="Q">Nur Queue</Option>
<Option sort="3" value="A">Nur Authorized</Option>
<Option sort="4" value="N">Keine</Option>
</SelectboxOptions>
</Setting>

</Settingslink>
</Adminmenu>
<PaymentMethod>
Expand Down

0 comments on commit 928c609

Please sign in to comment.