Completed
Push — master ( d9795d...c29da2 )
by
unknown
18:34
created
includes/modules/wps_orders/templates/frontend/order_row_in_account.php 3 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php if (!defined('ABSPATH')) {
2
-    exit;
2
+	exit;
3 3
 }
4 4
 
5 5
 ?>
@@ -18,7 +18,7 @@  discard block
 block discarded – undo
18 18
 			<?php /** Check if http:// it's found in the link */
19 19
 $url = $order_meta['order_trackingLink'];
20 20
 if ('http://' != substr($url, 0, 7)) {
21
-    $url = 'http://' . $url;
21
+	$url = 'http://' . $url;
22 22
 }
23 23
 
24 24
 ?>
Please login to merge, or discard this patch.
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -4,14 +4,14 @@  discard block
 block discarded – undo
4 4
 
5 5
 ?>
6 6
 <div class="wps-table-content wps-table-row">
7
-	<?php $order_status = unserialize(WPSHOP_ORDER_STATUS);?>
8
-	<?php $color_label = array('awaiting_payment' => 'jaune', 'canceled' => 'rouge', 'partially_paid' => 'orange', 'incorrect_amount' => 'orange', 'denied' => 'rouge', 'shipped' => 'bleu', 'payment_refused' => 'rouge', 'completed' => 'vert', 'refunded' => 'rouge', 'pos' => 'bleu');?>
9
-	<?php $currency = wpshop_tools::wpshop_get_currency(false);?>
7
+	<?php $order_status = unserialize(WPSHOP_ORDER_STATUS); ?>
8
+	<?php $color_label = array('awaiting_payment' => 'jaune', 'canceled' => 'rouge', 'partially_paid' => 'orange', 'incorrect_amount' => 'orange', 'denied' => 'rouge', 'shipped' => 'bleu', 'payment_refused' => 'rouge', 'completed' => 'vert', 'refunded' => 'rouge', 'pos' => 'bleu'); ?>
9
+	<?php $currency = wpshop_tools::wpshop_get_currency(false); ?>
10 10
 	<div class="wps-table-cell"><?php echo !empty($order_meta['order_date']) ? mysql2date(get_option('date_format'), $order_meta['order_date'], true) . '<br>' . mysql2date(get_option('time_format'), $order_meta['order_date'], true) : ''; ?></div>
11 11
 	<div class="wps-table-cell"><?php echo !empty($order_meta['order_key']) ? $order_meta['order_key'] : (!empty($order_meta['order_temporary_key']) ? $order_meta['order_temporary_key'] : ''); ?></div>
12 12
 	<div class="wps-table-cell"><?php echo !empty($order_meta['order_grand_total']) ? wpshop_tools::formate_number($order_meta['order_grand_total']) . ' ' . $currency : ''; ?></div>
13 13
 	<div class="wps-table-cell">
14
-		<span class="wps-label-<?php echo $color_label[$order_meta['order_status']]; ?>"><?php _e($order_status[$order_meta['order_status']], 'wpshop');?></span>
14
+		<span class="wps-label-<?php echo $color_label[$order_meta['order_status']]; ?>"><?php _e($order_status[$order_meta['order_status']], 'wpshop'); ?></span>
15 15
 	</div>
16 16
 	<div class="wps-table-cell">
17 17
 		<?php if (!empty($order_meta['order_trackingLink'])): ?>
@@ -24,32 +24,32 @@  discard block
 block discarded – undo
24 24
 ?>
25 25
 			<a href="<?php echo $url; ?>" target="_blank"><?php echo !empty($order_meta['order_trackingNumber']) ? $order_meta['order_trackingNumber'] : ""; ?></a>
26 26
 		<?php else: ?>
27
-			<?php _e('No tracking links', 'wpshop');?>
28
-		<?php endif;?>
27
+			<?php _e('No tracking links', 'wpshop'); ?>
28
+		<?php endif; ?>
29 29
 	</div>
30 30
 	<?php if (!is_admin()): ?>
31 31
 		<div class="wps-table-cell wps-customer-order-list-actions">
32
-			<button data-nonce="<?php echo wp_create_nonce('wps_orders_load_details'); ?>" class="wps-bton-third wps-orders-details-opener" id="wps-order-details-opener-<?php echo $order_id; ?>"><?php _e('Order details', 'wpshop');?></button>
32
+			<button data-nonce="<?php echo wp_create_nonce('wps_orders_load_details'); ?>" class="wps-bton-third wps-orders-details-opener" id="wps-order-details-opener-<?php echo $order_id; ?>"><?php _e('Order details', 'wpshop'); ?></button>
33 33
 
