7258 |
daniel |
1 |
<?php
|
|
|
2 |
|
7256 |
thomas |
3 |
/**
|
7258 |
daniel |
4 |
* Template für die Integration des Anschreiben Moduls in die Bestellverwaltung
|
7256 |
thomas |
5 |
*/
|
|
|
6 |
|
7258 |
daniel |
7 |
?>
|
7256 |
thomas |
8 |
|
|
|
9 |
<?php echo wpsg_drawForm_AdminboxStart(__('Anschreiben', 'wpsg'));?>
|
|
|
10 |
|
7264 |
daniel |
11 |
<?php if (sizeof($this->view['mod_coverletter']['arCoverLetter']) == 0 ) { ?>
|
7256 |
thomas |
12 |
|
7264 |
daniel |
13 |
<p><?php echo __('Bisher kein Anschreiben für diese Bestellung geschrieben.', 'wpsg'); ?></p>
|
7256 |
thomas |
14 |
|
7264 |
daniel |
15 |
<?php } else { ?>
|
7256 |
thomas |
16 |
|
7264 |
daniel |
17 |
<?php foreach ($this->view['mod_coverletter']['arCoverLetter'] as $a) { ?>
|
7256 |
thomas |
18 |
|
7264 |
daniel |
19 |
<div class="wpsg_flex wpsg_flex_justify_content_space_between">
|
|
|
20 |
<span>
|
|
|
21 |
<?php echo wpsg_translate(__('#2#: Anschreiben ##1#', 'wpsg'), $a['id'], wpsg_formatTimestamp(strtotime($a['cdate']))); ?>: <?php echo ((strlen($a['text']) > 50)?substr($a['text'],0,50).' ...':$a['text']); ?>
|
|
|
22 |
</span>
|
|
|
23 |
<a href="<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Order&mod=wpsg_mod_coverletter&noheader=1&action=ajax&order_id=<?php echo $a['order_id']; ?>&cl_id=<?php echo $a['id']; ?>&wpsg_mod_coverletter_get" target="_new">
|
7267 |
daniel |
24 |
<?php echo __('Ansehen', 'wpsg'); ?>
|
7264 |
daniel |
25 |
</a>
|
|
|
26 |
</div>
|
|
|
27 |
|
|
|
28 |
<?php } ?>
|
|
|
29 |
|
|
|
30 |
<?php } ?>
|
|
|
31 |
|
|
|
32 |
<br />
|
7256 |
thomas |
33 |
|
|
|
34 |
<div class="wpsg_clear"></div>
|
|
|
35 |
|
7258 |
daniel |
36 |
<hr />
|
7256 |
thomas |
37 |
|
|
|
38 |
<div class="inside">
|
7258 |
daniel |
39 |
<div>
|
7256 |
thomas |
40 |
|
7258 |
daniel |
41 |
<form target="_blank" method="post" action="<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Order&mod=wpsg_mod_coverletter&edit_id=<?php echo $this->view['data']['id']; ?>&action=ajax&noheader=1" id="wpsg_mod_coverletter_form">
|
7256 |
thomas |
42 |
|
7258 |
daniel |
43 |
<?php $arShopLocations = $this->getShopLocations(); ?>
|
|
|
44 |
<?php $arShopLocationLabels = []; foreach ($arShopLocations as $l_id => $l) $arShopLocationLabels[$l_id] = $l['label']; ?>
|
|
|
45 |
|
|
|
46 |
<?php if (sizeof($arShopLocations) > 1) { ?>
|
|
|
47 |
|
|
|
48 |
<?php echo wpsg_drawForm_Select('target', __('Shop Adresse', 'wpsg'), $arShopLocationLabels, '1'); ?>
|
|
|
49 |
|
|
|
50 |
<?php } else { ?>
|
|
|
51 |
|
|
|
52 |
<input type="hidden" name="target" value="1" />
|
|
|
53 |
|
|
|
54 |
<?php } ?>
|
7256 |
thomas |
55 |
|
7267 |
daniel |
56 |
<?php echo wpsg_drawForm_Textarea('text', __('Text', 'wpsg'),$this->replaceUniversalPlatzhalter($this->get_option('wpsg_mod_coverletter_text'), $this->view['data']['id']), ['noLabel' => true, 'fullLabel' => __('Text für das Anschreiben', 'wpsg'), 'style' => 'height:200px']); ?>
|
7258 |
daniel |
57 |
|
7256 |
thomas |
58 |
<br />
|
|
|
59 |
|
7258 |
daniel |
60 |
<input type="submit" name="wpsg_mod_coverletter_write" value="<?php echo __("Speichern & Drucken", "wpsg"); ?>" style="float:left;" class="button button-primary" />
|
7264 |
daniel |
61 |
<input type="submit" name="wpsg_mod_coverletter_preview" onclick="wpsg_form_refresh = false;" value="<?php echo __('Vorschau', 'wpsg'); ?>" style="float:left; margin-left:15px;" class="button" />
|
7256 |
thomas |
62 |
|
|
|
63 |
<div class="wpsg_clear"></div>
|
|
|
64 |
|
|
|
65 |
</form>
|
|
|
66 |
|
|
|
67 |
</div>
|
|
|
68 |
</div>
|
|
|
69 |
|
7258 |
daniel |
70 |
<?php echo wpsg_drawForm_AdminboxEnd(); ?>
|
|
|
71 |
|
|
|
72 |
<script>
|
|
|
73 |
|
7264 |
daniel |
74 |
var wpsg_form_refresh = true;
|
|
|
75 |
|
7258 |
daniel |
76 |
jQuery('#wpsg_mod_coverletter_form').on('submit', function() {
|
|
|
77 |
|
7264 |
daniel |
78 |
if (wpsg_form_refresh) {
|
|
|
79 |
|
|
|
80 |
setTimeout(function() {
|
7258 |
daniel |
81 |
|
7264 |
daniel |
82 |
location.reload();
|
|
|
83 |
|
|
|
84 |
}, 1000);
|
7258 |
daniel |
85 |
|
7264 |
daniel |
86 |
}
|
|
|
87 |
|
|
|
88 |
wpsg_form_refresh = true;
|
7258 |
daniel |
89 |
|
|
|
90 |
} );
|
|
|
91 |
|
|
|
92 |
</script>
|