5720 |
daniel |
1 |
<?php
|
|
|
2 |
|
|
|
3 |
/**
|
7787 |
daniel |
4 |
* User: Daschmi (https://daschmi.de)
|
5720 |
daniel |
5 |
* Date: 07.08.2016
|
|
|
6 |
* Time: 10:40
|
|
|
7 |
*/
|
|
|
8 |
|
7900 |
daniel |
9 |
/** @var wpsg_customer $Customer */
|
|
|
10 |
$Customer = $this->view['oCustomer'];
|
|
|
11 |
|
5720 |
daniel |
12 |
?>
|
|
|
13 |
|
|
|
14 |
<div class="modal fade" tabindex="-1" role="dialog" id="wpsg_customer_edit">
|
|
|
15 |
<div class="modal-dialog" role="document">
|
|
|
16 |
<div class="modal-content">
|
|
|
17 |
<div class="modal-header">
|
|
|
18 |
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
6081 |
hartmut |
19 |
<h4 class="modal-title"><?php echo __('Kundendaten bearbeiten', 'wpsg'); ?></h4>
|
5720 |
daniel |
20 |
</div>
|
|
|
21 |
<div class="modal-body">
|
7087 |
thomas |
22 |
<?php if ($this->view['pflicht']['firma'] != '2') { ?>
|
|
|
23 |
<?php echo wpsg_drawForm_Input('dialog_firma', __('Firma', 'wpsg'), $this->view['data']['firma']); ?>
|
|
|
24 |
<?php } ?>
|
|
|
25 |
<?php if ($this->view['pflicht']['ustidnr'] != '2') { ?>
|
|
|
26 |
<?php echo wpsg_drawForm_Input('dialog_ustidnr', __('UStIdNr', 'wpsg'), $this->view['data']['ustidnr']); ?>
|
|
|
27 |
<?php } ?>
|
6204 |
thomas |
28 |
<br />
|
7087 |
thomas |
29 |
<?php if ($this->view['pflicht']['anrede'] != '2') { ?>
|
|
|
30 |
<?php echo wpsg_drawForm_Select('dialog_title', __('Anrede', 'wpsg'), $this->view['arTitles'], $this->view['data']['title'], array('noIndex' => true)); ?>
|
|
|
31 |
<?php } ?>
|
|
|
32 |
<?php if ($this->view['pflicht']['vname'] != '2') { ?>
|
|
|
33 |
<?php echo wpsg_drawForm_Input('dialog_vname', __('Vorname', 'wpsg'), $this->view['data']['vname']); ?>
|
|
|
34 |
<?php } ?>
|
|
|
35 |
<?php if ($this->view['pflicht']['name'] != '2') { ?>
|
|
|
36 |
<?php echo wpsg_drawForm_Input('dialog_name', __('Name', 'wpsg'), $this->view['data']['name']); ?>
|
|
|
37 |
<?php } ?>
|
6204 |
thomas |
38 |
<br />
|
7087 |
thomas |
39 |
<?php if ($this->view['pflicht']['geb'] != '2') { ?>
|
|
|
40 |
<?php echo wpsg_drawForm_Input('dialog_geb', __('Geburtsdatum', 'wpsg'), $this->view['data']['geb']); ?>
|
|
|
41 |
<?php } ?>
|
6204 |
thomas |
42 |
<br />
|
7087 |
thomas |
43 |
<?php if ($this->view['pflicht']['tel'] != '2') { ?>
|
|
|
44 |
<?php echo wpsg_drawForm_Input('dialog_tel', __('Telefon', 'wpsg'), $this->view['data']['tel']); ?>
|
|
|
45 |
<?php } ?>
|
|
|
46 |
<?php if ($this->view['pflicht']['fax'] != '2') { ?>
|
|
|
47 |
<?php echo wpsg_drawForm_Input('dialog_fax', __('Fax', 'wpsg'), $this->view['data']['fax']); ?>
|
|
|
48 |
<?php } ?>
|
|
|
49 |
<?php if ($this->view['pflicht']['email'] != '2') { ?>
|
|
|
50 |
<?php if ($this->hasMod('wpsg_mod_kundenverwaltung')) { ?>
|
7612 |
daniel |
51 |
<?php echo wpsg_drawForm_Text(__('E-Mail', 'wpsg'),'<a href="'.
|
|
|
52 |
|
|
|
53 |
wpsg_admin_url('Customer', 'edit', ['edit_id' => $this->view['data']['k_id']]).
|
|
|
54 |
|
|
|
55 |
'">'.$this->view['data']['email'].'</a>'); ?>
|
7087 |
thomas |
56 |
<?php } ?>
|
6204 |
thomas |
57 |
<?php } ?>
|
8456 |
daniel |
58 |
|
|
|
59 |
<?php echo wpsg_drawForm_Input('email_einvoice', __('E-Mail für eInvoice', 'wpsg'), $this->view['data']['email_einvoice']); ?>
|
|
|
60 |
|
6204 |
thomas |
61 |
<br />
|
7087 |
thomas |
62 |
<?php if ($this->view['pflicht']['strasse'] != '2') { ?>
|
7247 |
daniel |
63 |
|
|
|
64 |
<?php echo wpsg_drawForm_Input('dialog_strasse', __('Straße', 'wpsg'), $this->view['data']['strasse']); ?>
|
|
|
65 |
|
7305 |
daniel |
66 |
<?php if (wpsg_getStr($this->view['pflicht']['wpsg_showNr']) === '1') { ?>
|
7247 |
daniel |
67 |
|
|
|
68 |
<?php echo wpsg_drawForm_Input('dialog_nr', __('Hausnummer', 'wpsg'), $this->view['data']['nr']); ?>
|
|
|
69 |
|
|
|
70 |
<?php } ?>
|
|
|
71 |
|
7087 |
thomas |
72 |
<?php } ?>
|
|
|
73 |
<?php if ($this->view['pflicht']['plz'] != '2') { ?>
|
|
|
74 |
<?php echo wpsg_drawForm_Input('dialog_plz', __('Postleitzahl', 'wpsg'), $this->view['data']['plz']); ?>
|
|
|
75 |
<?php } ?>
|
|
|
76 |
<?php if ($this->view['pflicht']['ort'] != '2') { ?>
|
|
|
77 |
<?php echo wpsg_drawForm_Input('dialog_ort', __('Ort', 'wpsg'), $this->view['data']['ort']); ?>
|
|
|
78 |
<?php } ?>
|
|
|
79 |
<?php if ($this->view['pflicht']['land'] != '2') { ?>
|
|
|
80 |
<?php echo wpsg_drawForm_Select('dialog_land', __('Land', 'wpsg'), $this->view['arCountry'], $this->view['data']['land']); ?>
|
|
|
81 |
<?php } ?>
|
5720 |
daniel |
82 |
<br />
|
|
|
83 |
|
5846 |
thomas |
84 |
<?php echo wpsg_drawForm_Checkbox('dialog_customer', __('Auch Kundendaten anpassen', 'wpsg'), false, array('help' => 'dialog_customer')); ?>
|
|
|
85 |
<?php echo wpsg_drawForm_Checkbox('dialog_all', __('Alle Bestellungen des Kunden ändern', 'wpsg'), false, array('help' => 'dialog_all')); ?>
|
|
|
86 |
|
|
|
87 |
<?php if ($this->hasMod('wpsg_mod_shippingadress')) {?>
|
|
|
88 |
<?php echo wpsg_drawForm_Checkbox('dialog_shipping', __('Auch Lieferanschrift anpassen', 'wpsg'), false, array('help' => 'dialog_shipping')); ?>
|
|
|
89 |
<?php } ?>
|
6846 |
hartmut |
90 |
<input type="hidden" id="dialog_change_land" name="dialog_change_land" />
|
|
|
91 |
|
5720 |
daniel |
92 |
</div>
|
|
|
93 |
<div class="modal-footer">
|
|
|
94 |
<button type="button" class="btn btn-default" data-dismiss="modal"><?php echo __('Schließen', 'wpsg'); ?></button>
|
|
|
95 |
<button type="button" class="btn btn-primary" onclick="return wpsg_saveInvoiceAdress();"><?php echo __('Speichern', 'wpsg'); ?></button>
|
|
|
96 |
</div>
|
|
|
97 |
</div>
|
|
|
98 |
</div>
|
|
|
99 |
</div>
|
|
|
100 |
|
|
|
101 |
<?php echo wpsg_drawForm_AdminboxStart(__('Kundendaten', 'wpsg')); ?>
|
|
|
102 |
|
|
|
103 |
<?php echo wpsg_drawForm_TextStart(); ?>
|
|
|
104 |
<?php echo $this->view['oOrder']->getCustomer()->getNr(); ?>
|
|
|
105 |
<?php if ($this->hasMod('wpsg_mod_kundenverwaltung')) { ?>
|
7612 |
daniel |
106 |
[ <a href="<?php
|
|
|
107 |
|
|
|
108 |
echo wpsg_admin_url('Customer', 'edit', ['edit_id' => $this->view['data']['k_id']]);
|
|
|
109 |
//echo WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Customer&action=edit&edit_id='.$this->view['data']['k_id'];
|
|
|
110 |
|
|
|
111 |
?>"><?php echo __('Zum Kunden', 'wpsg'); ?></a> ]
|
5720 |
daniel |
112 |
<?php } ?>
|
6081 |
hartmut |
113 |
<?php echo wpsg_drawForm_TextEnd(__('Kundennummer', 'wpsg')); ?>
|
5720 |
daniel |
114 |
|
|
|
115 |
<?php echo wpsg_drawForm_TextStart(); ?>
|
7087 |
thomas |
116 |
<?php if ($this->view['pflicht']['firma'] != '2') { ?>
|
|
|
117 |
<?php if (trim($this->view['data']['firma']) != '') { ?>
|
|
|
118 |
<?php echo wpsg_hspc($this->view['data']['firma']); ?><br />
|
|
|
119 |
<?php } ?>
|
|
|
120 |
<?php } ?>
|
|
|
121 |
<?php if ($this->view['pflicht']['anrede'] != '2') { ?>
|
|
|
122 |
<?php echo (($this->view['data']['title'] != '' && $this->view['data']['title'] != '-1')?wpsg_hspc($this->view['arTitles'][$this->view['data']['title']]).' ':''); ?>
|
|
|
123 |
<?php } ?>
|
|
|
124 |
<?php if ($this->view['pflicht']['vname'] != '2') { ?>
|
|
|
125 |
<?php echo wpsg_hspc($this->view['data']['vname']); ?>
|
|
|
126 |
<?php } ?>
|
|
|
127 |
<?php if ($this->view['pflicht']['name'] != '2') { ?>
|
|
|
128 |
<?php echo wpsg_hspc($this->view['data']['name']); ?><br />
|
|
|
129 |
<?php } ?>
|
|
|
130 |
<?php if ($this->view['pflicht']['strasse'] != '2') { ?>
|
7247 |
daniel |
131 |
|
7305 |
daniel |
132 |
<?php echo wpsg_hspc($this->view['data']['strasse']); ?> <?php echo wpsg_hspc(wpsg_getStr($this->view['data']['nr'])); ?><br />
|
7247 |
daniel |
133 |
|
7087 |
thomas |
134 |
<?php } ?>
|
|
|
135 |
<?php if ($this->view['pflicht']['plz'] != '2') { ?>
|
|
|
136 |
<?php echo wpsg_hspc($this->view['data']['plz']); ?>
|
|
|
137 |
<?php } ?>
|
|
|
138 |
<?php if ($this->view['pflicht']['ort'] != '2') { ?>
|
|
|
139 |
<?php echo wpsg_hspc($this->view['data']['ort']); ?>
|
|
|
140 |
<?php } ?>
|
|
|
141 |
<?php if ($this->view['pflicht']['land'] != '2') { ?>
|
|
|
142 |
<?php echo wpsg_hspc($this->view['country']['kuerzel']); ?><br />
|
|
|
143 |
<?php } ?>
|
6081 |
hartmut |
144 |
<a style="position: absolute; right:25px; top:10px; display:inline-block;" data-toggle="modal" data-target="#wpsg_customer_edit" href="#" title="<?php echo __('Anschrift ändern', 'wpsg'); ?>">
|
5720 |
daniel |
145 |
<span class="glyphicon glyphicon-pencil"></span>
|
|
|
146 |
</a>
|
|
|
147 |
|
6081 |
hartmut |
148 |
<?php echo wpsg_drawForm_TextEnd(__('Anschrift', 'wpsg')); ?>
|
8456 |
daniel |
149 |
|
7087 |
thomas |
150 |
<?php if ($this->view['pflicht']['geb'] != '2') { ?>
|
|
|
151 |
<?php if (strtotime($this->view['data']['geb']) > 0) { ?>
|
|
|
152 |
<?php echo wpsg_drawForm_Text(__('Geburtsdatum', 'wpsg'), wpsg_fromDate($this->view['data']['geb']), array('text' => true)); ?>
|
|
|
153 |
<?php } ?>
|
|
|
154 |
<?php } ?>
|
|
|
155 |
<?php if ($this->view['pflicht']['fax'] != '2') { ?>
|
|
|
156 |
<?php if (strlen($this->view['data']['fax']) > 0) { ?>
|
|
|
157 |
<?php echo wpsg_drawForm_Text(__('Fax', 'wpsg'), $this->view['data']['fax'], array('text' => true)); ?>
|
|
|
158 |
<?php } ?>
|
|
|
159 |
<?php } ?>
|
|
|
160 |
<?php if ($this->view['pflicht']['tel'] != '2') { ?>
|
|
|
161 |
<?php if (strlen($this->view['data']['tel']) > 0) { ?>
|
|
|
162 |
<?php echo wpsg_drawForm_Text(__('Telefon', 'wpsg'), $this->view['data']['tel'], array('text' => true)); ?>
|
|
|
163 |
<?php } ?>
|
|
|
164 |
<?php } ?>
|
7210 |
daniel |
165 |
|
|
|
166 |
|
|
|
167 |
<?php echo wpsg_drawForm_Text(__('UStIdNr.', 'wpsg'), $this->view['data']['ustidnr'], array('text' => true)); ?>
|
|
|
168 |
<br />
|
|
|
169 |
|
5720 |
daniel |
170 |
<?php $this->callMods('wpsg_order_view_customerdata', array(&$this->view['data']['id'])); ?>
|
|
|
171 |
|
|
|
172 |
<?php echo wpsg_drawForm_TextStart(); ?>
|
7087 |
thomas |
173 |
<?php if ($this->view['pflicht']['email'] != '2') { ?>
|
|
|
174 |
<a href="mailto:<?php echo $this->view['data']['email']; ?>"><?php echo $this->view['data']['email']; ?></a>
|
|
|
175 |
<?php } ?>
|
6081 |
hartmut |
176 |
<?php echo wpsg_drawForm_TextEnd(__('E-Mail', 'wpsg')); ?>
|
7087 |
thomas |
177 |
|
8456 |
daniel |
178 |
<?php $email_einvoice = $Customer->getEMailEInvoice(); if ($email_einvoice !== null) { ?>
|
|
|
179 |
<?php echo wpsg_drawForm_TextStart(); ?>
|
|
|
180 |
<a href="mailto:<?php echo htmlspecialchars($email_einvoice); ?>"><?php echo htmlspecialchars($email_einvoice); ?></a>
|
|
|
181 |
<?php echo wpsg_drawForm_TextEnd(__('E-Mail für eRechnungen', 'wpsg')); ?>
|
|
|
182 |
<?php } ?>
|
|
|
183 |
|
7900 |
daniel |
184 |
<script>
|
5720 |
daniel |
185 |
|
|
|
186 |
function wpsg_saveInvoiceAdress()
|
|
|
187 |
{
|
|
|
188 |
|
|
|
189 |
jQuery('#wpsg_backend_loading').show();
|
|
|
190 |
|
|
|
191 |
jQuery.ajax( {
|
|
|
192 |
url: '<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Order&action=ajax&wpsg_action=saveInvoiceAdress&edit_id=<?php echo $this->view['data']['id']; ?>&noheader=1',
|
|
|
193 |
data: {
|
|
|
194 |
form_data: jQuery('#wpsg_customer_edit input, #wpsg_customer_edit select').serialize()
|
|
|
195 |
},
|
|
|
196 |
success: function(data) {
|
|
|
197 |
|
6846 |
hartmut |
198 |
//location.href = location.href;
|
|
|
199 |
location.reload();
|
5720 |
daniel |
200 |
|
|
|
201 |
}
|
|
|
202 |
} );
|
|
|
203 |
|
|
|
204 |
return false;
|
|
|
205 |
|
|
|
206 |
}
|
|
|
207 |
|
6846 |
hartmut |
208 |
jQuery(document).ready(function() {
|
|
|
209 |
|
|
|
210 |
jQuery('#dialog_land').bind('change', function() {
|
|
|
211 |
|
|
|
212 |
jQuery('#dialog_change_land').val('1');
|
|
|
213 |
|
|
|
214 |
} );
|
|
|
215 |
|
|
|
216 |
} );
|
|
|
217 |
|
|
|
218 |
|
7900 |
daniel |
219 |
</script>
|
5720 |
daniel |
220 |
|
7900 |
daniel |
221 |
<?php $arCV = $Customer->getCustomerVariables(); ?>
|
|
|
222 |
<?php if (wpsg_isSizedArray($arCV)) { ?>
|
|
|
223 |
|
|
|
224 |
<br />
|
|
|
225 |
<?php foreach ($Customer->getCustomerVariables() as $cv) { ?>
|
|
|
226 |
|
|
|
227 |
<?php echo wpsg_drawForm_Text($cv['label'], $cv['value']); ?>
|
|
|
228 |
|
|
|
229 |
<?php } ?>
|
|
|
230 |
|
|
|
231 |
<?php } ?>
|
|
|
232 |
|
5720 |
daniel |
233 |
<?php echo wpsg_drawForm_AdminboxEnd(); ?>
|