From 143e4e96bd461cb4da4b80c7ff741b3f74f7c0da Mon Sep 17 00:00:00 2001 From: OpenXE <> Date: Tue, 20 Dec 2022 08:37:27 +0000 Subject: [PATCH 1/8] ticket system minor design improvement --- www/pages/content/ticket_nachricht.tpl | 44 ++++++++++++++++++-------- www/pages/ticket.php | 3 ++ www/themes/new/css/styles.css | 10 ++++-- 3 files changed, 40 insertions(+), 17 deletions(-) diff --git a/www/pages/content/ticket_nachricht.tpl b/www/pages/content/ticket_nachricht.tpl index 7e3f388d..8c28306a 100644 --- a/www/pages/content/ticket_nachricht.tpl +++ b/www/pages/content/ticket_nachricht.tpl @@ -1,19 +1,35 @@
-
-
-
- {|[NACHRICHT_BETREFF]|} - - - - - - - - -
{|Zeit|}:[NACHRICHT_ZEIT]
{|Von|}:[NACHRICHT_SENDER]
{|An|}:[NACHRICHT_RECIPIENTS]
{|CC|}:[NACHRICHT_CC_RECIPIENTS]

[NACHRICHT_TEXT]
[NACHRICHT_ANHANG]
-
+
+
+
+
+
+
+
+ + + + + + +
{|Zeit|}:[NACHRICHT_ZEIT]
{|Von|}:[NACHRICHT_SENDER]
{|An|}:[NACHRICHT_RECIPIENTS]
{|CC|}:[NACHRICHT_CC_RECIPIENTS]
[NACHRICHT_ANHANG]
+
+
+
+
+
+
+ {|[NACHRICHT_BETREFF]|} + + + +

