Subversion Repositories wpShopGermany4

Rev

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

Rev Author Line No. Line
1197 daniel 1
<?php
2
 
3
	/**
4
	 * Template für die Einstellungen eines Profils
5
	 */
6
 
5911 daniel 7
	$inlineEdit_url = WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_export&do=inlinedit&noheader=1&profil_id='.$this->view['profil']['id'];
5896 daniel 8
	$upload_url = WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_export&do=musterupload&noheader=1&profil_id='.$this->view['profil']['id'];
9
 
1197 daniel 10
?>
11
 
12
<?php echo $this->writeBackendMessage(); ?>
13
 
5896 daniel 14
<div id="wpsg_mod_export_profil_tab">
15
    <ul class="nav nav-tabs" role="tablist">
16
        <li role="presentation" class="active"><a href="#tab1" aria-controls="home" role="tab" data-toggle="tab"><?php echo __('Profiloptionen', 'wpsg'); ?></a></li>
17
        <li role="presentation"><a href="#tab2" aria-controls="profile" role="tab" data-toggle="tab"><?php echo __('Feldkonfiguration', 'wpsg'); ?></a></li>
5911 daniel 18
        <li role="presentation"><a href="#tab3" aria-controls="cron" role="tab" data-toggle="tab"><?php echo __('Automatische Ausführung', 'wpsg'); ?></a></li>
5896 daniel 19
    </ul>
20
	<div class="tab-content">
5911 daniel 21
		<div id="tab1" role="tabpanel" class="tab-pane active">
5896 daniel 22
 
23
            <?php echo wpsg_drawForm_Text(__('Profilname', 'wpsg'), $this->view['profil']['name'], 'name', array('inlineEdit' => true, 'inlineEdit_url' => $inlineEdit_url)); ?>
24
            <?php echo wpsg_drawForm_Text(__('Dateiname', 'wpsg'), $this->view['profil']['filename'], 'filename', array('inlineEdit' => true, 'inlineEdit_url' => $inlineEdit_url)); ?>
25
            <?php echo wpsg_drawForm_Text(__('Encoding', 'wpsg'), $this->view['arFileEncoding'][$this->view['profil']['file_encoding']], 'file_encoding', array('inlineEdit' => true, 'inlineEdit_type' => 'select', 'inlineEdit_source' => $this->view['arFileEncoding'], 'inlineEdit_url' => $inlineEdit_url)); ?>
26
            <?php echo wpsg_drawForm_Text(__('Dateiformat', 'wpsg'), $this->view['arExportFormats'][$this->view['profil']['format']], 'format', array('inlineEdit' => true, 'inlineEdit_type' => 'select', 'inlineEdit_source' => $this->view['arExportFormats'], 'inlineEdit_url' => $inlineEdit_url)); ?>
27
 
28
            <?php /* CSV */ ?>
29
            <div class="wpsg_mod_export_format wpsg_mod_export_format_<?php echo wpsg_mod_export::FORMAT_CSV; ?>" style="display:<?php echo (($this->view['profil']['format'] == wpsg_mod_export::FORMAT_CSV)?'block':'none'); ?>;">
30
 
31
                <?php echo wpsg_drawForm_Text('Feld-Trennzeichen', $this->view['profil']['field_delimiter'], 'field_delimiter', array('inlineEdit' => true, 'inlineEdit_url' => $inlineEdit_url)); ?>
6052 hartmut 32
                <?php echo wpsg_drawForm_Text('Feld-Begrenzung', $this->view['profil']['field_enclosure'], 'field_enclosure', array('inlineEdit' => true, 'inlineEdit_url' => $inlineEdit_url)); ?>
5896 daniel 33
                <?php echo wpsg_drawForm_Text('Maskierungs-Zeichen', $this->view['profil']['field_escape'], 'field_escape', array('inlineEdit' => true, 'inlineEdit_url' => $inlineEdit_url)); ?>
34
 
35
            </div>
36
 
5911 daniel 37
            <?php /* XML */ ?>
38
            <div class="wpsg_mod_export_format wpsg_mod_export_format_<?php echo wpsg_mod_export::FORMAT_XML; ?>" style="display:<?php echo (($this->view['profil']['format'] == wpsg_mod_export::FORMAT_XML)?'block':'none'); ?>;">
