summaryrefslogtreecommitdiff
path: root/views/mods/mod_ordercondition/settings_edit.phtml
blob: 0c7f4fab3d1aa98b3764586d10c263e3558cb4a2 (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
<?php

	/**
	 * Template für die Einstellungen des Bestellbedingungsmoduls
	 */

?>
<script type="text/javascript">/* <![CDATA[ */

	/**
	 * Wird beim Anlegen einer neuen Bestellbedingung aufgerufen
	 */
	function wpsg_addOC() 
	{
	
		jQuery('#wpsg_oc_list').html('<img src="<?php echo WPSG_URL; ?>views/gfx/ajax-loader.gif" alt="<?php echo __('Bitte warten ...', 'wpsg'); ?>" />');
		
		jQuery.ajax( {
			url: '<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_ordercondition&noheader=1&do=add',
			success: function(data) {
				jQuery('#wpsg_oc_list').html(data);
			}
		} );
	
		return false;
		
	} // function wpsg_addZV()
	
	/**
	 * Speichert den Text einer Bestellbedingung
	 */
	function wpsg_saveOCText(oc_id)
	{

		var OCText = jQuery('#oc_' + oc_id).val(); 

	    window.setTimeout(function() {

	    	jQuery.ajax( {
				url: '<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_ordercondition&do=inlinedit&noheader=1',
				type: 'POST',
				data: {
					field: 'text',
					value: OCText,
					oc_id: oc_id
				},
				success: function(data) {

					if (data != "1")
					{

						alert(data);
							
					}
					else
					{

						alert('<?php echo __('Text wurde erfolgreich gespeichert.', 'wpsg'); ?>');
						
					}
					  
				}		
			} );
		    
        	
        	
    	}, 10);		
		
		return false;
		
	} // function wpsg_saveOCText(oc_id)

	function wpsg_saveOCErrorText(oc_id)
	{

		var OCErrorText = jQuery('#oc_errortext_' + oc_id).val(); 

	    window.setTimeout(function() {

	    	jQuery.ajax( {
				url: '<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_ordercondition&do=inlinedit&noheader=1',
				type: 'POST',
				data: {
					field: 'errortext',
					value: OCErrorText,
					oc_id: oc_id
				},
				success: function(data) {

					if (data != "1")
					{

						alert(data);
							
					}
					  
				}		
			} );
		     
    	}, 10);		
		
		return false;
		
	} // function wpsg_saveOCErrorText(oc_id)
	
	/**
	 * Blendet den Editor einer Bestellbedingung ein und die anderen aus
	 */
	function wpsg_showOCText(oc_id)
	{

		jQuery('.wpsg_mod_ordercondition_editor').hide(500);

		if (!jQuery('.wpsg_mod_ordercondition_editor_' + oc_id).is(':visible'))
		{
			
			jQuery('.wpsg_mod_ordercondition_editor_' + oc_id).show(500);

		}

		return false;
		
	} // function wpsg_showOCText(oc_id)


	/**
	 * Blendet den Editor einer Bestellbedingung ein und die anderen aus
	 */
	function wpsg_showOCErrorText(oc_id)
	{

		jQuery('.wpsg_mod_ordercondition_editor').hide(500);

		if (!jQuery('.wpsg_mod_ordercondition_editor_errortext_' + oc_id).is(':visible'))
		{
			
			jQuery('.wpsg_mod_ordercondition_editor_errortext_' + oc_id).show(500);

		}

		return false;
		
	} // function wpsg_showOCErrorText(oc_id)
		
/* ]]> */</script>

<?php if ($this->hasMod('wpsg_mod_crefopay')) { ?>
<p>
	<span class="wpsg_error"><?php echo __('Aufgrund des für CrefoPay angepassten Bestellablaufs ist dieses Modul unwirksam.', 'wpsg'); ?></span>
</p>
<?php } ?>

<div id="wpsg_oc_list">
	<?php echo $this->callMod('wpsg_mod_ordercondition', 'oc_list'); ?>
</div>

<br />
<a href="#" onclick="return wpsg_addOC();"><span class="wpsg-glyphicon glyphicon glyphicon-plus"></span><?php echo __('Neue Bestellbedingung anlegen', 'wpsg'); ?></a>