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