39
 
40
                <?php echo wpsg_drawForm_Text('Root-Tagname', $this->view['profil']['xml_roottag'], 'xml_roottag', array('inlineEdit' => true, 'inlineEdit_url' => $inlineEdit_url)); ?>
6425 daniel 41
 
42
                <?php if ($this->view['profil']['export_type'] === wpsg_mod_export::TYPE_ORDER) { ?>
43
                    <?php echo wpsg_drawForm_Text('Bestellung-Tagname', $this->view['profil']['xml_ordertag'], 'xml_ordertag', array('inlineEdit' => true, 'inlineEdit_url' => $inlineEdit_url)); ?>
44
                    <?php echo wpsg_drawForm_Text('Produkt-Root-Tagname', $this->view['profil']['xml_productroottag'], 'xml_productroottag', array('inlineEdit' => true, 'inlineEdit_url' => $inlineEdit_url)); ?>
45
                <?php } ?>
46
 
5911 daniel 47
                <?php echo wpsg_drawForm_Text('Produkt-Tagname', $this->view['profil']['xml_producttag'], 'xml_producttag', array('inlineEdit' => true, 'inlineEdit_url' => $inlineEdit_url)); ?>
48
 
49
            </div>
50
 
5896 daniel 51
            <div class="wpsg_mod_export_format wpsg_mod_export_format_<?php echo wpsg_mod_export::FORMAT_CSV; ?>" style="display:<?php echo (($this->view['profil']['format'] == wpsg_mod_export::FORMAT_CSV)?'block':'none'); ?>">
5911 daniel 52
                <?php echo wpsg_drawForm_Upload('samplefile', __('Muster Vorlage', 'wpsg'), false, '50', '100000', array('ajax_upload' => true, 'ajax_upload_url' => $upload_url, 'ajax_success' => 'samplefile_success')); ?>
5896 daniel 53
            </div>
5911 daniel 54
 
55
            <br />
56
 
6425 daniel 57
            <?php if ($this->view['profil']['export_type'] === wpsg_mod_export::TYPE_ORDER) { ?>
5896 daniel 58
 
6425 daniel 59
                <?php echo wpsg_drawForm_Checkbox('order_onetime', __('Bestellungen nur einmalig exportieren', 'wpsg'), $this->view['profil']['order_onetime'], array('label' => __('Optionen', 'wpsg'), 'inlineEdit' => true, 'inlineEdit_url' => $inlineEdit_url)); ?>
60
 
61
                <div class="wpsg_mod_export_format wpsg_mod_export_format_<?php echo wpsg_mod_export::FORMAT_CSV; ?>" style="display:<?php echo (($this->view['profil']['format'] == wpsg_mod_export::FORMAT_CSV)?'block':'none'); ?>">
62
                <?php echo wpsg_drawForm_Checkbox('order_online', __('Eine Zeile pro Bestellung', 'wpsg'), $this->view['profil']['order_online'], array('inlineEdit' => true, 'inlineEdit_url' => $inlineEdit_url)); ?>
63
                </div>
64
 
65
            <?php } ?>
66
 
5911 daniel 67
            <div class="wpsg_mod_export_format wpsg_mod_export_format_<?php echo wpsg_mod_export::FORMAT_CSV; ?>" style="display:<?php echo (($this->view['profil']['format'] == wpsg_mod_export::FORMAT_CSV)?'block':'none'); ?>">
68
 
6052 hartmut 69
                <?php echo wpsg_drawForm_Checkbox('csv_fieldnames', __('Spaltennamen in erster Zeile', 'wpsg'), $this->view['profil']['csv_fieldnames'], array('inlineEdit' => true, 'inlineEdit_url' => $inlineEdit_url)); ?>
5896 daniel 70
 
71
            </div>
72
 
73
        </div>
74
 
5911 daniel 75
        <div id="tab2" role="tabpanel" class="tab-pane">
5896 daniel 76
 
77
            <div id="wpsg_mod_export_fields"><?php echo $this->view['strFields']; ?></div>
78
 
79
        </div>
5911 daniel 80
 
81
        <div id="tab3" role="tabpanel" class="tab-pane">
82
 
