Completed
Branch 2.0.0 (814c19)
by Jimmy
03:05
created
modules/cart/view/frontend/empty-cart.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -14,6 +14,6 @@
 block discarded – undo
14 14
 
15 15
 namespace wpshop;
16 16
 
17
-defined( 'ABSPATH' ) || exit; ?>
17
+defined('ABSPATH') || exit; ?>
18 18
 
19
-<p><?php esc_html_e( 'Your cart is empty.', 'wpshop' ); ?></p>
19
+<p><?php esc_html_e('Your cart is empty.', 'wpshop'); ?></p>
Please login to merge, or discard this patch.
modules/cart/view/frontend/link-cart.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -14,8 +14,8 @@
 block discarded – undo
14 14
 
15 15
 namespace wpshop;
16 16
 
17
-defined( 'ABSPATH' ) || exit; ?>
17
+defined('ABSPATH') || exit; ?>
18 18
 
19
-<a href="<?php echo esc_url( Pages::g()->get_cart_link() ); ?>" class="view-cart wpeo-button button-grey">
20
-	<?php esc_html_e( 'View cart', 'wpshop' ); ?>
19
+<a href="<?php echo esc_url(Pages::g()->get_cart_link()); ?>" class="view-cart wpeo-button button-grey">
20
+	<?php esc_html_e('View cart', 'wpshop'); ?>
21 21
 </a>
Please login to merge, or discard this patch.
modules/cart/view/frontend/cart.php 2 patches
Braces   +5 added lines, -2 removed lines patch added patch discarded remove patch
@@ -48,9 +48,12 @@
 block discarded – undo
48 48
 								?>
49 49
 								-
50 50
 								<?php
51
-							else :
51
+							else {
52
+								:
52 53
 								?>
53
-								<input style="width: 60px;" class="cart-qty" type="number" name="products[<?php echo esc_attr( $key ); ?>][qty]" value="<?php echo esc_html( $cart_item['qty'] ); ?>" />
54
+								<input style="width: 60px;" class="cart-qty" type="number" name="products[<?php echo esc_attr( $key );
55
+							}
56
+							?>][qty]" value="<?php echo esc_html( $cart_item['qty'] ); ?>" />
54 57
 								<?php
55 58
 							endif;
56 59
 							?>
Please login to merge, or discard this patch.
Spacing   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -14,58 +14,58 @@  discard block
 block discarded – undo
14 14
 
15 15
 namespace wpshop;
16 16
 
17
-defined( 'ABSPATH' ) || exit; ?>
17
+defined('ABSPATH') || exit; ?>
18 18
 
19
-<?php do_action( 'wps_before_cart_table' ); ?>
19
+<?php do_action('wps_before_cart_table'); ?>
20 20
 
21 21
 <div class="cart">
22
-	<?php wp_nonce_field( 'ajax_update_cart' ); ?>
22
+	<?php wp_nonce_field('ajax_update_cart'); ?>
23 23
 
24 24
 	<table class="wpeo-table">
25 25
 		<thead>
26 26
 			<tr>
27 27
 				<th></th>
28
-				<th data-title="<?php esc_html_e( 'Product name', 'wpshop' ); ?>"><?php esc_html_e( 'Product name', 'wpshop' ); ?></th>
29
-				<th data-title="<?php esc_html_e( 'VAT', 'wpshop' ); ?>"><?php esc_html_e( 'VAT', 'wpshop' ); ?></th>
30
-				<th data-title="<?php esc_html_e( 'P.U. HT', 'wpshop' ); ?>"><?php esc_html_e( 'P.U HT', 'wpshop' ); ?></th>
31
-				<th style="width: 60px;" data-title="<?php esc_html_e( 'Quantity', 'wpshop' ); ?>"><?php esc_html_e( 'Quantity', 'wpshop' ); ?></th>
32
-				<th data-title="<?php esc_html_e( 'Total HT', 'wpshop' ); ?>"><?php esc_html_e( 'Total HT', 'wpshop' ); ?></th>
28
+				<th data-title="<?php esc_html_e('Product name', 'wpshop'); ?>"><?php esc_html_e('Product name', 'wpshop'); ?></th>
29
+				<th data-title="<?php esc_html_e('VAT', 'wpshop'); ?>"><?php esc_html_e('VAT', 'wpshop'); ?></th>
30
+				<th data-title="<?php esc_html_e('P.U. HT', 'wpshop'); ?>"><?php esc_html_e('P.U HT', 'wpshop'); ?></th>
31
+				<th style="width: 60px;" data-title="<?php esc_html_e('Quantity', 'wpshop'); ?>"><?php esc_html_e('Quantity', 'wpshop'); ?></th>
32
+				<th data-title="<?php esc_html_e('Total HT', 'wpshop'); ?>"><?php esc_html_e('Total HT', 'wpshop'); ?></th>
33 33
 				<th></th>