34
-			<?php if (!empty($order_meta) && $order_meta['order_status'] && $order_meta['order_status'] != 'canceled' && (float) $order_meta['order_amount_to_pay_now'] != (float) 0): ?>
34
+			<?php if (!empty($order_meta) && $order_meta['order_status'] && $order_meta['order_status'] != 'canceled' && (float)$order_meta['order_amount_to_pay_now'] != (float)0): ?>
35 35
 				<?php if (isset($order_meta['pay_quotation']) && (!empty($order_meta['cart_type']) && $order_meta['cart_type'] == 'quotation') || !empty($order_meta['order_temporary_key'])): ?>
36
-				<a href="<?php echo wpshop_checkout::wps_direct_payment_link_url($order_id); ?>" target="_blank" class="wps-bton-third" role="button"><?php _e('Pay quotation', 'wpshop');?></a>
36
+				<a href="<?php echo wpshop_checkout::wps_direct_payment_link_url($order_id); ?>" target="_blank" class="wps-bton-third" role="button"><?php _e('Pay quotation', 'wpshop'); ?></a>
37 37
 				<?php else: ?>
38
-				<a href="<?php echo wpshop_checkout::wps_direct_payment_link_url($order_id); ?>" target="_blank" class="wps-bton-third" role="button"><?php _e('Pay order', 'wpshop');?></a>
39
-				<?php endif;?>
40
-			<?php endif;?>
38
+				<a href="<?php echo wpshop_checkout::wps_direct_payment_link_url($order_id); ?>" target="_blank" class="wps-bton-third" role="button"><?php _e('Pay order', 'wpshop'); ?></a>
39
+				<?php endif; ?>
40
+			<?php endif; ?>
41 41
 
42 42
 			<?php if (!empty($order_meta) && !empty($order_meta['order_invoice_ref'])): ?>
43
-			<br/><a href="<?php echo admin_url('admin-post.php?action=wps_invoice&order_id=' . $order_id . '&invoice_ref=' . $order_meta['order_invoice_ref'] . '&mode=pdf'); ?>" target="_blank" class="wps-bton-third" role="button"><?php _e('Download invoice', 'wpshop');?></a>
44
-			<?php endif;?>
43
+			<br/><a href="<?php echo admin_url('admin-post.php?action=wps_invoice&order_id=' . $order_id . '&invoice_ref=' . $order_meta['order_invoice_ref'] . '&mode=pdf'); ?>" target="_blank" class="wps-bton-third" role="button"><?php _e('Download invoice', 'wpshop'); ?></a>
44
+			<?php endif; ?>
45 45
 
46 46
 			<!-- Display delete order -->
47
-			<?php $wpshop_display_delete_order_option = get_option('wpshop_display_option');?>
47
+			<?php $wpshop_display_delete_order_option = get_option('wpshop_display_option'); ?>
48 48
 			<?php if (!empty($wpshop_display_delete_order_option) && !empty($wpshop_display_delete_order_option['wpshop_display_delete_order']) && $wpshop_display_delete_order_option['wpshop_display_delete_order'] && !empty($order_meta) && $order_meta['order_status'] == 'awaiting_payment'): ?>
49
-			<br/><button data-nonce="<?php echo wp_create_nonce('wps_delete_order'); ?>" class="wps-bton-first-mini-rounded wps-orders-delete button-secondary" data-id="<?php echo $order_id; ?>"><?php _e('Delete order', 'wpshop');?></button>
50
-			<?php endif;?>
49
+			<br/><button data-nonce="<?php echo wp_create_nonce('wps_delete_order'); ?>" class="wps-bton-first-mini-rounded wps-orders-delete button-secondary" data-id="<?php echo $order_id; ?>"><?php _e('Delete order', 'wpshop'); ?></button>
50
+			<?php endif; ?>
51 51
 		</div>
52 52
 	<?php else: ?>
53
-		<div class="wps-table-cell"><a href="<?php echo admin_url('post.php?post=' . $order_id . '&action=edit'); ?>" target="_blank" role="button" class="wps-bton-first-mini-rounded" ><?php _e('Order details', 'wpshop');?></a></div>
53
+		<div class="wps-table-cell"><a href="<?php echo admin_url('post.php?post=' . $order_id . '&action=edit'); ?>" target="_blank" role="button" class="wps-bton-first-mini-rounded" ><?php _e('Order details', 'wpshop'); ?></a></div>
54 54
 	<?php endif?>
55 55
 </div>
