From bb01a4e92d3df8e0546afbd76bc922126da4d576 Mon Sep 17 00:00:00 2001
From: OpenXE <>
Date: Thu, 13 Feb 2025 15:05:30 +0100
Subject: [PATCH 1/5] onlineshops moved from logfile to logger
---
www/pages/onlineshops.php | 18 ++++++++++++++++--
1 file changed, 16 insertions(+), 2 deletions(-)
diff --git a/www/pages/onlineshops.php b/www/pages/onlineshops.php
index 9ea25bf6..877379f5 100644
--- a/www/pages/onlineshops.php
+++ b/www/pages/onlineshops.php
@@ -13,6 +13,7 @@
*/
?>
app=$app;
+ $this->logger = $app->Container->get('Logger');
if($intern) {
return;
}
@@ -2860,7 +2864,8 @@ INNER JOIN shopexport s ON
LEFT JOIN (SELECT artikel FROM artikel_onlineshops WHERE shop = '$id' AND aktiv = 1 GROUP BY artikel) oa ON a.id = oa.artikel
SET a.cache_lagerplatzinhaltmenge = -999 WHERE (a.shop = '$id' OR a.shop2 = '$id' OR a.shop3 = '$id' OR NOT ISNULL(oa.artikel)) AND a.geloescht = 0 AND ($where)");
$anz = $this->app->DB->affected_rows();
- $this->app->erp->LogFile("Lagerzahlencache zurückgesetzt für $anz Artikel, shopid: $id");
+// $this->app->erp->LogFile("Lagerzahlencache zurückgesetzt für $anz Artikel, shopid: $id");
+ $this->Log(Logger::INFO, "Lagerzahlencache zurückgesetzt für $anz Artikel, shopid: $id");
$this->app->Tpl->Add('MESSAGE','
Lagerzahlencache zurückgesetzt für '.$anz.' Artikel, shopid: '.$id.'
');
}
}
@@ -3156,7 +3161,8 @@ INNER JOIN shopexport s ON
}
}
}catch(Exception $ex){
- $this->app->erp->LogFile('Fehlerhafter Aufruf in Modul: '.$moduleName);
+// $this->app->erp->LogFile('Fehlerhafter Aufruf in Modul: '.$moduleName);
+ $this->Log(Logger::INFO, 'Fehlerhafter Aufruf in Modul: '.$moduleName, $ex);
}
$username = $this->app->DB->real_escape_string($this->app->User->GetUsername());
@@ -3337,6 +3343,8 @@ INNER JOIN shopexport s ON
if($this->app->Secure->GetPOST('pruefen')) {
+ $this->Log(Logger::DEBUG, "Verbindung prüfen");
+
$className = 'Remote';
$methodName = 'RemoteConnection';
$r = new ReflectionMethod($className, $methodName);
@@ -4980,4 +4988,10 @@ INNER JOIN shopexport s ON
return $ret;
}
+
+ private function Log($level, $message, $dump = array()) {
+ $shopid = (int)$this->app->Secure->GetGET('id');
+ $this->logger->Log($level, 'Onlineshops (Shop '.$shopid.') '.$message, (array) $dump);
+ }
+
}
From f03a52474d5c418377be7e8a9716525614c08d03 Mon Sep 17 00:00:00 2001
From: OpenXE <>
Date: Mon, 24 Feb 2025 14:21:06 +0100
Subject: [PATCH 2/5] bugfixes auftrag change versandart and auto-versand when
changing project
---
www/widgets/templates/_gen/projekt.tpl | 8 ++++++--
www/widgets/widget.auftrag.php | 8 ++++----
2 files changed, 10 insertions(+), 6 deletions(-)
diff --git a/www/widgets/templates/_gen/projekt.tpl b/www/widgets/templates/_gen/projekt.tpl
index acb3f52f..de4b5794 100644
--- a/www/widgets/templates/_gen/projekt.tpl
+++ b/www/widgets/templates/_gen/projekt.tpl
@@ -122,7 +122,12 @@
{|Auto-Versand als Standard deaktivieren|}: |
- [DEACTIVATEAUTOSHIPPING][MSGDEACTIVATEAUTOSHIPPING] |
+ [DEACTIVATEAUTOSHIPPING][MSGDEACTIVATEAUTOSHIPPING] |
+
+
+
+ Standard Versandart: | [VERSANDART][MSGVERSANDART]
+ |
{|Drucker Stufe (Kommissionierung)|} | [DRUCKERLOGISTIKSTUFE1][MSGDRUCKERLOGISTIKSTUFE1] {|z.B. Lieferschein drucken|} |
{|Drucker Stufe (Versand)|} | [DRUCKERLOGISTIKSTUFE2][MSGDRUCKERLOGISTIKSTUFE2] {|Belege bei Versandstation|} |
@@ -338,7 +343,6 @@
Standard Zahlungsweise Kunde: | [ZAHLUNGSWEISE][MSGZAHLUNGSWEISE] |
Standard Zahlungsweise Lieferant: | [ZAHLUNGSWEISELIEFERANT][MSGZAHLUNGSWEISELIEFERANT] |
- Standard Versandart: | [VERSANDART][MSGVERSANDART] |
{|Währung|}: | [WAEHRUNG][MSGWAEHRUNG] |
{|USt.-ID|}: | [STEUERNUMMER][MSGSTEUERNUMMER] |
{|Mahnwesen aktiv|}: | [MAHNWESEN][MSGMAHNWESEN] |
diff --git a/www/widgets/widget.auftrag.php b/www/widgets/widget.auftrag.php
index 69181b03..ac1586f8 100644
--- a/www/widgets/widget.auftrag.php
+++ b/www/widgets/widget.auftrag.php
@@ -54,9 +54,9 @@ class WidgetAuftrag extends WidgetGenAuftrag
$this->form->HTMLList['standardlager']->dbvalue = $standardlager;
}
$deactivateautoshipping = $this->app->erp->Projektdaten($projektdanach, 'deactivateautoshipping');
- if($deactivateautoshipping && $this->form->CallbackAndMandatorycheck(true)) {
- $this->form->HTMLList['autoversand']->htmlvalue = 0;
- $this->form->HTMLList['autoversand']->dbvalue = 0;
+ if($this->form->CallbackAndMandatorycheck(true)) {
+ $this->form->HTMLList['autoversand']->htmlvalue = ($deactivateautoshipping == 0);
+ $this->form->HTMLList['autoversand']->dbvalue = ($deactivateautoshipping == 0);
}
$query = sprintf("SELECT zahlungsweise, zahlungsweiselieferant, versandart FROM projekt WHERE id='%s'",
$projektdanach);
@@ -219,7 +219,7 @@ class WidgetAuftrag extends WidgetGenAuftrag
// $field->onchange="versand(this.form.versandart.options[this.form.versandart.selectedIndex].value);";
$field->AddOptionsSimpleArray($versandart);
$this->form->NewField($field);
- if(!empty($overwriteZahlungsweise)){
+ if(!empty($overwriteVersandart)){
$this->form->HTMLList['versandart']->htmlvalue = $overwriteVersandart;
$this->form->HTMLList['versandart']->dbvalue = $overwriteVersandart;
}
From 94043a6609ce0d8127fa97ed2fd1d6fa28849f79 Mon Sep 17 00:00:00 2001
From: OpenXE <>
Date: Tue, 25 Feb 2025 17:07:52 +0100
Subject: [PATCH 3/5] Bugfix etiketten embedded images
---
www/lib/dokumente/class.etiketten.php | 30 +++++++++++++++++----------
www/pages/content/etiketten_bild.tpl | 3 ++-
www/pages/etiketten.php | 16 +++++++-------
3 files changed, 30 insertions(+), 19 deletions(-)
diff --git a/www/lib/dokumente/class.etiketten.php b/www/lib/dokumente/class.etiketten.php
index c6b6927b..c87a46be 100644
--- a/www/lib/dokumente/class.etiketten.php
+++ b/www/lib/dokumente/class.etiketten.php
@@ -68,20 +68,27 @@ class EtikettenPDF extends SuperFPDF {
break;
case "image":
- $filename = '';
- if(isset($items->attributes()->src))
- {
- $src = str_replace('&','&',$items->attributes()->src);
- if(stripos($src,'http://') === false && stripos($src,'https://') === false)
+ $filename = '';
+ if(isset($items->attributes()->src))
{
- $src = 'http://'.$src;
+ $src = str_replace('&','&',$items->attributes()->src);
+ if(stripos($src,'http://') === false && stripos($src,'https://') === false)
+ {
+ $src = 'http://'.$src;
+ }
+ $content = file_get_contents($src);
+ } else {
+ $content = base64_decode($items[0]);
+ if ($content === false) {
+ throw new RuntimeException('invalid image data');
+ }
}
- $content = file_get_contents($src);
+
if($content)
{
$filename = rtrim($this->app->erp->GetTMP(),'/').'/'.md5(microtime(true).$items[0]);
file_put_contents($filename.'1.jpg', $content);
-
+
$bildbreite = trim($items->attributes()->width);
$bildhoehe = trim($items->attributes()->height);
if(!class_exists('image'))include_once(__DIR__.'/../class.image.php');
@@ -120,9 +127,8 @@ class EtikettenPDF extends SuperFPDF {
$manipulator->save($filename.'2.jpg', $typ);
$items[0] = $filename.'2.jpg';
}
- }
-
- }
+ }
+
$type = exif_imagetype ( trim($items[0]) );
switch($type)
@@ -132,10 +138,12 @@ class EtikettenPDF extends SuperFPDF {
case IMAGETYPE_PNG: $type="png"; break;
default: $type="";
}
+
if($type!="")
{
$this->Image(trim($items[0]),trim($items->attributes()->x),trim($items->attributes()->y),trim($items->attributes()->width),trim($items->attributes()->height),$type);
}
+
if($filename != '')
{
unlink($filename.'1.jpg');
diff --git a/www/pages/content/etiketten_bild.tpl b/www/pages/content/etiketten_bild.tpl
index 7c866edf..6fea83bb 100644
--- a/www/pages/content/etiketten_bild.tpl
+++ b/www/pages/content/etiketten_bild.tpl
@@ -7,9 +7,10 @@