34 34
 			</tr>
35 35
 		</thead>
36 36
 		<tbody>
37 37
 			<?php
38
-			if ( ! empty( $cart_contents ) ) :
39
-				foreach ( $cart_contents as $key => $cart_item ) :
38
+			if (!empty($cart_contents)) :
39
+				foreach ($cart_contents as $key => $cart_item) :
40 40
 					?>
41
-					<input type="hidden" name="products[<?php echo esc_attr( $key ); ?>][id]" value="<?php echo esc_attr( $cart_item['id'] ); ?>" />
41
+					<input type="hidden" name="products[<?php echo esc_attr($key); ?>][id]" value="<?php echo esc_attr($cart_item['id']); ?>" />
42 42
 					<tr>
43
-						<td><?php echo get_the_post_thumbnail( $cart_item['id'], array( 80, 80 ) ); ?></td>
44
-						<td><a href="<?php echo esc_url( get_permalink( $cart_item['id'] ) ); ?>"><?php echo esc_html( $cart_item['title'] ); ?></a></td>
45
-						<td><?php echo esc_html( number_format( $cart_item['tva_tx'], 2, ',', '' ) ); ?>%</td>
46
-						<td><?php echo esc_html( number_format( $cart_item['price'], 2, ',', '' ) ); ?>€</td>
43
+						<td><?php echo get_the_post_thumbnail($cart_item['id'], array(80, 80)); ?></td>
44
+						<td><a href="<?php echo esc_url(get_permalink($cart_item['id'])); ?>"><?php echo esc_html($cart_item['title']); ?></a></td>
45
+						<td><?php echo esc_html(number_format($cart_item['tva_tx'], 2, ',', '')); ?>%</td>
46
+						<td><?php echo esc_html(number_format($cart_item['price'], 2, ',', '')); ?>€</td>
47 47
 						<td style="width: 60px;">
48 48
 							<?php
49
-							if ( $shipping_cost_option['shipping_product_id'] === $cart_item['id'] ) :
49
+							if ($shipping_cost_option['shipping_product_id'] === $cart_item['id']) :
50 50
 								?>
51 51
 								-
52 52
 								<?php
53 53
 							else :
54 54
 								?>
55
-								<input style="width: 60px;" class="cart-qty" type="number" name="products[<?php echo esc_attr( $key ); ?>][qty]" value="<?php echo esc_html( $cart_item['qty'] ); ?>" />
55
+								<input style="width: 60px;" class="cart-qty" type="number" name="products[<?php echo esc_attr($key); ?>][qty]" value="<?php echo esc_html($cart_item['qty']); ?>" />
56 56
 								<?php
57 57
 							endif;
58 58
 							?>
59 59
 						</td>
60
-						<td><?php echo esc_html( number_format( $cart_item['price'] * $cart_item['qty'], 2, ',', '' ) ); ?>€</td>
60
+						<td><?php echo esc_html(number_format($cart_item['price'] * $cart_item['qty'], 2, ',', '')); ?>€</td>
61 61
 						<td>
62 62
 							<?php
63
-							if ( $shipping_cost_option['shipping_product_id'] !== $cart_item['id'] ) :
63
+							if ($shipping_cost_option['shipping_product_id'] !== $cart_item['id']) :
64 64
 								?>
