1067 |
daniel |
1 |
<?php
|
|
|
2 |
|
|
|
3 |
/**
|
|
|
4 |
* Template für die Verwaltung der Kundendaten
|
|
|
5 |
*/
|
|
|
6 |
|
|
|
7 |
?>
|
5439 |
daniel |
8 |
|
1067 |
daniel |
9 |
<div class="wpsg_admin_submenu">
|
|
|
10 |
|
5439 |
daniel |
11 |
<div class="list-group">
|
|
|
12 |
<span class="list-group-head list-group-item"><?php echo __('Konfiguration'); ?></span>
|
|
|
13 |
<?php foreach ($this->view['arSubAction'] as $k => $v) { ?>
|
|
|
14 |
<a class="list-group-item <?php echo (($k == $this->view['subAction'])?'active':''); ?>" href="<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&subaction=<?php echo $k; ?>"><?php echo $v['Menutext']; ?></a>
|
1067 |
daniel |
15 |
<?php } ?>
|
5439 |
daniel |
16 |
</div>
|
|
|
17 |
|
1067 |
daniel |
18 |
</div>
|
|
|
19 |
|
5447 |
daniel |
20 |
<!-- Modal für Codeanzeige -->
|
5439 |
daniel |
21 |
<div class="modal fade" id="wpsg_code_dialog" tabindex="-1" role="dialog">
|
|
|
22 |
<div class="modal-dialog" role="document">
|
|
|
23 |
<div class="modal-content">
|
|
|
24 |
<div class="modal-header">
|
|
|
25 |
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
|
|
26 |
<h4 class="modal-title" id="myModalLabel"><?php echo __('HTML Code Block', 'wpsg'); ?></h4>
|
|
|
27 |
</div>
|
|
|
28 |
<div class="modal-body">
|
|
|
29 |
|
|
|
30 |
</div>
|
|
|
31 |
<div class="modal-footer">
|
|
|
32 |
<button type="button" class="btn btn-default" data-dismiss="modal"><?php echo __('Schließen', 'wpsg'); ?></button>
|
|
|
33 |
</div>
|
|
|
34 |
</div>
|
|
|
35 |
</div>
|
|
|
36 |
</div>
|
|
|
37 |
|
|
|
38 |
<div class="wpsg_admin_content form-horizontal wpsg_customerfield">
|
|
|
39 |
|
7527 |
daniel |
40 |
<form name="form1" method="post" enctype="multipart/form-data" action="<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&subaction=<?php echo $_REQUEST['subaction']; ?>&noheader=1">
|
5439 |
daniel |
41 |
|
7558 |
daniel |
42 |
<?php echo wp_nonce_field('wpsg-admin-kundendaten'); ?>
|
|
|
43 |
|
5439 |
daniel |
44 |
<div class="panel panel-default">
|
|
|
45 |
<div class="panel-heading clearfix">
|
|
|
46 |
<h3 class="panel-title"><?php echo __('Kundendaten', 'wpsg'); ?></h3>
|
|
|
47 |
</div>
|
|
|
48 |
<div class="panel-body">
|
|
|
49 |
|
|
|
50 |
<ul class="nav nav-tabs" role="tablist">
|
6871 |
hartmut |
51 |
<li role="presentation" class="active"><a href="#tabcontent1" role="tab" aria-controls="tabcontent1" data-toggle="tab"><?php echo __('Pflichtfelder', 'wpsg'); ?></a></li>
|
5439 |
daniel |
52 |
<li role="presentation" class=""><a href="#tabcontent2" role="tab" aria-controls="tabcontent2" data-toggle="tab"><?php echo __('Weitere Kundendaten', 'wpsg'); ?></a></li>
|
|
|
53 |
<li role="presentation" class=""><a href="#tabcontent3" role="tab" aria-controls="tabcontent3" data-toggle="tab"><?php echo __('Kundenvoreinstellungen', 'wpsg'); ?></a></li>
|
|
|
54 |
</ul>
|
|
|
55 |
|
|
|
56 |
<div class="tab-content">
|
|
|
57 |
<div role="tabpanel" id="tabcontent1" class="tab-pane active">
|
|
|
58 |
<?php echo $this->render(WPSG_PATH_VIEW.'/admin/kundendaten_tab1.phtml'); ?>
|
1067 |
daniel |
59 |
</div>
|
5439 |
daniel |
60 |
<div role="tabpanel" id="tabcontent2" class="tab-pane">
|
5447 |
daniel |
61 |
|
|
|
62 |
<div id="wpsg_kv_list">
|
|
|
63 |
<?php echo $this->render(WPSG_PATH_VIEW.'/admin/kundendaten_tab2.phtml'); ?>
|
|
|
64 |
</div>
|
|
|
65 |
|
|
|
66 |
<div class="wpsg_clear"></div><br />
|
|
|
67 |
<a href="" onclick="return wpsg_addCustomField();"><span class="glyphicon glyphicon-plus"></span> <?php echo __('Neue Kundenvariable anlegen.', 'wpsg'); ?></a>
|
|
|
68 |
|
5439 |
daniel |
69 |
</div>
|
5447 |
daniel |
70 |
<div role="tabpanel" id="tabcontent3" class="tab-pane">
|
5439 |
daniel |
71 |
<?php echo $this->render(WPSG_PATH_VIEW.'/admin/kundendaten_tab3.phtml'); ?>
|
|
|
72 |
</div>
|
1067 |
daniel |
73 |
</div>
|
5439 |
daniel |
74 |
|
1067 |
daniel |
75 |
</div>
|
5439 |
daniel |
76 |
</div>
|
|
|
77 |
|
6008 |
hartmut |
78 |
<p class="submit"><input name="submit" type="submit" value="<?php echo __('Einstellungen Speichern', 'wpsg'); ?>" class="button-primary" /></p>
|
5439 |
daniel |
79 |
|
|
|
80 |
</form>
|
|
|
81 |
|
7558 |
daniel |
82 |
<script>
|
5439 |
daniel |
83 |
|
|
|
84 |
/**
|
|
|
85 |
* Fügt ein neues Feld in die Liste der Kundenvariablen ein und lädt die Liste neu
|
|
|
86 |
*/
|
|
|
87 |
function wpsg_addCustomField()
|
|
|
88 |
{
|
|
|
89 |
|
5447 |
daniel |
90 |
jQuery('#wpsg_kv_list').html('<img src="<?php echo WPSG_URL; ?>views/gfx/ajax-loader.gif" alt="<?php echo __('Bitte warten ...', 'wpsg'); ?>" />');
|
1067 |
daniel |
91 |
|
5439 |
daniel |
92 |
jQuery.ajax( {
|
7558 |
daniel |
93 |
url: '<?php echo html_entity_decode(wp_nonce_url(WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Admin&subaction=kundendaten&do=add&noheader=1', 'wpsg-admin-kundendaten-add')); ?>',
|
5439 |
daniel |
94 |
success: function(data) {
|
5447 |
daniel |
95 |
jQuery('#wpsg_kv_list').html(data);
|
5439 |
daniel |
96 |
}
|
|
|
97 |
} );
|
|
|
98 |
|
|
|
99 |
return false;
|
1067 |
daniel |
100 |
|
5439 |
daniel |
101 |
} // function wpsg_addCustomField()
|
1067 |
daniel |
102 |
|
5439 |
daniel |
103 |
/**
|
|
|
104 |
* Löscht eine Kundenvariable und entfernt die Zeile aus der Liste
|
|
|
105 |
*/
|
|
|
106 |
function wpsg_removeCustomField(kv_index)
|
|
|
107 |
{
|
1067 |
daniel |
108 |
|
5439 |
daniel |
109 |
if (!confirm('<?php echo __('Sind Sie sich sicher?', 'wpsg'); ?>')) return false;
|
|
|
110 |
|
|
|
111 |
jQuery('.wpsg_customervar_row_' + kv_index).hide(250, function() { jQuery(this).remove(); } );
|
1067 |
daniel |
112 |
|
5439 |
daniel |
113 |
jQuery.ajax( {
|
7558 |
daniel |
114 |
url: '<?php echo html_entity_decode(wp_nonce_url(WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Admin&subaction=kundendaten&do=remove&noheader=1', 'wpsg-admin-kundendaten-delete')); ?>',
|
5439 |
daniel |
115 |
data: {
|
|
|
116 |
'kv_index': kv_index
|
|
|
117 |
},
|
|
|
118 |
success: function(data) {
|
|
|
119 |
|
|
|
120 |
if (data != "1") alert(data);
|
|
|
121 |
|
|
|
122 |
}
|
1067 |
daniel |
123 |
} );
|
5439 |
daniel |
124 |
|
|
|
125 |
return false;
|
|
|
126 |
|
|
|
127 |
} // function wpsg_removeCustomField(kv_index)
|
1067 |
daniel |
128 |
|
5439 |
daniel |
129 |
/**
|
|
|
130 |
* Zeigt den HTML Code, der die gewählte Kundenvariablen in die Templates einbaut
|
|
|
131 |
*/
|
|
|
132 |
function wpsg_genKVCode(kv_index)
|
|
|
133 |
{
|
|
|
134 |
|
|
|
135 |
jQuery('#wpsg_code_dialog .modal-body').html('<img src="<?php echo WPSG_URL; ?>views/gfx/ajax-loader.gif" alt="<?php echo __('Bitte warten ...', 'wpsg'); ?>" />');
|
|
|
136 |
|
7558 |
daniel |
137 |
jQuery('#wpsg_code_dialog').modal( { } );
|
5439 |
daniel |
138 |
|
|
|
139 |
jQuery.ajax( {
|
7558 |
daniel |
140 |
url: '<?php echo html_entity_decode(wp_nonce_url(WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Admin&subaction=kundendaten&noheader=1&show=code', 'wpsg-admin-kundendaten-code')); ?>',
|
5439 |
daniel |
141 |
data: { 'kv_id': kv_index },
|
|
|
142 |
success: function(data) { jQuery('#wpsg_code_dialog .modal-body').html(data); }
|
|
|
143 |
} );
|
|
|
144 |
|
|
|
145 |
return false;
|
|
|
146 |
|
|
|
147 |
} // function wpsg_genPACode(pa_id)
|
5447 |
daniel |
148 |
|
|
|
149 |
jQuery(document).ready(function() {
|
|
|
150 |
|
|
|
151 |
jQuery('a[data-toggle="tab"]').on('shown.bs.tab', function (e) { localStorage.setItem('wpsg_admin_customer_lastTab', jQuery(this).attr('href')); } );
|
|
|
152 |
|
|
|
153 |
var lastTab = localStorage.getItem('wpsg_admin_customer_lastTab');
|
|
|
154 |
if (lastTab) jQuery('[href="' + lastTab + '"]').tab('show');
|
|
|
155 |
|
|
|
156 |
} );
|
5439 |
daniel |
157 |
|
7558 |
daniel |
158 |
</script>
|
5439 |
daniel |
159 |
|
1067 |
daniel |
160 |
</div>
|