',
'',
- '
- ";
- $blink_css = "animation-name:animation_blink;animation-timing-function:linear;animation-duration:2s;animation-iteration-count:5;";
- $secure_text = $blink_style_tag." app->Conf->WFconf['defaulttheme']}/images/icon-invisible.svg\" alt=\"Einige Elemente wurden durch OpenXE blockiert.\" title=\"Einige Elemente wurden durch OpenXE blockiert.\" border=\"0\" style=\"all: initial;display:block;float:right;font-size:small;".$blink_css."\">".$secure_text;
- }
- $this->app->Tpl->Set("TEXT",$secure_text);
+ $html_start = "";
+ $head_start = "";
+ $security = "";
+ $style = "";
+ $head_end = "";
+ $html_end = "";
+ $prepared_text = $messages[0]['text'];
+
+ // Adjust cid images
+ $attachments = $this->app->erp->GetDateiSubjektObjekt('Anhang','Ticket',$mid);
+ foreach($attachments as $attachment) {
+ $filename = $this->app->erp->GetDateiName($attachment);
+ $prepared_text = str_replace($filename,'index.php?module=dateien&action=send&id='.$attachment,$prepared_text);
}
+
+ if ($insecure) {
+ // Add Content Security Policy
+ } else {
+
+ // Add Content Security Policy
+ $security = "";
+
+ // Strip html tags
+ $stripped_prepared_text = strip_tags($prepared_text,$secure_html_tags);
+
+ if (strlen($stripped_prepared_text) != strlen($prepared_text)) {
+ $stripped_prepared_text = " app->Conf->WFconf['defaulttheme']}/images/icon-invisible.svg\" alt=\"Einige Elemente wurden durch OpenXE blockiert.\" title=\"Einige Elemente wurden durch OpenXE blockiert.\" border=\"0\">".$stripped_prepared_text;
+ }
+ $prepared_text = $stripped_prepared_text;
+ }
+ $this->app->Tpl->Set("TEXT",$html_start.$head_start.$security.$style.$head_end.$prepared_text.$html_end);
$this->app->Tpl->Output('ticket_text.tpl');
$this->app->ExitXentral();
}
diff --git a/www/themes/new/css/styles.css b/www/themes/new/css/styles.css
index f4d39782..c8964ca4 100644
--- a/www/themes/new/css/styles.css
+++ b/www/themes/new/css/styles.css
@@ -2404,6 +2404,10 @@ ul.tag-editor {
border-color: var(--textfield-border);
border-radius: 7px;
padding: 0px !important;
+ min-height: 300px;
+ height: 300px;
+ resize: vertical;
+ overflow: hidden;
}
.ticket_nachricht_box fieldset {
@@ -2412,8 +2416,8 @@ ul.tag-editor {
.ticket_text {
width: 100%;
+ height: 100%;
border: none;
- height: 300px;
}
.ui-button-icon,
diff --git a/www/themes/new/css/ticket_iframe.css b/www/themes/new/css/ticket_iframe.css
new file mode 100644
index 00000000..60508127
--- /dev/null
+++ b/www/themes/new/css/ticket_iframe.css
@@ -0,0 +1,20 @@
+@keyframes animation_blink {
+ 0% { opacity: 1; }
+ 25% { opacity: 1; }
+ 26% { opacity: 0; }
+ 75% { opacity: 0; }
+ 76% { opacity: 1; }
+ 100% { opacity: 1; }
+}
+.eye {
+ all: initial;
+ display:block;
+ float:right;
+ font-size:small;
+}
+.blink {
+ animation-name:animation_blink;
+ animation-timing-function:linear;
+ animation-duration:2s;
+ animation-iteration-count:5;
+}
From 5c1a5d04df0c56a3cd02d61ce7e30cf8fb882629 Mon Sep 17 00:00:00 2001
From: OpenXE <>
Date: Wed, 17 Apr 2024 16:34:00 +0200
Subject: [PATCH 07/48] Email send bugfix empty recipients, bugfix IMAP error
display
---
www/lib/class.erpapi.php | 37 +++++++++++++++++++++----------------
1 file changed, 21 insertions(+), 16 deletions(-)
diff --git a/www/lib/class.erpapi.php b/www/lib/class.erpapi.php
index 9c7c2bfd..e62985c2 100644
--- a/www/lib/class.erpapi.php
+++ b/www/lib/class.erpapi.php
@@ -25671,21 +25671,25 @@ function MailSendFinal($from,$from_name,$to,$to_name,$betreff,$text,$files="",$p
$bccRecipients[] = new EmailRecipient($bcc3, $bcc3);
}
- // This will build the mail with phpmailer 6 and send it out
- // There is no way to retrieve the created mail e.g. for IMAP output
- // This should be migrated to laminas-mail (used for imap)
- // Phpmailer 6 can then be removed
- $sysMailerSent = $sysMailer->composeAndSendEmail(
- $from,
- $from_name,
- $recipients,
- $betreff,
- $body,
- $files,
- $ccRecipients,
- $bccRecipients,
- $sendmail_error
- );
+ if (!empty($recipients)) {
+ // This will build the mail with phpmailer 6 and send it out
+ // There is no way to retrieve the created mail e.g. for IMAP output
+ // This should be migrated to laminas-mail (used for imap)
+ // Phpmailer 6 can then be removed
+ $sysMailerSent = $sysMailer->composeAndSendEmail(
+ $from,
+ $from_name,
+ $recipients,
+ $betreff,
+ $body,
+ $files,
+ $ccRecipients,
+ $bccRecipients,
+ $sendmail_error
+ );
+ } else {
+ $sendmail_error = "Kein Empfänger angegeben";
+ }
}
if($sysMailerSent === false) {
@@ -25742,11 +25746,12 @@ function MailSendFinal($from,$from_name,$to,$to_name,$betreff,$text,$files="",$p
$client->connect();
$client->appendMessage($imapCopyMessage, $account->getImapOutgoingFolder());
} catch (Exception $e) {
- $this->app->erp->LogFile("Mailer Error: " . (string) $e);
+ $this->app->erp->LogFile("Mailer IMAP Error: " . (string) $e);
if(isset($this->app->User) && $this->app->User && method_exists($this->app->User, 'GetID'))
{
$this->app->erp->InternesEvent($this->app->User->GetID(),"IMAP-Fehler","alert",1);
}
+ $this->mail_error = "Mailer IMAP Error";
return 0;
}
}
From b3b516d0ad534286cd92b041b431c3d71aac01da Mon Sep 17 00:00:00 2001
From: OpenXE <>
Date: Mon, 22 Apr 2024 09:58:16 +0200
Subject: [PATCH 08/48] bugfix LDAP filter
---
phpwf/plugins/class.acl.php | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/phpwf/plugins/class.acl.php b/phpwf/plugins/class.acl.php
index 2a80631e..e26022ac 100644
--- a/phpwf/plugins/class.acl.php
+++ b/phpwf/plugins/class.acl.php
@@ -850,8 +850,7 @@ class Acl
// verbinden zum ldap server
$ds = ldap_connect($this->app->erp->Firmendaten("ldap_host"));
$suche = $this->app->erp->Firmendaten("ldap_searchbase");
- $filter = $this->app->erp->Firmendaten("ldap_filter");
- //$bind_name = str_replace('%user%',$username,$this->app->erp->Firmendaten("ldap_bindname"));
+ $filter = str_replace('{USER}',$username,$this->app->erp->Firmendaten("ldap_filter"));
$bind_name = str_replace('{USER}',$username,$this->app->erp->Firmendaten("ldap_bindname"));
if ($ds) {
From c834816e197ea602706050c30db1b0f7e068f937 Mon Sep 17 00:00:00 2001
From: Andreas Palm
Date: Tue, 23 Apr 2024 22:18:11 +0200
Subject: [PATCH 09/48] Improve Scheduler task with try-catch-finally. Jobs
should be deleted from db on error to prevent looping. Also errors should be
logged
---
.../SubscriptionCycleManualJobTask.php | 27 ++++++++++++-------
1 file changed, 18 insertions(+), 9 deletions(-)
diff --git a/classes/Modules/SubscriptionCycle/Scheduler/SubscriptionCycleManualJobTask.php b/classes/Modules/SubscriptionCycle/Scheduler/SubscriptionCycleManualJobTask.php
index 89064062..6fa2d9f7 100644
--- a/classes/Modules/SubscriptionCycle/Scheduler/SubscriptionCycleManualJobTask.php
+++ b/classes/Modules/SubscriptionCycle/Scheduler/SubscriptionCycleManualJobTask.php
@@ -15,6 +15,7 @@ use DateTimeImmutable;
use DateTimeInterface;
use Exception;
use Xentral\Components\Database\Database;
+use Xentral\Components\Logger\Logger;
use Xentral\Modules\SubscriptionCycle\Service\SubscriptionCycleJobService;
use Xentral\Modules\SubscriptionCycle\SubscriptionCycleModuleInterface;
use Xentral\Modules\SubscriptionCycle\SubscriptionModuleInterface;
@@ -58,15 +59,23 @@ final class SubscriptionCycleManualJobTask
$this->taskMutexService->setMutex('rechnungslauf_manual');
$jobs = $this->cycleJobService->listAll(100);
foreach ($jobs as $job) {
- switch ($job['document_type']) {
- case 'rechnung':
- $this->subscriptionModule->CreateInvoice((int)$job['address_id']);
- break;
- case 'auftrag':
- $this->subscriptionModule->CreateOrder((int)$job['address_id']);
- break;
- }
- $this->cycleJobService->delete((int)$job['id']);
+ try {
+ switch ($job['document_type']) {
+ case 'rechnung':
+ $this->subscriptionModule->CreateInvoice((int)$job['address_id']);
+ break;
+ case 'auftrag':
+ $this->subscriptionModule->CreateOrder((int)$job['address_id']);
+ break;
+ }
+ }
+ catch (Exception $e) {
+ /** @var Logger $logger */
+ $logger = $this->app->Container->get('Logger');
+ $logger->error($e->getMessage(), $job);
+ } finally {
+ $this->cycleJobService->delete((int)$job['id']);
+ }
}
}
From 05906533ddeac71f6afd88854d793452874c6401 Mon Sep 17 00:00:00 2001
From: Andreas Palm
Date: Thu, 25 Apr 2024 19:47:32 +0200
Subject: [PATCH 10/48] Filter supported subscription cycle types to prevent
errors
---
classes/Modules/SubscriptionCycle/SubscriptionModule.php | 1 +
www/pages/rechnungslauf.php | 5 +++--
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/classes/Modules/SubscriptionCycle/SubscriptionModule.php b/classes/Modules/SubscriptionCycle/SubscriptionModule.php
index d672c6a3..6f1ea212 100644
--- a/classes/Modules/SubscriptionCycle/SubscriptionModule.php
+++ b/classes/Modules/SubscriptionCycle/SubscriptionModule.php
@@ -61,6 +61,7 @@ class SubscriptionModule implements SubscriptionModuleInterface
WHERE aa.dokument = :doctype
AND greatest(aa.startdatum, aa.abgerechnetbis) <= :calcdate
AND (aa.enddatum = '0000-00-00' OR aa.abgerechnetbis < aa.enddatum)
+ AND aa.preisart IN ('monat', 'jahr', '30tage')
AND aa.adresse = :address";
return $this->db->fetchAll($sql, [
diff --git a/www/pages/rechnungslauf.php b/www/pages/rechnungslauf.php
index 186ed3d3..c0059880 100644
--- a/www/pages/rechnungslauf.php
+++ b/www/pages/rechnungslauf.php
@@ -70,7 +70,7 @@ class Rechnungslauf {
$calcdate = new \DateTimeImmutable('today');
$scalcdate = $calcdate->format('Y-m-d');
$where = " aa.id > 0
- AND aa.dokument = '$doctype'
+ AND aa.dokument = '$doctype' AND aa.preisart IN ('monat', 'jahr', '30tage')
AND greatest(aa.startdatum, aa.abgerechnetbis) < '$scalcdate'
AND (aa.enddatum = '0000-00-00' OR aa.abgerechnetbis < aa.enddatum)";
@@ -167,7 +167,8 @@ class Rechnungslauf {
. " Conf->WFconf['defaulttheme']}/images/forward.svg\" border=\"0\">"
. " |