Completed
Branch 2.0.0 (814c19)
by Jimmy
03:05
created
modules/third-parties/class/class-third-party.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@  discard block
 block discarded – undo
16 16
 
17 17
 namespace wpshop;
18 18
 
19
-defined( 'ABSPATH' ) || exit;
19
+defined('ABSPATH') || exit;
20 20
 
21 21
 /**
22 22
  * Third Party class.
@@ -74,22 +74,22 @@  discard block
 block discarded – undo
74 74
 	 * @since 2.0.0
75 75
 	 */
76 76
 	public function display() {
77
-		$current_page = isset( $_GET['current_page'] ) ? $_GET['current_page'] : 1;
77
+		$current_page = isset($_GET['current_page']) ? $_GET['current_page'] : 1;
78 78
 
79 79
 		$args = array(
80
-			'offset'         => ( $current_page - 1 ) * 25,
80
+			'offset'         => ($current_page - 1) * 25,
81 81
 			'posts_per_page' => 25,
82 82
 		);
83 83
 
84
-		if ( ! empty( $_GET['s'] ) ) {
84
+		if (!empty($_GET['s'])) {
85 85
 			$args['s'] = $_GET['s'];
86 86
 		}
87 87
 
88
-		$third_parties = $this->get( $args );
88
+		$third_parties = $this->get($args);
89 89
 
90
-		\eoxia\View_Util::exec( 'wpshop', 'third-parties', 'list', array(
90
+		\eoxia\View_Util::exec('wpshop', 'third-parties', 'list', array(
91 91
 			'third_parties' => $third_parties,
92
-		) );
92
+		));
93 93
 	}
94 94
 }
95 95
 
Please login to merge, or discard this patch.
modules/third-parties/filter/class-third-party-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
  * Third Party 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-third-party_register_post_type_args', array( $this, 'callback_register_post_type_args' ) );
30
+		add_filter('eo_model_wps-third-party_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( 'Third parties', 'post type general name', 'wpshop' ),
43
-			'singular_name'      => _x( 'Third party', 'post type singular name', 'wpshop' ),
44
-			'menu_name'          => _x( 'Third parties', 'admin menu', 'wpshop' ),
45
-			'name_admin_bar'     => _x( 'Third party', 'add new on admin bar', 'wpshop' ),
46
-			'add_new'            => _x( 'Add New', 'third party', 'wpshop' ),
47
-			'add_new_item'       => __( 'Add New Third party', 'wpshop' ),
48
-			'new_item'           => __( 'New Third party', 'wpshop' ),
49
-			'edit_item'          => __( 'Edit Third party', 'wpshop' ),
50
-			'view_item'          => __( 'View Third party', 'wpshop' ),
51
-			'all_items'          => __( 'All Third parties', 'wpshop' ),
52
-			'search_items'       => __( 'Search Third parties', 'wpshop' ),
53
-			'parent_item_colon'  => __( 'Parent Third parties:', 'wpshop' ),
54
-			'not_found'          => __( 'No third parties found.', 'wpshop' ),
55
-			'not_found_in_trash' => __( 'No third parties found in Trash.', 'wpshop' ),
42
+			'name'               => _x('Third parties', 'post type general name', 'wpshop'),
43
+			'singular_name'      => _x('Third party', 'post type singular name', 'wpshop'),
44
+			'menu_name'          => _x('Third parties', 'admin menu', 'wpshop'),
45
+			'name_admin_bar'     => _x('Third party', 'add new on admin bar', 'wpshop'),
46
+			'add_new'            => _x('Add New', 'third party', 'wpshop'),
47
+			'add_new_item'       => __('Add New Third party', 'wpshop'),
48
+			'new_item'           => __('New Third party', 'wpshop'),
49
+			'edit_item'          => __('Edit Third party', 'wpshop'),
50
+			'view_item'          => __('View Third party', 'wpshop'),
51
+			'all_items'          => __('All Third parties', 'wpshop'),
52
+			'search_items'       => __('Search Third parties', 'wpshop'),
53
+			'parent_item_colon'  => __('Parent Third parties:', 'wpshop'),
54
+			'not_found'          => __('No third parties found.', 'wpshop'),
55
+			'not_found_in_trash' => __('No third parties found in Trash.', 'wpshop'),
56 56
 		);
