From 65af8833785c5fdd4b704cc9e649aa379e070b67 Mon Sep 17 00:00:00 2001 From: thomas Date: Mon, 14 Jan 2019 09:08:45 +0000 Subject: - Vorbereitung Modul "Anschreiben" git-svn-id: https://[internal]/wordpress/plugins/wpsg4@7256 0d5edaf7-2b12-4e95-93f4-047927463d4b --- views/css/admin.css | 5 + views/mods/mod_anschreiben/anschreiben_pdf.phtml | 199 +++++++++++++++++++++ views/mods/mod_anschreiben/order_view.phtml | 113 ++++++++++++ views/mods/mod_anschreiben/settings_edit.phtml | 212 +++++++++++++++++++++++ 4 files changed, 529 insertions(+) create mode 100644 views/mods/mod_anschreiben/anschreiben_pdf.phtml create mode 100644 views/mods/mod_anschreiben/order_view.phtml create mode 100644 views/mods/mod_anschreiben/settings_edit.phtml diff --git a/views/css/admin.css b/views/css/admin.css index 9ffc90d..53c536e 100644 --- a/views/css/admin.css +++ b/views/css/admin.css @@ -116,6 +116,11 @@ table.wpsgitrecht_table { width:100%; } .wpsg_kundenkontakt_betreff { width:80%; float:right; margin-bottom:20px; } .wpsg_kundenkontakt_textarea { width:100%; float:right; height:150px; } +/* SMS-Versand */ +.wpsg_sms_template, +.wpsg_sms_newnumber { width:70%; float:right; margin-bottom:20px; } +.wpsg_sms_textarea { width:100%; float:right; height:150px; } + /* Länderverwaltung */ .wpsg_table_country { margin-bottom:0px; } .wpsg_table_country .col_mwst { width:25px; } diff --git a/views/mods/mod_anschreiben/anschreiben_pdf.phtml b/views/mods/mod_anschreiben/anschreiben_pdf.phtml new file mode 100644 index 0000000..714b53c --- /dev/null +++ b/views/mods/mod_anschreiben/anschreiben_pdf.phtml @@ -0,0 +1,199 @@ +AddPage(); + + if (file_exists($shop->callMod('wpsg_mod_anschreiben', 'getFilePath', array(''))."wpsg_anschreiben_bp.pdf")) + { + + $pagecount = $pdf->setSourceFile($shop->callMod('wpsg_mod_anschreiben', 'getFilePath', array(''))."wpsg_anschreiben_bp.pdf"); + $tplidx = $pdf->importPage(1, '/MediaBox'); + $pdf->useTemplate($tplidx, 0, 0, 210); + + } + else if (file_exists($shop->callMod('wpsg_mod_anschreiben', 'getFilePath', array(''))."wpsg_anschreiben_bp.jpg")) + { + + $pdf->image($shop->callMod('wpsg_mod_anschreiben', 'getFilePath', array(''))."wpsg_anschreiben_bp.jpg", 0, 0, 210, 297, 'jpg'); + + } + + + if (file_exists($shop->callMod('wpsg_mod_anschreiben', 'getFilePath', array(''))."wpsg_anschreiben_logo.jpg")) + { + + list($width, $height, $type, $attr) = getimagesize($shop->callMod('wpsg_mod_anschreiben', 'getFilePath', array(''))."wpsg_anschreiben_logo.jpg"); + + // Umrechnung von Inch zu Pixel + $wPix = (25.4 * $width) / 96; + $hPix = (25.4 * $height) / 96; + + $leftPos = 110 - $wPix; + $midPos = $wPix * 2.6 - $width / 2; + $rightPos = 210 - $wPix; + + $abscissa = $rightPos; + $ordinate = 0; + + $transparency = str_replace("%", "", $shop->get_option('wpsg_mod_anschreiben_logo_transparency')); + if($transparency !== "100") $transparency = str_replace(array("0", "00"), "", $transparency); + + $alpha = 1; + if(!is_null($transparency) && $transparency !== "100") $alpha = "0.$transparency"; + if(!is_null($transparency) && $transparency === "100") $alpha = $transparency; + + $logo_pos = $shop->get_option('wpsg_mod_anschreiben_logo_position'); + + if(isset($logo_pos) && $logo_pos === "left") { $abscissa = $leftPos; $ordinate = 20; } + if(isset($logo_pos) && $logo_pos === "center") { $abscissa = $midPos; $ordinate = 20; } + if(isset($logo_pos) && $logo_pos === "right") { $abscissa = $rightPos; } + + $pdf->SetAlpha($alpha); + $pdf->image($shop->callMod('wpsg_mod_anschreiben', 'getFilePath', array(''))."wpsg_anschreiben_logo.jpg", $abscissa, $ordinate, $wPix, $hPix); + $pdf->SetAlpha(1); + + } + + // Absenderadresszeile (Wird in der Konfiguration hinterlegt) + $pdf->SetFont('Arial', '', 6); + $pdf->Text($absender_left, $absender_top, $shop->replaceUniversalPlatzhalter($shop->get_option("wpsg_mod_anschreiben_adressrow"), $shop->view['order']['id'])); + + if (wpsg_getStr($shop->view['kunde']['kuerzel']) != "") $shop->view['kunde']['kuerzel'] = $shop->view['kunde']['kuerzel'].'-'; + + // Adresse des Kunden + $pdf->SetFont('Arial', '', 12); + $pdf->Text($adress_left, $adress_top, $shop->view['data']['firma']); + $pdf->Text($adress_left, $adress_top + 5, $shop->view['data']['vname'].' '.$shop->view['data']['name']); + $pdf->Text($adress_left, $adress_top + 10, $shop->view['data']['strasse'].' '.$shop->view['data']['hausnr']); + $pdf->Text($adress_left, $adress_top + 15, $shop->view['data']['plz'].' '.$shop->view['data']['ort']); + //if ($shop->get_option('wpsg_mod_anschreiben_hideCountry') != '1') $pdf->Text($adress_left, $adress_top + 20, strtoupper($shop->view['oOrder']->getShippingCountryName())); + if ($shop->get_option('wpsg_mod_anschreiben_hideCountry') != '1') $pdf->Text($adress_left, $adress_top + 20, $shop->view['data']['land']); + + // Daten + $pdf->SetFont('Arial', 'B', 16); + $pdf->Text($dndata_left, $dndata_top, $shop->view['title']); + $pdf->SetFont('Arial', 'B', 9); + $pdf->Text($dndata_left, $dndata_top + 6, $shop->view['lnr']); + $pdf->SetFont('Arial', '', 9); + + $pdf->Text($rdata_left + 100, $dndata_top, __("Kunden-Nr", "wpsg")); + $pdf->Text($rdata_left + 100, $dndata_top + 6, (($shop->view['customer']['knr'] != '')?$shop->view['customer']['knr']:$shop->view['customer']['id'])); + + $pdf->Text($rdata_left + 125, $dndata_top, __("Best. Nr.", "wpsg")); + $pdf->Text($rdata_left + 125, $dndata_top + 6, ((trim($shop->view['order']['onr']) != '')?$shop->view['order']['onr']:$shop->view['order']['id'])); + + $pdf->Text($rdata_left + 145, $dndata_top, __("Bestelldatum", "wpsg")); + $pdf->Text($rdata_left + 145, $dndata_top + 6, wpsg_formatTimestamp(strtotime($shop->view['order']['cdate']), true)); + + $pdf->Text($rdata_left + 170, $dndata_top, __("Lieferdatum", "wpsg")); + $pdf->Text($rdata_left + 170, $dndata_top + 6, wpsg_formatTimestamp($shop->view['lDatum'], true)); + + if ($shop->view['oOrder']->isInnerEu()) + { + + $pdf->SetFont('Arial', '', 9); + $pdf->Text($adress_left, $rdata_top + 11.5, __("Innergemeinschaftliche Lieferung.", "wpsg")); + + } else if (!$shop->view['oOrder']->isInnerEu() && $shop->view['oOrder']->getShippingCountryID() != $shop->getDefaultCountry(true)) { + + // Nicht InnerEU und Nicht Inland + + $pdf->SetFont('Arial', '', 9); + $pdf->Text($adress_left, $rdata_top + 11.5, __("Steuerfreie Ausfuhrlieferung.", "wpsg")); + + } + + + // Benutzerdefinierte Felder + $arTexte = $shop->callMod('wpsg_mod_anschreiben', 'getTexte', array($shop->view['data']['id'])); + + foreach ((array)$arTexte as $text) + { + + if (isset($text['aktiv']) && $text['aktiv'] == 1) + { + + $pdf->SetFont('Arial', 'B', ((intval($text['fontsize']) > 0)?intval($text['fontsize']):10)); + $pdf->wpsg_SetTextColor($text['color']); + $pdf->wpsg_MultiCell($text['x'], $text['y'], 5, $text['text']); + $pdf->wpsg_SetTextColor("#000000"); + + } + + } + + } + + } + + // Positionierung der Absenderadresszeile + $absender_left = 25; + $absender_top = 50; + + // Positionierung der Zieladress + $adress_left = 25; + $adress_top = 55; + + // Positionierund des Lieferscheinkopfes + $dndata_left = 25; + $dndata_top = 90; + + // Positionierung der Produktdaten + $prod_left = 25; + $prod_top = 105; + + // Anzahl an Produkten pro Seite + $prod_break = 10; + + $pdf = new wpsg_fpdf(); + $pdf->SetAutoPageBreak(true, 5); + AddanschreibenPage($this, $pdf); + + $filename = $this->view['filename'].".pdf"; + + + $offset += 5; + + if ($this->view['fussText'] != "") + { + + $pdf->wpsg_MultiCell($prod_left - 1, $prod_top + $offset, 5, $this->view['fussText']); + $pdf->SetFont('Arial', 'B', 9); + $offset += 10; + + } + + ob_end_clean(); + + if ($this->view['preview']) + { + $pdf->Output($this->view['filename'], 'I'); + } + else + { + + $pdf->Output($this->callMod('wpsg_mod_anschreiben', 'getFilePath', array($this->view['order']['id'])).$this->view['filename'], 'F'); + + if ($this->view['output'] === true) $pdf->Output($filename, 'I'); + + } + +?> \ No newline at end of file diff --git a/views/mods/mod_anschreiben/order_view.phtml b/views/mods/mod_anschreiben/order_view.phtml new file mode 100644 index 0000000..ddf4afc --- /dev/null +++ b/views/mods/mod_anschreiben/order_view.phtml @@ -0,0 +1,113 @@ + +view) ?> + + + view['mod_anschreiben']['aranschreiben']) == 0 ) { ?> + +

