summaryrefslogtreecommitdiff
path: root/views/order/view.phtml
blob: ace618b826cfd46ccd946ea7c8da172c63fa8dba (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
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
<?php

	/**
	 * Template für die Ansicht einer Bestellung im Backend
	 */

?>
<div class="wpsg_order_view" id="wpsg-bs">

	<nav class="navbar navbar-default">
		<div class="container-fluid">
			<div class="navbar-header">
				<a class="navbar-brand" href="#"><?php echo __('wpShopGermany', 'wpsg'); ?></a>
			</div>
			<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
				<ul class="nav navbar-nav">
					<li role="presentation" class="<?php echo ((!isset($_REQUEST['action']))?'active':''); ?>"><a href="<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Order"><?php echo __("Bestellübersicht", "wpsg"); ?></a></li>
					<li role="presentation" class="wpsg_showhide_filter active"><a onclick="return false;"><?php echo __("Bestellansicht (Detail)", "wpsg"); ?></a></li>
					<li role="presentation" class="wpsg_top_extend">

						<?php echo $this->view['oOrder']->getInvoiceFirstName().' '.$this->view['oOrder']->getInvoiceName().' / '.wpsg_ff($this->view['oOrder']->getAmount($this->getBackendTaxview()), $this->get_option('wpsg_currency')); ?>

						<?php if (trim($this->view['oOrder']->admincomment) != "") { ?>
							<a title="<?php echo __("Kommentar (Admin): ", "wpsg").htmlspecialchars($this->view['oOrder']->admincomment); ?>" onclick="return false;" class="glyphicon glyphicon-question-sign commenticon admincomment" href="#"></a>
						<?php } ?>

						<?php if (trim($this->view['oOrder']->comment) != "") { ?>
							<a title="<?php echo __("Kommentar (Kunde): ", "wpsg").htmlspecialchars($this->view['oOrder']->comment); ?>" onclick="return false;" class="glyphicon glyphicon-question-sign commenticon customercomment" href="#"></a>
						<?php } ?>

					</li>
				</ul>
				<ul class="nav navbar-nav navbar-right">

				</ul>
			</div>
		</div>

    </nav>
	
	<div class="wpsg_msg_wrap"><hr class="wp-header-end wpsg-wp-header-end"/></div>

    <div class="wpsg_admin_submenu">

        <div class="list-group" id="wpsg_order_view_tabs">
            <span class="list-group-head list-group-item"><?php echo wpsg_translate(__('Bestellung ID:#1#', 'wpsg'), $this->view['data']['id']); ?></span>

            <?php $i = 0; foreach ($this->view['arSubAction'] as $k => $v) { $i ++; ?>
            <a class="list-group-item <?php echo ((wpsg_getStr($_COOKIE['wpsg_order_view_tab'], 'general') == $k)?'active':''); ?>" wpsg-data-target="<?php echo $k; ?>" href="#"><?php echo $v['title']; ?></a>
            <?php } ?>
        </div>

		<?php if(true) {?>
        <a href="" id="LinkProduktNeu" onclick="return WPSG_BE_Product.addProduct(<?php echo $_REQUEST['edit_id']; ?>, 0);"><span class="glyphicon glyphicon-plus"></span>
	 	<?php echo __("Neues Produkt", "wpsg"); ?>
	 	</a><br />
	 	<?php } ?>

        <br />
        <?php if ($this->hasMod('wpsg_mod_gutschein')) { ?>
        	<?php if (((array_key_exists('gs', $this->view['basket'])) && ($this->view['basket']['gs']['value'] == 0))) { ?>
		        <a href="" id="LinkGutscheinNeu" onclick="return wpsg_addVoucher(<?php echo $_REQUEST['edit_id']; ?>);"><span class="glyphicon glyphicon-plus"></span>
			 	<?php echo __("Neuer Gutschein", "wpsg"); ?>
			 	</a><br />
            <?php } ?>
        <?php } ?>

        <?php if ($this->hasMod('wpsg_mod_discount')) { ?>
        	<?php //if (((array_key_exists('preis_rabatt', $this->view['basket']['sum'])) && ($this->view['basket']['sum']['preis_rabatt'] == 0))) { ?>
		        <a href="" id="LinkRabattNeu" onclick="return wpsg_addDiscount(<?php echo $_REQUEST['edit_id']; ?>);"><span class="glyphicon glyphicon-plus"></span>
			 	<?php echo __("Neuer Rabatt", "wpsg"); ?>
			 	</a><br />
            <?php //} ?>
        <?php } ?>

        <a href="" id="LinkSendMail" onclick="return wpsg_sendMail(<?php echo $_REQUEST['edit_id']; ?>);"><span class="glyphicon glyphicon-envelope"></span>
	 	<?php echo __("Bestellbestätigung", "wpsg"); ?><br /><?php echo __("erneut versenden", "wpsg"); ?>
	 	</a><br />

		<div id='wpsg_kv_list'>
		</div>
    </div>

    <div class="wpsg_admin_content form-horizontal">

        <?php $i = 0; foreach ($this->view['arSubAction'] as $k => $v) { $i ++; ?>
        <div id="tab<?php echo $k; ?>" style="display:<?php echo ((wpsg_getStr($_COOKIE['wpsg_order_view_tab'], 'general') == $k)?'block':'none'); ?>;" class="wpsg_order_view_tab_content">

            <?php echo $v['content']; ?>

        </div>
        <?php } ?>

    </div>

</div>

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


	/**
	 * Sendet eine eMail
	 */
	function wpsg_sendMail(oid)
	{
		jQuery('#wpsg_produkte_table').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&subaction=sendMail&do=send&edit_id=' + oid + '&noheader=1',
			success: function(data) {
				jQuery('#wpsg_produkte_table').replaceWith(data);
				location.href = location.href;
			}
		} );

		return false;

	} // function wpsg_sendMail()

	/**
	 * Fügt einen neuen Rabatt hinzu (nur wenn keiner da ist)
	 */
	function wpsg_addDiscount(oid)
	{
		jQuery('#wpsg_produkte_table').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&subaction=discountData&do=add&edit_id=' + oid + '&noheader=1',
			success: function(data) {
				jQuery('#wpsg_produkte_table').replaceWith(data);
				jQuery('#LinkRabattNeu').hide();
			}
		} );

		return false;

	} // function wpsg_addDiscount()


	/**
	 * Fügt einen neuen Gutschein hinzu (nur wenn keiner da ist)
	 */
	function wpsg_addVoucher(oid)
	{
		jQuery('#wpsg_produkte_table').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&subaction=voucherData&do=add&edit_id=' + oid + '&noheader=1',
			success: function(data) {
				jQuery('#wpsg_produkte_table').replaceWith(data);
				jQuery('#LinkGutscheinNeu').hide();
				//jQuery('#wpsg_kv_list').html(data);
				//location.href = location.href;
				//jQuery('#wpsg_kv_list').html('');
			}
		} );

		return false;

	} // function wpsg_addVoucher()



    jQuery(document).ready(function() {

    	wpsg_view_orderdata_hide();

        jQuery('#wpsg_order_view_tabs a.list-group-item').bind('click', function() {

            jQuery('#wpsg_order_view_tabs a').removeClass('active');
            jQuery('.wpsg_order_view_tab_content').hide();

            tab = jQuery(this).attr('wpsg-data-target');
			if (tab == 'orderdata') {
            	wpsg_view_orderdata_show();
			} else {
				wpsg_view_orderdata_hide();
			}
            jQuery(this).addClass('active');
            jQuery('#tab' + jQuery(this).attr('wpsg-data-target')).show();

            jQuery.cookie('wpsg_order_view_tab', jQuery(this).attr('wpsg-data-target'));
            jQuery(this).blur();

        } );

        co = jQuery.cookie('wpsg_order_view_tab');
        if (co === undefined) {
			jQuery("[wpsg-data-target='general']").trigger("click");
        } else {
        	jQuery("[wpsg-data-target='" + co + "']").trigger("click");
        }
		//jQuery('#wpsg_order_view_tabs a').removeClass('active');
        //jQuery('.wpsg_order_view_tab_content').hide();
		//jQuery('#tabgeneral').show();
		//jQuery("[wpsg-data-target='general']").addClass('active');

    } );

/* ]]> */</script>