summaryrefslogtreecommitdiff
path: root/views/mods/mod_deliverynote
diff options
context:
space:
mode:
authorDaniel Schmitzer <noreply@maennchen1.de>2016-01-14 14:55:36 +0000
committerDaniel Schmitzer <noreply@maennchen1.de>2016-01-14 14:55:36 +0000
commitad405c7045c6e242080ec9d3ce4c9e586b517c4f (patch)
treeb41905f4d27f3eaaabd5bad3a39f8d3873540b46 /views/mods/mod_deliverynote
- Testweise 4
git-svn-id: https://[internal]/wordpress/plugins/wpsg4@5261 0d5edaf7-2b12-4e95-93f4-047927463d4b
Diffstat (limited to 'views/mods/mod_deliverynote')
-rw-r--r--views/mods/mod_deliverynote/deliverymail.phtml19
-rw-r--r--views/mods/mod_deliverynote/deliverymail_html.phtml21
-rw-r--r--views/mods/mod_deliverynote/deliverynote_pdf.phtml340
-rw-r--r--views/mods/mod_deliverynote/foottext_list.phtml61
-rw-r--r--views/mods/mod_deliverynote/order_view_content.phtml150
-rw-r--r--views/mods/mod_deliverynote/order_view_row.phtml15
-rw-r--r--views/mods/mod_deliverynote/settings_edit.phtml209
7 files changed, 815 insertions, 0 deletions
diff --git a/views/mods/mod_deliverynote/deliverymail.phtml b/views/mods/mod_deliverynote/deliverymail.phtml
new file mode 100644
index 0000000..b3e1132
--- /dev/null
+++ b/views/mods/mod_deliverynote/deliverymail.phtml
@@ -0,0 +1,19 @@
+<?php
+
+ /**
+ * Template für die Mail an den Kunden
+ */
+
+?><?php echo __("Hallo", "wpsg"); ?> <?php echo $this->view['customer']['vname']; ?> <?php echo $this->view['customer']['name']; ?>,
+
+<?php echo wpsg_translate(__("Sie erhalten hiermit den Lieferschein mit der Nummer #1# für folgende Produkte.", "wpsg"), $this->view['dn']->lnr); ?>
+
+<?php foreach ($this->view['dn']->getProducts() as $p) { ?>
+- <?php echo $p['name']; ?>
+<?php } ?>
+
+<?php echo wpsg_translate(__('Das Lieferdatum ist der #1#', 'wpsg'), wpsg_formatTimestamp($this->view['dn']->getDeliveryTimestamp(), true)); ?>
+
+<?php echo __("Mit freundlichen Grüßen", "wpsg"); ?>
+
+<?php echo __($this->get_option('wpsg_shopdata_name'), 'wpsg'); ?> - <?php echo __('Team', 'wpsg'); ?> \ No newline at end of file
diff --git a/views/mods/mod_deliverynote/deliverymail_html.phtml b/views/mods/mod_deliverynote/deliverymail_html.phtml
new file mode 100644
index 0000000..99573f8
--- /dev/null
+++ b/views/mods/mod_deliverynote/deliverymail_html.phtml
@@ -0,0 +1,21 @@
+<?php
+
+ /**
+ * Template für die Mail an den Kunden (HTML)
+ */
+
+?><p><?php echo __("Hallo", "wpsg"); ?> <?php echo $this->view['customer']['vname']; ?> <?php echo $this->view['customer']['name']; ?>,</p>
+
+<p><?php echo wpsg_translate(__("Sie erhalten hiermit den Lieferschein mit der Nummer #1# für folgende Produkte.", "wpsg"), $this->view['dn']->lnr); ?></p>
+
+<ul>
+<?php foreach ($this->view['dn']->getProducts() as $p) { ?>
+<li><?php echo $p['name']; ?></li>
+<?php } ?>
+</ul>
+
+<p><?php echo wpsg_translate(__('Das Lieferdatum ist der #1#', 'wpsg'), wpsg_formatTimestamp($this->view['dn']->getDeliveryTimestamp(), true)); ?></p>
+
+<p><?php echo __("Mit freundlichen Grüßen", "wpsg"); ?></p>
+
+<p><?php echo __($this->get_option('wpsg_shopdata_name'), 'wpsg'); ?> - <?php echo __('Team', 'wpsg'); ?></p> \ No newline at end of file
diff --git a/views/mods/mod_deliverynote/deliverynote_pdf.phtml b/views/mods/mod_deliverynote/deliverynote_pdf.phtml
new file mode 100644
index 0000000..17a613f
--- /dev/null
+++ b/views/mods/mod_deliverynote/deliverynote_pdf.phtml
@@ -0,0 +1,340 @@
+<?php
+
+ /**
+ * FPDF Template für die Generierung des Lieferscheins
+ */
+
+ require_once WPSG_PATH_LIB.'fpdf/fpdf.php';
+ require_once WPSG_PATH_LIB.'fpdf/fpdi.php';
+ require_once WPSG_PATH_LIB.'wpsg_fpdf.class.php';
+
+ global $absender_left, $absender_top, $adress_left, $adress_top, $dndata_left, $dndata_top;
+
+ if (!function_exists('AddDeliverynotePage'))
+ {
+
+ function AddDeliverynotePage($shop, $pdf)
+ {
+
+ global $absender_left, $absender_top, $adress_left, $adress_top, $dndata_left, $dndata_top;
+
+ $pdf->AddPage();
+
+ if (file_exists($shop->callMod('wpsg_mod_deliverynote', getFilePath, array(''))."wpsg_deliverynote_bp.pdf"))
+ {
+
+ $pagecount = $pdf->setSourceFile($shop->callMod('wpsg_mod_deliverynote', getFilePath, array(''))."wpsg_deliverynote_bp.pdf");
+ $tplidx = $pdf->importPage(1, '/MediaBox');
+ $pdf->useTemplate($tplidx, 0, 0, 210);
+
+ }
+ else if (file_exists($shop->callMod('wpsg_mod_deliverynote', getFilePath, array(''))."wpsg_deliverynote_bp.jpg"))
+ {
+
+ $pdf->image($shop->callMod('wpsg_mod_deliverynote', getFilePath, array(''))."wpsg_deliverynote_bp.jpg", 0, 0, 210, 297, 'jpg');
+
+ }
+
+
+ if (file_exists($shop->callMod('wpsg_mod_deliverynote', getFilePath, array(''))."wpsg_deliverynote_logo.jpg"))
+ {
+
+ list($width, $height, $type, $attr) = getimagesize($shop->callMod('wpsg_mod_deliverynote', getFilePath, array(''))."wpsg_deliverynote_logo.jpg");
+
+ $wPix = (25.4 * $width) / 96;
+ $hPix = (25.4 * $height) / 96;
+
+ $pdf->image($shop->callMod('wpsg_mod_deliverynote', getFilePath, array(''))."wpsg_deliverynote_logo.jpg", 210 - $wPix, 0, $wPix, $hPix);
+
+ }
+
+ // Absenderadresszeile (Wird in der Konfiguration hinterlegt)
+ $pdf->SetFont('Arial', '', 6);
+ $pdf->Text($absender_left, $absender_top, $shop->replaceUniversalPlatzhalter($shop->get_option("wpsg_mod_deliverynote_adressrow"), $shop->view['order']['id']));
+
+ if ($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_deliverynote_hideCountry') != '1') $pdf->Text($adress_left, $adress_top + 20, strtoupper($shop->view['oOrder']->getShippingCountryName()));
+
+ // Lieferscheindaten
+ $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, $dndata_top + 11.5, __("Innergemeinschaftliche Lieferung.", "wpsg"));
+
+ }
+
+ // Benutzerdefinierte Felder
+ $arTexte = $shop->callMod('wpsg_mod_deliverynote', '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->SetTextColor($text['color']);
+ $pdf->MultiCell($text['x'], $text['y'], 5, utf8_encode($text['text']));
+ $pdf->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);
+ AddDeliverynotePage($this, $pdf);
+
+ $filename = $this->view['filename'].".pdf";
+
+ $bKopf = false; $pnr = 1; $offset = 0; $count = 0;
+ foreach ($this->view['data']['products'] as $p)
+ {
+
+ $product_data = $this->loadProduktArray($this->getProduktID($p['p_id']));
+
+ if (!$bKopf)
+ {
+
+ $pdf->SetFont('Arial', 'B', 9);
+ $pdf->setXY($prod_left, $prod_top);
+ $pdf->Cell(10, 8, __("Nr.", "wpsg"), 1, 0, 'C');
+
+ $pdf->setXY($prod_left + 10, $prod_top);
+ $pdf->Cell(137, 8, "Name", 1, 0, 'L');
+
+ $pdf->setXY($prod_left + 147, $prod_top);
+ $pdf->Cell(15, 8, __("Menge", "wpsg"), 1, 0, 'C');
+
+ $offset = 8;
+ $bKopf = true;
+
+ }
+
+ /*
+ if ($this->hasMod('wpsg_mod_varianten') && isset($p['mod_vp_varkey']))
+ {
+
+ $variante = $this->callMod('wpsg_mod_varianten', 'getVariantenInfoArray', array($p['mod_vp_varkey']));
+ $anr = $variante['akey'];
+
+ }
+ else
+ {
+
+ $anr = $product_data['anr'];
+
+ }*/
+
+ $pdf->SetFont('Arial', '', 9);
+ $pdf->setXY($prod_left, $prod_top + $offset);
+
+ if ($this->get_option('wpsg_mod_deliverynote_anr') === '1')
+ {
+
+ $anr = $this->getProductAnr($p['productkey']);
+ $pdf->Cell(10, 8, $anr, 0, 0, 'C'); /* Artikelnummer anzeigen */
+
+ }
+ else
+ {
+
+ $pdf->Cell(10, 8, $pnr.".", 0, 0, 'C');
+
+ }
+
+ $produkt_text = $this->getProductName($this->getProduktID($p['p_id']), true);
+ $produktBeschreibung = trim(strip_tags($p['beschreibung']));
+
+ if ($this->isOtherLang())
+ {
+
+ $trans_db = $this->db->fetchRow("SELECT * FROM `".WPSG_TBL_PRODUCTS."` WHERE `lang_parent` = '".wpsg_q($this->getProduktID($p['productkey']))."' AND `lang_locale` = '".wpsg_q(get_locale())."'");
+
+ if (is_array($trans_db) && sizeof($trans_db) > 0)
+ {
+
+ $produkt_text = $trans_db['name'];
+ $produktBeschreibung = trim(strip_tags($trans_db['beschreibung']));
+
+ }
+
+ }
+
+ $height = 0; // Höhe der Zeile für den Rahmen
+
+ $pdf->setXY($prod_left + 10, $prod_top + $offset);
+
+ // Produktvariablen
+ if ($this->hasMod('wpsg_mod_productvars') && $this->get_option("wpsg_mod_rechnungen_showpv") == "1")
+ {
+
+ $arPV = $this->callMod('wpsg_mod_productvars', 'getAllProductVarValues', array($this->view['data']['id'], $p['productkey']));
+
+ if (wpsg_isSizedArray($arPV))
+ {
+
+ foreach ($arPV as $pv)
+ {
+
+ $produkt_text .= "\r\n".$pv['name'].': '.$pv['value'];
+ $height += 5;
+
+ }
+
+ }
+
+ }
+
+ if ($this->get_option('wpsg_mod_deliverynote_anr') === '2')
+ {
+
+ $anr = $this->getProductAnr($p['productkey']);
+ $produkt_text .= "\r\n".wpsg_translate(__('Artikelnummer: #1#', 'wpsg'), $anr);
+
+ }
+
+ $produkt_text_cell_width = 137;
+ $produkt_text_width = $pdf->GetStringWidth($produkt_text);
+
+ $height += 5 * ceil($produkt_text_width / $produkt_text_cell_width) + 3;
+
+ $height_y = $pdf->getY();
+ $height = 2 + $pdf->MultiCell($prod_left + 10, $prod_top + $offset + 1.5, 5, utf8_encode($produkt_text), 0, 'L', 0, $produkt_text_cell_width);
+
+ $pdf->setXY($prod_left + 147, $prod_top + $offset);
+ $pdf->Cell(15, 8, $p['menge'], 0, 0, 'C');
+
+ /**
+ * Produktbeschreibung anzeigen Ja/Nein
+ */
+ $pBeschreibungHeight = 0;
+ if ($this->get_option("wpsg_mod_deliverynote_pdf_beschreibung") == "1" && trim(strip_tags($p['beschreibung'])) != '')
+ {
+
+ $produktBeschreibung = nl2br($produktBeschreibung);
+ preg_match_all('/\<br \/\>/', $produktBeschreibung, $treffer);
+ $produktBeschreibung = strip_tags($produktBeschreibung);
+
+ $pBeschreibungWidth = $pdf->getStringWidth($produktBeschreibung);
+ $pBeschreibungHeight = 5 * (ceil($pBeschreibungWidth / $produkt_text_cell_width) + @sizeof($treffer[0]));
+
+ $pdf->SetFont('Arial', 'I', 9);
+
+ $cellY = $pdf->getY();
+ $pdf->MultiCell($prod_left + 10, $prod_top + $height + $offset - 1, 5, utf8_encode($produktBeschreibung), 0, 'L', 0, $produkt_text_cell_width);
+ $pBeschreibungHeight = $pdf->getY() - $cellY - $height + 1;
+ $pdf->SetFont('Arial', '', 9);
+
+ }
+
+ $height += $pBeschreibungHeight;
+
+ /**
+ * Variante ?
+ */
+ if ($this->get_option("wpsg_mod_deliverynote_pdf_varianten") == "1" && preg_match('/vp_(.*)/', $p['productkey']))
+ {
+
+ $variInfo = $this->callMod('wpsg_mod_varianten', 'getVariantenInfoArray', array($p['productkey']));
+
+ $height += $pdf->MultiCell($prod_left + 10, $prod_top + $height + $offset - 1.5, 5, utf8_encode(wpsg_translate(__('Variante: #1#', 'wpsg'), $variInfo['key'])), 0, 'L', 0, $produkt_text_cell_width);
+
+ }
+
+ // Jetzt die Rahmen zeichnen
+ $pdf->Rect($prod_left, $prod_top + $offset, 10, $height);
+ $pdf->Rect($prod_left + 10, $prod_top + $offset, 137, $height);
+ $pdf->Rect($prod_left + 147, $prod_top + $offset, 15, $height);
+
+ $offset += $height;
+
+ $pnr ++;
+ $count ++;
+
+ $summe += $p['price'] * $p['menge'];
+
+ if ($pdf->getY() > 220 || ($count >= $prod_break && sizeof($this->view['data']['products']) > ($pnr - 1)))
+ {
+
+ AddDeliverynotePage($this, $pdf);
+ $bKopf = false; $offset = 0; $count = 0;
+
+ }
+
+ }
+
+ $offset += 5;
+
+ if ($this->view['fussText'] != "")
+ {
+
+ $pdf->MultiCell($prod_left - 1, $prod_top + $offset, 5, utf8_encode($this->view['fussText']));
+ $pdf->SetFont('Arial', 'B', 9);
+ $offset += 10;
+
+ }
+
+ if ($this->view['preview'])
+ {
+ $pdf->Output($this->view['filename'], 'I');
+ }
+ else
+ {
+
+ $pdf->Output($this->callMod('wpsg_mod_deliverynote', '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_deliverynote/foottext_list.phtml b/views/mods/mod_deliverynote/foottext_list.phtml
new file mode 100644
index 0000000..8845aab
--- /dev/null
+++ b/views/mods/mod_deliverynote/foottext_list.phtml
@@ -0,0 +1,61 @@
+<?php
+
+ /**
+ * Template für die Liste der Fußtexte
+ */
+
+?>
+<?php if (sizeof($this->view['wpsg_mod_deliverynote']['data']) <= 0) { ?>
+<p><?php echo __('Bisher keine Fußtexte angelegt!', 'wpsg'); ?></p>
+<?php } else { ?>
+<table class="wpsg_foottextlist">
+ <tr>
+ <th class="col_kuerzel"><?php echo __('Kürzel', 'wpsg'); ?></th>
+ <th class="col_text"><?php echo __('Text', 'wpsg'); ?></th>
+ <th class="col_standard"><?php echo __('Standard', 'wpsg'); ?></th>
+ <th class="col_aktion"></th>
+ </tr>
+ <?php foreach ((array)$this->view['wpsg_mod_deliverynote']['data'] as $key => $d) { ?>
+ <tr>
+ <td class="col_kuerzel wpsg_editable" id="wpsg_foottext_0_<?php echo $key; ?>"><?php echo wpsg_hspc($d[0]); ?></td>
+ <td class="col_text wpsg_editable" id="wpsg_foottext_1_<?php echo $key; ?>"><?php echo wpsg_hspc($d[1]); ?></td>
+ <td class="col_standard"><input type="radio" value="<?php echo $key; ?>" <?php echo (($this->get_option('wpsg_mod_deliverynote_foottext_standard') == $key)?'checked="checked"':''); ?> class="wpsg_mod_deliverynote_foottext_standard" name="wpsg_mod_deliverynote_foottext_standard" /></td>
+ <td class="col_aktion">
+
+ <a onclick="return wpsg_removeFooter(<?php echo $key; ?>);" title="<?php echo __('Fußtext löschen', 'wpsg'); ?>'" href="#" class="wpsg_icon wpsg_icon_center wpsg_icon_remove"></a>
+
+ <script type="text/javascript">
+
+ jQuery(document).ready(function() {
+
+ jQuery('#wpsg_foottext_0_<?php echo $key; ?>').editable('<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_deliverynote&do=inlineEdit&noheader=1', {
+ submitdata: {
+ field: '0',
+ field_id: '<?php echo $key; ?>'
+ },
+ submit: '<?php echo __('Speichern', 'wpsg'); ?>',
+ placeholder: '<?php echo __('Zum Bearbeiten anklicken ...', 'wpsg'); ?>',
+ indicator: '<?php echo __('Speicher ...', 'wpsg'); ?>',
+ tooltip: '<?php echo __('Zum Bearbeiten anklicken ...', 'wpsg'); ?>'
+ });
+
+ jQuery('#wpsg_foottext_1_<?php echo $key; ?>').editable('<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_deliverynote&do=inlineEdit&noheader=1', {
+ submitdata: {
+ field: '1',
+ field_id: '<?php echo $key; ?>'
+ },
+ submit: '<?php echo __('Speichern', 'wpsg'); ?>',
+ placeholder: '<?php echo __('Zum Bearbeiten anklicken ...', 'wpsg'); ?>',
+ indicator: '<?php echo __('Speicher ...', 'wpsg'); ?>',
+ tooltip: '<?php echo __('Zum Bearbeiten anklicken ...', 'wpsg'); ?>'
+ });
+
+ } );
+
+ </script>
+
+ </td>
+ </tr>
+ <?php } ?>
+</table>
+<?php } ?> \ No newline at end of file
diff --git a/views/mods/mod_deliverynote/order_view_content.phtml b/views/mods/mod_deliverynote/order_view_content.phtml
new file mode 100644
index 0000000..0811d5c
--- /dev/null
+++ b/views/mods/mod_deliverynote/order_view_content.phtml
@@ -0,0 +1,150 @@
+<?php
+
+ /**
+ * Template für die Integration des Lieferscheins in die Bestellverwaltung
+ */
+
+?>
+<div class="postbox" id="wpsg_deliverynote">
+ <h3 class="wpsg_handlediv">
+ <span title="<?php echo __('Zum Ein/Ausklappen hier klicken', 'wpsg'); ?>" class="handlediv"><br /></span>
+ <span><?php echo __('Lieferschein', 'wpsg'); ?></span>
+ </h3>
+ <div class="inside">
+
+ <?php if (!wpsg_isSizedArray($this->view['wpsg_mod_deliverynote']['arDeliverynotes'])) { ?>
+ <p><?php echo __('Bisher wurden zu dieser Bestellung keine Lieferscheine erstellt.', 'wpsg'); ?></p>
+ <?php } else { ?>
+
+ <?php foreach ($this->view['wpsg_mod_deliverynote']['arDeliverynotes'] as $k => $v) { ?>
+ <?php echo wpsg_translate(__('##1# Lieferschein geschrieben am #2# (Lieferdatum: #3#)', 'wpsg'),
+ $v->lnr,
+ wpsg_formatTimestamp(strtotime($v->cdate), true),
+ wpsg_formatTimestamp($v->getDeliveryTimestamp(), true)
+ ); ?> <a target="_blank" href="<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Order&action=ajax&noheader=1&mod=wpsg_mod_deliverynote&do=get&edit_id=<?php echo $this->view['data']['id']; ?>&dn_id=<?php echo $v->id; ?>"><?php echo __('Ansehen', 'wpsg'); ?></a><br />
+ <?php } ?><br />
+
+ <?php } ?>
+
+ <?php if (wpsg_isSizedArray($this->view['wpsg_mod_deliverynote']['arNoDeliveredProducts'])) { ?>
+ <fieldset style="border:1px solid #999999; width:100%;">
+ <legend style="margin-left:10px; margin-right:10px;"><?php echo __('Neuer Lieferschein', 'wpsg'); ?></legend>
+
+ <form target="_blank" method="post" action="<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Order&action=ajax&mod=wpsg_mod_deliverynote&cmd=deliverynote&noheader=1&edit_id=<?php echo $this->view['data']['id']; ?>">
+
+ <div style="padding:5px;">
+
+ <label style="height:25px; width:240px; float:left; margin-top:10px;">
+ <input onchange="if (this.checked) jQuery('#wpsg_mod_deliverynote_email').show(); else jQuery('#wpsg_mod_deliverynote_email').hide();" type="checkbox" checked="checked" value="1" name="wpsg_mod_deliverynote_showmail" />
+ &nbsp;<?php echo __("E-Mail an Kunden senden.", "wpsg"); ?>
+ </label>
+ <input type="text" style="display:block; width:300px; float:right;" id="wpsg_mod_deliverynote_email" name="wpsg_mod_deliverynote_email" value="<?php echo wpsg_hspc($this->view['data']['email']); ?>" />
+ <div style="clear:both; width:100%; height:5px;"></div>
+
+ <label style="height:25px; width:220px; float:left;">
+ <input checked="checked" onchange="if (this.checked) jQuery('#wpsg_mod_deliverynote_status').show(); else jQuery('#wpsg_mod_deliverynote_status').hide();" type="checkbox" value="1" name="wpsg_mod_deliverynote_setstatus" />
+ &nbsp;<?php echo __("Neuer Status:", "wpsg"); ?>
+ </label>
+ <select style="width:300px; float:right;" id="wpsg_mod_deliverynote_status" name="wpsg_mod_deliverynote_status">
+ <?php foreach ($this->arStatus as $k => $v) { ?>
+ <option value="<?php echo $k; ?>" <?php echo (($k == 250)?'selected="selected"':''); ?>><?php echo $v; ?></option>
+ <?php } ?>
+ </select>
+ <div style="clear:both; width:100%; height:5px;"></div>
+
+ <label style="height:25px; width:240px; float:left;">
+ <input <?php echo (($this->get_option("wpsg_mod_deliverynote_url_standard") === "1")?'checked="checked"':''); ?> type="checkbox" value="1" name="wpsg_mod_deliverynote_noticeurl" />
+ &nbsp;<?php echo __("URL Benachrichtigung", "wpsg"); ?>
+ </label>
+ <div style="clear:both; width:100%; height:5px;"></div>
+
+ <label style="height:25px; width:240px; float:left; padding-left:22px;">
+ <?php echo __("Lieferdatum", "wpsg"); ?>:
+ </label>
+ <input style="display:block;float:right; width:300px;" type="text" name="wpsg_mod_deliverynote_date" value="<?php echo date("d.m.Y", time()); ?>" />
+ <div style="clear:both; width:100%; height:5px;"></div>
+
+ <label for="wpsg_mod_deliverynote_foottext" style="height:25px; width:220px; padding-left:22px; float:left">
+ <?php echo __("Fußtext", "wpsg"); ?>
+ </label>
+
+ <?php
+
+ $wpsg_mod_deliverynote_footer = $this->get_option("wpsg_mod_deliverynote_footer");
+ if (!is_array($wpsg_mod_deliverynote_footer)) $wpsg_mod_deliverynote_footer = unserialize($this->get_option("wpsg_mod_deliverynote_footer"));
+ if (!is_array($wpsg_mod_deliverynote_footer)) $wpsg_mod_deliverynote_footer = Array();
+
+ ?>
+
+ <?php if (sizeof($wpsg_mod_deliverynote_footer) > 0) { ?>
+ <select style="width:300px; float:right;" name="wpsg_mod_deliverynote_select" id="wpsg_mod_deliverynote_select" onchange="jQuery('#wpsg_mod_deliverynote_fusstext').val(this.value);">
+ <?php foreach ($wpsg_mod_deliverynote_footer as $k => $v) { ?>
+ <option <?php echo (($this->get_option('wpsg_mod_deliverynote_foottext_standard') == $k)?'selected="selected"':''); ?> value="<?php echo wpsg_hspc($v[1]); ?>"><?php echo wpsg_hspc($v[0]); ?></option>
+ <?php } ?>
+ </select>
+ <?php } ?>
+
+ <div style="clear:both; width:100%; height:5px;"></div>
+ <div style="padding-left:25px;"><input style="width:100%;" type="text" name="wpsg_mod_deliverynote_fusstext" id="wpsg_mod_deliverynote_fusstext" value="" /></div>
+ <div style="clear:both; width:100%; height:15px;"></div>
+
+ <script type="text/javascript">/* <![CDATA[ */
+
+ jQuery(document).ready(function() {
+ jQuery('#wpsg_mod_deliverynote_fusstext').val(jQuery("#wpsg_mod_deliverynote_select").val());
+ });
+
+ /* ]]> */</script>
+
+ <input type="hidden" id="wpsg_mod_deliverynote_productindexes" name="wpsg_mod_deliverynote_productindexes" />
+
+ <input class="button" style="float:right;" onclick="if (!wpsg_mod_deliverynote_checkProducts()) return false; window.setTimeout(function() { location.href = '<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Order&action=view&edit_id=<?php echo $this->view['data']['id']; ?>'; }, 1000);" name="wpsg_mod_deliverynote_write" type="submit" value="<?php echo __("Lieferschein erstellen", "wpsg"); ?>" />
+ <input class="button" style="float:right; margin-right:10px;" onclick="if (!wpsg_mod_deliverynote_checkProducts()) return false;" name="wpsg_mod_deliverynote_preview" type="submit" value="<?php echo __("Vorschau", "wpsg"); ?>" />
+
+ <div style="clear:both; width:100%; height:5px;"></div>
+
+ </div>
+
+ </form>
+
+ </fieldset>
+ <?php } ?>
+
+ </div>
+</div>
+
+<script type="text/javascript">/* <![CDATA[ */
+
+ /**
+ * Prüft ob Produkte für den Lieferschein ausgewählt wurden
+ */
+ function wpsg_mod_deliverynote_checkProducts()
+ {
+
+ if (jQuery('.wpsg_mod_deliverynote_product:checked').length <= 0)
+ {
+
+ alert('<?php echo __('Bitte mindestens ein Produkt für den Lieferschein wählen', 'wpsg'); ?>');
+ return false;
+
+ }
+ else
+ {
+
+ var arProductKeys = Array();
+
+ jQuery('.wpsg_mod_deliverynote_product:checked').each(function() {
+
+ arProductKeys.push(jQuery(this).val());
+
+ } );
+
+ jQuery('#wpsg_mod_deliverynote_productindexes').val(arProductKeys.join(','));
+
+ }
+
+ return true;
+
+ } // function wpsg_mod_deliverynote_checkProducts()
+
+/* ]]> */</script> \ No newline at end of file
diff --git a/views/mods/mod_deliverynote/order_view_row.phtml b/views/mods/mod_deliverynote/order_view_row.phtml
new file mode 100644
index 0000000..188349f
--- /dev/null
+++ b/views/mods/mod_deliverynote/order_view_row.phtml
@@ -0,0 +1,15 @@
+<?php
+
+ /**
+ * Template für die Produktauswahl innerhalb der Bestellansicht
+ */
+
+?>
+<tr class="wpsg_<?php echo (($this->view['wpsg_mod_deliverynote']['i'] == 0)?'odd':'even'); ?>">
+ <td align="left" colspan="<?php echo ((sizeof($this->view['basket']['mwst']) > 1 || $this->get_option('wpsg_showMwstAlways') == '1')?'5':'4'); ?>">
+ <label>
+ <input checked="checked" type="checkbox" class="wpsg_mod_deliverynote_product" name="wpsg_mod_deliverynote_products[]" value="<?php echo $this->view['wpsg_mod_deliverynote']['product']['product_index']; ?>" />
+ &nbsp;<?php echo __('In Lieferschein einbeziehen', 'wpsg'); ?>
+ </label>
+ </td>
+</tr> \ No newline at end of file
diff --git a/views/mods/mod_deliverynote/settings_edit.phtml b/views/mods/mod_deliverynote/settings_edit.phtml
new file mode 100644
index 0000000..a9a1bae
--- /dev/null
+++ b/views/mods/mod_deliverynote/settings_edit.phtml
@@ -0,0 +1,209 @@
+<?php
+
+ /**
+ * Template für die Einstellungen des "Lieferschein" Moduls
+ */
+
+?>
+<br />
+<div class="wpsg_admin_box" id="wpsg_tab">
+ <div class="head">
+ <div class="title">
+ <div class="tab" id="tab1"><?php echo __('Vordefinierte Textfelder', 'wpsg'); ?></div>
+ <div class="tab" id="tab2"><?php echo __('Fußzeile', 'wpsg'); ?></div>
+ <div class="tab" id="tab3"><?php echo __('Sonstiges', 'wpsg'); ?></div>
+ <div class="tabcontent tablink">
+ <a href="" title="<?php echo __('Neues Feld für die Fußzeile hinzufügen', 'wpsg'); ?>" class="wpsg_icon wpsg_icon_right wpsg_icon_add" onclick="return wpsg_addFooter();"></a>
+ </div>
+ <div class="wpsg_clear"></div>
+ </div>
+ </div>
+ <div class="content">
+ <div id="tabcontent1" class="tabcontent">
+
+ <?php echo wpsg_drawForm_Input('wpsg_mod_deliverynote_adressrow', __('Adresszeile', 'wpsg'), $this->get_option('wpsg_mod_deliverynote_adressrow')); ?>
+ <div class="wpsg_hinweis"><?php echo __('Diese Zeile wird klein oberhalb der Kundenadresse platziert', 'wpsg'); ?></div>
+ <br />
+
+ <div class="wpsg_form_field">
+ <div class="wpsg_form_left">
+ <label><?php echo __('Briefpapier (PDF/JPG)', 'wpsg'); ?>:</label><br />
+ <?php if ($this->view['wpsg_mod_deliverynote']['bp'] !== false) { ?>
+ <label>
+ <input type="checkbox" name="wpsg_mod_deliverynote_bp_del" value="1" />&nbsp;<?php echo __('Löschen', 'wpsg'); ?>
+ </label>
+ <?php } ?>
+ </div>
+ <div class="wpsg_form_right">
+ <?php if ($this->view['wpsg_mod_deliverynote']['bp'] === false) { ?>
+ <p><?php echo __('Es wurde bisher kein Briefpapier hochgeladen', 'wpsg'); ?></p>
+ <?php } else { ?>
+ <a href="<?php echo $this->view['wpsg_mod_deliverynote']['bp']; ?>" target="_blank"><?php echo __('Derzeitiges Briefpapier', 'wpsg'); ?></a>
+ <?php } ?>
+ <a style="float:right; position:relative;" class="wpsg_form_help" href="?page=wpsg-Admin&subaction=loadHelp&noheader=1&field=mod_deliverynote_bp" rel="?page=wpsg-Admin&subaction=loadHelp&noheader=1&field=mod_deliverynote_bp"></a>
+ <input type="file" name="wpsg_mod_deliverynote_bp">
+ </div>
+ <div class="wpsg_clear"></div>
+ </div>
+
+ <div class="wpsg_form_field">
+ <div class="wpsg_form_left">
+ <label><?php echo __('Logo (JPG)', 'wpsg'); ?>:</label><br />
+ <?php if ($this->view['wpsg_mod_deliverynote']['logo'] !== false) { ?>
+ <label>
+ <input type="checkbox" name="wpsg_mod_deliverynote_logo_del" value="1" />&nbsp;<?php echo __('Löschen', 'wpsg'); ?>
+ </label>
+ <?php } ?>
+ </div>
+ <div class="wpsg_form_right">
+ <?php if ($this->view['wpsg_mod_deliverynote']['logo'] === false) { ?>
+ <p><?php echo __('Es wurde bisher kein Logo hochgeladen', 'wpsg'); ?></p>
+ <?php } else { ?>
+ <a href="<?php echo $this->view['wpsg_mod_deliverynote']['logo']; ?>" target="_blank"><?php echo __('Derzeitiges Logo', 'wpsg'); ?></a>
+ <?php } ?>
+ <a style="float:right; position:relative;" class="wpsg_form_help" href="?page=wpsg-Admin&subaction=loadHelp&noheader=1&field=mod_deliverynote_logo" rel="?page=wpsg-Admin&subaction=loadHelp&noheader=1&field=mod_deliverynote_logo"></a>
+ <input type="file" name="wpsg_mod_deliverynote_logo">
+ </div>
+ <div class="wpsg_clear"></div>
+ </div>
+
+ <div class="wpsg_hinweis"><?php echo __('Das Briefpapier wird hinter die gesamte Seite gelegt, das Logo wird rechts oben auf jeder Seite platziert. (96 dpi)', 'wpsg'); ?></div>
+ <br />
+
+ <table class="wpsg_mod_deliverynote_fieldtable">
+ <tr>
+ <th class="col_bezeichnung"><?php echo __('Bezeichnung', 'wpsg'); ?></th>
+ <th class="col_freitext"><?php echo __('Freitext', 'wpsg'); ?></th>
+ <th class="col_x"><?php echo __('X', 'wpsg'); ?></th>
+ <th class="col_y"><?php echo __('Y', 'wpsg'); ?></th>
+ <th class="col_color"><?php echo __('Farbe', 'wpsg'); ?></th>
+ <th class="col_groesse"><?php echo __('Größe', 'wpsg'); ?></th>
+ <th class="col_action"></th>
+ </tr>
+ <?php foreach ($this->view['wpsg_mod_deliverynote']['fields'] as $f => $field_name) { ?>
+ <tr>
+ <td><?php echo wpsg_hspc($field_name); ?></td>
+ <td>
+ <input type="text" style="width:100%;" name="text[<?php echo $f; ?>][text]" value="<?php echo wpsg_hspc($this->view['wpsg_mod_deliverynote']['arTexte'][$f]['text']); ?>" />
+ </td>
+ <td>
+ <input type="text" style="width:100%;" name="text[<?php echo $f; ?>][x]" value="<?php echo wpsg_hspc($this->view['wpsg_mod_deliverynote']['arTexte'][$f]['x']); ?>" />
+ </td>
+ <td>
+ <input type="text" style="width:100%;" name="text[<?php echo $f; ?>][y]" value="<?php echo wpsg_hspc($this->view['wpsg_mod_deliverynote']['arTexte'][$f]['y']); ?>" />
+ </td>
+ <td>
+ <input type="text" style="width:100%;" name="text[<?php echo $f; ?>][color]" value="<?php echo wpsg_hspc($this->view['wpsg_mod_deliverynote']['arTexte'][$f]['color']); ?>" />
+ </td>
+ <td>
+ <select name="text[<?php echo $f; ?>][fontsize]" style="width:100%;">
+ <option <?php echo (($this->view['wpsg_mod_deliverynote']['arTexte'][$f]['fontsize'] == "8")?'selected="selected"':''); ?> value="8">8</option>
+ <option <?php echo (($this->view['wpsg_mod_deliverynote']['arTexte'][$f]['fontsize'] == "9")?'selected="selected"':''); ?> value="9">9</option>
+ <option <?php echo (($this->view['wpsg_mod_deliverynote']['arTexte'][$f]['fontsize'] == "10")?'selected="selected"':''); ?> value="10">10</option>
+ <option <?php echo (($this->view['wpsg_mod_deliverynote']['arTexte'][$f]['fontsize'] == "11")?'selected="selected"':''); ?> value="11">11</option>
+ <option <?php echo (($this->view['wpsg_mod_deliverynote']['arTexte'][$f]['fontsize'] == "12")?'selected="selected"':''); ?> value="12">12</option>
+ <option <?php echo (($this->view['wpsg_mod_deliverynote']['arTexte'][$f]['fontsize'] == "13")?'selected="selected"':''); ?> value="13">13</option>
+ <option <?php echo (($this->view['wpsg_mod_deliverynote']['arTexte'][$f]['fontsize'] == "14")?'selected="selected"':''); ?> value="14">14</option>
+ </select>
+ </td>
+ <td>
+ <label><input type="checkbox" value="1" name="text[<?php echo $f; ?>][aktiv]" <?php echo ((wpsg_isSizedInt($this->view['wpsg_mod_deliverynote']['arTexte'][$f]['aktiv']))?'checked="checked"':''); ?> />&nbsp;<?php echo __("Aktiv", "wpsg"); ?></label>
+ <a style="float:right; position:relative;" class="wpsg_form_help" href="?page=wpsg-Admin&subaction=loadHelp&noheader=1&field=mod_deliverynote_fieldconfig" rel="?page=wpsg-Admin&subaction=loadHelp&noheader=1&field=mod_deliverynote_fieldconfig"></a>
+ </td>
+ </tr>
+ <?php } ?>
+ </table>
+
+ <br />
+
+ <input style="float:right;" class="button" onclick="if (!confirm('<?php echo __('Sind Sie sich sicher? Ihre bisherigen Einstellungen gehen verloren!', 'wpsg'); ?>')) return false; else location.href = '<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&amp;action=module&amp;modul=<?php echo $_REQUEST['modul']; ?>&amp;do=reset&amp;noheader=1';" type="button" value="<?php echo __('Standardeinstellungen laden', 'wpsg'); ?>" />
+
+ <div class="wpsg_hinweis">
+ <?php echo __('Die Angaben für X (Abstand von Links) und Y (Abstand von Oben) werden in mm eingetragen.', 'wpsg'); ?><br />
+ <?php echo __('Die Farbe wird im Hexadezimalformat angegeben (#FFFFF für weiß, #000000 für schwarz).', 'wpsg'); ?>
+ </div>
+ <br />
+
+ </div>
+ <div id="tabcontent2" class="tabcontent">
+
+ <div id="foottext_list"><?php echo $this->view['foottext_list']; ?></div>
+ <br />
+
+ <div class="wpsg_hinweis">
+ <?php echo __('Hier können Sie Texte vordefinieren, die sie unter den Lieferschein setzen können.', 'wpsg'); ?>
+ </div>
+
+ </div>
+ <div id="tabcontent3" class="tabcontent">
+
+ <?php echo wpsg_drawForm_Input('wpsg_mod_deliverynote_nrformat', __('Format der Lieferscheinnummer', 'wpsg'), $this->get_option('wpsg_mod_deliverynote_nrformat'), array('help' => 'wpsg_mod_deliverynote_nrformat')); ?>
+ <?php echo wpsg_drawForm_Input('wpsg_mod_deliverynote_nr', __('Start für Lieferscheinnummer', 'wpsg'), $this->get_option('wpsg_mod_deliverynote_nr'), array('help' => 'wpsg_mod_deliverynote_nr')); ?>
+ <?php echo wpsg_drawForm_Input('wpsg_mod_deliverynote_url', __('URL Für URL Benachrichtigung', 'wpsg'), $this->get_option('wpsg_mod_deliverynote_url'), array('help' => 'wpsg_mod_deliverynote_url')); ?>
+ <?php echo wpsg_drawForm_Checkbox('wpsg_mod_deliverynote_url_standard', __('URL Benachrichtigung standardmäßig aktiv', 'wpsg'), $this->get_option('wpsg_mod_deliverynote_url_standard'), array('help' => 'wpsg_mod_deliverynote_url_standard')); ?>
+ <?php echo wpsg_drawForm_Checkbox('wpsg_mod_deliverynote_hideCountry', __('Land auf Lieferschein verbergen', 'wpsg'), $this->get_option('wpsg_mod_deliverynote_hideCountry'), array('help' => 'wpsg_mod_deliverynote_hideCountry')); ?>
+ <?php echo wpsg_drawForm_Select('wpsg_mod_deliverynote_anr', __('Artikelnummer anzeigen', 'wpsg'), array(
+ '0' => __('Nicht anzeigen', 'wpsg'),
+ '1' => __('In Spalte "Nr." zeigen', 'wpsg'),
+ '2' => __('Als extra Zeile anzeigen', 'wpsg')
+ ), $this->get_option('wpsg_mod_deliverynote_anr'), array('help' => 'wpsg_mod_deliverynote_anr')); ?>
+
+ </div>
+ </div>
+</div>
+
+<script type="text/javascript">/* <![CDATA[ */
+
+ /**
+ * Wird beim anlegen einer neuen Fußzeile aufgerufen
+ */
+ function wpsg_addFooter()
+ {
+
+ jQuery('#foottext_list').html('<img src="<?php echo WPSG_URL; ?>views/gfx/ajax-loader.gif" alt="<?php echo __('Bitte warten ...', 'wpsg'); ?>" />');
+
+ jQuery.ajax( {
+ url: '<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_deliverynote&do=addFoottext&noheader=1',
+ success: function(data) {
+ jQuery('#foottext_list').html(data);
+ }
+ } );
+
+ return false;
+
+ } // function wpsg_addFooter()
+
+ /**
+ * Wird beim entfernen einer Fußzeile aufgerufen
+ */
+ function wpsg_removeFooter(foot_id)
+ {
+
+ if (!confirm('<?php echo __('Sind Sie sich sicher, dass Sie diese Fußzeile löschen möchten?', 'wpsg'); ?>')) return false;
+
+ jQuery('#foottext_list').html('<img src="<?php echo WPSG_URL; ?>views/gfx/ajax-loader.gif" alt="<?php echo __('Bitte warten ...', 'wpsg'); ?>" />');
+
+ jQuery.ajax( {
+ url: '<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_deliverynote&do=removeFoottext&noheader=1',
+ data: {
+ foot_id: foot_id
+ },
+ success: function(data) {
+ jQuery('#foottext_list').html(data);
+ }
+ } );
+
+ return false;
+
+ } // function wpsg_removeFooter()
+
+ jQuery(document).ready(function() {
+ jQuery('#wpsg_tab').wpsg_tab( {
+ 'cookiename': 'wpsg_mod_deliverynote_tab',
+ 'tab2': function() {
+ jQuery('.tablink').show();
+ }
+ } );
+ } );
+
+/* ]]> */</script> \ No newline at end of file