57 57
 
58 58
 		$args['labels']            = $labels;
59
-		$args['supports']          = array( 'title', 'thumbnail' );
59
+		$args['supports']          = array('title', 'thumbnail');
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/third-parties/model/class-third-party-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 Third Party model.
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
 	 * @param Third_Party $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
 		$this->schema['external_id'] = array(
34 34
 			'type'        => 'integer',
35 35
 			'meta_type'   => 'single',
@@ -125,9 +125,9 @@  discard block
 block discarded – undo
125 125
 			'type'      => 'wpeo_date',
126 126
 			'meta_type' => 'single',
127 127
 			'field'     => '_last_sync',
128
-			'context'   => array( 'GET' ),
128
+			'context'   => array('GET'),
129 129
 		);
130 130
 
131
-		parent::__construct( $object, $req_method );
131
+		parent::__construct($object, $req_method);
132 132
 	}
133 133
 }
Please login to merge, or discard this patch.
modules/third-parties/view/single-title-edit.view.php 2 patches
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -29,7 +29,8 @@  discard block
 block discarded – undo
29 29
 					?>
30 30
 					<input type="submit" class="wpeo-button button-square-30" value='Save' />
31 31
 					<?php
32
-				else :
32
+				else {
33
+					:
33 34
 					?>
34 35
 					<div data-parent="wpeo-form"
35 36
 						class="action-input wpeo-button button-square-30">
@@ -37,6 +38,7 @@  discard block
 block discarded – undo
37 38
 					</div>
38 39
 					<?php
39 40
 				endif;
41
+				}
40 42
 				?>
41 43
 			</span>
42 44
 		</label>
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -14,19 +14,19 @@
 block discarded – undo
14 14
 
15 15
 namespace wpshop;
16 16
 
17
-defined( 'ABSPATH' ) || exit; ?>
17
+defined('ABSPATH') || exit; ?>
18 18
 
19
-<form class="wpeo-form" method="post" action="<?php echo ( 0 === $third_party->data['id'] ) ? admin_url( 'admin-post.php' ) : admin_url( 'admin-ajax.php' ); ?>">
19
+<form class="wpeo-form" method="post" action="<?php echo (0 === $third_party->data['id']) ? admin_url('admin-post.php') : admin_url('admin-ajax.php'); ?>">
20 20
 	<input type="hidden" name="action" value="third_party_save_title" />
21 21
 	<input type="hidden" name="post_id" value="<?php echo $third_party->data['id']; ?>" />
22
-	<?php wp_nonce_field( 'save_third' ); ?>
22
+	<?php wp_nonce_field('save_third'); ?>
23 23
 
24 24
 	<div class="form-element">
25 25
 		<label class="form-field-container">
26
-			<input type="text" class="form-field" name="title" placeholder="<?php esc_attr_e( 'New third party', 'wpshop' ); ?>" value="<?php echo $third_party->data['title']; ?>" />
26
+			<input type="text" class="form-field" name="title" placeholder="<?php esc_attr_e('New third party', 'wpshop'); ?>" value="<?php echo $third_party->data['title']; ?>" />
27 27
 			<span class="form-field-label-next">
28 28
 				<?php
29
-				if ( 0 === $third_party->data['id'] ) :
29
+				if (0 === $third_party->data['id']) :
30 30
 					?>
31 31
 					<input type="submit" class="wpeo-button button-square-30" value='Save' />
32 32
 					<?php
Please login to merge, or discard this patch.
modules/third-parties/view/list.view.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -14,30 +14,30 @@
 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( 'Dolibarr ID', 'wpshop' ); ?></th>
