summaryrefslogtreecommitdiff
path: root/views/mods/mod_customergroup/addedit.phtml
blob: d3a2019fdde1dcc3fe70704a18be6876ebe58feb (plain)
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
161
162
163
<?php
	
	/**
	 * Template für das Anlegen und Bearbeiten einer Kundengruppe im Backend
	 */

?>
<div class="wrap wpsg_mod_kundenverwaltung_customergroup_addedit wpsg_customergroup_view wpsg_produkt_addedit wrap columns-2">
	<div class="icon32 icon32-posts-post" id="icon-add"><br /></div>
	
	<h2>
		<?php if ($this->view['mode'] == 'edit') { ?>
			<?php echo __('Kundengruppe bearbeiten', 'wpsg'); ?>
		<?php } else { ?>
			<?php echo __('Kundengruppe anlegen', 'wpsg'); ?>
		<?php } ?>
	</h2>
	<br />
	
	<?php echo $this->writeBackendMessage(); ?>
	
	<form method="POST" action="<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Customergroup&action=save&noheader=1" enctype="multipart/form-data">
		
		<?php if ($this->view['mode'] == 'edit') { ?>
		<input type="hidden" name="edit_id" value="<?php echo $this->view['data']->id; ?>" />
		<?php } ?>
		
		<div id="postbox" class="metabox-holder has-right-sidebar">
			
			<div id="side-info-column" class="inner-sidebar" style="width:386px;">
				
				<div id="side-sortables" class="meta-box-sortables ui-sortable" style="width:380px;">
				
					<?php $this->callMods('customergroup_edit', array(&$this->view['data'])); ?>
				
				</div>
				
			</div>
			
			<div id="post-body">	
			
				<div id="normal-sortables" class="meta-box-sortables" style="margin-right:400px;">
				
					<div id="wpsg_customergroup_general" class="postbox">								
						<h3 class="wpsg_handlediv">
							<span title="<?php echo __('Zum Ein/Ausklappen hier klicken', 'wpsg'); ?>" class="handlediv"><br /></span>
							<span><?php echo __('Allgemein', 'wpsg'); ?></span>
						</h3>
						<div class="inside">
						
							<?php echo wpsg_drawForm_Input('wpsg_mod_kundenverwaltung[name]', __('Name', 'wpsg'), $this->view['data']->name); ?> 
							<?php echo wpsg_drawForm_Select('wpsg_mod_kundenverwaltung[calculation]', __('Preisangaben im Shop (Frontend)', 'wpsg'), array(
								-1 => __('Standard', 'wpsg'),
								WPSG_BRUTTO => __('Brutto (inkl. Steuer)', 'wpsg'), 
								WPSG_NETTO => __('Netto (zzgl. Steuer)', 'wpsg')
							), $this->view['data']->calculation); ?>
						
						</div>
					</div>
					
				</div>
				
				<p class="submit">
					<input type="submit" value="<?php echo __('Kundengruppe speichern', 'wpsg'); ?>" class="button-primary" id="submit" name="submit" />
					<input type="submit" value="<?php echo __('Kundengruppe speichern und zur Übersicht', 'wpsg'); ?>" class="button-primary" id="submit_index" name="submit_index" />
				</p>
				
			</div>
			
		</div>
		
	</form>
	
</div>

<script type="text/javascript">/* <![CDATA[ */
                                            
	jQuery(document).ready( function() {

	    jQuery("#normal-sortables, #side-sortables").sortable({
			connectWith: ".meta-box-sortables",
			placeholder: 'wpsg_placeholder',
			dropOnEmpty: true,
			cursor: 'move',
			handle: '.wpsg_handlediv',
			grid: [50, 20],
			forceHelperSize: true,
			forcePlaceholderSize: true,
			opacity: 0.8,
			stop: function(e,ui) {

				var ser = jQuery("#normal-sortables").sortable("serialize");				
				ser = ser.replace(/\&wpsg\[\]\=/g, ',').replace(/wpsg\[\]\=/g, '');

				jQuery.cookie('wpsg_customergroup_view_normal', ser);

				var ser = jQuery("#side-sortables").sortable("serialize");				
				ser = ser.replace(/\&wpsg\[\]\=/g, ',').replace(/wpsg\[\]\=/g, '');

				jQuery.cookie('wpsg_customergroup_view_side', ser);
				
			},
			receive: function(e, ui) {
			}
		}); 

	    if (jQuery.cookie('wpsg_customergroup_view_normal') != null)
		{

			var divs = jQuery.cookie('wpsg_customergroup_view_normal').split(',').reverse();

			for (index in divs)
			{

				jQuery('#normal-sortables').prepend(jQuery('#wpsg_' + divs[index]));
				
			}
			
		}

		if (jQuery.cookie('wpsg_customergroup_view_side') != null)
		{
 
			var divs = jQuery.cookie('wpsg_customergroup_view_side').split(',').reverse();

			for (index in divs)
			{
				 
				jQuery('#side-sortables').prepend(jQuery('#wpsg_' + divs[index]));
				
			}
			
		}

		jQuery('.wpsg_handlediv').bind('click', function() {
			jQuery(this).next().toggle();

			var arClose = new Array();
			jQuery('.wpsg_customergroup_view .postbox .inside:hidden').each(function() {
				arClose.push(jQuery(this).parent().attr("id"));
			} );

			jQuery.cookie('wpsg_customergroup_closed', arClose.join(','));
			
		} );

		if (jQuery.cookie('wpsg_customergroup_closed') != null)
		{

			var arClose = jQuery.cookie('wpsg_customergroup_closed').split(',');

			for (index in arClose)
			{
				
				jQuery('#' + arClose[index] + ' .inside').hide();
							
			}
			
		}
		
	} );
	
/* ]]> */</script>