Subversion Repositories wpShopGermany4

Rev

Rev 5913 | Rev 6052 | 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)); ?>
32
                <?php echo wpsg_drawForm_Text('Feld-Begrenzungs', $this->view['profil']['field_enclosure'], 'field_enclosure', array('inlineEdit' => true, 'inlineEdit_url' => $inlineEdit_url)); ?>
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)); ?>
41
                <?php echo wpsg_drawForm_Text('Bestellung-Tagname', $this->view['profil']['xml_ordertag'], 'xml_ordertag', array('inlineEdit' => true, 'inlineEdit_url' => $inlineEdit_url)); ?>
42
                <?php echo wpsg_drawForm_Text('Produkt-Root-Tagname', $this->view['profil']['xml_productroottag'], 'xml_productroottag', array('inlineEdit' => true, 'inlineEdit_url' => $inlineEdit_url)); ?>
43
                <?php echo wpsg_drawForm_Text('Produkt-Tagname', $this->view['profil']['xml_producttag'], 'xml_producttag', array('inlineEdit' => true, 'inlineEdit_url' => $inlineEdit_url)); ?>
44
 
45
            </div>
46
 
5896 daniel 47
            <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 48
                <?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 49
            </div>
5911 daniel 50
 
51
            <br />
5896 daniel 52
 
5911 daniel 53
            <?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)); ?>
54
 
5896 daniel 55
            <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 56
            <?php echo wpsg_drawForm_Checkbox('order_online', __('Eine Zeile pro Bestellung', 'wpsg'), $this->view['profil']['order_online'], array('inlineEdit' => true, 'inlineEdit_url' => $inlineEdit_url)); ?>
57
            </div>
5896 daniel 58
 
5911 daniel 59
            <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'); ?>">
60
 
5896 daniel 61
                <?php echo wpsg_drawForm_Checkbox('csv_fieldnames', __('Spaltennamen in erster Spalte', 'wpsg'), $this->view['profil']['csv_fieldnames'], array('inlineEdit' => true, 'inlineEdit_url' => $inlineEdit_url)); ?>
62
 
63
            </div>
64
 
65
        </div>
66
 
5911 daniel 67
        <div id="tab2" role="tabpanel" class="tab-pane">
5896 daniel 68
 
69
            <div id="wpsg_mod_export_fields"><?php echo $this->view['strFields']; ?></div>
70
 
71
        </div>
5911 daniel 72
 
73
        <div id="tab3" role="tabpanel" class="tab-pane">
74
 
75
            <?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']))); ?>
76
 
77
            <div class="cron_interval cron_interval_1" style="<?php echo (($this->view['profil']['cron_interval'] == '0')?'display:none;':''); ?>">
78
 
79
                <?php echo wpsg_drawForm_Text(__('Pfad', 'wpsg'), $this->view['profil']['cron_path'], 'cron_path', array('inlineEdit' => true, 'inlineEdit_url' => $inlineEdit_url)); ?>
5912 daniel 80
                <?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)); ?>
81
                <?php echo wpsg_drawForm_Text(__('Cron Pfad', 'wpsg'), WPSG_PATH.DIRECTORY_SEPARATOR.'cron.php', false, array('noP' => false)); ?>
82
                <?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 83
 
84
                <fieldset id="wpsg_mod_export_orderfilter">
85
 
5912 daniel 86
                    <legend><div class="col-sm-offset-6"><?php echo __('Bestellfilter', 'wpsg'); ?></div></legend>
87
 
5911 daniel 88
                    <form id="wpsg_mod_export_searchfilter">
89
 
90
                        <?php echo wpsg_drawForm_Text(__('Suchfeld', 'wpsg'), wpsg_getStr($this->view['profil']['orderfilter']['s']), 'orderfilter_s', array('inlineEdit' => true, 'inlineEdit_url' => $inlineEdit_url)); ?>
91
                        <?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)); ?>
92
 
93
                        <?php $arOrderStatus = wpsg_array_merge(array('-1' => __('Alle', 'wpsg')), $this->arStatus); ?>
94
                        <?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)); ?>
95
 
96
                        <?php $arMonth = array('-1' => __('Alle', 'wpsg')); ?>
97
                        <?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)); } ?>
98
 
99
                        <?php $arYearCdate = array('-1' => __('Alle', 'wpsg')); ?>
100
                        <?php foreach ($this->view['cdate_years'] as $y) { $arYearCdate[$y] = $y; } ?>
101
 
102
                        <?php $arYearInvoice = array('-1' => __('Alle', 'wpsg')); ?>
103
                        <?php foreach ($this->view['invoicedate_years'] as $y) { $arYearInvoice[$y] = $y; } ?>
104
 
105
                        <?php echo wpsg_drawForm_TextStart(); ?>
106
                        <div class="row">
107
                            <div class="col-lg-6">
108
                                <p id="orderfilter_cdate_m" class="form-control-static"><?php echo $arMonth[wpsg_getStr($this->view['profil']['orderfilter']['cdate_m'], '-1')]; ?></p>
109
                                <script type="text/javascript">/* <![CDATA[ */
110
 
