From 83d45bfa57a8ad478b85964e01b45d5da92dc4a3 Mon Sep 17 00:00:00 2001 From: Daniel Schmitzer Date: Wed, 16 Jan 2019 05:05:05 +0000 Subject: - BETA git-svn-id: https://[internal]/wordpress/plugins/wpsg4@7258 0d5edaf7-2b12-4e95-93f4-047927463d4b --- views/admin/form/textarea.phtml | 10 +- views/mods/mod_anschreiben/anschreiben_pdf.phtml | 199 --------------------- views/mods/mod_anschreiben/order_view.phtml | 113 ------------ views/mods/mod_anschreiben/settings_edit.phtml | 212 ---------------------- views/mods/mod_coverletter/coverletter_pdf.phtml | 147 ++++++++++++++++ views/mods/mod_coverletter/order_view.phtml | 91 ++++++++++ views/mods/mod_coverletter/settings_edit.phtml | 213 +++++++++++++++++++++++ 7 files changed, 460 insertions(+), 525 deletions(-) delete mode 100644 views/mods/mod_anschreiben/anschreiben_pdf.phtml delete mode 100644 views/mods/mod_anschreiben/order_view.phtml delete mode 100644 views/mods/mod_anschreiben/settings_edit.phtml create mode 100644 views/mods/mod_coverletter/coverletter_pdf.phtml create mode 100644 views/mods/mod_coverletter/order_view.phtml create mode 100644 views/mods/mod_coverletter/settings_edit.phtml diff --git a/views/admin/form/textarea.phtml b/views/admin/form/textarea.phtml index f6459bb..1ef22a0 100644 --- a/views/admin/form/textarea.phtml +++ b/views/admin/form/textarea.phtml @@ -1,5 +1,13 @@
- + + view['field_config']['fullLabel'])) { ?> + +
+ + + + + view['field_config']['noLabel']) || $this->view['field_config']['noLabel'] != true) { ?> diff --git a/views/mods/mod_anschreiben/anschreiben_pdf.phtml b/views/mods/mod_anschreiben/anschreiben_pdf.phtml deleted file mode 100644 index 714b53c..0000000 --- a/views/mods/mod_anschreiben/anschreiben_pdf.phtml +++ /dev/null @@ -1,199 +0,0 @@ -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 deleted file mode 100644 index ddf4afc..0000000 --- a/views/mods/mod_anschreiben/order_view.phtml +++ /dev/null @@ -1,113 +0,0 @@ - -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 deleted file mode 100644 index b87e52e..0000000 --- a/views/mods/mod_anschreiben/settings_edit.phtml +++ /dev/null @@ -1,212 +0,0 @@ - - -
- -
-
- - -
- 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 diff --git a/views/mods/mod_coverletter/coverletter_pdf.phtml b/views/mods/mod_coverletter/coverletter_pdf.phtml new file mode 100644 index 0000000..69ab94f --- /dev/null +++ b/views/mods/mod_coverletter/coverletter_pdf.phtml @@ -0,0 +1,147 @@ +AddPage(); + + if (file_exists($shop->callMod('wpsg_mod_coverletter', 'getFilePath', array(''))."wpsg_coverletter_bp.pdf")) { + + $pdf->setSourceFile($shop->callMod('wpsg_mod_coverletter', 'getFilePath', array(''))."wpsg_coverletter_bp.pdf"); + $tplidx = $pdf->importPage(1, '/MediaBox'); + $pdf->useTemplate($tplidx, 0, 0, 210); + + } else if (file_exists($shop->callMod('wpsg_mod_coverletter', 'getFilePath', array(''))."wpsg_coverletter_bp.jpg")) { + + $pdf->image($shop->callMod('wpsg_mod_coverletter', 'getFilePath', array(''))."wpsg_coverletter_bp.jpg", 0, 0, 210, 297, 'jpg'); + + } + + if (file_exists($shop->callMod('wpsg_mod_coverletter', 'getFilePath', array(''))."wpsg_coverletter_logo.jpg")) { + + list($width, $height, $type, $attr) = getimagesize($shop->callMod('wpsg_mod_coverletter', 'getFilePath', array(''))."wpsg_coverletter_logo.jpg"); + + // Umrechnung von Inch zu Pixel + $wPix = (25.4 * $width) / 96; + $hPix = (25.4 * $height) / 96; + + $transparency = str_replace("%", "", $shop->get_option('wpsg_mod_coverletter_logo_transparency')); + if($transparency !== "100") $transparency = str_replace(array("0", "00"), "", $transparency); + + $alpha = 1; + if (wpsg_isSizedString($transparency) && $transparency !== "100") $alpha = "0.$transparency"; + if (wpsg_isSizedString($transparency) && $transparency === "100") $alpha = $transparency; + + $logo_pos = $shop->get_option('wpsg_mod_coverletter_logo_position'); + + if(isset($logo_pos) && $logo_pos === "left") { $abscissa = 0; } + if(isset($logo_pos) && $logo_pos === "center") { $abscissa = 105 - ($wPix / 2); } + if(isset($logo_pos) && $logo_pos === "right") { $abscissa = 210 - $wPix; } + + $pdf->SetAlpha($alpha); + $pdf->image($shop->callMod('wpsg_mod_coverletter', 'getFilePath', array(''))."wpsg_coverletter_logo.jpg", $abscissa, 0, $wPix, $hPix); + $pdf->SetAlpha(1); + + } + + // Adresse des Kunden + $pdf->SetFont('Arial', '', 12); + $pdf->Text($adress_left, $adress_top, $shop->view['data']['company']); + $pdf->Text($adress_left, $adress_top + 5, $shop->view['data']['firstname'].' '.$shop->view['data']['name']); + $pdf->Text($adress_left, $adress_top + 10, $shop->view['data']['street'].' '.$shop->view['data']['hnr']); + $pdf->Text($adress_left, $adress_top + 15, $shop->view['data']['zip'].' '.$shop->view['data']['city']); + $pdf->Text($adress_left, $adress_top + 20, $shop->view['data']['country']); + + // 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['clnr']); + $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, __("Datum", "wpsg")); + $pdf->Text($rdata_left + 170, $dndata_top + 6, wpsg_formatTimestamp(time(), true)); + + foreach ($shop->view['arTexts'] 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"); + + } + + } + + // Text + $pdf->setFont('Arial', '', 10); + $pdf->wpsg_MultiCell($dndata_left - 1, $dndata_top + 12, 4, $shop->view['text']); + + } + + } + + // 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); + addCoverLetterPage($this, $pdf); + + $offset += 5; + + ob_end_clean(); + + if ($this->view['preview']) { + + $pdf->Output($this->view['filename'], 'I'); + + } else { + + $pdf->Output($this->view['filename'], 'F'); + + if ($this->view['output'] === true) $pdf->Output($this->view['filename'], 'I'); + + } + \ No newline at end of file diff --git a/views/mods/mod_coverletter/order_view.phtml b/views/mods/mod_coverletter/order_view.phtml new file mode 100644 index 0000000..6804fdb --- /dev/null +++ b/views/mods/mod_coverletter/order_view.phtml @@ -0,0 +1,91 @@ + + + + + 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'; + + } ?> + +
+ + +
+ +
+ +
+ +
+
+ +
+ + getShopLocations(); ?> + $l) $arShopLocationLabels[$l_id] = $l['label']; ?> + + 1) { ?> + + + + + + + + + + true, 'fullLabel' => __('Text für das Anschreiben', 'wpsg'), 'style' => 'height:200px']); ?> + +
+ + " style="float:left;" class="button button-primary" /> + +
+ +
+ +
+
+ + + + diff --git a/views/mods/mod_coverletter/settings_edit.phtml b/views/mods/mod_coverletter/settings_edit.phtml new file mode 100644 index 0000000..57ef23c --- /dev/null +++ b/views/mods/mod_coverletter/settings_edit.phtml @@ -0,0 +1,213 @@ + + +
+ +
+
+ + +
+ view['wpsg_mod_coverletter']['bp'] === false) { ?> +

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

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

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

+ +
+

+
+ +

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