25
-			<th><?php esc_html_e( 'Title', 'wpshop' ); ?></th>
26
-			<th><?php esc_html_e( 'Associated contact', 'wpshop' ); ?></th>
27
-			<th><?php esc_html_e( 'Address', 'wpshop' ); ?></th>
28
-			<th><?php esc_html_e( 'Zip Code', 'wpshop' ); ?></th>
29
-			<th><?php esc_html_e( 'Town', 'wpshop' ); ?></th>
30
-			<th><?php esc_html_e( 'Country', 'wpshop' ); ?></th>
23
+			<th><?php esc_html_e('WP ID', 'wpshop'); ?></th>
24
+			<th><?php esc_html_e('Dolibarr ID', 'wpshop'); ?></th>
25
+			<th><?php esc_html_e('Title', 'wpshop'); ?></th>
26
+			<th><?php esc_html_e('Associated contact', 'wpshop'); ?></th>
27
+			<th><?php esc_html_e('Address', 'wpshop'); ?></th>
28
+			<th><?php esc_html_e('Zip Code', 'wpshop'); ?></th>
29
+			<th><?php esc_html_e('Town', 'wpshop'); ?></th>
30
+			<th><?php esc_html_e('Country', 'wpshop'); ?></th>
31 31
 			<th></th>
32 32
 		</tr>
33 33
 	</thead>
34 34
 	<tbody>
35 35
 		<?php
36
-		if ( ! empty( $third_parties ) ) :
37
-			foreach ( $third_parties as $third_party ) :
38
-				\eoxia\View_Util::exec( 'wpshop', 'third-parties', 'item', array(
36
+		if (!empty($third_parties)) :
37
+			foreach ($third_parties as $third_party) :
38
+				\eoxia\View_Util::exec('wpshop', 'third-parties', 'item', array(
39 39
 					'third_party' => $third_party,
40
-				) );
40
+				));
41 41
 			endforeach;
42 42
 		endif;
43 43
 		?>
Please login to merge, or discard this patch.
modules/third-parties/view/item.view.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -14,19 +14,19 @@
 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( $third_party->data['id'] ); ?></td>
22
-	<td><?php echo esc_html( $third_party->data['external_id'] ); ?></td>
23
-	<td><?php echo esc_html( $third_party->data['title'] ); ?></td>
24
-	<td><?php Contact::g()->display( $third_party ); ?></td>
25
-	<td><?php echo esc_html( $third_party->data['address'] ); ?></td>
26
-	<td><?php echo esc_html( $third_party->data['zip'] ); ?></td>
27
-	<td><?php echo esc_html( $third_party->data['town'] ); ?></td>
28
-	<td><?php echo esc_html( $third_party->data['country'] ); ?></td>
21
+	<td><?php echo esc_html($third_party->data['id']); ?></td>
22
+	<td><?php echo esc_html($third_party->data['external_id']); ?></td>
23
+	<td><?php echo esc_html($third_party->data['title']); ?></td>
24
+	<td><?php Contact::g()->display($third_party); ?></td>
25
+	<td><?php echo esc_html($third_party->data['address']); ?></td>
26
+	<td><?php echo esc_html($third_party->data['zip']); ?></td>
27
+	<td><?php echo esc_html($third_party->data['town']); ?></td>
28
+	<td><?php echo esc_html($third_party->data['country']); ?></td>
29 29
 	<td>
30
-		<a href="<?php echo esc_attr( admin_url( 'admin.php?page=wps-third-party&id=' . $third_party->data['id'] ) ); ?>" class="wpeo-button button-square-30 button-rounded"><i class="button-icon fas fa-pencil-alt"></i></a>
30
+		<a href="<?php echo esc_attr(admin_url('admin.php?page=wps-third-party&id=' . $third_party->data['id'])); ?>" class="wpeo-button button-square-30 button-rounded"><i class="button-icon fas fa-pencil-alt"></i></a>
31 31
 	</td>
32 32
 </tr>
Please login to merge, or discard this patch.
modules/third-parties/view/single.view.php 2 patches
Braces   +6 added lines, -2 removed lines patch added patch discarded remove patch
@@ -23,10 +23,12 @@  discard block
 block discarded – undo
23 23
 			\eoxia\View_Util::exec( 'wpshop', 'third-parties', 'single-title-edit', array(
24 24
 				'third_party' => $third_party,
25 25
 			) );
