Completed
Branch 2.0.0 (3669d6)
by Jimmy
02:47
created
core/util/class-template-util.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@  discard block
 block discarded – undo
14 14
 
15 15
 namespace wpshop;
16 16
 
17
-defined( 'ABSPATH' ) || exit;
17
+defined('ABSPATH') || exit;
18 18
 
19 19
 /**
20 20
  * Template Util Class.
@@ -38,13 +38,13 @@  discard block
 block discarded – undo
38 38
 	 *
39 39
 	 * @return string          Le chemin du template
40 40
 	 */
41
-	public static function get_template_part( $module, $template ) {
41
+	public static function get_template_part($module, $template) {
42 42
 		/** Get theme template if exist */
43
-		$path_to_theme = locate_template( $template . '.php' );
44
-		if ( ! empty( $path_to_theme ) ) {
43
+		$path_to_theme = locate_template($template . '.php');
44
+		if (!empty($path_to_theme)) {
45 45
 			$single_template = $path_to_theme;
46 46
 		} else {
47
-			$single_template = str_replace( '\\', '/', PLUGIN_WPSHOP_PATH . '/modules/' . $module . '/view/frontend/' . $template . '.php' );
47
+			$single_template = str_replace('\\', '/', PLUGIN_WPSHOP_PATH . '/modules/' . $module . '/view/frontend/' . $template . '.php');
48 48
 		}
49 49
 
50 50
 		return $single_template;
Please login to merge, or discard this patch.
modules/emails/class/class-emails.php 1 patch
Spacing   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@  discard block
 block discarded – undo
14 14
 
15 15
 namespace wpshop;
16 16
 
17
-defined( 'ABSPATH' ) || exit;
17
+defined('ABSPATH') || exit;
18 18
 
19 19
 /**
20 20
  * Emails Class.
@@ -37,32 +37,32 @@  discard block
 block discarded – undo
37 37
 	 */
38 38
 	protected function construct() {
39 39
 		$this->emails['wps_email_new_order'] = array(
40
-			'title'             => __( 'New order', 'wpshop' ),
40
+			'title'             => __('New order', 'wpshop'),
41 41
 			'filename_template' => 'admin-new-order.php',
42 42
 		);
43 43
 
44 44
 		$this->emails['wps_email_customer_processing_order'] = array(
45
-			'title'             => __( 'Pending order', 'wpshop' ),
45
+			'title'             => __('Pending order', 'wpshop'),
46 46
 			'filename_template' => 'customer-processing-order.php',
47 47
 		);
48 48
 
49 49
 		$this->emails['wps_email_customer_invoice'] = array(
50
-			'title'             => __( 'Send invoice', 'wpshop' ),
50
+			'title'             => __('Send invoice', 'wpshop'),
51 51
 			'filename_template' => 'customer-invoice.php',
52 52
 		);
53 53
 
54 54
 		$this->emails['wps_email_customer_completed_order'] = array(
55
-			'title'             => __( 'Completed order', 'wpshop' ),
55
+			'title'             => __('Completed order', 'wpshop'),
56 56
 			'filename_template' => 'customer-completed-order.php',
57 57
 		);
58 58
 
59 59
 		$this->emails['wps_email_customer_new_account'] = array(
60
-			'title'             => __( 'New account', 'wpshop' ),
60
+			'title'             => __('New account', 'wpshop'),
61 61
 			'filename_template' => 'customer-new-account.php',
62 62
 		);
63 63
 
64 64
 		$this->emails['wps_email_customer_reset_password'] = array(
65
-			'title'             => __( 'Reset password', 'wpshop' ),
65
+			'title'             => __('Reset password', 'wpshop'),
66 66
 			'filename_template' => 'customer-reset-password.php',
67 67
 		);
68 68
 	}
@@ -76,10 +76,10 @@  discard block
 block discarded – undo
76 76
 	 * @param  string $filename Le nom du template.
77 77
 	 * @return string           Le chemin vers le template.
78 78
 	 */
79
-	public function get_path( $filename ) {
80
-		$path = locate_template( array( 'wpshop/emails/view/' . $filename ) );
79
+	public function get_path($filename) {
80
+		$path = locate_template(array('wpshop/emails/view/' . $filename));
81 81
 
82
-		if ( empty( $path ) ) {
82
+		if (empty($path)) {
83 83
 			$path = \eoxia\Config_Util::$init['wpshop']->emails->path . '/view/' . $filename;
84 84
 		}
85 85
 
@@ -95,8 +95,8 @@  discard block
 block discarded – undo
95 95
 	 *
96 96
 	 * @return boolean           True ou false.
97 97
 	 */
98
-	public function is_override( $filename ) {
99
-		if ( locate_template( array( 'wpshop/emails/view/' . $filename ) ) ) {
98
+	public function is_override($filename) {
99
+		if (locate_template(array('wpshop/emails/view/' . $filename))) {
100 100
 			return true;
101 101
 		}
102 102
 
@@ -114,20 +114,20 @@  discard block
 block discarded – undo
114 114
 	 * @param  string $type Le template à utilisé.
115 115
 	 * @param  array  $data Les données utilisé par le template.
116 116
 	 */
117
-	public function send_mail( $to, $type, $data = array() ) {
118
-		$shop_options = get_option( 'wps_dolibarr', Settings::g()->default_settings );
117
+	public function send_mail($to, $type, $data = array()) {
118
+		$shop_options = get_option('wps_dolibarr', Settings::g()->default_settings);
119 119
 
120
-		if ( empty( $shop_options['shop_email'] ) ) {
120
+		if (empty($shop_options['shop_email'])) {
121 121
 			return;
122 122
 		}
123 123
 
124
-		$to          = empty( $to ) ? $shop_options['shop_email'] : $to;
124
+		$to          = empty($to) ? $shop_options['shop_email'] : $to;
125 125
 		$blog_name   = get_bloginfo();
126
-		$mail        = Emails::g()->emails[ $type ];
127
-		$path_file   = Emails::g()->get_path( $mail['filename_template'] );
126
+		$mail        = Emails::g()->emails[$type];
127
+		$path_file   = Emails::g()->get_path($mail['filename_template']);
128 128
 		$attachments = null;
129 129
 
130
-		if ( ! empty( $data['attachments'] ) ) {
130
+		if (!empty($data['attachments'])) {
131 131
 			$attachments = $data['attachments'];
132 132
 		}
133 133
 
@@ -138,7 +138,7 @@  discard block
 block discarded – undo
138 138
 		$headers   = array();
139 139
 		$headers[] = 'From: ' . $blog_name . ' <' . $shop_options['shop_email'] . '>';
140 140
 		$headers[] = 'Content-Type: text/html; charset=UTF-8';
141
-		wp_mail( $to, $mail['title'], $content, $headers, $attachments );
141
+		wp_mail($to, $mail['title'], $content, $headers, $attachments);
142 142
 	}
143 143
 }
144 144
 
Please login to merge, or discard this patch.
modules/emails/view/frontend/type-payment.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -16,12 +16,12 @@
 block discarded – undo
16 16
 
17 17
 namespace wpshop;
18 18
 
19
-defined( 'ABSPATH' ) || exit;
19
+defined('ABSPATH') || exit;
20 20
 
21
-if ( 'Cheque' === $order->mode_reglement ) :
22
-	echo stripslashes( nl2br( $payment_methods['cheque']['description'] ) );
21
+if ('Cheque' === $order->mode_reglement) :
22
+	echo stripslashes(nl2br($payment_methods['cheque']['description']));
23 23
 endif;
24 24
 
25
-if ( 'payment_in_shop' === $order->mode_reglement ) :
26
-	echo stripslashes( nl2br( $payment_methods['cheque']['description'] ) );
25
+if ('payment_in_shop' === $order->mode_reglement) :
26
+	echo stripslashes(nl2br($payment_methods['cheque']['description']));
27 27
 endif;
Please login to merge, or discard this patch.
modules/emails/view/customer-completed-order.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -16,21 +16,21 @@
 block discarded – undo
16 16
 
17 17
 namespace wpshop;
18 18
 
19
-defined( 'ABSPATH' ) || exit;
19
+defined('ABSPATH') || exit;
20 20
 
21
-if ( ! defined( 'ABSPATH' ) ) {
21
+if (!defined('ABSPATH')) {
22 22
 	exit;
23 23
 }
24 24
 
25
-do_action( 'wps_email_header' ); ?>
25
+do_action('wps_email_header'); ?>
26 26
 
27 27
 <p>Nouvelle commande admin</p>
28 28
 
29 29
 <?php
30
-do_action( 'wps_email_order_details' );
30
+do_action('wps_email_order_details');
31 31
 
32
-do_action( 'wps_email_order_meta' );
32
+do_action('wps_email_order_meta');
33 33
 
34
-do_action( 'wps_email_customer_details' );
34
+do_action('wps_email_customer_details');
35 35
 
36
-do_action( 'wps_email_footer' );
36
+do_action('wps_email_footer');
Please login to merge, or discard this patch.
modules/emails/view/customer-invoice.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -16,33 +16,33 @@
 block discarded – undo
16 16
 
17 17
 namespace wpshop;
18 18
 
19
-defined( 'ABSPATH' ) || exit;
19
+defined('ABSPATH') || exit;
20 20
 
21
-if ( ! defined( 'ABSPATH' ) ) {
21
+if (!defined('ABSPATH')) {
22 22
 	exit;
23 23
 }
24 24
 
25
-do_action( 'wps_email_header' ); ?>
25
+do_action('wps_email_header'); ?>
26 26
 
27 27
 <p>
28 28
 	<?php
29 29
 	/* translators: %s: Customer first name */
30
-	printf( esc_html__( 'Hi %s,', 'wpshop' ), esc_html( $data['contact']['lastname'] . ' ' . $data['contact']['firstname'] ) );
30
+	printf(esc_html__('Hi %s,', 'wpshop'), esc_html($data['contact']['lastname'] . ' ' . $data['contact']['firstname']));
31 31
 	?>
32 32
 </p>
33 33
 
34 34
 <p>
35 35
 	<?php
36 36
 	/* translators: %s: Order number */
37
-	printf( esc_html__( 'Your invoice %1$s for your order %2$s', 'wpshop' ), esc_html( $data['invoice']->data['title'] ), esc_html( $data['order']->data['title'] ) );
37
+	printf(esc_html__('Your invoice %1$s for your order %2$s', 'wpshop'), esc_html($data['invoice']->data['title']), esc_html($data['order']->data['title']));
38 38
 	?>
39 39
 </p>
40 40
 <?php
41 41
 
42
-do_action( 'wps_email_invoice_details' );
42
+do_action('wps_email_invoice_details');
43 43
 
44
-do_action( 'wps_email_invoice_meta' );
44
+do_action('wps_email_invoice_meta');
45 45
 
46
-do_action( 'wps_email_customer_details' );
46
+do_action('wps_email_customer_details');
47 47
 
48
-do_action( 'wps_email_footer' );
48
+do_action('wps_email_footer');
Please login to merge, or discard this patch.
modules/emails/view/customer-processing-order.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -16,29 +16,29 @@
 block discarded – undo
16 16
 
17 17
 namespace wpshop;
18 18
 
19
-defined( 'ABSPATH' ) || exit;
19
+defined('ABSPATH') || exit;
20 20
 
21
-do_action( 'wps_email_header' ); ?>
21
+do_action('wps_email_header'); ?>
22 22
 
23 23
 <p>
24 24
 	<?php
25 25
 	/* translators: %s: Customer first name */
26
-	printf( esc_html__( 'Hi %s,', 'wpshop' ), esc_html( $data['third_party']['title'] ) );
26
+	printf(esc_html__('Hi %s,', 'wpshop'), esc_html($data['third_party']['title']));
27 27
 	?>
28 28
 </p>
29 29
 <p>
30 30
 	<?php
31 31
 	/* translators: %s: Order number */
32
-	printf( esc_html__( 'Just to let you know — we\'ve received your order #%s, and it is now being processed:', 'wpshop' ), esc_html( $data['order']->ref ) );
32
+	printf(esc_html__('Just to let you know — we\'ve received your order #%s, and it is now being processed:', 'wpshop'), esc_html($data['order']->ref));
33 33
 	?>
34 34
 </p>
35 35
 
36 36
 <?php
37 37
 
38
-do_action( 'wps_email_order_details', $data['order'] );
38
+do_action('wps_email_order_details', $data['order']);
39 39
 
40
-do_action( 'wps_email_order_meta' );
40
+do_action('wps_email_order_meta');
41 41
 
42
-do_action( 'wps_email_customer_details' );
42
+do_action('wps_email_customer_details');
43 43
 
44
-do_action( 'wps_email_footer' );
44
+do_action('wps_email_footer');
Please login to merge, or discard this patch.
modules/emails/view/customer-reset-password.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -16,17 +16,17 @@
 block discarded – undo
16 16
 
17 17
 namespace wpshop;
18 18
 
19
-defined( 'ABSPATH' ) || exit;
19
+defined('ABSPATH') || exit;
20 20
 
21
-do_action( 'wps_email_header' ); ?>
21
+do_action('wps_email_header'); ?>
22 22
 
23 23
 <p>Reset password</p>
24 24
 
25 25
 <?php
26
-do_action( 'wps_email_order_details' );
26
+do_action('wps_email_order_details');
27 27
 
28
-do_action( 'wps_email_order_meta' );
28
+do_action('wps_email_order_meta');
29 29
 
30
-do_action( 'wps_email_customer_details' );
30
+do_action('wps_email_customer_details');
31 31
 
32
-do_action( 'wps_email_footer' );
32
+do_action('wps_email_footer');
Please login to merge, or discard this patch.
modules/doli-proposals/view/order-details.view.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -12,14 +12,14 @@
 block discarded – undo
12 12
  * @since     2.0.0
13 13
  */
14 14
 
15
-if ( ! empty( $invoice->data['payments'] ) ) :
16
-	foreach ( $invoice->data['payments'] as $payment ) :
15
+if (!empty($invoice->data['payments'])) :
16
+	foreach ($invoice->data['payments'] as $payment) :
17 17
 		?>
18 18
 		<ul>
19
-			<li><?php esc_html_e( 'Payment method', 'wpshop' ); ?> : <?php echo esc_html( $payment->data['payment_type'] ); ?></li>
20
-			<li><?php esc_html_e( 'Payment date', 'wpshop' ); ?> : <?php echo esc_html( $payment->data['date']['rendered']['date_human_readable'] ); ?></li>
21
-			<li><?php esc_html_e( 'Payment reference', 'wpshop' ); ?> : <?php echo esc_html( $payment->data['title'] ); ?></li>
22
-			<li><?php esc_html_e( 'Amount', 'wpshop' ); ?> : <?php echo esc_html( $payment->data['amount'] ); ?>€</li>
19
+			<li><?php esc_html_e('Payment method', 'wpshop'); ?> : <?php echo esc_html($payment->data['payment_type']); ?></li>
20
+			<li><?php esc_html_e('Payment date', 'wpshop'); ?> : <?php echo esc_html($payment->data['date']['rendered']['date_human_readable']); ?></li>
21
+			<li><?php esc_html_e('Payment reference', 'wpshop'); ?> : <?php echo esc_html($payment->data['title']); ?></li>
22
+			<li><?php esc_html_e('Amount', 'wpshop'); ?> : <?php echo esc_html($payment->data['amount']); ?>€</li>
23 23
 		</ul>
24 24
 
25 25
 		<?php
Please login to merge, or discard this patch.
modules/doli-proposals/view/list.view.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -14,26 +14,26 @@
 block discarded – undo
14 14
 
15 15
 namespace wpshop;
16 16
 
17
-defined( 'ABSPATH' ) || exit; ?>
17
+defined('ABSPATH') || exit; ?>
18 18
 
19 19
 <table class="wpeo-table">
20 20
 	<thead>
21 21
 		<tr>
22 22
 			<th><input type="checkbox" /></th>
23
-			<th><?php esc_html_e( 'WP ID', 'wpshop' ); ?></th>
24
-			<th><?php esc_html_e( 'Ref', 'wpshop' ); ?></th>
25
-			<th><?php esc_html_e( 'Price', 'wpshop' ); ?></th>
26
-			<?php echo apply_filters( 'wps_order_table_th', '' ); ?>
23
+			<th><?php esc_html_e('WP ID', 'wpshop'); ?></th>
24
+			<th><?php esc_html_e('Ref', 'wpshop'); ?></th>
25
+			<th><?php esc_html_e('Price', 'wpshop'); ?></th>
26
+			<?php echo apply_filters('wps_order_table_th', ''); ?>
27 27
 			<th></th>
28 28
 		</tr>
29 29
 	</thead>
30 30
 	<tbody>
31 31
 		<?php
32
-		if ( ! empty( $proposals ) ) :
33
-			foreach ( $proposals as $proposal ) :
34
-				\eoxia\View_Util::exec( 'wpshop', 'doli-proposals', 'item', array(
32
+		if (!empty($proposals)) :
33
+			foreach ($proposals as $proposal) :
34
+				\eoxia\View_Util::exec('wpshop', 'doli-proposals', 'item', array(
35 35
 					'proposal' => $proposal,
36
-				) );
36
+				));
37 37
 			endforeach;
38 38
 		endif;
39 39
 		?>
Please login to merge, or discard this patch.