Subversion Repositories wpShopGermany4

Rev

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

Rev Author Line No. Line
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">&times;</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 } ?>
58
                <br />
7087 thomas 59
                <?php if ($this->view['pflicht']['strasse'] != '2') { ?>
7247 daniel 60
 
61
					<?php echo wpsg_drawForm_Input('dialog_strasse', __('Straße', 'wpsg'), $this->view['data']['strasse']); ?>
62
 
7305 daniel 63
					<?php if (wpsg_getStr($this->view['pflicht']['wpsg_showNr']) === '1') { ?>
7247 daniel 64
 
65
						<?php echo wpsg_drawForm_Input('dialog_nr', __('Hausnummer', 'wpsg'), $this->view['data']['nr']); ?>
66
 
67
					<?php } ?>
68
 
7087 thomas 69
                <?php } ?>
70
                <?php if ($this->view['pflicht']['plz'] != '2') { ?>
71
                	<?php echo wpsg_drawForm_Input('dialog_plz', __('Postleitzahl', 'wpsg'), $this->view['data']['plz']); ?>
72
                <?php } ?>
73
                <?php if ($this->view['pflicht']['ort'] != '2') { ?>
74
                	<?php echo wpsg_drawForm_Input('dialog_ort', __('Ort', 'wpsg'), $this->view['data']['ort']); ?>
75
                <?php } ?>
76
                <?php if ($this->view['pflicht']['land'] != '2') { ?>
77
                	<?php echo wpsg_drawForm_Select('dialog_land', __('Land', 'wpsg'), $this->view['arCountry'], $this->view['data']['land']); ?>
78
				<?php } ?>
5720 daniel 79
                <br />
80
 
5846 thomas 81
                <?php echo wpsg_drawForm_Checkbox('dialog_customer', __('Auch Kundendaten anpassen', 'wpsg'), false, array('help' => 'dialog_customer')); ?>
82
                <?php echo wpsg_drawForm_Checkbox('dialog_all', __('Alle Bestellungen des Kunden ändern', 'wpsg'), false, array('help' => 'dialog_all')); ?>
83
 
84
                <?php if ($this->hasMod('wpsg_mod_shippingadress')) {?>
85
                <?php echo wpsg_drawForm_Checkbox('dialog_shipping', __('Auch Lieferanschrift anpassen', 'wpsg'), false, array('help' => 'dialog_shipping')); ?>
86
                <?php } ?>
6846 hartmut 87
				<input type="hidden" id="dialog_change_land" name="dialog_change_land" />
88
 
5720 daniel 89
            </div>
90
            <div class="modal-footer">
91
                <button type="button" class="btn btn-default" data-dismiss="modal"><?php echo __('Schließen', 'wpsg'); ?></button>
92
                <button type="button" class="btn btn-primary" onclick="return wpsg_saveInvoiceAdress();"><?php echo __('Speichern', 'wpsg'); ?></button>
93
            </div>
94
        </div>
95
    </div>
96
</div>
97
 
98
<?php echo wpsg_drawForm_AdminboxStart(__('Kundendaten', 'wpsg')); ?>
99
 
100
    <?php echo wpsg_drawForm_TextStart(); ?>
101
    <?php echo $this->view['oOrder']->getCustomer()->getNr(); ?>