83
            <?php echo wpsg_drawForm_Text(__('Automatische Ausführung aktivieren', 'wpsg'), $this->view['arCronTypes'][$this->view['profil']['cron_interval']], 'cron_interval', array('inlineEdit' => true, 'inlineEdit_callback' => 'switchCronType', 'inlineEdit_url' => $inlineEdit_url, 'inlineEdit_type' => 'select', 'inlineEdit_source' => wpsg_prepare_for_inlineEdit($this->view['arCronTypes']))); ?>
84
 
85
            <div class="cron_interval cron_interval_1" style="<?php echo (($this->view['profil']['cron_interval'] == '0')?'display:none;':''); ?>">
86
 
87
                <?php echo wpsg_drawForm_Text(__('Pfad', 'wpsg'), $this->view['profil']['cron_path'], 'cron_path', array('inlineEdit' => true, 'inlineEdit_url' => $inlineEdit_url)); ?>
5912 daniel 88
                <?php echo wpsg_drawForm_Text(__('Letzte Ausführung', 'wpsg'), (($this->view['profil']['cron_lastrun'] == '0000-00-00')?__('Noch nie', 'wpsg'):wpsg_formatTimestamp($this->view['profil']['cron_lastrun'], true)), false, array('noP' => false)); ?>
89
                <?php echo wpsg_drawForm_Text(__('Cron Pfad', 'wpsg'), WPSG_PATH.DIRECTORY_SEPARATOR.'cron.php', false, array('noP' => false)); ?>
90
                <?php echo wpsg_drawForm_Text(__('Cron URL', 'wpsg'), '<a href="'.WPSG_PLUGIN_URL.'wpshopgermany/cron.php">'.WPSG_PLUGIN_URL.'wpshopgermany/cron.php</a>', false, array('noP' => false)); ?>
5911 daniel 91
 