[NACHRICHT_TEXT]
+
+
+
+
+
diff --git a/www/pages/ticket.php b/www/pages/ticket.php index 936da277..a9ed6542 100644 --- a/www/pages/ticket.php +++ b/www/pages/ticket.php @@ -307,6 +307,7 @@ class Ticket { $this->app->Tpl->Set("NACHRICHT_BETREFF",''.htmlentities($message['betreff']).''); $this->app->Tpl->Set("NACHRICHT_ZEIT",$message['zeitausgang']); $this->app->Tpl->Set("NACHRICHT_FLOAT","right"); + $this->app->Tpl->Set("META_FLOAT","left"); $this->app->Tpl->Set("NACHRICHT_TEXT",$message['textausgang']); $this->app->Tpl->Set("NACHRICHT_SENDER",htmlentities($message['bearbeiter'])); $this->app->Tpl->Set("NACHRICHT_RECIPIENTS",htmlentities($message['verfasser']." <".$message['mail'].">")); @@ -333,6 +334,7 @@ class Ticket { $this->app->Tpl->Set("NACHRICHT_RECIPIENTS",htmlentities($message['mail'])); $this->app->Tpl->Set("NACHRICHT_CC_RECIPIENTS",htmlentities($message['mail_cc'])); $this->app->Tpl->Set("NACHRICHT_FLOAT","right"); + $this->app->Tpl->Set("META_FLOAT","left"); $this->app->Tpl->Set("NACHRICHT_ZEIT",$message['zeitausgang']); $this->app->Tpl->Set("NACHRICHT_NAME",htmlentities($message['verfasser'])); } else { @@ -351,6 +353,7 @@ class Ticket { $this->app->Tpl->Set("NACHRICHT_CC_RECIPIENTS",htmlentities($message['mail_cc_recipients'])); $this->app->Tpl->Set("NACHRICHT_BETREFF",''.htmlentities($message['betreff']).''); $this->app->Tpl->Set("NACHRICHT_FLOAT","left"); + $this->app->Tpl->Set("META_FLOAT","right"); $this->app->Tpl->Set("NACHRICHT_ZEIT",$message['zeit']); } diff --git a/www/themes/new/css/styles.css b/www/themes/new/css/styles.css index 5bdf18ed..9bdd766b 100644 --- a/www/themes/new/css/styles.css +++ b/www/themes/new/css/styles.css @@ -2467,12 +2467,16 @@ ul.tag-editor { visibility: hidden; } +.ticket_nachricht_box { + border: solid 1px; + border-radius: 7px; +} + .ticket_text { width: 100%; border: none; } - .ui-button-icon, .ui-button:not(.ui-dialog-titlebar-close):not(.button-secondary), input[type=submit]:not(.button-secondary) { @@ -3373,7 +3377,7 @@ div.noteit_highprio { right: 10px; top: 28px; } - +/* @media screen and (min-width: 320px) { .mkTableFormular tr td:first-child { padding-top: 7px; @@ -3386,7 +3390,7 @@ div.noteit_highprio { } .mkTableFormular tr td { vertical-align: top; -} +}*/ @media screen and (max-width: 768px) { .hide768 { display: none; From bb9fd68613b920aa216a7176ea9a43faa74341a3 Mon Sep 17 00:00:00 2001 From: OpenXE <> Date: Wed, 21 Dec 2022 10:21:14 +0000 Subject: [PATCH 2/8] Bugfix auftrag tpl --- www/themes/new/css/styles.css | 2 +- www/widgets/templates/_gen/auftrag.tpl | 79 ++++++++++++++++++++++---- 2 files changed, 68 insertions(+), 13 deletions(-) diff --git a/www/themes/new/css/styles.css b/www/themes/new/css/styles.css index 9bdd766b..4a59c714 100644 --- a/www/themes/new/css/styles.css +++ b/www/themes/new/css/styles.css @@ -2139,7 +2139,7 @@ img { -webkit-border-radius: 4px; -moz-border-radius: 4px; border-radius: 4px; - padding-top: 2px; +/* padding-top: 2px;*/ } diff --git a/www/widgets/templates/_gen/auftrag.tpl b/www/widgets/templates/_gen/auftrag.tpl index 820cac56..de9ca4bb 100644 --- a/www/widgets/templates/_gen/auftrag.tpl +++ b/www/widgets/templates/_gen/auftrag.tpl @@ -83,7 +83,7 @@ function abweichend2()
{|Allgemein|} - + @@ -228,18 +228,51 @@ function abweichend2()
{|Auftrag|}
{|Kunde|}[ADRESSE][MSGADRESSE] [BUTTON_UEBERNEHMEN]
{|Kunde|}[ADRESSE][MSGADRESSE] [BUTTON_UEBERNEHMEN]
{|Lieferant|}[LIEFERANT][MSGLIEFERANT] [BUTTON_UEBERNEHMEN2]
{|an Lieferanten|}:[LIEFERANTENAUFTRAG][MSGLIEFERANTENAUFTRAG] 
{|Projekt|}:[PROJEKT][MSGPROJEKT]
- + + + + + + + + - - - + + + + + + + + + + + +
{|Zahlungsweise|}:[ZAHLUNGSWEISE][MSGZAHLUNGSWEISE] -
[VORABBEZAHLTMARKIEREN][MSGVORABBEZAHLTMARKIEREN] manuell Zahlungsfreigabe erteilen -
+ {|Zahlungsweise|}: + + [ZAHLUNGSWEISE][MSGZAHLUNGSWEISE] +
+ {|Manuell Zahlungsfreigabe erteilen|}: + + [VORABBEZAHLTMARKIEREN][MSGVORABBEZAHLTMARKIEREN] +
{|Versandart|}:[VERSANDART][MSGVERSANDART]
[LIEFERBEDINGUNG][MSGLIEFERBEDINGUNG]
{|Vertrieb|}:[VERTRIEB][MSGVERTRIEB] [VERTRIEBBUTTON]
{|Bearbeiter|}:[BEARBEITER][MSGBEARBEITER] [INNENDIENSTBUTTON]
{|Portoprüfung ausschalten|}:[KEINPORTO][MSGKEINPORTO]             -{|Kein Briefpapier und Logo|}: [OHNE_BRIEFPAPIER][MSGOHNE_BRIEFPAPIER]
{|Artikeltexte ausblenden|}:[OHNE_ARTIKELTEXT][MSGOHNE_ARTIKELTEXT]
+ {|Portoprüfung ausschalten|}: + + [KEINPORTO][MSGKEINPORTO] +
+ {|Kein Briefpapier und Logo|}: + + [OHNE_BRIEFPAPIER][MSGOHNE_BRIEFPAPIER] +
+ {|Artikeltexte ausblenden|}: + + [OHNE_ARTIKELTEXT][MSGOHNE_ARTIKELTEXT] +
{|Versandzentrum Optionen|} @@ -261,7 +294,7 @@ function abweichend2()
-
{|Sonstiges|} +
{|Sonstigess|} [EXTRABEREICHSONSTIGES]
{|GLN|}:[GLN][MSGGLN]
@@ -295,7 +328,7 @@ function abweichend(cmd) -
+
{|Rechnung|} @@ -397,8 +430,30 @@ function abweichend(cmd)
UST-Prüfung
{|Zahlungsziel (in Tagen)|}:[ZAHLUNGSZIELTAGE][MSGZAHLUNGSZIELTAGE]
- - + + + + + + + + + + + +
{|UST ID|}:[USTID][MSGUSTID]
{|Besteuerung|}:[UST_BEFREIT][MSGUST_BEFREIT] [KEINSTEUERSATZ][MSGKEINSTEUERSATZ] {|ohne Hinweis bei EU oder Export|}
{|UST-ID geprüft|}:[UST_OK][MSGUST_OK] UST / Export geprüft + Freigabe für Versand
+ {|Besteuerung|}: + + [UST_BEFREIT][MSGUST_BEFREIT] +
+ {|Ohne Hinweis bei EU oder Export|}: + + [KEINSTEUERSATZ][MSGKEINSTEUERSATZ] +
+ {|UST-ID geprüft|}: + + [UST_OK] UST / Export geprüft + Freigabe für Versand +
From 0648e57b6376e229a7473af7c206de151ca9c38d Mon Sep 17 00:00:00 2001 From: OpenXE <> Date: Wed, 21 Dec 2022 15:05:05 +0000 Subject: [PATCH 3/8] Bugfix for use of BCC for all mails --- database/struktur.sql | 4 +++- www/lib/class.erpapi.php | 2 +- www/pages/firmendaten.php | 7 +++++-- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/database/struktur.sql b/database/struktur.sql index a2a03291..7607c522 100755 --- a/database/struktur.sql +++ b/database/struktur.sql @@ -16728,7 +16728,9 @@ INSERT INTO `firmendaten_werte` (`id`, `name`, `typ`, `typ1`, `typ2`, `wert`, `d (385, 'cleaner_shopimport', 'tinyint', '1', '', '1', '1', 0, 0), (386, 'cleaner_shopimport_tage', 'int', '11', '', '90', '90', 0, 0), (387, 'cleaner_adapterbox', 'tinyint', '1', '', '1', '1', 0, 0), -(388, 'cleaner_adapterbox_tage', 'int', '11', '', '90', '90', 0, 0); +(388, 'cleaner_adapterbox_tage', 'int', '11', '', '90', '90', 0, 0) +(389, 'bcc3', 'varchar', '128', '', '', '', 0, 0) +; INSERT INTO `geschaeftsbrief_vorlagen` (`id`, `sprache`, `betreff`, `text`, `subjekt`, `projekt`, `firma`) VALUES (1, 'deutsch', 'Bestellung {BELEGNR} von {FIRMA}', '{ANSCHREIBEN},

anbei übersenden wir Ihnen unsere Bestellung zu. Bitte senden Sie uns als Bestätigung für den Empfang eine Auftragsbestätigung zu.', 'Bestellung', 1, 1), diff --git a/www/lib/class.erpapi.php b/www/lib/class.erpapi.php index cfdd9220..a1dbc7bb 100644 --- a/www/lib/class.erpapi.php +++ b/www/lib/class.erpapi.php @@ -27328,7 +27328,7 @@ function MailSendFinal($from,$from_name,$to,$to_name,$betreff,$text,$files="",$p $bcc3 = $this->Firmendaten('bcc3'); if($bcc3!="") { - $bccRecipients[] = new EmailRecipient($bcc3[0], $bcc3[1]); + $bccRecipients[] = new EmailRecipient($bcc3, $bcc3); } // This will build the mail with phpmailer 6 and send it out diff --git a/www/pages/firmendaten.php b/www/pages/firmendaten.php index 0ece581b..e06eae2b 100644 --- a/www/pages/firmendaten.php +++ b/www/pages/firmendaten.php @@ -1016,7 +1016,7 @@ class Firmendaten { ,'zahlungszielskonto','kleinunternehmer','schnellanlegen','bestellvorschlaggroessernull','immernettorechnungen','rechnung_header','rechnung_footer', 'lieferschein_header','lieferschein_footer','auftrag_header','auftrag_footer','angebot_header','angebot_footer','gutschrift_header','gutschrift_footer','bestellung_header','bestellung_footer', 'arbeitsnachweis_header','arbeitsnachweis_footer','provisionsgutschrift_header','provisionsgutschrift_footer','proformarechnung_header','proformarechnung_footer','eu_lieferung_vermerk','export_lieferung_vermerk' - ,'wareneingang_kamera_waage','layout_iconbar','passwort','host','port','mailssl','signatur','email','absendername','bcc1','bcc2' + ,'wareneingang_kamera_waage','layout_iconbar','passwort','host','port','mailssl','signatur','email','absendername','bcc1','bcc2','bcc3' ,'firmenfarbe','name','strasse','plz','ort','steuernummer','projekt','steuer_positionen_export','tabsnavigationfarbe','tabsnavigationfarbeschrift' ); @@ -1719,6 +1719,7 @@ class Firmendaten { $this->app->Tpl->Set('ABSENDERNAME' , $data[0]['absendername']); $this->app->Tpl->Set('BCC1' , $data[0]['bcc1']); $this->app->Tpl->Set('BCC2' , $data[0]['bcc2']); + $this->app->Tpl->Set('BCC3' , $data[0]['bcc3']); $this->app->Tpl->Set('FIRMENFARBE' , $data[0]['firmenfarbe']); $this->app->Tpl->Set('NAME' , $data[0]['name']); $this->app->Tpl->Set('STRASSE' , $data[0]['strasse']); @@ -2072,7 +2073,8 @@ class Firmendaten { $this->app->Tpl->Set('EMAIL' , $data['email']); $this->app->Tpl->Set('ABSENDERNAME' , $data['absendername']); $this->app->Tpl->Set('BCC1' , $data['bcc1']); - $this->app->Tpl->Set('BCC2' , $data['bcc2']); + $this->app->Tpl->Set('BCC2' , $data['bcc2']); + $this->app->Tpl->Set('BCC3' , $data['bcc3']); $this->app->Tpl->Set('FIRMENFARBE' , $data['firmenfarbe']); $this->app->Tpl->Set('NAME' , $data['name']); $this->app->Tpl->Set('STRASSE' , $data['strasse']); @@ -2224,6 +2226,7 @@ class Firmendaten { $data['absendername'] = ($this->app->Secure->POST["absendername"]); $data['bcc1'] = ($this->app->Secure->POST["bcc1"]); $data['bcc2'] = ($this->app->Secure->POST["bcc2"]); + $data['bcc3'] = ($this->app->Secure->POST["bcc3"]); $data['name'] = ($this->app->Secure->POST["name"]); $data['firmenfarbe'] = ($this->app->Secure->POST["firmenfarbe"]); $data['strasse'] = ($this->app->Secure->POST["strasse"]); From 71861079e366723411f5a31218b8d21ce6376765 Mon Sep 17 00:00:00 2001 From: OpenXE <> Date: Wed, 21 Dec 2022 21:34:00 +0100 Subject: [PATCH 4/8] ticket system rework for secure import, email stays unread until import is successfull emailbackup_mails will be reverted on error --- .../Ticket/Task/TicketImportHelper.php | 167 +++++++++--------- 1 file changed, 82 insertions(+), 85 deletions(-) diff --git a/classes/Modules/Ticket/Task/TicketImportHelper.php b/classes/Modules/Ticket/Task/TicketImportHelper.php index e0ce9408..44f9c115 100644 --- a/classes/Modules/Ticket/Task/TicketImportHelper.php +++ b/classes/Modules/Ticket/Task/TicketImportHelper.php @@ -493,12 +493,17 @@ class TicketImportHelper $this->logger->debug('Start import', ['message' => $message->getSubject()]); - $this->importMessage($message); - $insertedMailsCount++; - if ($this->mailAccount->isDeleteAfterImportEnabled()) { - $this->mailClient->deleteMessage((int)$messageNumber); + $result = $this->importMessage($message); + + if ($result === true) { + $insertedMailsCount++; + if ($this->mailAccount->isDeleteAfterImportEnabled()) { + $this->mailClient->deleteMessage((int)$messageNumber); + } else { + $this->mailClient->setFlags((int)$messageNumber, ['\\Seen']); + } } else { - $this->mailClient->setFlags((int)$messageNumber, ['\\Seen']); + $this->logger->error('Error during email import', ['']); } } catch (Throwable $e) { $this->logger->error('Error during email import', ['exception' => $e]); @@ -517,12 +522,10 @@ class TicketImportHelper /** * @param MailMessageInterface $message * - * @return void + * @return true on success */ - public function importMessage(MailMessageInterface $message): void + public function importMessage(MailMessageInterface $message): bool { - $DEBUG = 0; - // extract email data $subject = $this->formatter->encodeToUtf8($message->getSubject()); $from = $this->formatter->encodeToUtf8($message->getSender()->getEmail()); @@ -549,7 +552,7 @@ class TicketImportHelper $action_html = nl2br($action); } - //check if email exists in database + // Import database emailbackup $date = $message->getDate(); if (is_null($date)) { // This should not be happening -> Todo check getDate function $this->logger->debug('Null date',['subject' => $message->getSubject()]); @@ -563,21 +566,21 @@ class TicketImportHelper FROM `emailbackup_mails` WHERE `checksum`='$frommd5' AND `empfang`='$empfang' + AND `ticketnachricht` != 0 AND `webmail`='" . $this->mailAccount->getId() . "'"; - $this->logger->debug('Importing message '.$from.' '.$fromname); - if ($this->db->Select($sql) == 0) { + $result = $this->db->Select($sql); + $emailbackup_mails_id = null; + + if ($result == 0) { $this->logger->debug('Importing message',['']); $attachments = $message->getAttachments(); $anhang = count($attachments) > 0 ? 1 : 0; $mailacc = $this->mailAccount->getEmailAddress(); - if (empty($mailacc) && count($message->getRecipients()) > 0) { - $mailacc = array_values($message->getRecipients())[0]->getEmail(); - } $mailaccid = $this->mailAccount->getId(); if (!$this->erpApi->isMailAdr($from)) { @@ -604,23 +607,24 @@ class TicketImportHelper '$empfang','$anhang','$frommd5' )"; - $id = null; - if ($DEBUG) { - echo $sql; - } else { - $this->db->InsertWithoutLog($sql); - $id = $this->db->GetInsertID(); - } - } - - if ($DEBUG) { - echo "ticket suchen oder anlegen\n"; - } + $this->db->InsertWithoutLog($sql); + $emailbackup_mails_id = $this->db->GetInsertID(); + } else { + $this->logger->debug('Message already imported.',['']); + return(true); + } + $this->logger->debug('Message emailbackup_mails imported.',['id' => $emailbackup_mails_id]); + // END database import emailbackup + + // Find ticket and add or create new ticket $ticketNumber = null; $ticketexists = null; if (preg_match("/Ticket #[0-9]{12}/i", $subject, $matches)) { $ticketNumber = str_replace('Ticket #', '', $matches[0]); + + $this->logger->debug('Check for number',['ticketnummer' => $ticketNumber]); + $ticketexists = $this->db->Select( "SELECT schluessel FROM ticket @@ -648,7 +652,7 @@ class TicketImportHelper $this->logger->debug('Add message to existing ticket',['ticketnummer' => $ticketNumber]); } - // Add message to new or existing ticket + // Database import ticket: Add message to new or existing ticket $ticketnachricht = $this->addTicketMessage( (string) $ticketNumber, $timestamp, @@ -661,11 +665,11 @@ class TicketImportHelper $from ); - if ($ticketnachricht > 0 && $id > 0) { + if ($ticketnachricht > 0 && $emailbackup_mails_id > 0) { $this->db->Update( "UPDATE `emailbackup_mails` SET ticketnachricht='$ticketnachricht' - WHERE id='$id' LIMIT 1" + WHERE id='$emailbackup_mails_id' LIMIT 1" ); @@ -711,56 +715,58 @@ class TicketImportHelper } } } + } else { + $this->logger->error("Message not imported!", ['Time' => $timestamp, 'Subject' => $subject, 'From' => $from]); + $this->db->Delete("DELETE FROM emailbackup_mails WHERE id = ".$emailbackup_mails_id); + return(false); } - - // Prüfen ob Ordner vorhanden ansonsten anlegen - $ordner = $this->config->WFuserdata . '/emailbackup/' . $this->config->WFdbname . "/$id"; - if (!is_dir($ordner) && $id > 0) { + // END database import ticket + + // File management folder with raw text + $ordner = $this->config->WFuserdata . '/emailbackup/' . $this->config->WFdbname . "/$emailbackup_mails_id"; + if (!is_dir($ordner) && $emailbackup_mails_id > 0) { if (!mkdir($ordner, 0777, true) && !is_dir($ordner)) { + $this->logger->error("Folder \"{folder}\" was not created", ['folder' => $ordner]); + $this->db->Delete("DELETE FROM emailbackup_mails WHERE id = ".$emailbackup_mails_id); + return(false); } $raw_full_email = $message->getRawContent(); file_put_contents($ordner . '/mail.txt', $raw_full_email); } - //speichere anhang als datei - if ($anhang == 1 && $id > 0) { + // File management attachments + if ($anhang == 1 && $emailbackup_mails_id > 0) { $ordner = $this->config->WFuserdata . '/emailbackup/' . $this->config->WFdbname; if (!is_dir($ordner)) { if (!mkdir($ordner, 0777, true) && !is_dir($ordner)) { $this->logger->error("Folder \"{folder}\" was not created", ['folder' => $ordner]); + $this->db->Delete("DELETE FROM emailbackup_mails WHERE id = ".$emailbackup_mails_id); + return(false); } } // Prüfen ob Ordner vorhanden ansonsten anlegen - $ordner = $this->config->WFuserdata . '/emailbackup/' . $this->config->WFdbname . "/$id"; + $ordner = $this->config->WFuserdata . '/emailbackup/' . $this->config->WFdbname . "/$emailbackup_mails_id"; if (!is_dir($ordner)) { - if ($DEBUG) { - echo "mkdir $ordner\n"; - } else { - if (!mkdir($ordner, 0777, true) && !is_dir($ordner)) { - $this->logger->error("Folder \"{folder}\" was not created", ['folder' => $ordner]); - } + if (!mkdir($ordner, 0777, true) && !is_dir($ordner)) { + $this->logger->error("Folder \"{folder}\" was not created", ['folder' => $ordner]); + $this->db->Delete("DELETE FROM emailbackup_mails WHERE id = ".$emailbackup_mails_id); + return(false); } } - $this->logger->debug('Add attachments',['ticketnummer' => $ticketNumber, 'nachricht' => $ticketnachricht, 'count' => count($attachments)]); - + $this->logger->debug('Add '.count($attachments).' attachments',['']); foreach ($attachments as $attachment) { if ($attachment->getFileName() !== '') { - if ($DEBUG) { - } else { - $handle = fopen($ordner . '/' . $attachment->getFileName(), 'wb'); - if ($handle) { - fwrite($handle, $attachment->getContent()); - fclose($handle); - } + $handle = fopen($ordner . '/' . $attachment->getFileName(), 'wb'); + if ($handle) { + fwrite($handle, $attachment->getContent()); + fclose($handle); } //Schreibe Anhänge in Datei-Tabelle $datei = $ordner . '/' . $attachment->getFileName(); $dateiname = $attachment->getFileName(); - $this->logger->debug("Attachment", ['filename' => $dateiname]); - if (stripos(strtoupper($dateiname), '=?UTF-8') !== false) { $dateiname = $this->formatter->encodeToUtf8($dateiname); $dateiname = htmlspecialchars_decode($dateiname); @@ -774,42 +780,31 @@ class TicketImportHelper $dateiname = htmlspecialchars_decode($dateiname); } - $this->logger->debug("Attachment cleaned", ['filename' => $dateiname]); + $tmpid = $this->erpApi->CreateDatei( + $dateiname, + $dateiname, + '', + '', + $datei, + 'Support Mail', + true, + $this->config->WFuserdata . '/dms/' . $this->config->WFdbname + ); - if ($DEBUG) { - echo "CreateDatei($dateiname,{$dateiname},\"\",\"\",\"datei\",\"Support Mail\",true," - . $this->config->WFuserdata . "/dms/" . $this->config->WFdbname . ")\n"; - } else { - $tmpid = $this->erpApi->CreateDatei( - $dateiname, - $dateiname, - '', - '', - $datei, - 'Support Mail', - true, - $this->config->WFuserdata . '/dms/' . $this->config->WFdbname - ); - } + $this->logger->debug('Add attachment',['filename' => $dateiname, 'ticketnummer' => $ticketNumber,'id' => $tmpid, 'nachricht' => $ticketnachricht]); - if ($DEBUG) { - echo "AddDateiStichwort $tmpid,'Anhang','Ticket',$ticketnachricht,true)\n"; - } else { - - $this->logger->debug('Add attachment',['ticketnummer' => $ticketNumber,'id' => $tmpid, 'nachricht' => $ticketnachricht]); - - $this->erpApi->AddDateiStichwort( - $tmpid, - 'Anhang', - 'Ticket', - $ticketnachricht, - true - ); - } + $this->erpApi->AddDateiStichwort( + $tmpid, + 'Anhang', + 'Ticket', + $ticketnachricht, + true + ); } } - } + } // END File management + // Autoresponder if ( $this->mailAccount->isAutoresponseEnabled() && $this->mailAccount->getAutoresponseText() !== '' @@ -843,5 +838,7 @@ class TicketImportHelper $text ); } + + return(true); } } From 135017158c2a01d5cc1e9aa527cf243b6c846ceb Mon Sep 17 00:00:00 2001 From: OpenXE <> Date: Fri, 23 Dec 2022 19:08:18 +0100 Subject: [PATCH 5/8] Log with milliseconds --- classes/Components/Logger/Handler/DatabaseLogHandler.php | 2 +- upgrade/data/db_schema.json | 2 +- www/pages/log.php | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/classes/Components/Logger/Handler/DatabaseLogHandler.php b/classes/Components/Logger/Handler/DatabaseLogHandler.php index 1b74c1e4..692f9e29 100644 --- a/classes/Components/Logger/Handler/DatabaseLogHandler.php +++ b/classes/Components/Logger/Handler/DatabaseLogHandler.php @@ -66,7 +66,7 @@ final class DatabaseLogHandler extends AbstractLogHandler $sql = 'INSERT INTO `log` (`log_time`, `level`, `message`, `class`, `method`, `line`, `origin_type`, `origin_detail`, `dump`) VALUES - (NOW(), :level, :message, :class, :method, :line, :origin_type, :origin_detail, :dump)'; + (NOW(3), :level, :message, :class, :method, :line, :origin_type, :origin_detail, :dump)'; $this->db->perform($sql, $values); } } diff --git a/upgrade/data/db_schema.json b/upgrade/data/db_schema.json index fbfab4fd..2feed475 100644 --- a/upgrade/data/db_schema.json +++ b/upgrade/data/db_schema.json @@ -56922,7 +56922,7 @@ }, { "Field": "log_time", - "Type": "datetime", + "Type": "datetime(3)", "Collation": null, "Null": "YES", "Key": "", diff --git a/www/pages/log.php b/www/pages/log.php index 46d18563..6de8da11 100644 --- a/www/pages/log.php +++ b/www/pages/log.php @@ -82,7 +82,7 @@ class Log 'Nachricht', '', ]; - $width = ['1%', '4%', '8%', '4%', '10%', '15%', '20%', '10%', '5%', '40%']; + $width = ['1%', '4%', '9%', '4%', '10%', '15%', '20%', '10%', '5%', '40%']; $findcols = [ 'open', 'l.id', @@ -116,7 +116,7 @@ class Log $sql = "SELECT l.id, '' AS `open`, l.id, - DATE_FORMAT(l.log_time,'%d.%m.%Y %H:%i:%s') AS `log_time`, + SUBSTRING(DATE_FORMAT(l.log_time,'%d.%m.%Y %H:%i:%s %f'),1,23) AS `log_time`, l.level, l.origin_type, l.origin_detail, l.class, l.method, l.line, l.message, l.id FROM `log` AS `l`"; $fastcount = 'SELECT COUNT(l.id) FROM `log` AS `l`'; From d94c05383a143d0b6c5ff244f68a042aeb7717b0 Mon Sep 17 00:00:00 2001 From: OpenXE <> Date: Fri, 23 Dec 2022 19:55:48 +0100 Subject: [PATCH 6/8] ticket system design improvements, subject in info box, optimized space usage, bugfix warteschlange autocomplete --- www/pages/ajax.php | 2 +- www/pages/content/ticket_edit.tpl | 2 +- www/pages/content/ticket_nachricht.tpl | 3 +-- www/pages/ticket.php | 6 +++++- www/themes/new/css/styles.css | 11 +++++++++-- 5 files changed, 17 insertions(+), 7 deletions(-) diff --git a/www/pages/ajax.php b/www/pages/ajax.php index e17fd730..b5276378 100644 --- a/www/pages/ajax.php +++ b/www/pages/ajax.php @@ -1289,7 +1289,7 @@ class Ajax { } break; case 'warteschlangename': - $arr = $this->app->DB->SelectArr("SELECT CONCAT(label, ' ', warteschlange) as result from warteschlangen"); + $arr = $this->app->DB->SelectArr("SELECT CONCAT(label, ' ', warteschlange) as result from warteschlangen WHERE label LIKE '%$term%' OR warteschlange LIKE '%$term%' ORDER BY label"); $carr = !empty($arr)?count($arr):0; for($i = 0; $i < $carr; $i++) { $newarr[] = "{$arr[$i]['result']}"; diff --git a/www/pages/content/ticket_edit.tpl b/www/pages/content/ticket_edit.tpl index 67118ba5..a6d057ce 100644 --- a/www/pages/content/ticket_edit.tpl +++ b/www/pages/content/ticket_edit.tpl @@ -21,7 +21,7 @@ {|[STATUSICON]Ticket #[SCHLUESSEL]|} {|Betreff|}: {|Letzte Aktion|}:[ZEIT] - {|Von|}:[MAILADRESSE] ([KUNDE]) + {|Von|}:[KUNDE] [MAILADRESSE] {|Projekt|}: {|Adresse|}: {|Tags|}: diff --git a/www/pages/content/ticket_nachricht.tpl b/www/pages/content/ticket_nachricht.tpl index 8c28306a..8452ac29 100644 --- a/www/pages/content/ticket_nachricht.tpl +++ b/www/pages/content/ticket_nachricht.tpl @@ -8,6 +8,7 @@
+ @@ -20,9 +21,7 @@
- {|[NACHRICHT_BETREFF]|}
{|Betreff|}:[NACHRICHT_BETREFF]
{|Zeit|}:[NACHRICHT_ZEIT]
{|Von|}:[NACHRICHT_SENDER]
{|An|}:[NACHRICHT_RECIPIENTS]
-

[NACHRICHT_TEXT]
diff --git a/www/pages/ticket.php b/www/pages/ticket.php index a9ed6542..5dc371b5 100644 --- a/www/pages/ticket.php +++ b/www/pages/ticket.php @@ -328,7 +328,7 @@ class Ticket { } $this->app->Tpl->Set("NACHRICHT_BETREFF",htmlentities($message['betreff']." (Entwurf)")); } else { - $this->app->Tpl->Set("NACHRICHT_BETREFF",htmlentities($message['betreff'])); + $this->app->Tpl->Set("NACHRICHT_BETREFF",''.htmlentities($message['betreff']).''); } $this->app->Tpl->Set("NACHRICHT_SENDER",htmlentities($message['verfasser']." <".$message['mail_replyto'].">")); $this->app->Tpl->Set("NACHRICHT_RECIPIENTS",htmlentities($message['mail'])); @@ -564,6 +564,10 @@ class Ticket { $this->app->Tpl->Set('ADRESSE', $this->app->erp->ReplaceAdresse(false,$ticket_from_db['adresse'],false)); // Convert ID to form display + if ($ticket_from_db['mailadresse'] != "") { + $this->app->Tpl->Set('MAILADRESSE',"<".$ticket_from_db['mailadresse'].">"); + } + $this->app->Tpl->Set('ADRESSE_ID',$ticket_from_db['adresse']); $this->app->YUI->AutoComplete("projekt","projektname",1); diff --git a/www/themes/new/css/styles.css b/www/themes/new/css/styles.css index 4a59c714..98b759ed 100644 --- a/www/themes/new/css/styles.css +++ b/www/themes/new/css/styles.css @@ -1809,12 +1809,12 @@ fieldset.usersave div.filter-item > label { fieldset { position: relative; margin: 0; - margin-top: 5px; +/* margin-top: 5px; padding: 5px; border: 0 solid transparent; border-top: 25px solid transparent; border-bottom: 5px solid transparent; - border-width: 24px 5px 0; + border-width: 24px 5px 0;*/ border-color: transparent; background-color: transparent; } @@ -2469,12 +2469,19 @@ ul.tag-editor { .ticket_nachricht_box { border: solid 1px; + border-color: var(--textfield-border); border-radius: 7px; + padding: 0px !important; +} + +.ticket_nachricht_box fieldset { + padding: 0px !important; } .ticket_text { width: 100%; border: none; + height: 300px; } .ui-button-icon, From 45164166f525d04c990fe67f6aeb4245cb58f16b Mon Sep 17 00:00:00 2001 From: OpenXE <> Date: Mon, 26 Dec 2022 13:30:38 +0100 Subject: [PATCH 7/8] Bugfix for bcc in struktur.sql --- database/struktur.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/database/struktur.sql b/database/struktur.sql index 7607c522..84b51edb 100755 --- a/database/struktur.sql +++ b/database/struktur.sql @@ -16728,7 +16728,7 @@ INSERT INTO `firmendaten_werte` (`id`, `name`, `typ`, `typ1`, `typ2`, `wert`, `d (385, 'cleaner_shopimport', 'tinyint', '1', '', '1', '1', 0, 0), (386, 'cleaner_shopimport_tage', 'int', '11', '', '90', '90', 0, 0), (387, 'cleaner_adapterbox', 'tinyint', '1', '', '1', '1', 0, 0), -(388, 'cleaner_adapterbox_tage', 'int', '11', '', '90', '90', 0, 0) +(388, 'cleaner_adapterbox_tage', 'int', '11', '', '90', '90', 0, 0), (389, 'bcc3', 'varchar', '128', '', '', '', 0, 0) ; From 1f661b9a2b91031089f06522bafbe9d190dd3bec Mon Sep 17 00:00:00 2001 From: OpenXE <> Date: Tue, 27 Dec 2022 16:35:59 +0100 Subject: [PATCH 8/8] loginpage now with custom.css --- www/themes/new/templates/loginpage.tpl | 1 + 1 file changed, 1 insertion(+) diff --git a/www/themes/new/templates/loginpage.tpl b/www/themes/new/templates/loginpage.tpl index 0540019b..6c22e7eb 100644 --- a/www/themes/new/templates/loginpage.tpl +++ b/www/themes/new/templates/loginpage.tpl @@ -13,6 +13,7 @@ +