Subversion Repositories wpShopGermany4

Rev

Rev 6453 | Rev 7541 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
2975 daniel 1
<?php
2
 
3
	/**
4
	 * Template für die Integration des Lieferscheins in die Bestellverwaltung
5
	 */
6
 
7
?>
5945 hartmut 8
<?php echo wpsg_drawForm_AdminboxStart(__('Lieferscheine', 'wpsg'));  ?>
9
 
2975 daniel 10
	<div class="inside">
11
 
12
		<?php if (!wpsg_isSizedArray($this->view['wpsg_mod_deliverynote']['arDeliverynotes'])) { ?>
13
		<p><?php echo __('Bisher wurden zu dieser Bestellung keine Lieferscheine erstellt.', 'wpsg'); ?></p>
14
		<?php } else { ?>
15
 
16
			<?php foreach ($this->view['wpsg_mod_deliverynote']['arDeliverynotes'] as $k => $v) { ?>
17
				<?php echo wpsg_translate(__('##1# Lieferschein geschrieben am #2# (Lieferdatum: #3#)', 'wpsg'),
18
					$v->lnr,
19
					wpsg_formatTimestamp(strtotime($v->cdate), true),
20
					wpsg_formatTimestamp($v->getDeliveryTimestamp(), true)
5046 daniel 21
				); ?> <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 />
22
			<?php } ?><br />
2975 daniel 23
 
24
		<?php } ?>
25
 
26
		<?php if (wpsg_isSizedArray($this->view['wpsg_mod_deliverynote']['arNoDeliveredProducts'])) { ?>
5945 hartmut 27
			<fieldset>
28
				<legend ><?php echo __('Neuer Lieferschein', 'wpsg'); ?></legend>
2975 daniel 29
 
6453 thomas 30
				<form target="_blank" method="post" id="deliverynote_order_backend" 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']; ?>">
2975 daniel 31
 
5945 hartmut 32
					<div>
2975 daniel 33
 
34
						<label style="height:25px; width:240px; float:left; margin-top:10px;">
35
							<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" />
6081 hartmut 36
							&nbsp;<?php echo __("E-Mail an Kunden senden", "wpsg"); ?>
2975 daniel 37
						</label>
38
						<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']); ?>" />
39
						<div style="clear:both; width:100%; height:5px;"></div>
40
 
41
						<label style="height:25px; width:220px; float:left;">
42
							<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" />
6081 hartmut 43
							&nbsp;<?php echo __("Neuer Status", "wpsg"); ?>
2975 daniel 44
						</label>
45
						<select style="width:300px; float:right;" id="wpsg_mod_deliverynote_status" name="wpsg_mod_deliverynote_status">
46
							<?php foreach ($this->arStatus as $k => $v) { ?>
47
							<option value="<?php echo $k; ?>" <?php echo (($k == 250)?'selected="selected"':''); ?>><?php echo $v; ?></option>
48
							<?php } ?>
49
						</select>
50
						<div style="clear:both; width:100%; height:5px;"></div>
51
 
52
						<label style="height:25px; width:240px; float:left;">
6453 thomas 53
							<input id="wpsg_mod_deliverynote_url"<?php echo (($this->get_option("wpsg_mod_deliverynote_url_standard") === "1")?'checked="checked"':''); ?> type="checkbox" value="1" name="wpsg_mod_deliverynote_noticeurl" />
2975 daniel 54
							&nbsp;<?php echo __("URL Benachrichtigung", "wpsg"); ?>
55
						</label>
56
						<div style="clear:both; width:100%; height:5px;"></div>
57
 
58
						<label style="height:25px; width:240px; float:left; padding-left:22px;">
6081 hartmut 59
							<?php echo __("Lieferdatum", "wpsg"); ?>
2975 daniel 60
						</label>
6453 thomas 61
						<input id="wpsg_mod_deliverynote_date" style="display:block;float:right; width:300px;" type="text" name="wpsg_mod_deliverynote_date" value="<?php echo date("d.m.Y", time()); ?>" />
2975 daniel 62
						<div style="clear:both; width:100%; height:5px;"></div>
63
 
64
						<label for="wpsg_mod_deliverynote_foottext" style="height:25px; width:220px; padding-left:22px; float:left">
65
							<?php echo __("Fußtext", "wpsg"); ?>
66
						</label>
67
 
68
						<?php
69
 
70
							$wpsg_mod_deliverynote_footer = $this->get_option("wpsg_mod_deliverynote_footer");
71
		 					if (!is_array($wpsg_mod_deliverynote_footer)) $wpsg_mod_deliverynote_footer = unserialize($this->get_option("wpsg_mod_deliverynote_footer"));
72
							if (!is_array($wpsg_mod_deliverynote_footer)) $wpsg_mod_deliverynote_footer = Array();
73
 
74
						?>
75
 
76
						<?php if (sizeof($wpsg_mod_deliverynote_footer) > 0) { ?>
77
						<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);">
78
							<?php foreach ($wpsg_mod_deliverynote_footer as $k => $v) { ?>
79
							<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>
80
							<?php } ?>
81
						</select>
82
						<?php } ?>
83
 
84
						<div style="clear:both; width:100%; height:5px;"></div>
6961 thomas 85
						<div style="padding-left:25px;"><textarea style="width:100%;" type="text" name="wpsg_mod_deliverynote_fusstext" id="wpsg_mod_deliverynote_fusstext" value="" /></textarea></div>
2975 daniel 86
						<div style="clear:both; width:100%; height:15px;"></div>
87
 
88
						<script type="text/javascript">/* <![CDATA[ */
89
 
90
							jQuery(document).ready(function() {
91
								jQuery('#wpsg_mod_deliverynote_fusstext').val(jQuery("#wpsg_mod_deliverynote_select").val());
92
							});
93
 
94
						/* ]]> */</script>
95
 
5046 daniel 96
						<input type="hidden" id="wpsg_mod_deliverynote_productindexes" name="wpsg_mod_deliverynote_productindexes" />
2975 daniel 97
 
98
						<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"); ?>" />
99
						<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"); ?>" />
100
 
101
						<div style="clear:both; width:100%; height:5px;"></div>
102
 
103
					</div>
104
 
105
				</form>
106
 
107
			</fieldset>
108
		<?php } ?>
109
 
110
	</div>
111
 
5945 hartmut 112
<?php echo wpsg_drawForm_AdminboxEnd(); ?>
113
 
2975 daniel 114
<script type="text/javascript">/* <![CDATA[ */
115
 
116
	/**
117
	 * Prüft ob Produkte für den Lieferschein ausgewählt wurden
118
	 */
119
	function wpsg_mod_deliverynote_checkProducts()
120
	{
121
 
122
		if (jQuery('.wpsg_mod_deliverynote_product:checked').length <= 0)
123
		{
124
 
125
			alert('<?php echo __('Bitte mindestens ein Produkt für den Lieferschein wählen', 'wpsg'); ?>');
126
			return false;
127
 
128
		}
129
		else
130
		{
131
 
132
			var arProductKeys = Array();
133
 
134
			jQuery('.wpsg_mod_deliverynote_product:checked').each(function() {
135
 
136
				arProductKeys.push(jQuery(this).val());
137
 
138
			} );
139
 
5046 daniel 140
			jQuery('#wpsg_mod_deliverynote_productindexes').val(arProductKeys.join(','));
2975 daniel 141
 
142
		}
143
 
144
		return true;
145
 
146
	} // function wpsg_mod_deliverynote_checkProducts()
147
 
148
/* ]]> */</script>