6425 daniel 92
                <?php if ($this->view['profil']['export_type'] === wpsg_mod_export::TYPE_ORDER) { ?>
5911 daniel 93
                <fieldset id="wpsg_mod_export_orderfilter">
94
 
5912 daniel 95
                    <legend><div class="col-sm-offset-6"><?php echo __('Bestellfilter', 'wpsg'); ?></div></legend>
96
 
5911 daniel 97
                    <form id="wpsg_mod_export_searchfilter">
98
 
99
                        <?php echo wpsg_drawForm_Text(__('Suchfeld', 'wpsg'), wpsg_getStr($this->view['profil']['orderfilter']['s']), 'orderfilter_s', array('inlineEdit' => true, 'inlineEdit_url' => $inlineEdit_url)); ?>
100
                        <?php echo wpsg_drawForm_Text(__('Kunde (ID)', 'wpsg'), wpsg_getStr($this->view['profil']['orderfilter']['k_id']), 'orderfilter_k_id', array('inlineEdit' => true, 'inlineEdit_url' => $inlineEdit_url)); ?>
101
 
102
                        <?php $arOrderStatus = wpsg_array_merge(array('-1' => __('Alle', 'wpsg')), $this->arStatus); ?>
103
                        <?php echo wpsg_drawForm_Text(__('Bestellstatus', 'wpsg'), $arOrderStatus[wpsg_getStr($this->view['profil']['orderfilter']['status'], '-1')], 'orderfilter_status', array('inlineEdit' => true, 'inlineEdit_type' => 'select', 'inlineEdit_url' => $inlineEdit_url, 'inlineEdit_source' => $arOrderStatus)); ?>
104
 
105
                        <?php $arMonth = array('-1' => __('Alle', 'wpsg')); ?>
106
                        <?php for ($i = 1; $i <= 12; $i ++) { $arMonth[str_pad($i, 2, '0', STR_PAD_LEFT)] = strftime("%B", mktime(0, 0, 0, $i, 1, 2000)); } ?>
107
 
108
                        <?php $arYearCdate = array('-1' => __('Alle', 'wpsg')); ?>
109
                        <?php foreach ($this->view['cdate_years'] as $y) { $arYearCdate[$y] = $y; } ?>
110
 
111
                        <?php $arYearInvoice = array('-1' => __('Alle', 'wpsg')); ?>
112
                        <?php foreach ($this->view['invoicedate_years'] as $y) { $arYearInvoice[$y] = $y; } ?>
113
 
114
                        <?php echo wpsg_drawForm_TextStart(); ?>
115
                        <div class="row">
116
                            <div class="col-lg-6">
117
                                <p id="orderfilter_cdate_m" class="form-control-static"><?php echo $arMonth[wpsg_getStr($this->view['profil']['orderfilter']['cdate_m'], '-1')]; ?></p>
118
                                <script type="text/javascript">/* <![CDATA[ */
119
 
120
                                    jQuery(document).ready(function() {
121
 
5934 hartmut 122
                                        jQuery('#orderfilter_cdate_m').wpsg_editable('<?php echo $inlineEdit_url; ?>', {
5911 daniel 123
                                            'test': '1', 'placement': 'bottom', 'type': 'select',  'data': <?php echo wpsg_prepare_for_inlineEdit($arMonth); ?>
124
                                        } );
125
 
126
                                    } );
127
 
128
                                /* ]]> */</script>
129
                            </div>
130
                            <div class="col-lg-6">
131
                                <p id="orderfilter_cdate_y" class="form-control-static"><?php echo $arYearCdate[wpsg_getStr($this->view['profil']['orderfilter']['cdate_y'], '-1')]; ?></p>
132
                                <script type="text/javascript">/* <![CDATA[ */
133
 
134
                                    jQuery(document).ready(function() {
135
 
5934 hartmut 136
                                        jQuery('#orderfilter_cdate_y').wpsg_editable('<?php echo $inlineEdit_url; ?>', {
5911 daniel 137
                                            'placement': 'bottom', 'type': 'select',  'data': <?php echo wpsg_prepare_for_inlineEdit($arYearCdate); ?>
138
                                        } );
139
 
140
                                    } );
141
 
142
                                /* ]]> */</script>
143
                            </div>
144
                        </div>
145
                        <?php echo wpsg_drawForm_TextEnd(__('Bestelldatum (Monat/Jahr)', 'wpsg'), array('noP' => true)); ?>
146
 
147
                        <?php if ($this->hasMod('wpsg_mod_rechnungen')) { ?>
148
                        <?php echo wpsg_drawForm_TextStart(); ?>
149
                        <div class="row">
150
                            <div class="col-lg-6">
151
                                <p id="orderfilter_invoicedate_m" class="form-control-static"><?php echo $arMonth[wpsg_getStr($this->view['profil']['orderfilter']['invoicedate_m'], '-1')]; ?></p>
152
                                <script type="text/javascript">/* <![CDATA[ */
153
 
154
                                    jQuery(document).ready(function() {
155
 
5934 hartmut 156
                                        jQuery('#orderfilter_invoicedate_m').wpsg_editable('<?php echo $inlineEdit_url; ?>', {
5911 daniel 157
                                            'placement': 'bottom', 'type': 'select',  'data': <?php echo wpsg_prepare_for_inlineEdit($arMonth); ?>
158
                                        } );
159
 
160
                                    } );
161
 
162
                                /* ]]> */</script>
163
                            </div>
164
                            <div class="col-lg-6">
165
                                <p id="orderfilter_invoicedate_y" class="form-control-static"><?php echo $arYearInvoice[wpsg_getStr($this->view['profil']['orderfilter']['invoicedate_y'], '-1')]; ?></p>
166
                                <script type="text/javascript">/* <![CDATA[ */
167
 
168
                                    jQuery(document).ready(function() {
169
 
5934 hartmut 170
                                        jQuery('#orderfilter_invoicedate_y').wpsg_editable('<?php echo $inlineEdit_url; ?>', {
5911 daniel 171
                                            'placement': 'bottom', 'type': 'select',  'data': <?php echo wpsg_prepare_for_inlineEdit($arYearInvoice); ?>
172
                                        } );
173
 
174
                                    } );
175
 
176
                                /* ]]> */</script>
177
                            </div>
178
                        </div>
179
                        <?php echo wpsg_drawForm_TextEnd(__('Rechnungsdatum (Monat/Jahr)', 'wpsg'), array('noP' => true)); ?>
180
                        <?php } ?>
181
 
182
                    </form>
183
 
184
                </fieldset>
6425 daniel 185
                <?php } else if ($this->view['profil']['export_type'] === wpsg_mod_export::TYPE_PRODUCT) { ?>
186
                <fieldset id="wpsg_mod_export_productfilter">
187
 
188
                    <legend><div class="col-sm-offset-6"><?php echo __('Produktfilter', 'wpsg'); ?></div></legend>
189
 
190
                    <form id="wpsg_mod_export_searchfilter">
191
 
192
                        <?php echo wpsg_drawForm_Text(__('Suchfeld', 'wpsg'), wpsg_getStr($this->view['profil']['orderfilter']['s']), 'orderfilter_s', array('inlineEdit' => true, 'inlineEdit_url' => $inlineEdit_url)); ?>
193
 
194
                        <?php if ($this->hasMod('wpsg_mod_productgroups')) { $arProductGroupSelect = array('-1' => __('Alle Produktgruppen', 'wpsg')) + wpsg_productgroup::getProductgroupSelect(); ?>
195
                        <?php echo wpsg_drawForm_Text(__('Produktgruppe', 'wpsg'), $arProductGroupSelect[wpsg_getStr($this->view['profil']['orderfilter']['productgroup_ids'], '-1')], 'orderfilter_productgroup_ids', array('inlineEdit' => true, 'inlineEdit_type' => 'select', 'inlineEdit_url' => $inlineEdit_url, 'inlineEdit_source' => $arProductGroupSelect)); ?>
196
                        <?php } ?>
197
 
198
                        <?php if ($this->hasMod('wpsg_mod_produktartikel')) { $temp = $this->callMod('wpsg_mod_produktartikel', 'getProductcategorySelect', array()); ?>
199
                        <?php $arProductCategorySelect = array(); foreach ($temp as $k => $v) $arProductCategorySelect[$v['term_id']] = $v['label']; ?>
200
                        <?php echo wpsg_drawForm_Text(__('Produktkategorie', 'wpsg'), $arProductCategorySelect[wpsg_getStr($this->view['profil']['orderfilter']['productcategory_ids'], '-1')], 'orderfilter_productcategory_ids', array('inlineEdit' => true, 'inlineEdit_type' => 'select', 'inlineEdit_url' => $inlineEdit_url, 'inlineEdit_source' => $arProductCategorySelect)); ?>
201
                        <?php } ?>
202
 
203
                    </form>
204
 
205
                </fieldset>
206
                <?php } ?>
