1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
|
<?php
declare(strict_types=1);
/**
* @author: Daniel Schmitzer (daniel@maennchen1.de)
* @date: 26.10.23
* @time: 18:55
*/
namespace wpsgTicket;
$arTicketTemplates = TicketTemplate::find();
$arFontVue = [];
foreach ($this->view['arFonts'] as $font_code => $font_label) {
$arFontVue[] = ['code' => $font_code, 'label' => $font_label];
}
?>
<div id="wpsg_ticket_modul">
<ul class="nav nav-tabs" role="tablist">
<li role="presentation" class="active"><a href="#tab1" role="tab" data-toggle="tab"><?php echo __('Einstellungen', 'wpsg'); ?></a></li>
<li role="presentation" class=""><a href="#tab2" role="tab" data-toggle="tab"><?php echo __('Templates', 'wpsg'); ?></a></li>
<li role="presentation" style="float:right;"><a href="#tab5" role="tab" data-toggle="tab"><?php echo __('Info / Hilfe', 'wpsg'); ?></a></li>
</ul>
<div class="tab-content">
<div role="tabpanel" class="tab-pane active" id="tab1">
<p>
<?php echo __('Beim Wechsel einer Bestellung auf einen der folgenden Bestellzuständen wird einmalig eine E-Mail mit den Tickets versendet.', 'wpsg'); ?>
</p>
<?php
$wpsg_mod_ticket_orderstate_send = Plugin::getInstance()->getSendOrderState();
?>
<select id="wpsg_mod_ticket_orderstate_send" multiple="multiple" size="5" style="border:1px solid black; width:100%;">
<?php foreach ($this->arStatus as $status_key => $status_label) { ?>
<option
<?php echo ((in_array($status_key, $wpsg_mod_ticket_orderstate_send))?'selected="selected"':''); ?>
value="<?php echo $status_key; ?>"><?php echo $status_label; ?></option>
<?php } ?>
</select>
<hr />
<p>
<?php echo __('Bei folgenden Bestellzuständen gilt ein Ticket als "aktiv" sofern es noch nicht entwertet wurde.', 'wpsg'); ?>
</p>
<?php
$wpsg_mod_ticket_orderstate_active = Plugin::getInstance()->getActiveOrderState();
?>
<select id="wpsg_mod_ticket_orderstate_active" multiple="multiple" size="5" style="border:1px solid black; width:100%;">
<?php foreach ($this->arStatus as $status_key => $status_label) { ?>
<option
<?php echo ((in_array($status_key, $wpsg_mod_ticket_orderstate_active))?'selected="selected"':''); ?>
value="<?php echo $status_key; ?>"><?php echo $status_label; ?></option>
<?php } ?>
</select>
</div>
<div role="tabpanel" class="tab-pane" id="tab2">
<?php echo $this->render(WPSG_PATH_VIEW.'/mods/mod_ticket/settings_edit_templates.phtml'); ?>
</div>
<div role="tabpanel" class="tab-pane" id="tab5">
TODO
</div>
</div>
<div v-if="loading" class="loading_layer">
<img src="<?php echo WPSG_URL; ?>views/gfx/ajax-loader.gif" alt="<?php echo __('Bitte warten ...', 'wpsg'); ?>" />
</div>
</div>
<style>
.items-center { justify-content:center; }
.items-start { justify-content:start; }
.flex { display:flex; }
.justify-between { justify-content:space-between; }
.mb-4 { margin-bottom:1rem; }
.gap-2 { gap:0.5rem; }
.text-center { text-align:center; }
#wpsg_ticket_modul .control-label { padding-top:0; font-size:1em; }
.checkbox_row { display:flex; flex-direction:row; align-items:center; justify-content:flex-start; gap:1rem; margin-bottom:0.5rem; }
.checkbox_row input { margin:0; }
#wpsg_ticket_modul { position:relative; }
#wpsg_ticket_modul a { text-decoration:none; position:relative; }
#wpsg_ticket_modul select.template_select { width:200px; }
#wpsg_ticket_modul > .loading_layer { position:absolute; left:0; top:0; width:100%; height:100%; transition:all 0.1s; display:flex; align-items:center; justify-content:center; background-color:rgba(255, 255, 255, 0.75); }
#wpsg_ticket_modul .field_table { width:100%; border-top:1px solid #dddddd; border-left:1px solid #dddddd; border-right:1px solid #dddddd; font-size:12px; }
#wpsg_ticket_modul .field_table td { padding:1px 5px; }
#wpsg_ticket_modul .field_table tbody > tr:first-child > * { padding-top:1rem; }
#wpsg_ticket_modul .field_table tbody > tr:last-child > * { padding-bottom:1rem; }
#wpsg_ticket_modul .field_table th { padding:1px 5px; }
#wpsg_ticket_modul .field_table tr > * { background-color:#f9f9f9; }
#wpsg_ticket_modul .field_table tr:nth-child(4) > * { border-bottom:1px solid #dddddd; padding-bottom:1rem; }
#wpsg_ticket_modul .field_table .w-1 { width:100px; font-size:12px; }
#wpsg_ticket_modul .field_table .w-2 { width:200px; font-size:12px; }
#wpsg_ticket_modul_template .head { width:100%; display:flex; align-items:center; justify-content:space-between; border-bottom:1px solid #DDDDDD; margin-bottom:1rem; padding-bottom:1rem; }
#wpsg_ticket_modul_template .head select { width:300px; }
#wpsg_ticket_modul_template .head div { flex-grow:1; }
#wpsg_ticket_modul_template .wpsg_field_wrap_template_name { display:flex; justify-content:space-between; align-items:center; padding-right:10px !important; }
#wpsg_ticket_modul_template .wpsg_field_wrap_template_name > div { gap:1rem; display:flex; justify-content:flex-start; align-items:center; }
#wpsg_ticket_modul_template .wpsg_field_wrap_template_name > input[type="text"] { flex:1; min-width:0; margin-right:1rem; }
#wpsg_ticket_modul_template .template td.col_bg,
#wpsg_ticket_modul_template .template td.col_align { width:50px; text-align:center; }
#wpsg_ticket_modul_template .template tr td { vertical-align:middle; }
#wpsg_ticket_modul_template .template tr td:last-child { text-align:right; }
#wpsg_ticket_modul_template .template tr td:last-child .wpsg-glyphicon { margin-right:0; }
#wpsg_ticket_modul_template .uploadstate { display:flex; justify-content:flex-start; align-items:center; }
#wpsg_ticket_modul_template .uploadstate > img { margin-right:1rem; }
#wpsg_ticket_modul_template .file_wrap { display:flex; justify-content:space-between; align-items:center; }
#wpsg_ticket_modul_template .file_wrap .file { display:flex; gap:1rem; justify-content:flex-end; align-items:center; }
#wpsg_ticket_modul_template .file_wrap .file .wpsg-glyphicon { margin-right:8px; }
#wpsg_ticket_modul_template .label-copy { display:flex; justify-content:space-between; }
#wpsg_ticket_modul_template .label-copy .glyphicon { font-size:14px; }
#wpsg_ticket_modul_template .col_w0 { width:50px; }
#wpsg_ticket_modul_template .col_w1 { width:100px; }
#wpsg_ticket_modul_template .col_w1 select,
#wpsg_ticket_modul_template .col_w1 input { width:100% !important; }
</style>
<script type="module">
const wpsgSettings = {
baseUrl: '<?php echo WPSG_URL; ?>'
};
import { ticket_settings_edit } from '<?php echo WPSG_URL; ?>mods/mod_ticket/assets/js/wpsg_modul.js';
ticket_settings_edit(wpsgSettings, '<?php echo \admin_url('admin-ajax.php'); ?>', <?php echo json_encode([
'arTemplates' => $arTicketTemplates,
'arFonts' => $arFontVue,
'label' => [
'copyTemplateConfirm' => __('Sind Sie sich sicher, dass sie das Template kopieren möchten?', 'wpsg'),
'removeFieldConfirm' => __('Sind Sie sich sicher, dass sie das Feld löschen möchten?', 'wpsg'),
'newTemplate' => __('Bitte die Bezeichnung des neuen Templates angeben.', 'wpsg'),
'error_noTemplateName' => __('Bitte eine Bezeichnung angeben', 'wpsg')
]
]); ?>);
</script>
|