26
-		else :
26
+		else {
27
+			:
27 28
 			\eoxia\View_Util::exec( 'wpshop', 'third-parties', 'single-title', array(
28 29
 				'third_party' => $third_party,
29 30
 			) );
31
+		}
30 32
 		endif;
31 33
 		?>
32 34
 	</h2>
@@ -43,11 +45,13 @@  discard block
 block discarded – undo
43 45
 					?>
44 46
 					Dernière synchronisation le <?php echo $third_party->data['last_sync']['rendered']['date_human_readable']; ?>. Resynchroniser.
45 47
 					<?php
46
-				else :
48
+				else {
49
+					:
47 50
 					?>
48 51
 					Associer et synchroniser
49 52
 					<?php
50 53
 				endif;
54
+				}
51 55
 				?>
52 56
 			</span>
53 57
 		</span>
Please login to merge, or discard this patch.
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -14,33 +14,33 @@  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
 <div class="wrap">
20 20
 	<h2>
21 21
 		<?php
22
-		if ( 0 == $third_party->data['id'] ) :
23
-			\eoxia\View_Util::exec( 'wpshop', 'third-parties', 'single-title-edit', array(
22
+		if (0 == $third_party->data['id']) :
23
+			\eoxia\View_Util::exec('wpshop', 'third-parties', 'single-title-edit', array(
24 24
 				'third_party' => $third_party,
25
-			) );
25
+			));
26 26
 		else :
27
-			\eoxia\View_Util::exec( 'wpshop', 'third-parties', 'single-title', array(
27
+			\eoxia\View_Util::exec('wpshop', 'third-parties', 'single-title', array(
28 28
 				'third_party' => $third_party,
29
-			) );
29
+			));
30 30
 		endif;
31 31
 		?>
32 32
 	</h2>
33 33
 
34 34
 	<p>
35
-		<span class="wpeo-button button-main <?php echo ! empty( $third_party->data['external_id'] ) ? 'action-attribute' : 'wpeo-modal-event'; ?>"
35
+		<span class="wpeo-button button-main <?php echo !empty($third_party->data['external_id']) ? 'action-attribute' : 'wpeo-modal-event'; ?>"
36 36
 			data-title="Choix du tier à associer"
37 37
 			data-class="synchro-single"
38
-			data-id="<?php echo esc_attr( $third_party->data['id'] ); ?>"
38
+			data-id="<?php echo esc_attr($third_party->data['id']); ?>"
39 39
 			data-action="load_synchro_modal_single"
40
-			data-nonce="<?php echo esc_attr( wp_create_nonce( 'load_modal_synchro_single' ) ); ?>">
40
+			data-nonce="<?php echo esc_attr(wp_create_nonce('load_modal_synchro_single')); ?>">
41 41
 			<span>
42 42
 				<?php
43
-				if ( ! empty( $third_party->data['external_id'] ) ) :
43
+				if (!empty($third_party->data['external_id'])) :
44 44
 					?>
45 45
 					Dernière synchronisation le <?php echo $third_party->data['last_sync']['rendered']['date_human_readable']; ?>. Resynchroniser.
46 46
 					<?php
@@ -54,5 +54,5 @@  discard block
 block discarded – undo
54 54
 		</span>
55 55
 	</p>
56 56
 
57
-	<?php do_meta_boxes( 'wps-third-party', 'normal', '' ); ?>
57
+	<?php do_meta_boxes('wps-third-party', 'normal', ''); ?>
58 58
 </div>
Please login to merge, or discard this patch.
modules/third-parties/view/main.view.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -14,62 +14,62 @@
 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( 'Third Parties', 'wpshop' ); ?></h2>
20
+	<h2><?php esc_html_e('Third Parties', 'wpshop'); ?></h2>
21 21
 
