Subversion Repositories wpShopGermany4

Rev

Rev 7256 | Rev 7264 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 7256 Rev 7258
Line 1... Line 1...
1
<script type="text/javascript">
1
<?php
2
				
2
	
3
	/**
3
	/**
4
	 *
-
 
-
 
4
	 * Template für die Integration des Anschreiben Moduls in die Bestellverwaltung
5
	 */
5
	 */
6
	function anschreiben_sendMail()
-
 
7
	{
-
 
8
		
-
 
9
		if (jQuery('#anschreiben_text').val() == '')
-
 
10
		{
-
 
11
 
-
 
12
			alert("<?php echo __('Bitte einen Text angeben!', 'wpsg'); ?>");
-
 
13
			return;
-
 
14
			
-
 
15
		}
-
 
16
 
-
 
17
		var text = "";
-
 
18
 
-
 
19
		text = tinyMCE.get('anschreiben_html').getContent();
-
 
20
		
-
 
21
		jQuery.ajax( {
-
 
22
			url: "<?php echo WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Order&action=ajax&mod=wpsg_mod_anschreiben&edit_id='.$this->view['data']['id'].'&noheader=1&do=anschreiben_sendMail' ?>",
-
 
23
			method: 'post',
-
 
24
			success: function(data) {
-
 
25
				
-
 
26
				if (data != '1')
-
 
27
				{
-
 
28
 
6
 
29
					alert("<?php echo __("Anschreiben konnte nicht gespeichert/gedruckt werden es, weil ein Fehler aufgetreten ist!", "wpsg"); ?>");
-
 
30
 
-
 
31
				}
-
 
32
				else
-
 
33
				{
-
 
34
 
-
 
35
					tinyMCE.get('_html').setContent('');
-
 
36
					alert("<?php echo __('Mail wurde erfolgreich an den Kunden gesendet.', 'wpsg'); ?>");
-
 
37
 
-
 
38
					location.reload();
-
 
39
					
-
 
40
				}
-
 
41
				
-
 
42
			}
-
 
43
			
-
 
44
		} );	
-
 
45
		
-
 
46
	}
7
?>
47
	
8
	
48
	
-
 
49
</script>
-
 
50
<?php //wpsg_debug($this->view) ?>
-
 
51
<?php echo wpsg_drawForm_AdminboxStart(__('Anschreiben', 'wpsg'));?>
9
<?php echo wpsg_drawForm_AdminboxStart(__('Anschreiben', 'wpsg'));?>
52
 
10
 
53
	<?php if (sizeof($this->view['mod_anschreiben']['aranschreiben']) == 0 ) { ?>
11
	<?php if (sizeof($this->view['mod_anschreiben']['aranschreiben']) == 0 ) { ?>
54
	   
12
	   
55
	   <p><?php echo __('Bisher kein Anschreiben geschrieben.', 'wpsg'); ?></p>
13
	   <p><?php echo __('Bisher kein Anschreiben geschrieben.', 'wpsg'); ?></p>
Line 81... Line 39...
81
	
39
	
82
	<br>
40
	<br>
83
	
41
	
84
	<div class="wpsg_clear"></div>
42
	<div class="wpsg_clear"></div>
85
	
43
	
86
	<hr>
44
	<hr />
87
	
45
	
88
	<div class="inside">						
46
	<div class="inside">						
89
		<div style="padding:5px;">
47
		<div>
90
			
48
			
91
			<form method="post" action="<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Order&action=ajax&mod=wpsg_mod_anschreiben&edit_id=<?php echo $this->view['data']['id']; ?>&noheader=1">	
49
			<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">	
92
 
50
 
93
				<?php /* Auswahl Adresse (Zweitstelle/Hauptstelle */ ?>
51
				<?php $arShopLocations = $this->getShopLocations(); ?>
-
 
52
				<?php $arShopLocationLabels = []; foreach ($arShopLocations as $l_id => $l) $arShopLocationLabels[$l_id] = $l['label']; ?>
94
 
53
				
-
 
54
				<?php if (sizeof($arShopLocations) > 1) { ?>
-
 
55
					
-
 
56
					<?php echo wpsg_drawForm_Select('target', __('Shop Adresse', 'wpsg'), $arShopLocationLabels, '1'); ?>
-
 
57
					
95
				<?php /* Anredeauswahl */ ?>
58
				<?php } else { ?>
-
 
59
					
-
 
60
					<input type="hidden" name="target" value="1" />
-
 
61
					
-
 
62
				<?php } ?>
96
 
63
 
97
				<?php echo __('Text für das Anschreiben', 'wpsg'); ?>:<br /><br />			
64
				<?php echo wpsg_drawForm_Textarea('text', __('Text', 'wpsg'),'', ['noLabel' => true, 'fullLabel' => __('Text für das Anschreiben', 'wpsg'), 'style' => 'height:200px']); ?>
98
				<?php wp_editor('', 'anschreiben_html'); ?>
-
 
99
							
65
				
100
				<div class="wpsg_clear"></div>
-
 
101
						
-
 
102
				<br />
66
				<br />
103
				
67
				
104
				<input type="button" class="button" onclick="anschreiben_sendMail(); return false;" value="<?php echo __("Speichern & Drucken", "wpsg"); ?>" style="float:right;" />
68
				<input type="submit" name="wpsg_mod_coverletter_write" value="<?php echo __("Speichern & Drucken", "wpsg"); ?>" style="float:left;" class="button button-primary" />
105
				
69
				
106
				<div class="wpsg_clear"></div>
70
				<div class="wpsg_clear"></div>
107
				
71
				
108
			</form>
72
			</form>
109
			
73
			
110
		</div>
74
		</div>
111
	</div>
75
	</div>
112
 
76
 
113
<?php echo wpsg_drawForm_AdminboxEnd(); ?>
-
 
114
77
<?php echo wpsg_drawForm_AdminboxEnd(); ?>
-
 
78
 
-
 
79
<script>
-
 
80
	
-
 
81
	jQuery('#wpsg_mod_coverletter_form').on('submit', function() {
-
 
82
		
-
 
83
		setTimeout(function() {
-
 
84
			
-
 
85
			location.reload();
-
 
86
			
-
 
87
		}, 1000);
-
 
88
				
-
 
89
	} );
-
 
90
	
-
 
91
</script>
-
 
92