Subversion Repositories wpShopGermany4

Rev

Rev 6961 | Rev 7552 | 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");
7541 daniel 71
 
72
							if (!is_array($wpsg_mod_deliverynote_footer)) $wpsg_mod_deliverynote_footer = unserialize($this->get_option("wpsg_mod_deliverynote_footer"));
2975 daniel 73
							if (!is_array($wpsg_mod_deliverynote_footer)) $wpsg_mod_deliverynote_footer = Array();
7541 daniel 74
 
75
							$default = $this->get_option('wpsg_mod_deliverynote_foottext_standard');
76
 
2975 daniel 77
						?>
78
 
79
						<?php if (sizeof($wpsg_mod_deliverynote_footer) > 0) { ?>
80
						<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);">
81
							<?php foreach ($wpsg_mod_deliverynote_footer as $k => $v) { ?>
7541 daniel 82
							<option <?php echo ((intval($default) === intval($k))?'selected="selected"':''); ?> value="<?php echo wpsg_hspc($v[1]); ?>"><?php echo wpsg_hspc($v[0]); ?></option>
2975 daniel 83
							<?php } ?>
84
						</select>
85
						<?php } ?>
86
 
87
						<div style="clear:both; width:100%; height:5px;"></div>
6961 thomas 88
						<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 89
						<div style="clear:both; width:100%; height:15px;"></div>
90
 
91
						<script type="text/javascript">/* <![CDATA[ */
92
 
93
							jQuery(document).ready(function() {
94
								jQuery('#wpsg_mod_deliverynote_fusstext').val(jQuery("#wpsg_mod_deliverynote_select").val());
95
							});
96
 
97
						/* ]]> */</script>
98
 
5046 daniel 99
						<input type="hidden" id="wpsg_mod_deliverynote_productindexes" name="wpsg_mod_deliverynote_productindexes" />
2975 daniel 100
 
101
						<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"); ?>" />
102
						<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"); ?>" />
103
 
104
						<div style="clear:both; width:100%; height:5px;"></div>
105
 
106
					</div>
107
 
108
				</form>
109
 
110
			</fieldset>
111
		<?php } ?>
112
 
113
	</div>
114
 
5945 hartmut 115
<?php echo wpsg_drawForm_AdminboxEnd(); ?>
116
 
2975 daniel 117
<script type="text/javascript">/* <![CDATA[ */
118
 
119
	/**
120
	 * Prüft ob Produkte für den Lieferschein ausgewählt wurden
121
	 */
122
	function wpsg_mod_deliverynote_checkProducts()
123
	{
124
 
125
		if (jQuery('.wpsg_mod_deliverynote_product:checked').length <= 0)
126
		{
127
 
128
			alert('<?php echo __('Bitte mindestens ein Produkt für den Lieferschein wählen', 'wpsg'); ?>');
129
			return false;
130
 
131
		}
132
		else
133
		{
134
 
135
			var arProductKeys = Array();
136
 
137
			jQuery('.wpsg_mod_deliverynote_product:checked').each(function() {
138
 
139
				arProductKeys.push(jQuery(this).val());
140
 
141
			} );
142
 
5046 daniel 143
			jQuery('#wpsg_mod_deliverynote_productindexes').val(arProductKeys.join(','));
2975 daniel 144
 
145
		}
146
 
147
		return true;
148
 
149
	} // function wpsg_mod_deliverynote_checkProducts()
150
 
151
/* ]]> */</script>