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