22
-	<a href="<?php echo esc_attr( admin_url( 'admin.php?page=wps-third-party&id=0' ) ); ?>" class="wpeo-button button-main"><?php esc_html_e( 'Add', 'wpshop' ); ?></a>
22
+	<a href="<?php echo esc_attr(admin_url('admin.php?page=wps-third-party&id=0')); ?>" class="wpeo-button button-main"><?php esc_html_e('Add', 'wpshop'); ?></a>
23 23
 
24 24
 	<?php
25
-	if ( ! empty( $_GET['s'] ) ) :
25
+	if (!empty($_GET['s'])) :
26 26
 		?>
27 27
 		<p>Résultats de recherche pour « <?php echo $_GET['s']; ?> »</p>
28 28
 		<?php
29 29
 	endif;
30 30
 	?>
31 31
 
32
-	<form method="GET" action="<?php echo admin_url( 'admin.php' ); ?>">
32
+	<form method="GET" action="<?php echo admin_url('admin.php'); ?>">
33 33
 		<input type="hidden" name="page" value="wps-third-party" />
34
-		<input type="text" name="s" value="<?php echo esc_attr( ! empty( $_GET['s'] ) ? $_GET['s'] : '' ); ?>" />
34
+		<input type="text" name="s" value="<?php echo esc_attr(!empty($_GET['s']) ? $_GET['s'] : ''); ?>" />
35 35
 		<input type="submit" value="Search in third party" />
36 36
 	</form>
37 37
 
38 38
 	<p><?php echo $count . ' éléments'; ?></p>
39 39
 
40
-	<?php if ( $number_page > 1 ) : ?>
40
+	<?php if ($number_page > 1) : ?>
41 41
 		<ul class="wpeo-pagination">
42 42
 			<?php
43
-			if ( 1 !== $current_page ) :
43
+			if (1 !== $current_page) :
44 44
 				?>
45 45
 				<li class="pagination-element pagination-prev">
46
-					<a href="<?php echo esc_attr( $begin_url ); ?>"><<</a>
46
+					<a href="<?php echo esc_attr($begin_url); ?>"><<</a>
47 47
 				</li>
48 48
 
49 49
 				<li class="pagination-element pagination-prev">
50
-					<a href="<?php echo esc_attr( $prev_url ); ?>"><</a>
50
+					<a href="<?php echo esc_attr($prev_url); ?>"><</a>
51 51
 				</li>
52 52
 				<?php
53 53
 			endif;
54 54
 			?>
55 55
 
56
-			<form method="GET" action="<?php echo admin_url( 'admin.php' ); ?>" />
56
+			<form method="GET" action="<?php echo admin_url('admin.php'); ?>" />
57 57
 				<input type="hidden" name="page" value="wps-third-party" />
58
-				<input type="hidden" name="s" value="<?php echo esc_attr( ! empty( $_GET['s'] ) ? $_GET['s'] : '' ); ?>" />
59
-				<input style="width: 50px;" type="text" name="current_page" value="<?php echo esc_attr( $current_page ); ?>" />
58
+				<input type="hidden" name="s" value="<?php echo esc_attr(!empty($_GET['s']) ? $_GET['s'] : ''); ?>" />
59
+				<input style="width: 50px;" type="text" name="current_page" value="<?php echo esc_attr($current_page); ?>" />
60 60
 			</form>
61 61
 
62 62
 			sur <?php echo $number_page; ?>
63 63
 
64 64
 			<?php
65
-			if ( $current_page !== $number_page ) :
65
+			if ($current_page !== $number_page) :
66 66
 				?>
67 67
 				<li class="pagination-element pagination-next">
68
-					<a href="<?php echo esc_attr( $next_url ); ?>">></a>
68
+					<a href="<?php echo esc_attr($next_url); ?>">></a>
69 69
 				</li>
70 70
 
71 71
 				<li class="pagination-element pagination-next">
72
-					<a href="<?php echo esc_attr( $end_url ); ?>">>></a>
72
+					<a href="<?php echo esc_attr($end_url); ?>">>></a>
73 73
 				</li>
74 74
 				<?php
75 75
 			endif;
Please login to merge, or discard this patch.
modules/third-parties/view/metaboxes/metabox-activities.view.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@
 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>
Please login to merge, or discard this patch.