65 65
 								<a href="#" class="action-attribute"
66 66
 									data-action="delete_product_from_cart"
67
-									data-nonce="<?php echo esc_attr( wp_create_nonce( 'ajax_delete_product_from_cart' ) ); ?>"
68
-									data-key="<?php echo esc_attr( $key ); ?>">
67
+									data-nonce="<?php echo esc_attr(wp_create_nonce('ajax_delete_product_from_cart')); ?>"
68
+									data-key="<?php echo esc_attr($key); ?>">
69 69
 									<i class="fas fa-trash"></i>
70 70
 								</a>
71 71
 								<?php
@@ -82,8 +82,8 @@  discard block
 block discarded – undo
82 82
 
83 83
 	<div data-parent="cart" data-action="wps_update_cart"
84 84
 		class="update-cart wpeo-button action-input button-disable">
85
-		<?php esc_html_e( 'Update cart', 'wpshop' ); ?>
85
+		<?php esc_html_e('Update cart', 'wpshop'); ?>
86 86
 	</div>
87 87
 
88
-	<?php do_action( 'wps_after_cart_table' ); ?>
88
+	<?php do_action('wps_after_cart_table'); ?>
89 89
 </div>
Please login to merge, or discard this patch.
modules/proposals/class/class-proposals.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
  * Proposals Class.
@@ -83,9 +83,9 @@  discard block
 block discarded – undo
83 83
 	public function display() {
84 84
 		$proposals = $this->get();
85 85
 
86
-		\eoxia\View_Util::exec( 'wpshop', 'proposals', 'list', array(
86
+		\eoxia\View_Util::exec('wpshop', 'proposals', 'list', array(
87 87
 			'proposals' => $proposals,
88
-		) );
88
+		));
89 89
 	}
90 90
 
91 91
 	/**
@@ -98,13 +98,13 @@  discard block
 block discarded – undo
98 98
 	public function get_last_ref() {
99 99
 		global $wpdb;
100 100
 
101
-		$last_ref = $wpdb->get_var( "
101
+		$last_ref = $wpdb->get_var("
102 102
 			SELECT meta_value FROM $wpdb->postmeta AS PM
103 103
 				JOIN $wpdb->posts AS P ON PM.post_id=P.ID
104 104
 
105 105
 			WHERE PM.meta_key='_ref'
106 106
 				AND P.post_type='wps-proposal'
107
-		" );
107
+		");
108 108
 
109 109
 		return $last_ref;
110 110
 	}
Please login to merge, or discard this patch.
modules/proposals/filter/class-proposals-filter.php 1 patch
Spacing   +17 added lines, -17 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
  * Proposals Filter Class.
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
 	 * @since 2.0.0
28 28
 	 */
29 29
 	public function __construct() {
30
-		add_filter( 'eo_model_wps-proposal_register_post_type_args', array( $this, 'callback_register_post_type_args' ) );
30
+		add_filter('eo_model_wps-proposal_register_post_type_args', array($this, 'callback_register_post_type_args'));
31 31
 	}
32 32
 
33 33
 	/**
@@ -39,24 +39,24 @@  discard block
 block discarded – undo
39 39
 	 */
