Subversion Repositories wpShopGermany4

Rev

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

Rev Author Line No. Line
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&amp;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">&times;</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
 
42
		<div class="panel panel-default">
43
			<div class="panel-heading clearfix">
44
	       		<h3 class="panel-title"><?php echo __('Kundendaten', 'wpsg'); ?></h3>
45
	       	</div>
46
			<div class="panel-body">
47
 
48
				<ul class="nav nav-tabs" role="tablist">
6871 hartmut 49
					<li role="presentation" class="active"><a href="#tabcontent1" role="tab" aria-controls="tabcontent1" data-toggle="tab"><?php echo __('Pflichtfelder', 'wpsg'); ?></a></li>
5439 daniel 50
					<li role="presentation" class=""><a href="#tabcontent2" role="tab" aria-controls="tabcontent2" data-toggle="tab"><?php echo __('Weitere Kundendaten', 'wpsg'); ?></a></li>
51
					<li role="presentation" class=""><a href="#tabcontent3" role="tab" aria-controls="tabcontent3" data-toggle="tab"><?php echo __('Kundenvoreinstellungen', 'wpsg'); ?></a></li>
52
				</ul>
53
 
54
				<div class="tab-content">
55
					<div role="tabpanel" id="tabcontent1" class="tab-pane active">
56
						<?php echo $this->render(WPSG_PATH_VIEW.'/admin/kundendaten_tab1.phtml'); ?>
1067 daniel 57
					</div>
5439 daniel 58
					<div role="tabpanel" id="tabcontent2" class="tab-pane">
5447 daniel 59
 
60
						<div id="wpsg_kv_list">
61
							<?php echo $this->render(WPSG_PATH_VIEW.'/admin/kundendaten_tab2.phtml'); ?>
62
						</div>
63
 
64
						<div class="wpsg_clear"></div><br />
65
						<a href="" onclick="return wpsg_addCustomField();"><span class="glyphicon glyphicon-plus"></span>&nbsp;<?php echo __('Neue Kundenvariable anlegen.', 'wpsg'); ?></a>
66
 
5439 daniel 67
					</div>
5447 daniel 68
					<div role="tabpanel" id="tabcontent3" class="tab-pane">
5439 daniel 69
						<?php echo $this->render(WPSG_PATH_VIEW.'/admin/kundendaten_tab3.phtml'); ?>
70
					</div>
1067 daniel 71
				</div>
5439 daniel 72
 
1067 daniel 73
			</div>
5439 daniel 74
		</div>
75
 
6008 hartmut 76
		<p class="submit"><input name="submit" type="submit" value="<?php echo __('Einstellungen Speichern', 'wpsg'); ?>" class="button-primary" /></p>
5439 daniel 77
 
78
	</form>
79
 
80
	<script type="text/javascript">/* <![CDATA[ */
81
 
82
		/**
83
		 * Fügt ein neues Feld in die Liste der Kundenvariablen ein und lädt die Liste neu
84
		 */
85
		function wpsg_addCustomField()
86
		{
87
 
5447 daniel 88
			jQuery('#wpsg_kv_list').html('<img src="<?php echo WPSG_URL; ?>views/gfx/ajax-loader.gif" alt="<?php echo __('Bitte warten ...', 'wpsg'); ?>" />');
1067 daniel 89
 
5439 daniel 90
			jQuery.ajax( {
91
				url: '<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&subaction=kundendaten&do=add&noheader=1',
92
				success: function(data) {
5447 daniel 93
					jQuery('#wpsg_kv_list').html(data);
5439 daniel 94
				}
95
			} );
96
 
97
			return false;
1067 daniel 98
 
5439 daniel 99
		} // function wpsg_addCustomField()
1067 daniel 100
 
5439 daniel 101
		/**
102
		 * Löscht eine Kundenvariable und entfernt die Zeile aus der Liste
103
		 */
104
		function wpsg_removeCustomField(kv_index)
105
		{
1067 daniel 106
 
5439 daniel 107
			if (!confirm('<?php echo __('Sind Sie sich sicher?', 'wpsg'); ?>')) return false;
108
 
109
			jQuery('.wpsg_customervar_row_' + kv_index).hide(250, function() { jQuery(this).remove(); } );
1067 daniel 110
 
5439 daniel 111
			jQuery.ajax( {
112
				url: '<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&subaction=kundendaten&do=remove&noheader=1',
113
				data: {
114
					'kv_index': kv_index
115
				},
116
				success: function(data) {
117
 
118
					if (data != "1") alert(data);
119
 
120
				}
1067 daniel 121
			} );
5439 daniel 122
 
123
			return false;
124
 
125
		} // function wpsg_removeCustomField(kv_index)
1067 daniel 126
 
5439 daniel 127
		/**
128
		 * Zeigt den HTML Code, der die gewählte Kundenvariablen in die Templates einbaut
129
		 */
130
		function wpsg_genKVCode(kv_index)
131
		{
132
 
133
			jQuery('#wpsg_code_dialog .modal-body').html('<img src="<?php echo WPSG_URL; ?>views/gfx/ajax-loader.gif" alt="<?php echo __('Bitte warten ...', 'wpsg'); ?>" />');
134
 
135
			jQuery('#wpsg_code_dialog').modal( { } )
136
 
137
			jQuery.ajax( {
138
    			url: 'admin.php?page=wpsg-Admin&subaction=kundendaten&noheader=1&show=code',
139
    			data: { 'kv_id': kv_index },
140
    			success: function(data) { jQuery('#wpsg_code_dialog .modal-body').html(data); }
141
        	} );
142
 
143
			return false;
144
 
145
		} // function wpsg_genPACode(pa_id)
5447 daniel 146
 
147
		jQuery(document).ready(function() {
148
 
149
			jQuery('a[data-toggle="tab"]').on('shown.bs.tab', function (e) { localStorage.setItem('wpsg_admin_customer_lastTab', jQuery(this).attr('href')); } );
150
 
151
			var lastTab = localStorage.getItem('wpsg_admin_customer_lastTab');
152
			if (lastTab) jQuery('[href="' + lastTab + '"]').tab('show');
153
 
154
		} );
5439 daniel 155
 
156
	/* ]]> */</script>
157
 
1067 daniel 158
</div>