102
    <?php if ($this->hasMod('wpsg_mod_kundenverwaltung')) { ?>
7612 daniel 103
	[&nbsp; <a href="<?php
104
 
105
		echo wpsg_admin_url('Customer', 'edit', ['edit_id' => $this->view['data']['k_id']]);
106
		//echo WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Customer&action=edit&edit_id='.$this->view['data']['k_id'];
107
 
108
	?>"><?php echo __('Zum Kunden', 'wpsg'); ?></a>&nbsp;]
5720 daniel 109
	<?php } ?>
6081 hartmut 110
    <?php echo wpsg_drawForm_TextEnd(__('Kundennummer', 'wpsg')); ?>
5720 daniel 111
 
112
    <?php echo wpsg_drawForm_TextStart(); ?>
7087 thomas 113
	<?php if ($this->view['pflicht']['firma'] != '2') { ?>
114
    	<?php if (trim($this->view['data']['firma']) != '') { ?>
115
    		<?php echo wpsg_hspc($this->view['data']['firma']); ?><br />
116
    	<?php } ?>
117
    <?php } ?>
118
 	<?php if ($this->view['pflicht']['anrede'] != '2') { ?>
119
    	<?php echo (($this->view['data']['title'] != '' && $this->view['data']['title'] != '-1')?wpsg_hspc($this->view['arTitles'][$this->view['data']['title']]).' ':''); ?>
120
    <?php } ?>
121
    <?php if ($this->view['pflicht']['vname'] != '2') { ?>
122
    	<?php echo wpsg_hspc($this->view['data']['vname']); ?>
123
    <?php } ?>
124
    <?php if ($this->view['pflicht']['name'] != '2') { ?>
125
    	<?php echo wpsg_hspc($this->view['data']['name']); ?><br />
126
    <?php } ?>
127
    <?php if ($this->view['pflicht']['strasse'] != '2') { ?>
7247 daniel 128
 
7305 daniel 129
		<?php echo wpsg_hspc($this->view['data']['strasse']); ?> <?php echo wpsg_hspc(wpsg_getStr($this->view['data']['nr'])); ?><br />
7247 daniel 130
 
7087 thomas 131
    <?php } ?>
132
   	<?php if ($this->view['pflicht']['plz'] != '2') { ?>
133
    	<?php echo wpsg_hspc($this->view['data']['plz']); ?>
134
    <?php } ?>
135
   	<?php if ($this->view['pflicht']['ort'] != '2') { ?>
136
    	<?php echo wpsg_hspc($this->view['data']['ort']); ?>
137
    <?php } ?>
138
    <?php if ($this->view['pflicht']['land'] != '2') { ?>
139
    	<?php echo wpsg_hspc($this->view['country']['kuerzel']); ?><br />
140
	<?php } ?>
6081 hartmut 141
    <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 142
        <span class="glyphicon glyphicon-pencil"></span>
143
    </a>
144
 
6081 hartmut 145
    <?php echo wpsg_drawForm_TextEnd(__('Anschrift', 'wpsg')); ?>
7087 thomas 146
 
147
    <?php if ($this->view['pflicht']['geb'] != '2') { ?>
148
    	<?php if (strtotime($this->view['data']['geb']) > 0) { ?>
149
    		<?php echo wpsg_drawForm_Text(__('Geburtsdatum', 'wpsg'), wpsg_fromDate($this->view['data']['geb']), array('text' => true)); ?>
150
    	<?php } ?>
151
	<?php } ?>
152
    <?php if ($this->view['pflicht']['fax'] != '2') { ?>
153
	    <?php if (strlen($this->view['data']['fax']) > 0) { ?>
154
	    	<?php echo wpsg_drawForm_Text(__('Fax', 'wpsg'), $this->view['data']['fax'], array('text' => true)); ?>
155
	    <?php } ?>
156
	<?php } ?>
157
    <?php if ($this->view['pflicht']['tel'] != '2') { ?>
158
	    <?php if (strlen($this->view['data']['tel']) > 0) { ?>
159
	    	<?php echo wpsg_drawForm_Text(__('Telefon', 'wpsg'), $this->view['data']['tel'], array('text' => true)); ?>
160
	    <?php } ?>
161
	<?php } ?>
7210 daniel 162
 
163
 
164
	<?php echo wpsg_drawForm_Text(__('UStIdNr.', 'wpsg'), $this->view['data']['ustidnr'], array('text' => true)); ?>
165
	<br />
166
 
5720 daniel 167
    <?php $this->callMods('wpsg_order_view_customerdata', array(&$this->view['data']['id'])); ?>
168
 
169
    <?php echo wpsg_drawForm_TextStart(); ?>
7087 thomas 170
     <?php if ($this->view['pflicht']['email'] != '2') { ?>
171
    	<a href="mailto:<?php echo $this->view['data']['email']; ?>"><?php echo $this->view['data']['email']; ?></a>
172
    <?php } ?>
6081 hartmut 173
    <?php echo wpsg_drawForm_TextEnd(__('E-Mail', 'wpsg')); ?>
7087 thomas 174
 
7900 daniel 175
    <script>
5720 daniel 176
 
177
        function wpsg_saveInvoiceAdress()
178
        {
179
 
180
            jQuery('#wpsg_backend_loading').show();
181
 
182
            jQuery.ajax( {
183
                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',
184
                data: {
185
                    form_data: jQuery('#wpsg_customer_edit input, #wpsg_customer_edit select').serialize()
186
                },
187
                success: function(data) {
188
 
6846 hartmut 189
                    //location.href = location.href;
190
                    location.reload();
5720 daniel 191
 
192
                }
193
            } );
194
 
195
            return false;
196
 
197
        }
198
 
6846 hartmut 199
        jQuery(document).ready(function() {
200
 
201
            jQuery('#dialog_land').bind('change', function() {
202
 
203
				jQuery('#dialog_change_land').val('1');
204
 
205
            } );
206
 
207
        } );
208
 
209
 
7900 daniel 210
    </script>
5720 daniel 211
 
7900 daniel 212
    <?php $arCV = $Customer->getCustomerVariables(); ?>
213
    <?php if (wpsg_isSizedArray($arCV)) { ?>
214
 
215
        <br />
216
        <?php foreach ($Customer->getCustomerVariables() as $cv) { ?>
217
 
218
            <?php echo wpsg_drawForm_Text($cv['label'], $cv['value']); ?>
219
 
220
        <?php } ?>
221
 
222
    <?php } ?>
223
 
5720 daniel 224
<?php echo wpsg_drawForm_AdminboxEnd(); ?>