40 40
 	public function callback_register_post_type_args() {
41 41
 		$labels = array(
42
-			'name'               => _x( 'Proposals', 'post type general name', 'wpshop' ),
43
-			'singular_name'      => _x( 'Proposal', 'post type singular name', 'wpshop' ),
44
-			'menu_name'          => _x( 'Proposals', 'admin menu', 'wpshop' ),
45
-			'name_admin_bar'     => _x( 'Proposal', 'add new on admin bar', 'wpshop' ),
46
-			'add_new'            => _x( 'Add New', 'proposal', 'wpshop' ),
47
-			'add_new_item'       => __( 'Add New Proposal', 'wpshop' ),
48
-			'new_item'           => __( 'New Proposal', 'wpshop' ),
49
-			'edit_item'          => __( 'Edit Proposal', 'wpshop' ),
50
-			'view_item'          => __( 'View Proposal', 'wpshop' ),
51
-			'all_items'          => __( 'All Proposals', 'wpshop' ),
52
-			'search_items'       => __( 'Search Proposals', 'wpshop' ),
53
-			'parent_item_colon'  => __( 'Parent Proposals:', 'wpshop' ),
54
-			'not_found'          => __( 'No proposals found.', 'wpshop' ),
55
-			'not_found_in_trash' => __( 'No proposals found in Trash.', 'wpshop' ),
42
+			'name'               => _x('Proposals', 'post type general name', 'wpshop'),
43
+			'singular_name'      => _x('Proposal', 'post type singular name', 'wpshop'),
44
+			'menu_name'          => _x('Proposals', 'admin menu', 'wpshop'),
45
+			'name_admin_bar'     => _x('Proposal', 'add new on admin bar', 'wpshop'),
46
+			'add_new'            => _x('Add New', 'proposal', 'wpshop'),
47
+			'add_new_item'       => __('Add New Proposal', 'wpshop'),
48
+			'new_item'           => __('New Proposal', 'wpshop'),
49
+			'edit_item'          => __('Edit Proposal', 'wpshop'),
50
+			'view_item'          => __('View Proposal', 'wpshop'),
51
+			'all_items'          => __('All Proposals', 'wpshop'),
52
+			'search_items'       => __('Search Proposals', 'wpshop'),
53
+			'parent_item_colon'  => __('Parent Proposals:', 'wpshop'),
54
+			'not_found'          => __('No proposals found.', 'wpshop'),
55
+			'not_found_in_trash' => __('No proposals found in Trash.', 'wpshop'),
56 56
 		);
57 57
 
58 58
 		$args['labels']            = $labels;
59
-		$args['supports']          = array( 'title' );
59
+		$args['supports']          = array('title');
60 60
 		$args['public']            = true;
61 61
 		$args['has_archive']       = true;
62 62
 		$args['show_ui']           = true;
Please login to merge, or discard this patch.
modules/proposals/model/class-proposals-model.php 1 patch
Spacing   +4 added lines, -4 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
  * Class proposal model.
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
 	 * @param Order  $object     Les données de l'objet.
30 30
 	 * @param string $req_method La méthode de la requête.
31 31
 	 */
32
-	public function __construct( $object, $req_method = null ) {
32
+	public function __construct($object, $req_method = null) {
33 33
 
34 34
 		$this->schema['external_id'] = array(
35 35
 			'type'        => 'integer',
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
 			'field'       => 'datec',
60 60
 			'since'       => '2.0.0',
61 61
 			'description' => 'Date de création de la commande. Relation avec dolibarr',
62
-			'context'     => array( 'GET' ),
62
+			'context'     => array('GET'),
63 63
 		);
64 64
 
65 65
 		$this->schema['total_ht'] = array(
@@ -100,6 +100,6 @@  discard block
 block discarded – undo
100 100
 			'default'   => '',
101 101
 		);
102 102
 
103
-		parent::__construct( $object, $req_method );
103
+		parent::__construct($object, $req_method);
104 104
 	}
105 105
 }
Please login to merge, or discard this patch.
modules/proposals/view/list.view.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -14,28 +14,28 @@
 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( 'DOLI ID', 'wpshop' ); ?></th>
25
-			<th><?php esc_html_e( 'Ref', 'wpshop' ); ?></th>
26
-			<th><?php esc_html_e( 'Status', 'wpshop' ); ?></th>
27
-			<th><?php esc_html_e( 'Price', 'wpshop' ); ?></th>
28
-			<?php echo apply_filters( 'wps_order_table_th', '' ); ?>
23
+			<th><?php esc_html_e('WP ID', 'wpshop'); ?></th>
24
+			<th><?php esc_html_e('DOLI ID', 'wpshop'); ?></th>
25
+			<th><?php esc_html_e('Ref', 'wpshop'); ?></th>
26
+			<th><?php esc_html_e('Status', 'wpshop'); ?></th>
27
+			<th><?php esc_html_e('Price', 'wpshop'); ?></th>
28
+			<?php echo apply_filters('wps_order_table_th', ''); ?>
29 29
 			<th></th>
30 30
 		</tr>
31 31
 	</thead>
32 32
 	<tbody>
33 33
 		<?php
34
-		if ( ! empty( $proposals ) ) :
35
-			foreach ( $proposals as $proposal ) :
36
-				\eoxia\View_Util::exec( 'wpshop', 'doli-order', 'item', array(
34
+		if (!empty($proposals)) :
35
+			foreach ($proposals as $proposal) :
36
+				\eoxia\View_Util::exec('wpshop', 'doli-order', 'item', array(
37 37
 					'proposal' => $proposal,
38
-				) );
38
+				));
39 39
 			endforeach;
40 40
 		endif;
41 41
 		?>
Please login to merge, or discard this patch.
modules/proposals/view/item.view.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -14,17 +14,17 @@
 block discarded – undo
14 14
 
15 15
 namespace wpshop;
16 16
 
17
-defined( 'ABSPATH' ) || exit; ?>
17
+defined('ABSPATH') || exit; ?>
18 18
 
19 19
 <tr>
20 20
 	<td><input type="checkbox" /></td>
21
-	<td><?php echo esc_html( $proposal->data['id'] ); ?></td>
22
-	<td><?php echo esc_html( $proposal->data['external_id'] ); ?></td>
23
-	<td><?php echo esc_html( $proposal->data['title'] ); ?></td>
24
-	<td><?php echo esc_html( $proposal->data['status'] ); ?></td>
25
-	<td><?php echo esc_html( $proposal->data['total_ttc'] ); ?>€</td>
26
-	<?php apply_filters( 'wps_order_table_tr', $proposal ); ?>
21
+	<td><?php echo esc_html($proposal->data['id']); ?></td>
22
+	<td><?php echo esc_html($proposal->data['external_id']); ?></td>
23
+	<td><?php echo esc_html($proposal->data['title']); ?></td>
24
+	<td><?php echo esc_html($proposal->data['status']); ?></td>
25
+	<td><?php echo esc_html($proposal->data['total_ttc']); ?>€</td>
26
+	<?php apply_filters('wps_order_table_tr', $proposal); ?>
27 27
 	<td>
28
-		<a href="<?php echo esc_attr( admin_url( 'post.php?post=' . $proposal->data['id'] . '&action=edit' ) ); ?>" class="wpeo-button button-square-30 button-rounded"><i class="button-icon fas fa-pencil"></i></a>
28
+		<a href="<?php echo esc_attr(admin_url('post.php?post=' . $proposal->data['id'] . '&action=edit')); ?>" class="wpeo-button button-square-30 button-rounded"><i class="button-icon fas fa-pencil"></i></a>
29 29
 	</td>
30 30
 </tr>
Please login to merge, or discard this patch.
modules/proposals/view/main.view.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -14,12 +14,12 @@
 block discarded – undo
14 14
 
15 15
 namespace wpshop;
16 16
 
17
-defined( 'ABSPATH' ) || exit; ?>
17
+defined('ABSPATH') || exit; ?>
18 18
 
19 19
 <div class="wrap">
20
-	<h2><?php esc_html_e( 'Proposals', 'wpshop' ); ?></h2>
20
+	<h2><?php esc_html_e('Proposals', 'wpshop'); ?></h2>
21 21
 
22
-	<a href="<?php echo esc_attr( admin_url( 'post-new.php?post_type=wps-proposal' ) ); ?>" class="wpeo-button button-main"><?php esc_html_e( 'Add', 'wpshop' ); ?></a>
22
+	<a href="<?php echo esc_attr(admin_url('post-new.php?post_type=wps-proposal')); ?>" class="wpeo-button button-main"><?php esc_html_e('Add', 'wpshop'); ?></a>
23 23
 
24 24
 	<?php Proposals::g()->display(); ?>
25 25
 </div>
Please login to merge, or discard this patch.