111
                                    jQuery(document).ready(function() {
112
 
5934 hartmut 113
                                        jQuery('#orderfilter_cdate_m').wpsg_editable('<?php echo $inlineEdit_url; ?>', {
5911 daniel 114
                                            'test': '1', 'placement': 'bottom', 'type': 'select',  'data': <?php echo wpsg_prepare_for_inlineEdit($arMonth); ?>
115
                                        } );
116
 
117
                                    } );
118
 
119
                                /* ]]> */</script>
120
                            </div>
121
                            <div class="col-lg-6">
122
                                <p id="orderfilter_cdate_y" class="form-control-static"><?php echo $arYearCdate[wpsg_getStr($this->view['profil']['orderfilter']['cdate_y'], '-1')]; ?></p>
123
                                <script type="text/javascript">/* <![CDATA[ */
124
 
125
                                    jQuery(document).ready(function() {
126
 
5934 hartmut 127
                                        jQuery('#orderfilter_cdate_y').wpsg_editable('<?php echo $inlineEdit_url; ?>', {
5911 daniel 128
                                            'placement': 'bottom', 'type': 'select',  'data': <?php echo wpsg_prepare_for_inlineEdit($arYearCdate); ?>
129
                                        } );
130
 
131
                                    } );
132
 
133
                                /* ]]> */</script>
134
                            </div>
135
                        </div>
136
                        <?php echo wpsg_drawForm_TextEnd(__('Bestelldatum (Monat/Jahr)', 'wpsg'), array('noP' => true)); ?>
137
 
138
                        <?php if ($this->hasMod('wpsg_mod_rechnungen')) { ?>
139
                        <?php echo wpsg_drawForm_TextStart(); ?>
140
                        <div class="row">
141
                            <div class="col-lg-6">
142
                                <p id="orderfilter_invoicedate_m" class="form-control-static"><?php echo $arMonth[wpsg_getStr($this->view['profil']['orderfilter']['invoicedate_m'], '-1')]; ?></p>
143
                                <script type="text/javascript">/* <![CDATA[ */
144
 
145
                                    jQuery(document).ready(function() {
146
 
5934 hartmut 147
                                        jQuery('#orderfilter_invoicedate_m').wpsg_editable('<?php echo $inlineEdit_url; ?>', {
5911 daniel 148
                                            'placement': 'bottom', 'type': 'select',  'data': <?php echo wpsg_prepare_for_inlineEdit($arMonth); ?>
149
                                        } );
150
 
151
                                    } );
152
 
153
                                /* ]]> */</script>
154
                            </div>
155
                            <div class="col-lg-6">
156
                                <p id="orderfilter_invoicedate_y" class="form-control-static"><?php echo $arYearInvoice[wpsg_getStr($this->view['profil']['orderfilter']['invoicedate_y'], '-1')]; ?></p>
157
                                <script type="text/javascript">/* <![CDATA[ */
158
 
159
                                    jQuery(document).ready(function() {
160
 
5934 hartmut 161
                                        jQuery('#orderfilter_invoicedate_y').wpsg_editable('<?php echo $inlineEdit_url; ?>', {
5911 daniel 162
                                            'placement': 'bottom', 'type': 'select',  'data': <?php echo wpsg_prepare_for_inlineEdit($arYearInvoice); ?>
163
                                        } );
164
 
165
                                    } );
166
 
167
                                /* ]]> */</script>
168
                            </div>
169
                        </div>
170
                        <?php echo wpsg_drawForm_TextEnd(__('Rechnungsdatum (Monat/Jahr)', 'wpsg'), array('noP' => true)); ?>
171
                        <?php } ?>
172
 
173
                    </form>
174
 
175
                </fieldset>
176
 
177
            </div>
178
 
179
        </div>
180
 
5896 daniel 181
    </div>
1197 daniel 182
</div>
183
 
2598 daniel 184
<br />
185
 
5896 daniel 186
<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 187
 
5896 daniel 188
<script type="text/javascript">/* <![CDATA[ */
5856 thomas 189
 
5911 daniel 190
    function switchCronType(response, newValue)
191
    {
192
 
193
        if (newValue != "0") jQuery('.cron_interval_1').show();
194
        else jQuery('.cron_interval_1').hide();
195
 
196
    }
197
 
5896 daniel 198
    function samplefile_success(data)
199
    {
200
 
201
        jQuery('#wpsg_mod_export_fields').html(data);
202
        jQuery('#samplefile').val('');
203
 
204
    }
205
 
206
    jQuery(document).ready(function() {
207
 
208
		jQuery('#format').on('save', function(e, params) {
1197 daniel 209
 
5896 daniel 210
			jQuery('.wpsg_mod_export_format').hide();
211
			jQuery('.wpsg_mod_export_format_' + params.newValue).show();
1197 daniel 212
 
1212 daniel 213
		} );
5913 daniel 214
 
215
        jQuery('#name').on('save', function(e, params) {
216
 
217
            jQuery('#wpsg_mod_export_profil option[value="<?php echo $this->view['profil']['id']; ?>"]').text(params.newValue);
218
 
219
		} );
1210 daniel 220
 
221
	} );
222
 
5896 daniel 223
/* ]]> */</script>