5911 daniel 207
 
208
            </div>
209
 
210
        </div>
211
 
5896 daniel 212
    </div>
1197 daniel 213
</div>
214
 
2598 daniel 215
<br />
216
 
5896 daniel 217
<a onclick="return wpsg_mod_export_removeProfil(<?php echo $this->view['profil']['id']; ?>);" href="#"><span class="glyphicon glyphicon-trash wpsg-glyphicon"></span><?php echo __('Profil löschen', 'wpsg'); ?></a>
1197 daniel 218
 
5896 daniel 219
<script type="text/javascript">/* <![CDATA[ */
5856 thomas 220
 
5911 daniel 221
    function switchCronType(response, newValue)
222
    {
223
 
224
        if (newValue != "0") jQuery('.cron_interval_1').show();
225
        else jQuery('.cron_interval_1').hide();
226
 
227
    }
228
 
5896 daniel 229
    function samplefile_success(data)
230
    {
231
 
232
        jQuery('#wpsg_mod_export_fields').html(data);
233
        jQuery('#samplefile').val('');
234
 
235
    }
236
 
237
    jQuery(document).ready(function() {
238
 
239
		jQuery('#format').on('save', function(e, params) {
1197 daniel 240
 
5896 daniel 241
			jQuery('.wpsg_mod_export_format').hide();
242
			jQuery('.wpsg_mod_export_format_' + params.newValue).show();
1197 daniel 243
 
1212 daniel 244
		} );
5913 daniel 245
 
246
        jQuery('#name').on('save', function(e, params) {
247
 
248
            jQuery('#wpsg_mod_export_profil option[value="<?php echo $this->view['profil']['id']; ?>"]').text(params.newValue);
249
 
250
		} );
1210 daniel 251
 
252
	} );
253
 
5896 daniel 254
/* ]]> */</script>