Please login to merge, or discard this patch.
Braces   +15 added lines, -6 removed lines patch added patch discarded remove patch
@@ -23,8 +23,11 @@  discard block
 block discarded – undo
23 23
 
24 24
 ?>
25 25
 			<a href="<?php echo $url; ?>" target="_blank"><?php echo !empty($order_meta['order_trackingNumber']) ? $order_meta['order_trackingNumber'] : ""; ?></a>
26
-		<?php else: ?>
27
-			<?php _e('No tracking links', 'wpshop');?>
26
+		<?php else {
27
+	: ?>
28
+			<?php _e('No tracking links', 'wpshop');
29
+}
30
+?>
28 31
 		<?php endif;?>
29 32
 	</div>
30 33
 	<?php if (!is_admin()): ?>
@@ -34,8 +37,11 @@  discard block
 block discarded – undo
34 37
 			<?php if (!empty($order_meta) && $order_meta['order_status'] && $order_meta['order_status'] != 'canceled' && (float) $order_meta['order_amount_to_pay_now'] != (float) 0): ?>
35 38
 				<?php if (isset($order_meta['pay_quotation']) && (!empty($order_meta['cart_type']) && $order_meta['cart_type'] == 'quotation') || !empty($order_meta['order_temporary_key'])): ?>
36 39
 				<a href="<?php echo wpshop_checkout::wps_direct_payment_link_url($order_id); ?>" target="_blank" class="wps-bton-third" role="button"><?php _e('Pay quotation', 'wpshop');?></a>
37
-				<?php else: ?>
38
-				<a href="<?php echo wpshop_checkout::wps_direct_payment_link_url($order_id); ?>" target="_blank" class="wps-bton-third" role="button"><?php _e('Pay order', 'wpshop');?></a>
40
+				<?php else {
41
+	: ?>
42
+				<a href="<?php echo wpshop_checkout::wps_direct_payment_link_url($order_id);
43
+}
44
+?>" target="_blank" class="wps-bton-third" role="button"><?php _e('Pay order', 'wpshop');?></a>
39 45
 				<?php endif;?>
40 46
 			<?php endif;?>
41 47
 
@@ -49,7 +55,10 @@  discard block
 block discarded – undo
49 55
 			<br/><button data-nonce="<?php echo wp_create_nonce('wps_delete_order'); ?>" class="wps-bton-first-mini-rounded wps-orders-delete button-secondary" data-id="<?php echo $order_id; ?>"><?php _e('Delete order', 'wpshop');?></button>
50 56
 			<?php endif;?>
51 57
 		</div>
52
-	<?php else: ?>
53
-		<div class="wps-table-cell"><a href="<?php echo admin_url('post.php?post=' . $order_id . '&action=edit'); ?>" target="_blank" role="button" class="wps-bton-first-mini-rounded" ><?php _e('Order details', 'wpshop');?></a></div>
58
+	<?php else {
59
+	: ?>
60
+		<div class="wps-table-cell"><a href="<?php echo admin_url('post.php?post=' . $order_id . '&action=edit');
61
+}
62
+?>" target="_blank" role="button" class="wps-bton-first-mini-rounded" ><?php _e('Order details', 'wpshop');?></a></div>
54 63
 	<?php endif?>
55 64
 </div>
Please login to merge, or discard this patch.
wpshop.php 1 patch
Indentation   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
 
22 22
 /**    Check if file is include. No direct access possible with file url    */
23 23
 if (!defined('ABSPATH')) {
24
-    die('Access is not allowed by this way');
24
+	die('Access is not allowed by this way');
25 25
 }
26 26
 
27 27
 /**    Allows to refresh css and js file in final user browser    */
@@ -40,9 +40,9 @@  discard block
 block discarded – undo
40 40
 $locale = get_locale();
41 41
 global $wpdb;
42 42
 if (defined("ICL_LANGUAGE_CODE")) {
43
-    $query = $wpdb->prepare("SELECT locale FROM " . $wpdb->prefix . "icl_locale_map WHERE code = %s", ICL_LANGUAGE_CODE);
44
-    $local = $wpdb->get_var($query);
45
-    $locale = !empty($local) ? $local : $locale;
43
+	$query = $wpdb->prepare("SELECT locale FROM " . $wpdb->prefix . "icl_locale_map WHERE code = %s", ICL_LANGUAGE_CODE);
44
+	$local = $wpdb->get_var($query);
45
+	$locale = !empty($local) ? $local : $locale;
46 46
 }
47 47
 DEFINE('WPSHOP_CURRENT_LOCALE', $locale);
48 48
 /**    Load plugin translation    */
