Subversion Repositories wpShopGermany4

Rev

Rev 7553 | 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)
7581 daniel 21
				); ?> <a target="_blank" href="<?php
22
 
23
					/* 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; */
24
					echo wp_nonce_url(WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Order&action=ajax&noheader=1&mod=wpsg_mod_deliverynote&do=get&edit_id='.$this->view['data']['id'].'&dn_id='.$v->id, 'wpsg-deliverynote-order_ajax-deliverynote-'.$this->view['data']['id']);
25
 
26
				?>"><?php echo __('Ansehen', 'wpsg'); ?></a><br />
5046 daniel 27
			<?php } ?><br />
2975 daniel 28
 
29
		<?php } ?>
30
 
31
		<?php if (wpsg_isSizedArray($this->view['wpsg_mod_deliverynote']['arNoDeliveredProducts'])) { ?>
5945 hartmut 32
			<fieldset>
33
				<legend ><?php echo __('Neuer Lieferschein', 'wpsg'); ?></legend>
2975 daniel 34
 
6453 thomas 35
				<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']; ?>">
7553 daniel 36
 
37
					<?php \wp_nonce_field('wpsg-deliverynote-order_ajax-deliverynote-'.$this->view['data']['id']); ?>
7552 daniel 38
 
5945 hartmut 39
					<div>
2975 daniel 40
 
41
						<label style="height:25px; width:240px; float:left; margin-top:10px;">
42
							<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 43
							&nbsp;<?php echo __("E-Mail an Kunden senden", "wpsg"); ?>
2975 daniel 44
						</label>
45
						<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']); ?>" />
46
						<div style="clear:both; width:100%; height:5px;"></div>
47
 
48
						<label style="height:25px; width:220px; float:left;">
49
							<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 50
							&nbsp;<?php echo __("Neuer Status", "wpsg"); ?>
2975 daniel 51
						</label>
52
						<select style="width:300px; float:right;" id="wpsg_mod_deliverynote_status" name="wpsg_mod_deliverynote_status">
53
							<?php foreach ($this->arStatus as $k => $v) { ?>
54
							<option value="<?php echo $k; ?>" <?php echo (($k == 250)?'selected="selected"':''); ?>><?php echo $v; ?></option>
55
							<?php } ?>
56
						</select>
57
						<div style="clear:both; width:100%; height:5px;"></div>
58
 
59
						<label style="height:25px; width:240px; float:left;">
6453 thomas 60
							<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 61
							&nbsp;<?php echo __("URL Benachrichtigung", "wpsg"); ?>
62
						</label>
63
						<div style="clear:both; width:100%; height:5px;"></div>
64
 
65
						<label style="height:25px; width:240px; float:left; padding-left:22px;">
6081 hartmut 66
							<?php echo __("Lieferdatum", "wpsg"); ?>
2975 daniel 67
						</label>
6453 thomas 68
						<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 69
						<div style="clear:both; width:100%; height:5px;"></div>
70
 
71
						<label for="wpsg_mod_deliverynote_foottext" style="height:25px; width:220px; padding-left:22px; float:left">
72
							<?php echo __("Fußtext", "wpsg"); ?>
73
						</label>
74
 
75
						<?php
76
 
77
							$wpsg_mod_deliverynote_footer = $this->get_option("wpsg_mod_deliverynote_footer");
7541 daniel 78
 
79
							if (!is_array($wpsg_mod_deliverynote_footer)) $wpsg_mod_deliverynote_footer = unserialize($this->get_option("wpsg_mod_deliverynote_footer"));
2975 daniel 80
							if (!is_array($wpsg_mod_deliverynote_footer)) $wpsg_mod_deliverynote_footer = Array();
7541 daniel 81
 
82
							$default = $this->get_option('wpsg_mod_deliverynote_foottext_standard');
83
 
2975 daniel 84
						?>
85
 
86
						<?php if (sizeof($wpsg_mod_deliverynote_footer) > 0) { ?>
87
						<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);">
88
							<?php foreach ($wpsg_mod_deliverynote_footer as $k => $v) { ?>
7541 daniel 89
							<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 90
							<?php } ?>
91
						</select>
92
						<?php } ?>
93
 
94
						<div style="clear:both; width:100%; height:5px;"></div>
6961 thomas 95
						<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 96
						<div style="clear:both; width:100%; height:15px;"></div>
97
 
98
						<script type="text/javascript">/* <![CDATA[ */
99
 
100
							jQuery(document).ready(function() {
101
								jQuery('#wpsg_mod_deliverynote_fusstext').val(jQuery("#wpsg_mod_deliverynote_select").val());
102
							});
103
 
104
						/* ]]> */</script>
105
 
5046 daniel 106
						<input type="hidden" id="wpsg_mod_deliverynote_productindexes" name="wpsg_mod_deliverynote_productindexes" />
2975 daniel 107
 
7581 daniel 108
						<input class="button" style="float:right;" onclick="if (!wpsg_mod_deliverynote_checkProducts()) return false; window.setTimeout(function() { location.href = '<?php
109
 
110
							/*echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Order&action=view&edit_id=<?php echo $this->view['data']['id'];*/
111
							echo wpsg_admin_url('Order', 'view', ['edit_id' => $this->view['data']['id']]);
112
 
113
						?>'; }, 1000);" name="wpsg_mod_deliverynote_write" type="submit" value="<?php echo __("Lieferschein erstellen", "wpsg"); ?>" />
2975 daniel 114
						<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"); ?>" />
115
 
116
						<div style="clear:both; width:100%; height:5px;"></div>
117
 
118
					</div>
119
 
120
				</form>
121
 
122
			</fieldset>
123
		<?php } ?>
124
 
125
	</div>
126
 
5945 hartmut 127
<?php echo wpsg_drawForm_AdminboxEnd(); ?>
128
 
2975 daniel 129
<script type="text/javascript">/* <![CDATA[ */
130
 
131
	/**
132
	 * Prüft ob Produkte für den Lieferschein ausgewählt wurden
133
	 */
134
	function wpsg_mod_deliverynote_checkProducts()
135
	{
136
 
137
		if (jQuery('.wpsg_mod_deliverynote_product:checked').length <= 0)
138
		{
139
 
140
			alert('<?php echo __('Bitte mindestens ein Produkt für den Lieferschein wählen', 'wpsg'); ?>');
141
			return false;
142
 
143
		}
144
		else
145
		{
146
 
147
			var arProductKeys = Array();
148
 
149
			jQuery('.wpsg_mod_deliverynote_product:checked').each(function() {
150
 
151
				arProductKeys.push(jQuery(this).val());
152
 
153
			} );
154
 
5046 daniel 155
			jQuery('#wpsg_mod_deliverynote_productindexes').val(arProductKeys.join(','));
2975 daniel 156
 
157
		}
158
 
159
		return true;
160
 
161
	} // function wpsg_mod_deliverynote_checkProducts()
162
 
163
/* ]]> */</script>