+ + + + view['mod_anschreiben']['aranschreiben_gesamt'] as $a) { ?> + + + + + +
# + + + + + + + + callMod('wpsg_mod_anschreiben', 'getFilePath', array($this->view['data']['id'], true)).'A'.$r['anr'].'.pdf'; + + } ?> + +
+ + +
+ +
+ +
+ +
+
+ +
+ + + + + + :

+ + +
+ +
+ + " style="float:right;" /> + +
+ +
+ +
+
+ + \ No newline at end of file diff --git a/views/mods/mod_anschreiben/settings_edit.phtml b/views/mods/mod_anschreiben/settings_edit.phtml new file mode 100644 index 0000000..b87e52e --- /dev/null +++ b/views/mods/mod_anschreiben/settings_edit.phtml @@ -0,0 +1,212 @@ + + +
+ +
+
+ + +
+ view['wpsg_mod_anschreiben']['bp'] === false) { ?> +

+ + + + + + view['wpsg_mod_anschreiben']['bp'] !== false) { $strSuffix = ' + '; + echo __($strSuffix); + } ?> +
+ true, 'helps' => 'wpsg_mod_anschreiben_bp')); ?> + +
+ + +
+ view['wpsg_mod_anschreiben']['logo'] === false) { ?> +

+ + + + + + get_option("wpsg_mod_anschreiben_logo_position"); ?> + + + + + + + get_option("wpsg_mod_anschreiben_logo_transparency") ?: "0%"; ?> + + view['logo'] !== false) { $strSuffix = ' +
+
+
+ + + +
+
+
+ +
+
+ +
+
'; + echo __($strSuffix); + } ?> + + + + +
+ true, 'helps' => 'wpsg_mod_anschreiben_logo')); ?> + +

+ + + + + + + + + + + + + + + view['wpsg_mod_anschreiben']['fields'] as $f => $field_name) { ?> + + + + + + + + + + + +
+ + + + + + + + + + + view['wpsg_mod_anschreiben']['arTexte'][$f]['aktiv']))?'checked="checked"':''); ?> /> +
+ + + +

+ +
+

+
+ +

+
+ +
+ +
+
+
+ + \ No newline at end of file -- cgit v1.2.3