@@ -53,8 +53,8 @@  discard block
 block discarded – undo
53 53
 
54 54
 /** Allow to get errors back when debug mode is set to true    */
55 55
 if (WPSHOP_DEBUG_MODE && (in_array(long2ip(ip2long($_SERVER['REMOTE_ADDR'])), unserialize(WPSHOP_DEBUG_MODE_ALLOWED_IP)))) {
56
-    ini_set('display_errors', true);
57
-    error_reporting(E_ALL);
56
+	ini_set('display_errors', true);
57
+	error_reporting(E_ALL);
58 58
 }
59 59
 
60 60
 include_once WPSHOP_LIBRAIRIES_DIR . 'init.class.php';
@@ -100,9 +100,9 @@  discard block
 block discarded – undo
100 100
 /**    Add the database content    */
101 101
 add_action('admin_init', array('wpshop_install', 'update_wpshop'));
102 102
 if ((defined('WPSINSTALLER_STEPS_COUNT') && (WPSINSTALLER_STEPS_COUNT <= $current_installation_step)) || (!empty($current_db_version) && !empty($current_db_version['db_version']) && (51 < $current_db_version['db_version'])) || (!empty($current_db_version) && !empty($current_db_version['installation_state']) && ("ignore" == $current_db_version['installation_state']))) {
103
-    if (in_array(long2ip(ip2long($_SERVER['REMOTE_ADDR'])), unserialize(WPSHOP_DEBUG_MODE_ALLOWED_IP))) {
104
-        add_action('admin_init', array('wpshop_install', 'update_wpshop_dev'));
105
-    }
103
+	if (in_array(long2ip(ip2long($_SERVER['REMOTE_ADDR'])), unserialize(WPSHOP_DEBUG_MODE_ALLOWED_IP))) {
104
+		add_action('admin_init', array('wpshop_install', 'update_wpshop_dev'));
105
+	}
106 106
 }
107 107
 // Start session
108 108
 @session_start();
@@ -110,9 +110,9 @@  discard block
 block discarded – undo
110 110
 // WP-Shop class instanciation
111 111
 function classes_init()
112 112
 {
113
-    global $wpshop_cart, $wpshop, $wpshop_account, $wpshop_payment;
114
-    $wpshop = new wpshop_form_management();
115
-    $wpshop_payment = new wpshop_payment();
113
+	global $wpshop_cart, $wpshop, $wpshop_account, $wpshop_payment;
114
+	$wpshop = new wpshop_form_management();
115
+	$wpshop_payment = new wpshop_payment();
116 116
 }
117 117
 add_action('init', 'classes_init');
118 118
 
@@ -145,18 +145,18 @@  discard block
 block discarded – undo
145 145
 add_action($hook, 'wps_update_message', 10, 2); // 10:priority, 2:arguments #
146 146
 function wps_update_message($currentPluginMetadata, $newPluginMetadata)
147 147
 {
148
-    $message = '';
148
+	$message = '';
149 149
 
150
-    if ('1.4.1.6' == $currentPluginMetadata['Version']) {
151
-        $message = sprintf(__('For security reason %splease read this post%s', 'wpshop'), '<a href="" >', '</a>');
152
-    }
150
+	if ('1.4.1.6' == $currentPluginMetadata['Version']) {
151
+		$message = sprintf(__('For security reason %splease read this post%s', 'wpshop'), '<a href="" >', '</a>');
152
+	}
153 153
 
154
-    // check "upgrade_notice"
155
-    if (isset($newPluginMetadata->upgrade_notice) && strlen(trim($newPluginMetadata->upgrade_notice)) > 0) {
156
-        $message = esc_html($newPluginMetadata->upgrade_notice);
157
-    }
154
+	// check "upgrade_notice"
155
+	if (isset($newPluginMetadata->upgrade_notice) && strlen(trim($newPluginMetadata->upgrade_notice)) > 0) {
156
+		$message = esc_html($newPluginMetadata->upgrade_notice);
157
+	}
158 158
 
159
-    if (!empty($message)) {
160
-        echo '<p style="background-color: #d54e21; padding: 10px; color: #f9f9f9; margin-top: 10px"><strong>' . __('Important upgrade notice', 'wpshop') . ': </strong>' . $message . '</p>';
161
-    }
159
+	if (!empty($message)) {
160
+		echo '<p style="background-color: #d54e21; padding: 10px; color: #f9f9f9; margin-top: 10px"><strong>' . __('Important upgrade notice', 'wpshop') . ': </strong>' . $message . '</p>';
161
+	}
162 162
 }
Please login to merge, or discard this patch.