Import Export WordPress Users and WooCommerce Customers - Version 1.1.2

Version Description

  • Tested OK WC 3.4.4 and WP 4.9.8
  • Warnings fixed.
  • UI Changed.
  • Export multiple roles at a time.
Download this release

Release Info

Developer webtoffee
Plugin Icon 128x128 Import Export WordPress Users and WooCommerce Customers
Version 1.1.2
Comparing to
See all releases

Code changes from version 1.1.1 to 1.1.2

Sample_Users.csv CHANGED
@@ -1,2 +1,2 @@
1
- ID,user_login,user_pass,user_nicename,user_email,user_url,user_registered,display_name,first_name,last_name,user_status,roles
2
- 9,Mark,$P$By6K6/oknjRBovyyxs3sCDogZgO6ST1,mark,mark@xadapter.com,http://www.xadapter.com,2016-10-20 11:52:04,Mark,Mark,Wough,,"subscriber, customer"
1
+ ID,user_login,user_pass,user_nicename,user_email,user_url,user_registered,display_name,first_name,last_name,user_status,roles
2
+ 9,Mark,$P$By6K6/oknjRBovyyxs3sCDogZgO6ST1,mark,mark@xadapter.com,http://www.xadapter.com,2016-10-20 11:52:04,Mark,Mark,Wough,,"subscriber, customer"
customer-import-export.php CHANGED
@@ -1,153 +1,195 @@
1
- <?php
2
-
3
- /*
4
- Plugin Name: WordPress Users & WooCommerce Customers Import Export(BASIC)
5
- Plugin URI: https://www.xadapter.com/product/wordpress-users-woocommerce-customers-import-export/
6
- Description: Export and Import User/Customers details From and To your WordPress/WooCommerce.
7
- Author: XAdapter
8
- Author URI: https://www.xadapter.com/
9
- Version: 1.1.1
10
- WC tested up to: 3.4.0
11
- Text Domain: wf_customer_import_export
12
- */
13
-
14
-
15
-
16
- if (!defined('ABSPATH') || !is_admin()) {
17
- return;
18
- }
19
-
20
- /**
21
- * Function to check whether Premium version of User Import Export plugin is installed or not
22
- */
23
- function wf_wordpress_user_import_export_premium_check(){
24
- if ( is_plugin_active('customer-import-export-for-woocommerce/customer-import-export.php') ){
25
- deactivate_plugins( basename( __FILE__ ) );
26
- wp_die(__("You already have the Premium version installed. For any issues, kindly contact our <a target='_blank' href='https://www.xadapter.com/online-support/'>support</a>.", "wf_customer_import_export"), "", array('back_link' => 1 ));
27
- }
28
- }
29
- register_activation_hook( __FILE__, 'wf_wordpress_user_import_export_premium_check' );
30
-
31
-
32
- if( !defined('WF_CUSTOMER_IMP_EXP_ID') )
33
- {
34
- define("WF_CUSTOMER_IMP_EXP_ID", "wf_customer_imp_exp");
35
- }
36
-
37
- if( !defined('HF_WORDPRESS_CUSTOMER_IM_EX') )
38
- {
39
- define("HF_WORDPRESS_CUSTOMER_IM_EX", "hf_wordpress_customer_im_ex");
40
- }
41
-
42
- if (!class_exists('WF_Customer_Import_Export_CSV')) :
43
-
44
- /*
45
- * Main CSV Import class
46
- */
47
-
48
- class WF_Customer_Import_Export_CSV {
49
-
50
- /**
51
- * Constructor
52
- */
53
- public function __construct() {
54
- if( !defined('WF_CustomerImpExpCsv_FILE') )
55
- {
56
- define('WF_CustomerImpExpCsv_FILE', __FILE__);
57
- }
58
-
59
- add_filter('woocommerce_screen_ids', array($this, 'woocommerce_screen_ids'));
60
- add_filter('plugin_action_links_' . plugin_basename(__FILE__), array($this, 'wf_plugin_action_links'));
61
- add_action('init', array($this, 'load_plugin_textdomain'));
62
- add_action('init', array($this, 'catch_export_request'), 20);
63
- add_action('init', array($this, 'catch_save_settings'), 20);
64
- add_action('admin_init', array($this, 'register_importers'));
65
-
66
- include_once( 'includes/class-wf-customerimpexpcsv-admin-screen.php' );
67
- include_once( 'includes/importer/class-wf-customerimpexpcsv-importer.php' );
68
-
69
- if (defined('DOING_AJAX')) {
70
- include_once( 'includes/class-wf-customerimpexpcsv-ajax-handler.php' );
71
- }
72
- }
73
-
74
- public function wf_plugin_action_links($links) {
75
- $plugin_links = array(
76
- '<a href="' . admin_url('admin.php?page=hf_wordpress_customer_im_ex') . '">' . __('Import Export Users/Customers', 'wf_customer_import_export') . '</a>',
77
- '<a href="https://www.xadapter.com/support/forum/wordpress-users-woocommerce-customers-import-export/">' . __('Support', 'wf_customer_import_export') . '</a>',
78
- '<a href="https://wordpress.org/support/plugin/users-customers-import-export-for-wp-woocommerce/reviews/">' . __('Review', 'wf_customer_import_export') . '</a>',
79
- );
80
- return array_merge($plugin_links, $links);
81
- }
82
-
83
- /**
84
- * Add screen ID
85
- */
86
- public function woocommerce_screen_ids($ids) {
87
- $ids[] = 'admin'; // For import screen
88
- return $ids;
89
- }
90
-
91
- /**
92
- * Handle localisation
93
- */
94
- public function load_plugin_textdomain() {
95
- load_plugin_textdomain('wf_customer_import_export', false, dirname(plugin_basename(__FILE__)) . '/lang/');
96
- }
97
-
98
- /**
99
- * Catches an export request and exports the data. This class is only loaded in admin.
100
- */
101
- public function catch_export_request() {
102
- if (!empty($_GET['action']) && !empty($_GET['page']) && $_GET['page'] == 'hf_wordpress_customer_im_ex') {
103
- switch ($_GET['action']) {
104
- case "export" :
105
- $user_ok = $this->hf_user_permission();
106
- if ($user_ok) {
107
- include_once( 'includes/exporter/class-wf-customerimpexpcsv-exporter.php' );
108
- WF_CustomerImpExpCsv_Exporter::do_export();
109
- } else {
110
- wp_redirect(wp_login_url());
111
- }
112
- break;
113
- }
114
- }
115
- }
116
-
117
- public function catch_save_settings() {
118
- if (!empty($_GET['action']) && !empty($_GET['page']) && $_GET['page'] == 'hf_wordpress_customer_im_ex') {
119
- switch ($_GET['action']) {
120
- case "settings" :
121
- include_once( 'includes/settings/class-wf-customerimpexpcsv-settings.php' );
122
- WF_CustomerImpExpCsv_Settings::save_settings();
123
- break;
124
- }
125
- }
126
- }
127
-
128
- /**
129
- * Register importers for use
130
- */
131
- public function register_importers() {
132
- register_importer('wordpress_hf_user_csv', 'WordPress User/Customers (CSV)', __('Import <strong>users/customers</strong> to your site via a csv file.', 'wf_customer_import_export'), 'WF_CustomerImpExpCsv_Importer::customer_importer');
133
- }
134
-
135
- private function hf_user_permission() {
136
- // Check if user has rights to export
137
- $current_user = wp_get_current_user();
138
- $user_ok = false;
139
- $wf_roles = apply_filters('hf_user_permission_roles', array('administrator', 'shop_manager'));
140
- if ($current_user instanceof WP_User) {
141
- $can_users = array_intersect($wf_roles, $current_user->roles);
142
- if (!empty($can_users)) {
143
- $user_ok = true;
144
- }
145
- }
146
- return $user_ok;
147
- }
148
-
149
- }
150
-
151
- endif;
152
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
153
  new WF_Customer_Import_Export_CSV();
1
+ <?php
2
+
3
+ /*
4
+ Plugin Name: WordPress Users & WooCommerce Customers Import Export(BASIC)
5
+ Plugin URI: https://wordpress.org/plugins/users-customers-import-export-for-wp-woocommerce/
6
+ Description: Export and Import User/Customers details From and To your WordPress/WooCommerce.
7
+ Author: WebToffee
8
+ Author URI: https://www.webtoffee.com/product/wordpress-users-woocommerce-customers-import-export/
9
+ Version: 1.1.2
10
+ WC tested up to: 3.4.4
11
+ Text Domain: wf_customer_import_export
12
+ License: GPLv3
13
+ License URI: https://www.gnu.org/licenses/gpl-3.0.html
14
+ */
15
+
16
+
17
+
18
+ if (!defined('ABSPATH') || !is_admin()) {
19
+ return;
20
+ }
21
+
22
+ /**
23
+ * Function to check whether Premium version of User Import Export plugin is installed or not
24
+ */
25
+ function wf_wordpress_user_import_export_premium_check(){
26
+ if ( is_plugin_active('customer-import-export-for-woocommerce/customer-import-export.php') ){
27
+ deactivate_plugins( basename( __FILE__ ) );
28
+ wp_die(__("You already have the Premium version installed. For any issues, kindly contact our <a target='_blank' href='https://www.xadapter.com/online-support/'>support</a>.", "wf_customer_import_export"), "", array('back_link' => 1 ));
29
+ }
30
+ }
31
+ register_activation_hook( __FILE__, 'wf_wordpress_user_import_export_premium_check' );
32
+
33
+
34
+ if( !defined('WF_CUSTOMER_IMP_EXP_ID') )
35
+ {
36
+ define("WF_CUSTOMER_IMP_EXP_ID", "wf_customer_imp_exp");
37
+ }
38
+
39
+ if( !defined('HF_WORDPRESS_CUSTOMER_IM_EX') )
40
+ {
41
+ define("HF_WORDPRESS_CUSTOMER_IM_EX", "hf_wordpress_customer_im_ex");
42
+ }
43
+
44
+ if (!class_exists('WF_Customer_Import_Export_CSV')) :
45
+
46
+ /*
47
+ * Main CSV Import class
48
+ */
49
+
50
+ class WF_Customer_Import_Export_CSV {
51
+
52
+ /**
53
+ * Constructor
54
+ */
55
+ public function __construct() {
56
+ if( !defined('WF_CustomerImpExpCsv_FILE') )
57
+ {
58
+ define('WF_CustomerImpExpCsv_FILE', __FILE__);
59
+ }
60
+
61
+ add_filter('woocommerce_screen_ids', array($this, 'woocommerce_screen_ids'));
62
+ add_filter('plugin_action_links_' . plugin_basename(__FILE__), array($this, 'wf_plugin_action_links'));
63
+ add_action('init', array($this, 'load_plugin_textdomain'));
64
+ add_action('init', array($this, 'catch_export_request'), 20);
65
+ add_action('init', array($this, 'catch_save_settings'), 20);
66
+ add_action('admin_init', array($this, 'register_importers'));
67
+
68
+ if (!get_option('UEIPF_Webtoffee_storefrog_admin_notices_dismissed')) {
69
+ add_action('admin_notices', array($this, 'webtoffee_storefrog_admin_notices'));
70
+ add_action('wp_ajax_UEIPF_webtoffee_storefrog_notice_dismiss', array($this, 'webtoffee_storefrog_notice_dismiss'));
71
+ }
72
+
73
+ include_once( 'includes/class-wf-customerimpexpcsv-admin-screen.php' );
74
+ include_once( 'includes/importer/class-wf-customerimpexpcsv-importer.php' );
75
+
76
+ if (defined('DOING_AJAX')) {
77
+ include_once( 'includes/class-wf-customerimpexpcsv-ajax-handler.php' );
78
+ }
79
+ }
80
+
81
+ public function wf_plugin_action_links($links) {
82
+ $plugin_links = array(
83
+ '<a href="' . admin_url('admin.php?page=hf_wordpress_customer_im_ex') . '">' . __('Import Export Users/Customers', 'wf_customer_import_export') . '</a>',
84
+ '<a href="https://www.xadapter.com/support/forum/wordpress-users-woocommerce-customers-import-export/">' . __('Support', 'wf_customer_import_export') . '</a>',
85
+ '<a href="https://wordpress.org/support/plugin/users-customers-import-export-for-wp-woocommerce/reviews/">' . __('Review', 'wf_customer_import_export') . '</a>',
86
+ );
87
+ return array_merge($plugin_links, $links);
88
+ }
89
+
90
+ /**
91
+ * Add screen ID
92
+ */
93
+ public function woocommerce_screen_ids($ids) {
94
+ $ids[] = 'admin'; // For import screen
95
+ return $ids;
96
+ }
97
+
98
+ /**
99
+ * Handle localisation
100
+ */
101
+ public function load_plugin_textdomain() {
102
+ load_plugin_textdomain('wf_customer_import_export', false, dirname(plugin_basename(__FILE__)) . '/lang/');
103
+ }
104
+
105
+ /**
106
+ * Catches an export request and exports the data. This class is only loaded in admin.
107
+ */
108
+ public function catch_export_request() {
109
+ if (!empty($_GET['action']) && !empty($_GET['page']) && $_GET['page'] == 'hf_wordpress_customer_im_ex') {
110
+ switch ($_GET['action']) {
111
+ case "export" :
112
+ $user_ok = $this->hf_user_permission();
113
+ if ($user_ok) {
114
+ include_once( 'includes/exporter/class-wf-customerimpexpcsv-exporter.php' );
115
+ WF_CustomerImpExpCsv_Exporter::do_export();
116
+ } else {
117
+ wp_redirect(wp_login_url());
118
+ }
119
+ break;
120
+ }
121
+ }
122
+ }
123
+
124
+ public function catch_save_settings() {
125
+ if (!empty($_GET['action']) && !empty($_GET['page']) && $_GET['page'] == 'hf_wordpress_customer_im_ex') {
126
+ switch ($_GET['action']) {
127
+ case "settings" :
128
+ include_once( 'includes/settings/class-wf-customerimpexpcsv-settings.php' );
129
+ WF_CustomerImpExpCsv_Settings::save_settings();
130
+ break;
131
+ }
132
+ }
133
+ }
134
+
135
+ /**
136
+ * Register importers for use
137
+ */
138
+ public function register_importers() {
139
+ register_importer('wordpress_hf_user_csv', 'WordPress User/Customers (CSV)', __('Import <strong>users/customers</strong> to your site via a csv file.', 'wf_customer_import_export'), 'WF_CustomerImpExpCsv_Importer::customer_importer');
140
+ }
141
+
142
+ private function hf_user_permission() {
143
+ // Check if user has rights to export
144
+ $current_user = wp_get_current_user();
145
+ $user_ok = false;
146
+ $wf_roles = apply_filters('hf_user_permission_roles', array('administrator', 'shop_manager'));
147
+ if ($current_user instanceof WP_User) {
148
+ $can_users = array_intersect($wf_roles, $current_user->roles);
149
+ if (!empty($can_users)) {
150
+ $user_ok = true;
151
+ }
152
+ }
153
+ return $user_ok;
154
+ }
155
+
156
+ function webtoffee_storefrog_admin_notices() {
157
+
158
+ if (apply_filters('webtoffee_storefrog_suppress_admin_notices', false)) {
159
+ return;
160
+ }
161
+ $screen = get_current_screen();
162
+
163
+ $allowed_screen_ids = array('users_page_hf_wordpress_customer_im_ex', 'admin');
164
+ if (in_array($screen->id, $allowed_screen_ids)) {
165
+
166
+ $notice = __('<h3>Save Time, Money & Hassle on Your WooCommerce Data Migration?</h3>', 'wf_customer_import_export');
167
+ $notice .= __('<h3>Use StoreFrog Migration Services.</h3>', 'wf_customer_import_export');
168
+
169
+ $content = '<style>.webtoffee-storefrog-nav-tab.updated {z-index:2; display: flex;align-items: center;margin: 18px 20px 10px 0;padding:23px;border-left-color: #2c85d7!important}.webtoffee-storefrog-nav-tab ul {margin: 0;}.webtoffee-storefrog-nav-tab h3 {margin-top: 0;margin-bottom: 9px;font-weight: 500;font-size: 16px;color: #2880d3;}.webtoffee-storefrog-nav-tab h3:last-child {margin-bottom: 0;}.webtoffee-storefrog-banner {flex-basis: 20%;padding: 0 15px;margin-left: auto;} .webtoffee-storefrog-banner a:focus{box-shadow: none;}</style>';
170
+ $content .= '<div class="updated woocommerce-message webtoffee-storefrog-nav-tab notice is-dismissible"><ul>' . $notice . '</ul><div class="webtoffee-storefrog-banner"><a href="http://www.storefrog.com/" target="_blank"> <img src="' . plugins_url(basename(plugin_dir_path(WF_CustomerImpExpCsv_FILE))) . '/images/storefrog.png"/></a></div><div style="position: absolute;top: 0;right: 1px;z-index: 10000;" ><button type="button" id="webtoffee-storefrog-notice-dismiss" class="notice-dismiss"><span class="screen-reader-text">' . __('Dismiss this notice.', 'wf_order_import_export') . '</span></button></div></div>';
171
+ echo $content;
172
+
173
+
174
+ wc_enqueue_js("jQuery( '#webtoffee-storefrog-notice-dismiss' ).click( function() {
175
+ jQuery.post( '" . admin_url("admin-ajax.php") . "', { action: 'UEIPF_webtoffee_storefrog_notice_dismiss' } );
176
+ jQuery('.webtoffee-storefrog-nav-tab').fadeOut();
177
+ });
178
+ ");
179
+ }
180
+ }
181
+
182
+ function webtoffee_storefrog_notice_dismiss() {
183
+
184
+ if (!current_user_can('manage_woocommerce')) {
185
+ wp_die(-1);
186
+ }
187
+ update_option('UEIPF_Webtoffee_storefrog_admin_notices_dismissed', 1);
188
+ wp_die();
189
+ }
190
+
191
+ }
192
+
193
+ endif;
194
+
195
  new WF_Customer_Import_Export_CSV();
images/documentation.png ADDED
Binary file
images/storefrog.png ADDED
Binary file
images/support.png ADDED
Binary file
images/video.png ADDED
Binary file
includes/class-wf-customerimpexpcsv-admin-screen.php CHANGED
@@ -1,84 +1,86 @@
1
- <?php
2
- if (!defined('ABSPATH')) {
3
- exit;
4
- }
5
-
6
- class WF_CustomerImpExpCsv_Admin_Screen {
7
-
8
- /**
9
- * Constructor
10
- */
11
- public function __construct() {
12
- add_action('admin_menu', array($this, 'admin_menu'));
13
- add_action('admin_print_styles', array($this, 'admin_scripts'));
14
- add_action('admin_notices', array($this, 'admin_notices'));
15
- }
16
-
17
- /**
18
- * Notices in admin
19
- */
20
- public function admin_notices() {
21
- if (!function_exists('mb_detect_encoding')) {
22
- echo '<div class="error"><p>' . __('User/Customer CSV Import Export requires the function <code>mb_detect_encoding</code> to import and export CSV files. Please ask your hosting provider to enable this function.', 'wf_customer_import_export') . '</p></div>';
23
- }
24
- }
25
-
26
- /**
27
- * Admin Menu
28
- */
29
- public function admin_menu() {
30
- $page = add_users_page( __( 'User Import Export', 'wf_customer_import_export' ), __( 'User Import Export', 'wf_customer_import_export' ), 'list_users', 'hf_wordpress_customer_im_ex', array( $this, 'output' ) );
31
- $page1 = add_submenu_page( 'woocommerce', __( 'Customer Import Export', 'wf_customer_import_export' ), __( 'Customer Import Export', 'wf_customer_import_export' ), 'manage_woocommerce', 'hf_wordpress_customer_im_ex', array( $this, 'output' ) );
32
- }
33
-
34
- /**
35
- * Admin Scripts
36
- */
37
- public function admin_scripts() {
38
- global $wp_scripts;
39
- if(function_exists('WC')){
40
- wp_enqueue_style('woocommerce_admin_styles', WC()->plugin_url() . '/assets/css/admin.css');
41
- }
42
- wp_enqueue_style('woocommerce-user-csv-importer', plugins_url(basename(plugin_dir_path(WF_CustomerImpExpCsv_FILE)) . '/styles/wf-style.css', basename(__FILE__)), '', '1.0.0', 'screen');
43
- }
44
-
45
- /**
46
- * Admin Screen output
47
- */
48
- public function output() {
49
- $tab = 'import';
50
-
51
- if (!empty($_GET['tab'])) {
52
- if ($_GET['tab'] == 'export') {
53
- $tab = 'export';
54
- } else if ($_GET['tab'] == 'settings') {
55
- $tab = 'settings';
56
- }
57
- }
58
- include( 'views/html-wf-admin-screen.php' );
59
- }
60
-
61
-
62
-
63
- /**
64
- * Admin page for importing
65
- */
66
- public function admin_import_page() {
67
-
68
- include( 'views/import/html-wf-import-customers.php' );
69
- $post_columns = include( 'exporter/data/data-wf-post-columns.php' );
70
- include( 'views/export/html-wf-export-customers.php' );
71
- }
72
-
73
- /**
74
- * Admin Page for exporting
75
- */
76
- public function admin_export_page() {
77
- $post_columns = include( 'exporter/data/data-wf-post-columns.php' );
78
- include( 'views/export/html-wf-export-customers.php' );
79
- }
80
-
81
-
82
- }
83
-
 
 
84
  new WF_CustomerImpExpCsv_Admin_Screen();
1
+ <?php
2
+ if (!defined('ABSPATH')) {
3
+ exit;
4
+ }
5
+
6
+ class WF_CustomerImpExpCsv_Admin_Screen {
7
+
8
+ /**
9
+ * Constructor
10
+ */
11
+ public function __construct() {
12
+ add_action('admin_menu', array($this, 'admin_menu'));
13
+ add_action('admin_print_styles', array($this, 'admin_scripts'));
14
+ add_action('admin_notices', array($this, 'admin_notices'));
15
+ }
16
+
17
+ /**
18
+ * Notices in admin
19
+ */
20
+ public function admin_notices() {
21
+ if (!function_exists('mb_detect_encoding')) {
22
+ echo '<div class="error"><p>' . __('User/Customer CSV Import Export requires the function <code>mb_detect_encoding</code> to import and export CSV files. Please ask your hosting provider to enable this function.', 'wf_customer_import_export') . '</p></div>';
23
+ }
24
+ }
25
+
26
+ /**
27
+ * Admin Menu
28
+ */
29
+ public function admin_menu() {
30
+ $page = add_users_page( __( 'User Import Export', 'wf_customer_import_export' ), __( 'User Import Export', 'wf_customer_import_export' ), 'list_users', 'hf_wordpress_customer_im_ex', array( $this, 'output' ) );
31
+ $page1 = add_submenu_page( 'woocommerce', __( 'Customer Import Export', 'wf_customer_import_export' ), __( 'Customer Import Export', 'wf_customer_import_export' ), 'manage_woocommerce', 'hf_wordpress_customer_im_ex', array( $this, 'output' ) );
32
+ }
33
+
34
+ /**
35
+ * Admin Scripts
36
+ */
37
+ public function admin_scripts() {
38
+ global $wp_scripts;
39
+ if(function_exists('WC')){
40
+ wp_enqueue_style('woocommerce_admin_styles', WC()->plugin_url() . '/assets/css/admin.css');
41
+ }
42
+ wp_enqueue_style('woocommerce-user-csv-importer', plugins_url(basename(plugin_dir_path(WF_CustomerImpExpCsv_FILE)) . '/styles/wf-style.css', basename(__FILE__)), '', '1.0.0', 'screen');
43
+ wp_enqueue_style('woocommerce-user-csv-importer1', plugins_url(basename(plugin_dir_path(WF_CustomerImpExpCsv_FILE)) . '/styles/select2.css', basename(__FILE__)), '', '4.0.6', '');
44
+ wp_enqueue_script('woocommerce-user-csv-importer', plugins_url(basename(plugin_dir_path(WF_CustomerImpExpCsv_FILE)) . '/styles/select2.js', basename(__FILE__)), array(), '4.0.6', true);
45
+
46
+ }
47
+
48
+
49
+ /**
50
+ * Admin Screen output
51
+ */
52
+ public function output() {
53
+ $tab = 'export';
54
+
55
+ if (!empty($_GET['tab'])) {
56
+ if ($_GET['tab'] == 'import') {
57
+ $tab = 'import';
58
+ } else if ($_GET['tab'] == 'settings') {
59
+ $tab = 'settings';
60
+ } else if ($_GET['tab'] == 'help') {
61
+ $tab = 'help';
62
+ }
63
+ }
64
+
65
+ include( 'views/html-wf-admin-screen.php' );
66
+ }
67
+
68
+ /**
69
+ * Admin page for help
70
+ */
71
+ public function admin_help_page() {
72
+ include('views/html-wf-help-guide.php');
73
+ }
74
+
75
+ /**
76
+ * Admin Page for exporting
77
+ */
78
+ public function admin_export_page() {
79
+ $post_columns = include( 'exporter/data/data-wf-post-columns.php' );
80
+ include( 'views/export/html-wf-export-customers.php' );
81
+ }
82
+
83
+
84
+ }
85
+
86
  new WF_CustomerImpExpCsv_Admin_Screen();
includes/class-wf-customerimpexpcsv-ajax-handler.php CHANGED
@@ -1,25 +1,25 @@
1
- <?php
2
- if ( ! defined( 'ABSPATH' ) ) {
3
- exit;
4
- }
5
-
6
- class WF_CustomerImpExpCsv_AJAX_Handler {
7
-
8
- /**
9
- * Constructor
10
- */
11
- public function __construct() {
12
- add_action( 'wp_ajax_user_csv_import_request', array( $this, 'csv_customer_import_request' ) );
13
- }
14
-
15
- /**
16
- * Ajax event for importing a CSV
17
- */
18
- public function csv_customer_import_request() {
19
- define( 'WP_LOAD_IMPORTERS', true );
20
- WF_CustomerImpExpCsv_Importer::customer_importer();
21
- }
22
-
23
- }
24
-
25
  new WF_CustomerImpExpCsv_AJAX_Handler();
1
+ <?php
2
+ if ( ! defined( 'ABSPATH' ) ) {
3
+ exit;
4
+ }
5
+
6
+ class WF_CustomerImpExpCsv_AJAX_Handler {
7
+
8
+ /**
9
+ * Constructor
10
+ */
11
+ public function __construct() {
12
+ add_action( 'wp_ajax_user_csv_import_request', array( $this, 'csv_customer_import_request' ) );
13
+ }
14
+
15
+ /**
16
+ * Ajax event for importing a CSV
17
+ */
18
+ public function csv_customer_import_request() {
19
+ define( 'WP_LOAD_IMPORTERS', true );
20
+ WF_CustomerImpExpCsv_Importer::customer_importer();
21
+ }
22
+
23
+ }
24
+
25
  new WF_CustomerImpExpCsv_AJAX_Handler();
includes/exporter/class-wf-customerimpexpcsv-exporter.php CHANGED
@@ -1,133 +1,133 @@
1
- <?php
2
-
3
- if (!defined('ABSPATH')) {
4
- exit;
5
- }
6
-
7
- class WF_CustomerImpExpCsv_Exporter {
8
-
9
- /**
10
- * Customer Exporter Tool
11
- */
12
- public static function do_export() {
13
- global $wpdb;
14
-
15
- $export_limit = !empty($_POST['limit']) ? intval($_POST['limit']) : 999999999;
16
- $export_offset = !empty($_POST['offset']) ? intval($_POST['offset']) : 0;
17
- $csv_columns = include( 'data/data-wf-post-columns.php' );
18
-
19
- $user_columns_name = !empty($_POST['columns_name']) ? $_POST['columns_name'] : $csv_columns;
20
- $export_columns = !empty($_POST['columns']) ? $_POST['columns'] : array();
21
-
22
- $export_user_roles = !empty($_POST['user_roles']) ? $_POST['user_roles'] : array();
23
- $delimiter = !empty($_POST['delimiter']) ? $_POST['delimiter'] : ',';
24
-
25
-
26
- $wpdb->hide_errors();
27
- @set_time_limit(0);
28
- if (function_exists('apache_setenv'))
29
- @apache_setenv('no-gzip', 1);
30
- @ini_set('zlib.output_compression', 0);
31
- @ob_clean();
32
-
33
- header('Content-Type: text/csv; charset=UTF-8');
34
- header('Content-Disposition: attachment; filename=Customer-Export-' . date('Y_m_d_H_i_s', current_time('timestamp')) . ".csv");
35
- header('Pragma: no-cache');
36
- header('Expires: 0');
37
-
38
- $fp = fopen('php://output', 'w');
39
-
40
-
41
-
42
- $args = array(
43
- 'fields' => 'ID', // exclude standard wp_users fields from get_users query -> get Only ID##
44
- 'role__in' => $export_user_roles, //An array of role names. Matched users must have at least one of these roles. Default empty array.
45
- 'number' => $export_limit, // number of users to retrieve
46
- 'offset' => $export_offset // offset to skip from list
47
- );
48
-
49
- $users = get_users($args);
50
-
51
- // Variable to hold the CSV data we're exporting
52
- $row = array();
53
-
54
- // Export header rows
55
- foreach ($csv_columns as $column => $value) {
56
- $temp_head = esc_attr($user_columns_name[$column]);
57
- if (!$export_columns || in_array($column, $export_columns))
58
- $row[] = $temp_head;
59
- }
60
-
61
-
62
-
63
-
64
- $row = array_map('WF_CustomerImpExpCsv_Exporter::wrap_column', $row);
65
- fwrite($fp, implode($delimiter, $row) . "\n");
66
- unset($row);
67
-
68
- // Loop users
69
- foreach ($users as $user) {
70
- //$row = array();
71
- $data = WF_CustomerImpExpCsv_Exporter::get_customers_csv_row($user, $export_columns, $csv_columns);
72
- $row = array_map('WF_CustomerImpExpCsv_Exporter::wrap_column', $data);
73
- fwrite($fp, implode($delimiter, $row) . "\n");
74
- unset($row);
75
- unset($data);
76
- }
77
-
78
- fclose($fp);
79
- exit;
80
- }
81
-
82
- public static function format_data($data) {
83
- //if (!is_array($data));
84
- //$data = (string) urldecode($data);
85
- $enc = mb_detect_encoding($data, 'UTF-8, ISO-8859-1', true);
86
- $data = ( $enc == 'UTF-8' ) ? $data : utf8_encode($data);
87
- return $data;
88
- }
89
-
90
- /**
91
- * Wrap a column in quotes for the CSV
92
- * @param string data to wrap
93
- * @return string wrapped data
94
- */
95
- public static function wrap_column($data) {
96
- return '"' . str_replace('"', '""', $data) . '"';
97
- }
98
-
99
- /**
100
- * Get the customer data for a single CSV row
101
- * @since 3.0
102
- * @param int $customer_id
103
- * @param array $export_columns - user selected columns / all
104
- * @return array $meta_keys customer/user meta data
105
- */
106
- public static function get_customers_csv_row($id, $export_columns, $csv_columns) {
107
-
108
- $user = get_user_by('ID', $id);
109
-
110
- $customer_data = array();
111
- foreach ($csv_columns as $key) {
112
-
113
- $customer_data[$key] = !empty($user->{$key}) ? maybe_serialize($user->{$key}) : '';
114
- }
115
- $customer_data['roles'] = implode(', ', $user->roles);
116
-
117
- foreach ($customer_data as $key => $value) {
118
- if (!$export_columns || in_array($key, $export_columns)) {
119
- // need to modify code
120
- } else {
121
- unset($customer_data[$key]);
122
- }
123
- }
124
- /*
125
- * CSV Customer Export Row.
126
- * Filter the individual row data for the customer export
127
- * @since 3.0
128
- * @param array $customer_data
129
- */
130
- return apply_filters('hf_customer_csv_export_data', $customer_data);
131
- }
132
-
133
- }
1
+ <?php
2
+
3
+ if (!defined('ABSPATH')) {
4
+ exit;
5
+ }
6
+
7
+ class WF_CustomerImpExpCsv_Exporter {
8
+
9
+ /**
10
+ * Customer Exporter Tool
11
+ */
12
+ public static function do_export() {
13
+ global $wpdb;
14
+
15
+ $export_limit = !empty($_POST['limit']) ? intval($_POST['limit']) : 999999999;
16
+ $export_offset = !empty($_POST['offset']) ? intval($_POST['offset']) : 0;
17
+ $csv_columns = include( 'data/data-wf-post-columns.php' );
18
+
19
+ $user_columns_name = !empty($_POST['columns_name']) ? $_POST['columns_name'] : $csv_columns;
20
+ $export_columns = !empty($_POST['columns']) ? $_POST['columns'] : array();
21
+
22
+ $export_user_roles = !empty($_POST['user_roles']) ? $_POST['user_roles'] : array();
23
+ $delimiter = !empty($_POST['delimiter']) ? $_POST['delimiter'] : ',';
24
+
25
+
26
+ $wpdb->hide_errors();
27
+ @set_time_limit(0);
28
+ if (function_exists('apache_setenv'))
29
+ @apache_setenv('no-gzip', 1);
30
+ @ini_set('zlib.output_compression', 0);
31
+ @ob_clean();
32
+
33
+ header('Content-Type: text/csv; charset=UTF-8');
34
+ header('Content-Disposition: attachment; filename=Customer-Export-' . date('Y_m_d_H_i_s', current_time('timestamp')) . ".csv");
35
+ header('Pragma: no-cache');
36
+ header('Expires: 0');
37
+
38
+ $fp = fopen('php://output', 'w');
39
+
40
+
41
+
42
+ $args = array(
43
+ 'fields' => 'ID', // exclude standard wp_users fields from get_users query -> get Only ID##
44
+ 'role__in' => $export_user_roles, //An array of role names. Matched users must have at least one of these roles. Default empty array.
45
+ 'number' => $export_limit, // number of users to retrieve
46
+ 'offset' => $export_offset // offset to skip from list
47
+ );
48
+
49
+ $users = get_users($args);
50
+
51
+ // Variable to hold the CSV data we're exporting
52
+ $row = array();
53
+
54
+ // Export header rows
55
+ foreach ($csv_columns as $column => $value) {
56
+ $temp_head = esc_attr($user_columns_name[$column]);
57
+ if (!$export_columns || in_array($column, $export_columns))
58
+ $row[] = $temp_head;
59
+ }
60
+
61
+
62
+
63
+
64
+ $row = array_map('WF_CustomerImpExpCsv_Exporter::wrap_column', $row);
65
+ fwrite($fp, implode($delimiter, $row) . "\n");
66
+ unset($row);
67
+
68
+ // Loop users
69
+ foreach ($users as $user) {
70
+ //$row = array();
71
+ $data = WF_CustomerImpExpCsv_Exporter::get_customers_csv_row($user, $export_columns, $csv_columns);
72
+ $row = array_map('WF_CustomerImpExpCsv_Exporter::wrap_column', $data);
73
+ fwrite($fp, implode($delimiter, $row) . "\n");
74
+ unset($row);
75
+ unset($data);
76
+ }
77
+
78
+ fclose($fp);
79
+ exit;
80
+ }
81
+
82
+ public static function format_data($data) {
83
+ //if (!is_array($data));
84
+ //$data = (string) urldecode($data);
85
+ $enc = mb_detect_encoding($data, 'UTF-8, ISO-8859-1', true);
86
+ $data = ( $enc == 'UTF-8' ) ? $data : utf8_encode($data);
87
+ return $data;
88
+ }
89
+
90
+ /**
91
+ * Wrap a column in quotes for the CSV
92
+ * @param string data to wrap
93
+ * @return string wrapped data
94
+ */
95
+ public static function wrap_column($data) {
96
+ return '"' . str_replace('"', '""', $data) . '"';
97
+ }
98
+
99
+ /**
100
+ * Get the customer data for a single CSV row
101
+ * @since 3.0
102
+ * @param int $customer_id
103
+ * @param array $export_columns - user selected columns / all
104
+ * @return array $meta_keys customer/user meta data
105
+ */
106
+ public static function get_customers_csv_row($id, $export_columns, $csv_columns) {
107
+
108
+ $user = get_user_by('ID', $id);
109
+
110
+ $customer_data = array();
111
+ foreach ($csv_columns as $key) {
112
+
113
+ $customer_data[$key] = !empty($user->{$key}) ? maybe_serialize($user->{$key}) : '';
114
+ }
115
+ $customer_data['roles'] = implode(', ', $user->roles);
116
+
117
+ foreach ($customer_data as $key => $value) {
118
+ if (!$export_columns || in_array($key, $export_columns)) {
119
+ // need to modify code
120
+ } else {
121
+ unset($customer_data[$key]);
122
+ }
123
+ }
124
+ /*
125
+ * CSV Customer Export Row.
126
+ * Filter the individual row data for the customer export
127
+ * @since 3.0
128
+ * @param array $customer_data
129
+ */
130
+ return apply_filters('hf_customer_csv_export_data', $customer_data);
131
+ }
132
+
133
+ }
includes/exporter/data/data-wf-post-columns.php CHANGED
@@ -1,22 +1,22 @@
1
- <?php
2
-
3
- if (!defined('ABSPATH')) {
4
- exit;
5
- }
6
-
7
- $columns = array(
8
- 'ID' => 'ID',
9
- 'user_login' => 'user_login',
10
- 'user_pass' => 'user_pass',
11
- 'user_nicename' => 'user_nicename',
12
- 'user_email' => 'user_email',
13
- 'user_url' => 'user_url',
14
- 'user_registered' => 'user_registered',
15
- 'display_name' => 'display_name',
16
- 'first_name' => 'first_name',
17
- 'last_name' => 'last_name',
18
- 'user_status' => 'user_status',
19
- 'roles' => 'roles'
20
- );
21
-
22
- return apply_filters('hf_csv_customer_post_columns', $columns);
1
+ <?php
2
+
3
+ if (!defined('ABSPATH')) {
4
+ exit;
5
+ }
6
+
7
+ $columns = array(
8
+ 'ID' => 'ID',
9
+ 'user_login' => 'user_login',
10
+ 'user_pass' => 'user_pass',
11
+ 'user_nicename' => 'user_nicename',
12
+ 'user_email' => 'user_email',
13
+ 'user_url' => 'user_url',
14
+ 'user_registered' => 'user_registered',
15
+ 'display_name' => 'display_name',
16
+ 'first_name' => 'first_name',
17
+ 'last_name' => 'last_name',
18
+ 'user_status' => 'user_status',
19
+ 'roles' => 'roles'
20
+ );
21
+
22
+ return apply_filters('hf_csv_customer_post_columns', $columns);
includes/importer/class-wf-csv-parser.php CHANGED
@@ -1,231 +1,234 @@
1
- <?php
2
- /**
3
- * WooCommerce CSV Importer class for managing parsing of CSV files.
4
- */
5
- class WF_CSV_Parser {
6
-
7
- var $row;
8
- var $post_type;
9
- var $posts = array();
10
- var $processed_posts = array();
11
- var $file_url_import_enabled = true;
12
- var $log;
13
- var $merged = 0;
14
- var $skipped = 0;
15
- var $imported = 0;
16
- var $errored = 0;
17
- var $id;
18
- var $file_url;
19
- var $delimiter;
20
- var $send_mail;
21
-
22
- /**
23
- * Constructor
24
- */
25
- public function __construct( $post_type = 'user' ) {
26
- $this->post_type = $post_type;
27
- $this->user_base_fields = array(
28
- 'ID' => 'ID',
29
- 'user_login' => 'user_login',
30
- 'user_pass' => 'user_pass',
31
- 'user_nicename' => 'user_nicename',
32
- 'user_email' => 'user_email',
33
- 'user_url' => 'user_url',
34
- 'user_registered' => 'user_registered',
35
- 'display_name' => 'display_name',
36
- 'first_name' => 'first_name',
37
- 'last_name' => 'last_name',
38
- 'user_status' => 'user_status',
39
- 'roles' => 'roles'
40
- );
41
-
42
- }
43
-
44
-
45
- /**
46
- * Format data from the csv file
47
- * @param string $data
48
- * @param string $enc
49
- * @return string
50
- */
51
- public function format_data_from_csv( $data, $enc ) {
52
- return ( $enc == 'UTF-8' ) ? $data : utf8_encode( $data );
53
- }
54
-
55
- /**
56
- * Parse the data
57
- * @param string $file [description]
58
- * @param string $delimiter [description]
59
- * @param array $mapping [description]
60
- * @param integer $start_pos [description]
61
- * @param integer $end_pos [description]
62
- * @return array
63
- */
64
- public function parse_data( $file, $delimiter, $mapping, $start_pos = 0, $end_pos = null, $eval_field ) {
65
- // Set locale
66
- $enc = mb_detect_encoding( $file, 'UTF-8, ISO-8859-1', true );
67
- if ( $enc )
68
- setlocale( LC_ALL, 'en_US.' . $enc );
69
- @ini_set( 'auto_detect_line_endings', true );
70
-
71
- $parsed_data = array();
72
- $raw_headers = array();
73
-
74
- // Put all CSV data into an associative array
75
- if ( ( $handle = fopen( $file, "r" ) ) !== FALSE ) {
76
-
77
- $header = fgetcsv( $handle, 0, $delimiter );
78
- if ( $start_pos != 0 )
79
- fseek( $handle, $start_pos );
80
-
81
- while ( ( $postmeta = fgetcsv( $handle, 0, $delimiter ) ) !== FALSE ) {
82
- $row = array();
83
-
84
- foreach ( $header as $key => $heading ) {
85
- $s_heading = $heading;
86
-
87
- // Check if this heading is being mapped to a different field
88
- if ( isset( $mapping[$s_heading] ) ) {
89
- if ( $mapping[$s_heading] == 'import_as_meta' ) {
90
-
91
- $s_heading = 'meta:' . $s_heading;
92
-
93
- }else {
94
- $s_heading = esc_attr( $mapping[$s_heading] );
95
- }
96
- }
97
- foreach ($mapping as $mkey => $mvalue) {
98
- if(trim($mvalue) === trim($heading)){
99
- $s_heading = $mkey;
100
- }
101
- }
102
-
103
- if ( $s_heading == '' )
104
- continue;
105
-
106
- // Add the heading to the parsed data
107
- $row[$s_heading] = ( isset( $postmeta[$key] ) ) ? $this->format_data_from_csv( $postmeta[$key], $enc ) : '';
108
-
109
- $row[$s_heading] = $this->evaluate_field($row[$s_heading], $eval_field[$s_heading]);
110
-
111
- // Raw Headers stores the actual column name in the CSV
112
- $raw_headers[ $s_heading ] = $heading;
113
- }
114
- $parsed_data[] = $row;
115
-
116
- unset( $postmeta, $row );
117
-
118
- $position = ftell( $handle );
119
-
120
- if ( $end_pos && $position >= $end_pos )
121
- break;
122
- }
123
- fclose( $handle );
124
- }
125
- return array( $parsed_data, $raw_headers, $position );
126
- }
127
-
128
- private function evaluate_field($value, $evaluation_field){
129
- $processed_value = $value;
130
- if(!empty($evaluation_field)){
131
- $operator = substr($evaluation_field, 0, 1);
132
- if(in_array($operator, array('=', '+', '-', '*', '/', '&' , '@'))){
133
- $eval_val = substr($evaluation_field, 1);
134
- switch($operator){
135
- case '=':
136
- $processed_value = trim($eval_val);
137
- break;
138
- case '+':
139
- $processed_value = $this->hf_currency_formatter($value) + $eval_val;
140
- break;
141
- case '-':
142
- $processed_value = $value - $eval_val;
143
- break;
144
- case '*':
145
- $processed_value = $value * $eval_val;
146
- break;
147
- case '/':
148
- $processed_value = $value / $eval_val;
149
- break;
150
- case '@':
151
- $date = DateTime::createFromFormat($eval_val, $value);
152
- $processed_value = $date->format('Y-m-d H:i:s');
153
- break;
154
- case '&':
155
- if (strpos($eval_val, '[VAL]') !== false) {
156
- $processed_value = str_replace('[VAL]',$value,$eval_val);
157
- }
158
- else{
159
- $processed_value = $value . $eval_val;
160
- }
161
- break;
162
- }
163
- }
164
- }
165
- return $processed_value;
166
- }
167
-
168
- /**
169
- * Parse users
170
- * @param array $item
171
- * @param integer $merge_empty_cells
172
- * @return array
173
- */
174
-
175
-
176
-
177
-
178
- public function parse_users( $item, $raw_headers, $merging, $record_offset ) {
179
-
180
-
181
- global $WF_CSV_User_Import, $wpdb;
182
-
183
- $results = array();
184
- $row = 0;
185
- $skipped = 0;
186
-
187
- $row++;
188
- if ( $row <= $record_offset ) {
189
- if($WF_CSV_User_Import->log)
190
- $WF_CSV_User_Import->log->add( 'user-csv-import', sprintf( __( '> Row %s - skipped due to record offset.', 'wf_customer_import_export' ), $row ) );
191
- unset($item);
192
- return;
193
- }
194
- if ( empty($item['user_email']) ) {
195
- if($WF_CSV_User_Import->log)
196
- $WF_CSV_User_Import->log->add( 'user-csv-import', sprintf( __( '> Row %s - skipped: cannot insert user without email.', 'wf_customer_import_export' ), $row ) );
197
- unset($item);
198
- return;
199
- }elseif(!is_email($item['user_email'])){
200
- if($WF_CSV_User_Import->log)
201
- $WF_CSV_User_Import->log->add( 'user-csv-import', sprintf( __( '> Row %s - skipped: Email is not valid.', 'wf_customer_import_export' ), $row ) );
202
- unset($item);
203
- return;
204
- }
205
-
206
- $user_details = array();
207
- foreach ($this->user_base_fields as $key => $value) {
208
- $user_details[$key] = isset( $item[$value] ) ? $item[$value] : "" ;
209
- }
210
-
211
-
212
- $parsed_details = array();
213
-
214
- $parsed_details['user_details'] = $user_details;
215
-
216
-
217
- // the $user_details array will now contain the necessary name-value pairs for the wp_users table
218
- $results[] = $parsed_details;
219
-
220
- // Result
221
- return array(
222
- $this->post_type => $results,
223
- 'skipped' => $skipped,
224
- );
225
- }
226
-
227
- function hf_currency_formatter($price){
228
- $decimal_seperator = wc_get_price_decimal_separator();
229
- return preg_replace("[^0-9\\'.$decimal_seperator.']", "", $price);
230
- }
 
 
 
231
  }
1
+ <?php
2
+ /**
3
+ * WooCommerce CSV Importer class for managing parsing of CSV files.
4
+ */
5
+ class WF_CSV_Parser {
6
+
7
+ var $row;
8
+ var $post_type;
9
+ var $posts = array();
10
+ var $processed_posts = array();
11
+ var $file_url_import_enabled = true;
12
+ var $log;
13
+ var $merged = 0;
14
+ var $skipped = 0;
15
+ var $imported = 0;
16
+ var $errored = 0;
17
+ var $id;
18
+ var $file_url;
19
+ var $delimiter;
20
+ var $send_mail;
21
+
22
+ /**
23
+ * Constructor
24
+ */
25
+ public function __construct( $post_type = 'user' ) {
26
+ $this->post_type = $post_type;
27
+ $this->user_base_fields = array(
28
+ 'ID' => 'ID',
29
+ 'user_login' => 'user_login',
30
+ 'user_pass' => 'user_pass',
31
+ 'user_nicename' => 'user_nicename',
32
+ 'user_email' => 'user_email',
33
+ 'user_url' => 'user_url',
34
+ 'user_registered' => 'user_registered',
35
+ 'display_name' => 'display_name',
36
+ 'first_name' => 'first_name',
37
+ 'last_name' => 'last_name',
38
+ 'user_status' => 'user_status',
39
+ 'roles' => 'roles'
40
+ );
41
+
42
+ }
43
+
44
+
45
+ /**
46
+ * Format data from the csv file
47
+ * @param string $data
48
+ * @param string $enc
49
+ * @return string
50
+ */
51
+ public function format_data_from_csv( $data, $enc ) {
52
+ return ( $enc == 'UTF-8' ) ? $data : utf8_encode( $data );
53
+ }
54
+
55
+ /**
56
+ * Parse the data
57
+ * @param string $file [description]
58
+ * @param string $delimiter [description]
59
+ * @param array $mapping [description]
60
+ * @param integer $start_pos [description]
61
+ * @param integer $end_pos [description]
62
+ * @return array
63
+ */
64
+ public function parse_data( $file, $delimiter, $mapping, $start_pos = 0, $end_pos = null, $eval_field ) {
65
+ // Set locale
66
+ $enc = mb_detect_encoding( $file, 'UTF-8, ISO-8859-1', true );
67
+ if ( $enc )
68
+ setlocale( LC_ALL, 'en_US.' . $enc );
69
+ @ini_set( 'auto_detect_line_endings', true );
70
+
71
+ $parsed_data = array();
72
+ $raw_headers = array();
73
+
74
+ // Put all CSV data into an associative array
75
+ if ( ( $handle = fopen( $file, "r" ) ) !== FALSE ) {
76
+
77
+ $header = fgetcsv( $handle, 0, $delimiter );
78
+ if ( $start_pos != 0 )
79
+ fseek( $handle, $start_pos );
80
+
81
+ while ( ( $postmeta = fgetcsv( $handle, 0, $delimiter ) ) !== FALSE ) {
82
+ $row = array();
83
+
84
+ foreach ( $header as $key => $heading ) {
85
+ $s_heading = $heading;
86
+
87
+ // Check if this heading is being mapped to a different field
88
+ if ( isset( $mapping[$s_heading] ) ) {
89
+ if ( $mapping[$s_heading] == 'import_as_meta' ) {
90
+
91
+ $s_heading = 'meta:' . $s_heading;
92
+
93
+ }else {
94
+ $s_heading = esc_attr( $mapping[$s_heading] );
95
+ }
96
+ }
97
+ if( !empty($mapping) ){
98
+ foreach ($mapping as $mkey => $mvalue) {
99
+ if(trim($mvalue) === trim($heading)){
100
+ $s_heading = $mkey;
101
+ }
102
+ }
103
+ }
104
+
105
+ if ( $s_heading == '' )
106
+ continue;
107
+
108
+ // Add the heading to the parsed data
109
+ $row[$s_heading] = ( isset( $postmeta[$key] ) ) ? $this->format_data_from_csv( $postmeta[$key], $enc ) : '';
110
+
111
+ if(!empty($eval_field[ $heading ]))
112
+ $row[$s_heading] = $this->evaluate_field($row[$s_heading], $eval_field[$s_heading]);
113
+
114
+ // Raw Headers stores the actual column name in the CSV
115
+ $raw_headers[ $s_heading ] = $heading;
116
+ }
117
+ $parsed_data[] = $row;
118
+
119
+ unset( $postmeta, $row );
120
+
121
+ $position = ftell( $handle );
122
+
123
+ if ( $end_pos && $position >= $end_pos )
124
+ break;
125
+ }
126
+ fclose( $handle );
127
+ }
128
+ return array( $parsed_data, $raw_headers, $position );
129
+ }
130
+
131
+ private function evaluate_field($value, $evaluation_field){
132
+ $processed_value = $value;
133
+ if(!empty($evaluation_field)){
134
+ $operator = substr($evaluation_field, 0, 1);
135
+ if(in_array($operator, array('=', '+', '-', '*', '/', '&' , '@'))){
136
+ $eval_val = substr($evaluation_field, 1);
137
+ switch($operator){
138
+ case '=':
139
+ $processed_value = trim($eval_val);
140
+ break;
141
+ case '+':
142
+ $processed_value = $this->hf_currency_formatter($value) + $eval_val;
143
+ break;
144
+ case '-':
145
+ $processed_value = $value - $eval_val;
146
+ break;
147
+ case '*':
148
+ $processed_value = $value * $eval_val;
149
+ break;
150
+ case '/':
151
+ $processed_value = $value / $eval_val;
152
+ break;
153
+ case '@':
154
+ $date = DateTime::createFromFormat($eval_val, $value);
155
+ $processed_value = $date->format('Y-m-d H:i:s');
156
+ break;
157
+ case '&':
158
+ if (strpos($eval_val, '[VAL]') !== false) {
159
+ $processed_value = str_replace('[VAL]',$value,$eval_val);
160
+ }
161
+ else{
162
+ $processed_value = $value . $eval_val;
163
+ }
164
+ break;
165
+ }
166
+ }
167
+ }
168
+ return $processed_value;
169
+ }
170
+
171
+ /**
172
+ * Parse users
173
+ * @param array $item
174
+ * @param integer $merge_empty_cells
175
+ * @return array
176
+ */
177
+
178
+
179
+
180
+
181
+ public function parse_users( $item, $raw_headers, $merging, $record_offset ) {
182
+
183
+
184
+ global $WF_CSV_User_Import, $wpdb;
185
+
186
+ $results = array();
187
+ $row = 0;
188
+ $skipped = 0;
189
+
190
+ $row++;
191
+ if ( $row <= $record_offset ) {
192
+ if($WF_CSV_User_Import->log)
193
+ $WF_CSV_User_Import->log->add( 'user-csv-import', sprintf( __( '> Row %s - skipped due to record offset.', 'wf_customer_import_export' ), $row ) );
194
+ unset($item);
195
+ return;
196
+ }
197
+ if ( empty($item['user_email']) ) {
198
+ if($WF_CSV_User_Import->log)
199
+ $WF_CSV_User_Import->log->add( 'user-csv-import', sprintf( __( '> Row %s - skipped: cannot insert user without email.', 'wf_customer_import_export' ), $row ) );
200
+ unset($item);
201
+ return;
202
+ }elseif(!is_email($item['user_email'])){
203
+ if($WF_CSV_User_Import->log)
204
+ $WF_CSV_User_Import->log->add( 'user-csv-import', sprintf( __( '> Row %s - skipped: Email is not valid.', 'wf_customer_import_export' ), $row ) );
205
+ unset($item);
206
+ return;
207
+ }
208
+
209
+ $user_details = array();
210
+ foreach ($this->user_base_fields as $key => $value) {
211
+ $user_details[$key] = isset( $item[$value] ) ? $item[$value] : "" ;
212
+ }
213
+
214
+
215
+ $parsed_details = array();
216
+
217
+ $parsed_details['user_details'] = $user_details;
218
+
219
+
220
+ // the $user_details array will now contain the necessary name-value pairs for the wp_users table
221
+ $results[] = $parsed_details;
222
+
223
+ // Result
224
+ return array(
225
+ $this->post_type => $results,
226
+ 'skipped' => $skipped,
227
+ );
228
+ }
229
+
230
+ function hf_currency_formatter($price){
231
+ $decimal_seperator = wc_get_price_decimal_separator();
232
+ return preg_replace("[^0-9\\'.$decimal_seperator.']", "", $price);
233
+ }
234
  }
includes/importer/class-wf-customerimpexpcsv-customer-import.php CHANGED
@@ -1,832 +1,833 @@
1
- <?php
2
- /**
3
- * WordPress Importer class for managing the import process of a CSV file
4
- *
5
- * @package WordPress
6
- * @subpackage Importer
7
- */
8
- if (!class_exists('WP_Importer'))
9
- return;
10
-
11
- class WF_CustomerImpExpCsv_Customer_Import extends WP_Importer {
12
-
13
- var $id;
14
- var $file_url;
15
- var $delimiter;
16
- var $send_mail;
17
- var $profile;
18
- var $merge_empty_cells;
19
- var $processed_terms = array();
20
- var $processed_posts = array();
21
- var $merged = 0;
22
- var $skipped = 0;
23
- var $imported = 0;
24
- var $errored = 0;
25
- // Results
26
- var $import_results = array();
27
- var $log = false;
28
-
29
- /**
30
- * Constructor
31
- */
32
- public function __construct() {
33
-
34
- // Check that the class exists before trying to use it
35
- if (function_exists('WC')) {
36
- if(WC()->version < '3.0')
37
- {
38
- $this->log = new WC_Logger();
39
- }
40
- else
41
- {
42
- $this->log = wc_get_logger();
43
- }
44
- }
45
- $this->import_page = 'wordpress_hf_user_csv';
46
- $this->file_url_import_enabled = apply_filters('woocommerce_csv_product_file_url_import_enabled', true);
47
- }
48
-
49
- public function hf_log_data_change ($content = 'user-csv-import',$data='')
50
- {
51
- if (WC()->version < '2.7.0')
52
- {
53
- $this->log->add($content,$data);
54
- }else
55
- {
56
- $context = array( 'source' => $content );
57
- $this->log->log("debug", $data ,$context);
58
- }
59
- }
60
-
61
- /**
62
- * Registered callback function for the WordPress Importer
63
- *
64
- * Manages the three separate stages of the CSV import process
65
- */
66
- public function dispatch() {
67
-
68
- global $woocommerce, $wpdb;
69
-
70
- if (!empty($_POST['delimiter'])) {
71
- $this->delimiter = stripslashes(trim($_POST['delimiter']));
72
- } else if (!empty($_GET['delimiter'])) {
73
- $this->delimiter = stripslashes(trim($_GET['delimiter']));
74
- }
75
-
76
- if (!$this->delimiter)
77
- $this->delimiter = ',';
78
-
79
-
80
- $this->send_mail = !empty($_POST['send_mail']) ? 1 : 0;
81
-
82
-
83
- if (!empty($_POST['profile'])) {
84
- $this->profile = stripslashes(trim($_POST['profile']));
85
- } else if (!empty($_GET['profile'])) {
86
- $this->profile = stripslashes(trim($_GET['profile']));
87
- }
88
- if (!$this->profile)
89
- $this->profile = '';
90
-
91
- if (!empty($_POST['merge_empty_cells']) || !empty($_GET['merge_empty_cells'])) {
92
- $this->merge_empty_cells = 1;
93
- } else {
94
- $this->merge_empty_cells = 0;
95
- }
96
-
97
- $step = empty($_GET['step']) ? 0 : (int) $_GET['step'];
98
-
99
- switch ($step) {
100
- case 0 :
101
- $this->header();
102
- $this->greet();
103
- break;
104
- case 1 :
105
- $this->header();
106
-
107
- check_admin_referer('import-upload');
108
-
109
- if (!empty($_GET['file_url']))
110
- $this->file_url = esc_attr($_GET['file_url']);
111
- if (!empty($_GET['file_id']))
112
- $this->id = $_GET['file_id'];
113
-
114
- if (!empty($_GET['clearmapping']) || $this->handle_upload())
115
- $this->import_options();
116
- else
117
- _e('Error with handle_upload!', 'wf_customer_import_export');
118
- break;
119
- case 2 :
120
- $this->header();
121
-
122
- check_admin_referer('import-woocommerce');
123
-
124
- $this->id = (int) $_POST['import_id'];
125
-
126
- if ($this->file_url_import_enabled)
127
- $this->file_url = esc_attr($_POST['import_url']);
128
-
129
- if ($this->id)
130
- $file = get_attached_file($this->id);
131
- else if ($this->file_url_import_enabled)
132
- $file = ABSPATH . $this->file_url;
133
-
134
- $file = str_replace("\\", "/", $file);
135
-
136
- if ($file) {
137
- ?>
138
- <table id="import-progress" class="widefat_importer widefat">
139
- <thead>
140
- <tr>
141
- <th class="status">&nbsp;</th>
142
- <th class="row"><?php _e('Row', 'wf_customer_import_export'); ?></th>
143
- <th><?php _e('User ID', 'wf_customer_import_export'); ?></th>
144
- <th><?php _e('User Status', 'wf_customer_import_export'); ?></th>
145
- <th class="reason"><?php _e('Status Msg', 'wf_customer_import_export'); ?></th>
146
- </tr>
147
- </thead>
148
- <tfoot>
149
- <tr class="importer-loading">
150
- <td colspan="5"></td> </tr>
151
- </tfoot>
152
- <tbody></tbody>
153
- </table>
154
- <script type="text/javascript">
155
- jQuery(document).ready(function($) {
156
-
157
- if (! window.console) { window.console = function(){}; }
158
-
159
- var processed_terms = [];
160
- var processed_posts = [];
161
- var i = 1;
162
- var done_count = 0;
163
- function import_rows(start_pos, end_pos) {
164
-
165
- var data = {
166
- action: 'user_csv_import_request',
167
- file: '<?php echo addslashes($file); ?>',
168
- mapping: '<?php echo @json_encode($_POST['map_from']); ?>',
169
- profile: '<?php echo $this->profile; ?>',
170
- eval_field: '<?php echo @stripslashes(json_encode(($_POST['eval_field']), JSON_HEX_APOS)) ?>',
171
- start_pos: start_pos,
172
- end_pos: end_pos,
173
- };
174
- data.eval_field = $.parseJSON(data.eval_field);
175
- return $.ajax({
176
- url: '<?php echo add_query_arg(array('import_page' => $this->import_page, 'step' => '3', 'merge' => !empty($_GET['merge']) ? '1' : '0'), admin_url('admin-ajax.php')); ?>',
177
- data: data,
178
- type: 'POST',
179
- success: function(response) {
180
- if (response) {
181
-
182
- try {
183
- // Get the valid JSON only from the returned string
184
- if (response.indexOf("<!--WC_START-->") >= 0)
185
- response = response.split("<!--WC_START-->")[1]; // Strip off before after WC_START
186
-
187
- if (response.indexOf("<!--WC_END-->") >= 0)
188
- response = response.split("<!--WC_END-->")[0]; // Strip off anything after WC_END
189
-
190
- // Parse
191
-
192
- var results = $.parseJSON(response);
193
- if (results.error) {
194
-
195
- $('#import-progress tbody').append('<tr id="row-' + i + '" class="error"><td class="status" colspan="5">' + results.error + '</td></tr>');
196
- i++;
197
- } else if (results.import_results && $(results.import_results).size() > 0) {
198
-
199
- $.each(results.processed_terms, function(index, value) {
200
- processed_terms.push(value);
201
- });
202
- $.each(results.processed_posts, function(index, value) {
203
- processed_posts.push(value);
204
- });
205
- $(results.import_results).each(function(index, row) {
206
- $('#import-progress tbody').append('<tr id="row-' + i + '" class="' + row['status'] + '"><td><mark class="result" title="' + row['status'] + '">' + row['status'] + '</mark></td><td class="row">' + i + '</td><td>' + row['user_id'] + '</td><td>' + row['post_id'] + ' - ' + row['post_title'] + '</td><td class="reason">' + row['reason'] + '</td></tr>');
207
- i++;
208
- });
209
- }
210
-
211
- } catch (err) {}
212
-
213
- } else {
214
- $('#import-progress tbody').append('<tr class="error"><td class="status" colspan="5">' + '<?php _e('AJAX Error', 'wf_customer_import_export'); ?>' + '</td></tr>');
215
- }
216
-
217
- var w = $(window);
218
- var row = $("#row-" + (i - 1));
219
- if (row.length) {
220
- w.scrollTop(row.offset().top - (w.height() / 2));
221
- }
222
-
223
- done_count++;
224
- $('body').trigger('user_csv_import_request_complete');
225
- }
226
- });
227
- }
228
-
229
- var rows = [];
230
- <?php
231
- $limit = apply_filters('woocommerce_csv_import_limit_per_request', 10);
232
- $enc = mb_detect_encoding($file, 'UTF-8, ISO-8859-1', true);
233
- if ($enc)
234
- setlocale(LC_ALL, 'en_US.' . $enc);
235
- @ini_set('auto_detect_line_endings', true);
236
-
237
- $count = 0;
238
- $previous_position = 0;
239
- $position = 0;
240
- $import_count = 0;
241
-
242
- // Get CSV positions
243
- if (( $handle = fopen($file, "r") ) !== FALSE) {
244
-
245
- while (( $postmeta = fgetcsv($handle, 0, $this->delimiter) ) !== FALSE) {
246
- $count++;
247
-
248
- if ($count >= $limit) {
249
- $previous_position = $position;
250
- $position = ftell($handle);
251
- $count = 0;
252
- $import_count ++;
253
-
254
- // Import rows between $previous_position $position
255
- ?>rows.push([ <?php echo $previous_position; ?>, <?php echo $position; ?> ]); <?php
256
- }
257
- }
258
-
259
- // Remainder
260
- if ($count > 0) {
261
- ?>rows.push([ <?php echo $position; ?>, '' ]); <?php
262
- $import_count ++;
263
- }
264
-
265
- fclose($handle);
266
- }
267
- ?>
268
-
269
- var data = rows.shift();
270
- var regen_count = 0;
271
- import_rows( data[0], data[1] );
272
-
273
- $('body').on( 'user_csv_import_request_complete', function() {
274
- if ( done_count == <?php echo $import_count; ?> ) {
275
-
276
- import_done();
277
- } else {
278
- // Call next request
279
- data = rows.shift();
280
- import_rows( data[0], data[1] );
281
- }
282
- } );
283
-
284
- function import_done() {
285
- var data = {
286
- action: 'user_csv_import_request',
287
- file: '<?php echo $file; ?>',
288
- processed_terms: processed_terms,
289
- processed_posts: processed_posts,
290
- };
291
-
292
- $.ajax({
293
- url: '<?php echo add_query_arg(array('import_page' => $this->import_page, 'step' => '4', 'merge' => !empty($_GET['merge']) ? 1 : 0), admin_url('admin-ajax.php')); ?>',
294
- data: data,
295
- type: 'POST',
296
- success: function( response ) {
297
- console.log( response );
298
- $('#import-progress tbody').append( '<tr class="complete"><td colspan="5">' + response + '</td></tr>' );
299
- $('.importer-loading').hide();
300
- }
301
- });
302
- }
303
- });
304
- </script>
305
- <?php
306
- } else {
307
- echo '<p class="error">' . __('Error finding uploaded file!', 'wf_customer_import_export') . '</p>';
308
- }
309
- break;
310
- case 3 :
311
-
312
- // Check access - cannot use nonce here as it will expire after multiple requests
313
- if (function_exists('WC')) {
314
- if (!current_user_can('manage_woocommerce'))
315
- die();
316
- }
317
- add_filter('http_request_timeout', array($this, 'bump_request_timeout'));
318
-
319
- if (function_exists('gc_enable'))
320
- gc_enable();
321
-
322
- @set_time_limit(0);
323
- @ob_flush();
324
- @flush();
325
- $wpdb->hide_errors();
326
-
327
- $file = stripslashes($_POST['file']);
328
- $mapping = json_decode(stripslashes($_POST['mapping']), true);
329
- $profile = isset($_POST['profile']) ? $_POST['profile'] : '';
330
- $eval_field = $_POST['eval_field'];
331
- $start_pos = isset($_POST['start_pos']) ? absint($_POST['start_pos']) : 0;
332
- $end_pos = isset($_POST['end_pos']) ? absint($_POST['end_pos']) : '';
333
-
334
- if ($profile !== '') {
335
- $profile_array = get_option('wf_user_csv_imp_exp_mapping');
336
- $profile_array[$profile] = array($mapping, $eval_field);
337
- update_option('wf_user_csv_imp_exp_mapping', $profile_array);
338
- }
339
-
340
- $position = $this->import_start($file, $mapping, $start_pos, $end_pos, $eval_field);
341
- $this->import();
342
- $this->import_end();
343
-
344
- $results = array();
345
- $results['import_results'] = $this->import_results;
346
- $results['processed_terms'] = $this->processed_terms;
347
- $results['processed_posts'] = $this->processed_posts;
348
-
349
- echo "<!--WC_START-->";
350
- echo json_encode($results);
351
- echo "<!--WC_END-->";
352
- exit;
353
- break;
354
- case 4 :
355
- // Check access - cannot use nonce here as it will expire after multiple requests
356
- if (function_exists('WC')) {
357
- if (!current_user_can('manage_woocommerce'))
358
- die();
359
- }
360
-
361
- add_filter('http_request_timeout', array($this, 'bump_request_timeout'));
362
-
363
- if (function_exists('gc_enable'))
364
- gc_enable();
365
-
366
- @set_time_limit(0);
367
- @ob_flush();
368
- @flush();
369
- $wpdb->hide_errors();
370
-
371
- $this->processed_terms = isset($_POST['processed_terms']) ? $_POST['processed_terms'] : array();
372
- $this->processed_posts = isset($_POST['processed_posts']) ? $_POST['processed_posts'] : array();
373
-
374
- _e('Step 1...', 'wf_customer_import_export') . ' ';
375
-
376
- wp_defer_term_counting(true);
377
- wp_defer_comment_counting(true);
378
-
379
- _e('Step 2...', 'wf_customer_import_export') . ' ';
380
-
381
- echo 'Step 3...' . ' '; // Easter egg
382
-
383
- _e('Finalizing...', 'wf_customer_import_export') . ' ';
384
-
385
- // SUCCESS
386
- _e('Finished. Import complete.', 'wf_customer_import_export');
387
-
388
- $this->import_end();
389
- exit;
390
- break;
391
- }
392
-
393
- $this->footer();
394
- }
395
-
396
- /**
397
- * format_data_from_csv
398
- */
399
- public function format_data_from_csv($data, $enc) {
400
- return ( $enc == 'UTF-8' ) ? $data : utf8_encode($data);
401
- }
402
-
403
- /**
404
- * Display pre-import options
405
- */
406
- public function import_options() {
407
- $j = 0;
408
-
409
- if ($this->id)
410
- $file = get_attached_file($this->id);
411
- else if ($this->file_url_import_enabled)
412
- $file = ABSPATH . $this->file_url;
413
- else
414
- return;
415
-
416
- // Set locale
417
- $enc = mb_detect_encoding($file, 'UTF-8, ISO-8859-1', true);
418
- if ($enc)
419
- setlocale(LC_ALL, 'en_US.' . $enc);
420
- @ini_set('auto_detect_line_endings', true);
421
-
422
- // Get headers
423
- if (( $handle = fopen($file, "r") ) !== FALSE) {
424
-
425
- $row = $raw_headers = array();
426
- $header = fgetcsv($handle, 0, $this->delimiter);
427
-
428
- while (( $postmeta = fgetcsv($handle, 0, $this->delimiter) ) !== FALSE) {
429
- foreach ($header as $key => $heading) {
430
- if (!$heading)
431
- continue;
432
- $s_heading = $heading;
433
- $row[$s_heading] = ( isset($postmeta[$key]) ) ? $this->format_data_from_csv($postmeta[$key], $enc) : '';
434
- $raw_headers[$s_heading] = $heading;
435
- }
436
- break;
437
- }
438
- fclose($handle);
439
- }
440
-
441
- $mapping_from_db = get_option('wf_user_csv_imp_exp_mapping');
442
-
443
- if ($this->profile !== '' && !empty($_GET['clearmapping'])) {
444
- unset($mapping_from_db[$this->profile]);
445
- update_option('wf_user_csv_imp_exp_mapping', $mapping_from_db);
446
- $this->profile = '';
447
- }
448
- if ($this->profile !== '')
449
- $mapping_from_db = $mapping_from_db[$this->profile];
450
-
451
- $saved_mapping = null;
452
- $saved_evaluation = null;
453
- if ($mapping_from_db && is_array($mapping_from_db) && count($mapping_from_db) == 2 && empty($_GET['clearmapping'])) {
454
- $reset_action = 'admin.php?clearmapping=1&amp;profile=' . $this->profile . '&amp;import=' . $this->import_page . '&amp;step=1&amp;merge=' . (!empty($_GET['merge']) ? 1 : 0 ) . '&amp;file_url=' . $this->file_url . '&amp;delimiter=' . $this->delimiter . '&amp;merge_empty_cells=' . $this->merge_empty_cells. '&amp;send_mail=' . $this->send_mail . '&amp;file_id=' . $this->id . '';
455
- $reset_action = esc_attr(wp_nonce_url($reset_action, 'import-upload'));
456
- echo '<h3>' . __('Columns are pre-selected using the Mapping file: "<b style="color:gray">' . $this->profile . '</b>". <a href="' . $reset_action . '"> Delete</a> this mapping file.', 'wf_customer_import_export') . '</h3>';
457
- $saved_mapping = $mapping_from_db[0];
458
- $saved_evaluation = $mapping_from_db[1];
459
- }
460
-
461
- $merge = (!empty($_GET['merge']) && $_GET['merge']) ? 1 : 0;
462
-
463
- include( 'views/html-wf-import-options.php' );
464
- }
465
-
466
- /**
467
- * The main controller for the actual import stage.
468
- */
469
- public function import() {
470
- global $woocommerce, $wpdb;
471
-
472
- wp_suspend_cache_invalidation(true);
473
- if ($this->log) {
474
- $this->hf_log_data_change('user-csv-import', '---');
475
- $this->hf_log_data_change('user-csv-import', __('Processing users.', 'wf_customer_import_export'));
476
- }
477
- $merging = 1;
478
- $record_offset = 0;
479
-
480
- $i = 0;
481
- //echo '<pre>';print_r($this->parsed_data);exit;
482
- foreach ($this->parsed_data as $key => &$item) {
483
- $user = $this->parser->parse_users($item, $this->raw_headers, $merging, $record_offset);
484
- if (!is_wp_error($user))
485
- $this->process_users($user['user'][0]);
486
- else
487
- $this->add_import_result('failed', $user->get_error_message(), 'Not parsed', json_encode($item), '-');
488
-
489
- unset($item, $user);
490
- $i++;
491
- }
492
- if ($this->log)
493
- $this->hf_log_data_change('user-csv-import', __('Finished processing Users.', 'wf_customer_import_export'));
494
- wp_suspend_cache_invalidation(false);
495
- }
496
-
497
- /**
498
- * Parses the CSV file and prepares us for the task of processing parsed data
499
- *
500
- * @param string $file Path to the CSV file for importing
501
- */
502
- public function import_start($file, $mapping, $start_pos, $end_pos, $eval_field) {
503
-
504
-
505
- if (function_exists('WC')) {
506
- $memory = size_format(woocommerce_let_to_num(ini_get('memory_limit')));
507
- $wp_memory = size_format(woocommerce_let_to_num(WP_MEMORY_LIMIT));
508
- } else {
509
- $memory = size_format($this->wf_let_to_num(ini_get('memory_limit')));
510
- $wp_memory = size_format($this->wf_let_to_num(WP_MEMORY_LIMIT));
511
- }
512
-
513
- if ($this->log) {
514
- $this->hf_log_data_change('user-csv-import', '---[ New Import ] PHP Memory: ' . $memory . ', WP Memory: ' . $wp_memory);
515
- $this->hf_log_data_change('user-csv-import', __('Parsing products CSV.', 'wf_customer_import_export'));
516
- }
517
- $this->parser = new WF_CSV_Parser('user');
518
-
519
-
520
- list( $this->parsed_data, $this->raw_headers, $position ) = $this->parser->parse_data($file, $this->delimiter, $mapping, $start_pos, $end_pos, $eval_field);
521
- if ($this->log)
522
- $this->hf_log_data_change('user-csv-import', __('Finished parsing products CSV.', 'wf_customer_import_export'));
523
-
524
- unset($import_data);
525
-
526
- wp_defer_term_counting(true);
527
- wp_defer_comment_counting(true);
528
-
529
- return $position;
530
- }
531
-
532
- /**
533
- * Performs post-import cleanup of files and the cache
534
- */
535
- public function import_end() {
536
-
537
- //wp_cache_flush(); Stops output in some hosting environments
538
- foreach (get_taxonomies() as $tax) {
539
- delete_option("{$tax}_children");
540
- _get_term_hierarchy($tax);
541
- }
542
-
543
- wp_defer_term_counting(false);
544
- wp_defer_comment_counting(false);
545
-
546
- do_action('import_end');
547
- }
548
-
549
- /**
550
- * Handles the CSV upload and initial parsing of the file to prepare for
551
- * displaying author import options
552
- *
553
- * @return bool False if error uploading or invalid file, true otherwise
554
- */
555
- public function handle_upload() {
556
-
557
- if (empty($_POST['file_url'])) {
558
-
559
- $file = wp_import_handle_upload();
560
-
561
- if (isset($file['error'])) {
562
- echo '<p><strong>' . __('Sorry, there has been an error.', 'wf_customer_import_export') . '</strong><br />';
563
- echo esc_html($file['error']) . '</p>';
564
- return false;
565
- }
566
-
567
- $this->id = (int) $file['id'];
568
- return true;
569
- } else {
570
-
571
- if (file_exists(ABSPATH . $_POST['file_url'])) {
572
-
573
- $this->file_url = esc_attr($_POST['file_url']);
574
- return true;
575
- } else {
576
-
577
- echo '<p><strong>' . __('Sorry, there has been an error.', 'wf_customer_import_export') . '</strong></p>';
578
- return false;
579
- }
580
- }
581
-
582
- return false;
583
- }
584
-
585
- /**
586
- * Create new posts based on import information
587
- */
588
- private function process_users($post) {
589
-
590
-
591
- global $wpdb;
592
- $this->imported = $this->merged = 0;
593
-
594
- // plan a dry run
595
- //$dry_run = isset( $_POST['dry_run'] ) && $_POST['dry_run'] ? true : false;
596
- $dry_run = 0; //mockup import and check weather the users can be imported without fail
597
- if ($this->log) {
598
- $this->hf_log_data_change('user-csv-import', '---');
599
- $this->hf_log_data_change('user-csv-import', __('Processing users.', 'wf_customer_import_export'));
600
- }
601
-
602
- if (empty($post['user_details']['user_email'])) {
603
- $this->add_import_result('skipped', __('Cannot insert user without email', 'wf_customer_import_export'), 1, 1, 1);
604
- unset($post);
605
- return;
606
- } elseif (!is_email($post['user_details']['user_email'])) {
607
- $this->add_import_result('skipped', __('skipped: Email is not valid.', 'wf_customer_import_export'), 1, $post['user_details']['user_email'], 1);
608
- unset($post);
609
- return;
610
- }
611
-
612
- $user_id = $this->hf_check_customer($post);
613
-
614
- $new_added = false;
615
-
616
-
617
- if ($user_id) {
618
- $usr_msg = 'User already exists.';
619
- $user_info = get_userdata($user_id);
620
- $user_string = sprintf('<a href="%s">%s</a>', get_edit_user_link($user_id), $user_info->first_name);
621
- $this->add_import_result('skipped', __($usr_msg, 'wf_customer_import_export'),$user_id , $user_string, $user_id);
622
- if ($this->log)
623
- $this->hf_log_data_change('user-csv-import', sprintf(__('> &#8220;%s&#8221;' . $usr_msg, 'wf_customer_import_export'), $user_id), true);
624
- unset($post);
625
- return;
626
- } else{
627
- $user_id = $this->hf_create_customer($post);
628
- $new_added = true;
629
- if (is_wp_error($user_id)) {
630
- $this->errored++;
631
- $this->add_import_result('failed', __($user_id->get_error_message(), 'wf_customer_import_export'), 0, 'failed', 1);
632
- if ($this->log)
633
- $this->hf_log_data_change('user-csv-import', sprintf(__('> Error inserting %s: %s', 'wf_customer_import_export'), 1, $user_id->get_error_message()), true);
634
- $skipped++;
635
- unset($post);
636
- return;
637
- } elseif (empty($user_id)) {
638
- $this->errored++;
639
- if ($this->log)
640
- $this->hf_log_data_change('user-csv-import', sprintf(__('An error occurred with the customer information provided.', 'wf_customer_import_export')));
641
- $this->add_import_result('skipped', __('An error occurred with the customer information provided.', 'wf_customer_import_export'), 0, 'failed', 1);
642
- $skipped++;
643
- unset($post);
644
- return;
645
- }
646
- }
647
-
648
- $out_msg = 'User Imported Successfully.';
649
-
650
- $user_info = get_userdata($user_id);
651
- $user_string = sprintf('<a href="%s">%s</a>', get_edit_user_link($user_id), $user_info->first_name);
652
-
653
-
654
- $this->add_import_result('imported', __($out_msg, 'wf_customer_import_export'), $user_id , $user_string, $user_id);
655
- if ($this->log)
656
- $this->hf_log_data_change('user-csv-import', sprintf(__('> &#8220;%s&#8221;' . $out_msg, 'wf_customer_import_export'), $user_id), true);
657
- $this->imported++;
658
- if ($this->log) {
659
- $this->hf_log_data_change('user-csv-import', sprintf(__('> Finished importing user %s', 'wf_customer_import_export'), $dry_run ? "" : $user_id ));
660
- $this->hf_log_data_change('user-csv-import', __('Finished processing users.', 'wf_customer_import_export'));
661
- }
662
-
663
- unset($post);
664
- }
665
-
666
- public function hf_check_customer($data) {
667
- $customer_email = (!empty($data['user_details']['user_email']) ) ? $data['user_details']['user_email'] : '';
668
- $username = (!empty($data['user_details']['user_login']) ) ? $data['user_details']['user_login'] : '';
669
- $customer_id = (!empty($data['user_details']['ID']) ) ? $data['user_details']['ID'] : '';
670
-
671
- $found_customer = false;
672
-
673
- if (!empty($customer_email)) {
674
-
675
- if (is_email($customer_email) && false !== email_exists($customer_email)) {
676
- $found_customer = email_exists($customer_email);
677
- } elseif (!empty($username) && false !== username_exists($username)) {
678
- $found_customer = username_exists($username);
679
- }
680
- }
681
- return $found_customer;
682
- }
683
-
684
- public function hf_create_customer($data) {
685
-
686
- $customer_email = (!empty($data['user_details']['user_email']) ) ? $data['user_details']['user_email'] : '';
687
- $username = (!empty($data['user_details']['user_login']) ) ? $data['user_details']['user_login'] : '';
688
- $customer_id = (!empty($data['user_details']['ID']) ) ? $data['user_details']['ID'] : '';
689
-
690
- if (!empty($data['user_details']['user_pass'])) {
691
- $password = $data['user_details']['user_pass'];
692
- $password_generated = false;
693
- } else {
694
- $password = wp_generate_password(12, true);
695
- $password_generated = true;
696
- }
697
- $found_customer = false;
698
- if (is_email($customer_email)) {
699
-
700
-
701
-
702
- // Not in test mode, create a user account for this email
703
- if (empty($username)) {
704
-
705
- $maybe_username = explode('@', $customer_email);
706
- $maybe_username = sanitize_user($maybe_username[0]);
707
- $counter = 1;
708
- $username = $maybe_username;
709
-
710
- while (username_exists($username)) {
711
- $username = $maybe_username . $counter;
712
- $counter++;
713
- }
714
- }
715
-
716
- $found_customer = wp_create_user($username, $password, $customer_email);
717
-
718
- if (!is_wp_error($found_customer)) {
719
-
720
-
721
- $wp_user_object = new WP_User($found_customer);
722
-
723
- $roles = explode(',', $data['user_details']['roles']);
724
- if(!empty($roles)){
725
- foreach ($roles as $role) {
726
- $wp_user_object->add_role($role);
727
- }
728
- //$wp_user_object->set_role($role);
729
- }
730
- $user_nicename = (!empty($data['user_details']['user_nicename'])) ? $data['user_details']['user_nicename'] : '';
731
- $website = (!empty($data['user_details']['user_url'])) ? $data['user_details']['user_url'] : '';
732
- $user_registered = (!empty($data['user_details']['user_registered'])) ? $data['user_details']['user_registered'] : '';
733
- $display_name = (!empty($data['user_details']['display_name'])) ? $data['user_details']['display_name'] : '';
734
- $first_name = (!empty($data['user_details']['first_name'])) ? $data['user_details']['first_name'] : '';
735
- $last_name = (!empty($data['user_details']['last_name'])) ? $data['user_details']['last_name'] : '';
736
- $user_status = (!empty($data['user_details']['user_status'])) ? $data['user_details']['user_status'] : '';
737
- wp_update_user( array(
738
- 'ID' => $found_customer,
739
- 'user_nicename' => $user_nicename,
740
- 'user_url' => $website,
741
- 'user_registered' => $user_registered,
742
- 'display_name' => $display_name,
743
- 'first_name' => $first_name,
744
- 'last_name' => $last_name,
745
- 'user_status' => $user_status,
746
-
747
- )
748
- );
749
-
750
- }
751
- } else {
752
-
753
- $found_customer = new WP_Error('hf_invalid_customer', sprintf(__('User could not be created without Email.', 'wf_customer_import_export'), $customer_id));
754
- }
755
-
756
- return $found_customer;
757
- }
758
-
759
-
760
- /**
761
- * Log a row's import status
762
- */
763
- protected function add_import_result($status, $reason, $post_id = '', $post_title = '', $user_id = '') {
764
- $this->import_results[] = array(
765
- 'post_title' => $post_title,
766
- 'post_id' => $post_id,
767
- 'user_id' => $user_id,
768
- 'status' => $status,
769
- 'reason' => $reason
770
- );
771
- }
772
-
773
- /**
774
- * Decide what the maximum file size for downloaded attachments is.
775
- * Default is 0 (unlimited), can be filtered via import_attachment_size_limit
776
- *
777
- * @return int Maximum attachment file size to import
778
- */
779
- public function max_attachment_size() {
780
- return apply_filters('import_attachment_size_limit', 0);
781
- }
782
-
783
- // Display import page title
784
- public function header() {
785
- echo '<div class="wrap"><div class="icon32" id="icon-woocommerce-importer"><br></div>';
786
- echo '<h2>' . ( empty($_GET['merge']) ? __('Import', 'wf_customer_import_export') : __('Merge Users', 'wf_customer_import_export') ) . '</h2>';
787
- }
788
-
789
- // Close div.wrap
790
- public function footer() {
791
- echo '</div>';
792
- }
793
-
794
- /**
795
- * Display introductory text and file upload form
796
- */
797
- public function greet() {
798
- $action = 'admin.php?import=wordpress_hf_user_csv&amp;step=1';
799
- $bytes = apply_filters('import_upload_size_limit', wp_max_upload_size());
800
- $size = size_format($bytes);
801
- $upload_dir = wp_upload_dir();
802
-
803
- include( 'views/html-wf-import-greeting.php' );
804
- }
805
-
806
- /**
807
- * Added to http_request_timeout filter to force timeout at 60 seconds during import
808
- * @return int 60
809
- */
810
- public function bump_request_timeout($val) {
811
- return 60;
812
- }
813
-
814
- public function wf_let_to_num($size) {
815
- $l = substr($size, -1);
816
- $ret = substr($size, 0, -1);
817
- switch (strtoupper($l)) {
818
- case 'P':
819
- $ret *= 1024;
820
- case 'T':
821
- $ret *= 1024;
822
- case 'G':
823
- $ret *= 1024;
824
- case 'M':
825
- $ret *= 1024;
826
- case 'K':
827
- $ret *= 1024;
828
- }
829
- return $ret;
830
- }
831
-
832
- }
 
1
+ <?php
2
+ /**
3
+ * WordPress Importer class for managing the import process of a CSV file
4
+ *
5
+ * @package WordPress
6
+ * @subpackage Importer
7
+ */
8
+ if (!class_exists('WP_Importer'))
9
+ return;
10
+
11
+ class WF_CustomerImpExpCsv_Customer_Import extends WP_Importer {
12
+
13
+ var $id;
14
+ var $file_url;
15
+ var $delimiter;
16
+ var $send_mail;
17
+ var $profile;
18
+ var $merge_empty_cells;
19
+ var $processed_terms = array();
20
+ var $processed_posts = array();
21
+ var $merged = 0;
22
+ var $skipped = 0;
23
+ var $imported = 0;
24
+ var $errored = 0;
25
+ // Results
26
+ var $import_results = array();
27
+ var $log = false;
28
+
29
+ /**
30
+ * Constructor
31
+ */
32
+ public function __construct() {
33
+
34
+ // Check that the class exists before trying to use it
35
+ if (function_exists('WC')) {
36
+ if(WC()->version < '3.0')
37
+ {
38
+ $this->log = new WC_Logger();
39
+ }
40
+ else
41
+ {
42
+ $this->log = wc_get_logger();
43
+ }
44
+ }
45
+ $this->import_page = 'wordpress_hf_user_csv';
46
+ $this->file_url_import_enabled = apply_filters('woocommerce_csv_product_file_url_import_enabled', true);
47
+ }
48
+
49
+ public function hf_log_data_change ($content = 'user-csv-import',$data='')
50
+ {
51
+ if (WC()->version < '2.7.0')
52
+ {
53
+ $this->log->add($content,$data);
54
+ }else
55
+ {
56
+ $context = array( 'source' => $content );
57
+ $this->log->log("debug", $data ,$context);
58
+ }
59
+ }
60
+
61
+ /**
62
+ * Registered callback function for the WordPress Importer
63
+ *
64
+ * Manages the three separate stages of the CSV import process
65
+ */
66
+ public function dispatch() {
67
+
68
+ global $woocommerce, $wpdb;
69
+
70
+ if (!empty($_POST['delimiter'])) {
71
+ $this->delimiter = stripslashes(trim($_POST['delimiter']));
72
+ } else if (!empty($_GET['delimiter'])) {
73
+ $this->delimiter = stripslashes(trim($_GET['delimiter']));
74
+ }
75
+
76
+ if (!$this->delimiter)
77
+ $this->delimiter = ',';
78
+
79
+
80
+ $this->send_mail = !empty($_POST['send_mail']) ? 1 : 0;
81
+
82
+
83
+ if (!empty($_POST['profile'])) {
84
+ $this->profile = stripslashes(trim($_POST['profile']));
85
+ } else if (!empty($_GET['profile'])) {
86
+ $this->profile = stripslashes(trim($_GET['profile']));
87
+ }
88
+ if (!$this->profile)
89
+ $this->profile = '';
90
+
91
+ if (!empty($_POST['merge_empty_cells']) || !empty($_GET['merge_empty_cells'])) {
92
+ $this->merge_empty_cells = 1;
93
+ } else {
94
+ $this->merge_empty_cells = 0;
95
+ }
96
+
97
+ $step = empty($_GET['step']) ? 0 : (int) $_GET['step'];
98
+
99
+ switch ($step) {
100
+ case 0 :
101
+ $this->header();
102
+ $this->greet();
103
+ break;
104
+ case 1 :
105
+ $this->header();
106
+
107
+ check_admin_referer('import-upload');
108
+
109
+ if (!empty($_GET['file_url']))
110
+ $this->file_url = esc_attr($_GET['file_url']);
111
+ if (!empty($_GET['file_id']))
112
+ $this->id = $_GET['file_id'];
113
+
114
+ if (!empty($_GET['clearmapping']) || $this->handle_upload())
115
+ $this->import_options();
116
+ else
117
+ _e('Error with handle_upload!', 'wf_customer_import_export');
118
+ break;
119
+ case 2 :
120
+ $this->header();
121
+
122
+ check_admin_referer('import-woocommerce');
123
+
124
+ $this->id = (int) $_POST['import_id'];
125
+
126
+ if ($this->file_url_import_enabled)
127
+ $this->file_url = esc_attr($_POST['import_url']);
128
+
129
+ if ($this->id)
130
+ $file = get_attached_file($this->id);
131
+ else if ($this->file_url_import_enabled)
132
+ $file = ABSPATH . $this->file_url;
133
+
134
+ $file = str_replace("\\", "/", $file);
135
+
136
+ if ($file) {
137
+ ?>
138
+ <table id="import-progress" class="widefat_importer widefat">
139
+ <thead>
140
+ <tr>
141
+ <th class="status">&nbsp;</th>
142
+ <th class="row"><?php _e('Row', 'wf_customer_import_export'); ?></th>
143
+ <th><?php _e('User ID', 'wf_customer_import_export'); ?></th>
144
+ <th><?php _e('User Status', 'wf_customer_import_export'); ?></th>
145
+ <th class="reason"><?php _e('Status Msg', 'wf_customer_import_export'); ?></th>
146
+ </tr>
147
+ </thead>
148
+ <tfoot>
149
+ <tr class="importer-loading">
150
+ <td colspan="5"></td> </tr>
151
+ </tfoot>
152
+ <tbody></tbody>
153
+ </table>
154
+ <script type="text/javascript">
155
+ jQuery(document).ready(function($) {
156
+
157
+ if (! window.console) { window.console = function(){}; }
158
+
159
+ var processed_terms = [];
160
+ var processed_posts = [];
161
+ var i = 1;
162
+ var done_count = 0;
163
+ function import_rows(start_pos, end_pos) {
164
+
165
+ var data = {
166
+ action: 'user_csv_import_request',
167
+ file: '<?php echo addslashes($file); ?>',
168
+ mapping: '<?php echo @json_encode($_POST['map_from']); ?>',
169
+ profile: '<?php echo $this->profile; ?>',
170
+ eval_field: '<?php echo @stripslashes(json_encode(($_POST['eval_field']), JSON_HEX_APOS)) ?>',
171
+ start_pos: start_pos,
172
+ end_pos: end_pos,
173
+ };
174
+ data.eval_field = $.parseJSON(data.eval_field);
175
+ return $.ajax({
176
+ url: '<?php echo add_query_arg(array('import_page' => $this->import_page, 'step' => '3', 'merge' => !empty($_GET['merge']) ? '1' : '0'), admin_url('admin-ajax.php')); ?>',
177
+ data: data,
178
+ type: 'POST',
179
+ success: function(response) {
180
+ if (response) {
181
+
182
+ try {
183
+ // Get the valid JSON only from the returned string
184
+ if (response.indexOf("<!--WC_START-->") >= 0)
185
+ response = response.split("<!--WC_START-->")[1]; // Strip off before after WC_START
186
+
187
+ if (response.indexOf("<!--WC_END-->") >= 0)
188
+ response = response.split("<!--WC_END-->")[0]; // Strip off anything after WC_END
189
+
190
+ // Parse
191
+
192
+ var results = $.parseJSON(response);
193
+ if (results.error) {
194
+
195
+ $('#import-progress tbody').append('<tr id="row-' + i + '" class="error"><td class="status" colspan="5">' + results.error + '</td></tr>');
196
+ i++;
197
+ } else if (results.import_results && $(results.import_results).size() > 0) {
198
+
199
+ $.each(results.processed_terms, function(index, value) {
200
+ processed_terms.push(value);
201
+ });
202
+ $.each(results.processed_posts, function(index, value) {
203
+ processed_posts.push(value);
204
+ });
205
+ $(results.import_results).each(function(index, row) {
206
+ $('#import-progress tbody').append('<tr id="row-' + i + '" class="' + row['status'] + '"><td><mark class="result" title="' + row['status'] + '">' + row['status'] + '</mark></td><td class="row">' + i + '</td><td>' + row['user_id'] + '</td><td>' + row['post_id'] + ' - ' + row['post_title'] + '</td><td class="reason">' + row['reason'] + '</td></tr>');
207
+ i++;
208
+ });
209
+ }
210
+
211
+ } catch (err) {}
212
+
213
+ } else {
214
+ $('#import-progress tbody').append('<tr class="error"><td class="status" colspan="5">' + '<?php _e('AJAX Error', 'wf_customer_import_export'); ?>' + '</td></tr>');
215
+ }
216
+
217
+ var w = $(window);
218
+ var row = $("#row-" + (i - 1));
219
+ if (row.length) {
220
+ w.scrollTop(row.offset().top - (w.height() / 2));
221
+ }
222
+
223
+ done_count++;
224
+ $('body').trigger('user_csv_import_request_complete');
225
+ }
226
+ });
227
+ }
228
+
229
+ var rows = [];
230
+ <?php
231
+ $limit = apply_filters('woocommerce_csv_import_limit_per_request', 10);
232
+ $enc = mb_detect_encoding($file, 'UTF-8, ISO-8859-1', true);
233
+ if ($enc)
234
+ setlocale(LC_ALL, 'en_US.' . $enc);
235
+ @ini_set('auto_detect_line_endings', true);
236
+
237
+ $count = 0;
238
+ $previous_position = 0;
239
+ $position = 0;
240
+ $import_count = 0;
241
+
242
+ // Get CSV positions
243
+ if (( $handle = fopen($file, "r") ) !== FALSE) {
244
+
245
+ while (( $postmeta = fgetcsv($handle, 0, $this->delimiter) ) !== FALSE) {
246
+ $count++;
247
+
248
+ if ($count >= $limit) {
249
+ $previous_position = $position;
250
+ $position = ftell($handle);
251
+ $count = 0;
252
+ $import_count ++;
253
+
254
+ // Import rows between $previous_position $position
255
+ ?>rows.push([ <?php echo $previous_position; ?>, <?php echo $position; ?> ]); <?php
256
+ }
257
+ }
258
+
259
+ // Remainder
260
+ if ($count > 0) {
261
+ ?>rows.push([ <?php echo $position; ?>, '' ]); <?php
262
+ $import_count ++;
263
+ }
264
+
265
+ fclose($handle);
266
+ }
267
+ ?>
268
+
269
+ var data = rows.shift();
270
+ var regen_count = 0;
271
+ import_rows( data[0], data[1] );
272
+
273
+ $('body').on( 'user_csv_import_request_complete', function() {
274
+ if ( done_count == <?php echo $import_count; ?> ) {
275
+
276
+ import_done();
277
+ } else {
278
+ // Call next request
279
+ data = rows.shift();
280
+ import_rows( data[0], data[1] );
281
+ }
282
+ } );
283
+
284
+ function import_done() {
285
+ var data = {
286
+ action: 'user_csv_import_request',
287
+ file: '<?php echo $file; ?>',
288
+ processed_terms: processed_terms,
289
+ processed_posts: processed_posts,
290
+ };
291
+
292
+ $.ajax({
293
+ url: '<?php echo add_query_arg(array('import_page' => $this->import_page, 'step' => '4', 'merge' => !empty($_GET['merge']) ? 1 : 0), admin_url('admin-ajax.php')); ?>',
294
+ data: data,
295
+ type: 'POST',
296
+ success: function( response ) {
297
+ console.log( response );
298
+ $('#import-progress tbody').append( '<tr class="complete"><td colspan="5">' + response + '</td></tr>' );
299
+ $('.importer-loading').hide();
300
+ }
301
+ });
302
+ }
303
+ });
304
+ </script>
305
+ <?php
306
+ } else {
307
+ echo '<p class="error">' . __('Error finding uploaded file!', 'wf_customer_import_export') . '</p>';
308
+ }
309
+ break;
310
+ case 3 :
311
+
312
+ // Check access - cannot use nonce here as it will expire after multiple requests
313
+ if (function_exists('WC')) {
314
+ if (!current_user_can('manage_woocommerce'))
315
+ die();
316
+ }
317
+ add_filter('http_request_timeout', array($this, 'bump_request_timeout'));
318
+
319
+ if (function_exists('gc_enable'))
320
+ gc_enable();
321
+
322
+ @set_time_limit(0);
323
+ @ob_flush();
324
+ @flush();
325
+ $wpdb->hide_errors();
326
+
327
+ $file = stripslashes($_POST['file']);
328
+ $mapping = json_decode(stripslashes($_POST['mapping']), true);
329
+ $profile = isset($_POST['profile']) ? $_POST['profile'] : '';
330
+ $eval_field = $_POST['eval_field'];
331
+ $start_pos = isset($_POST['start_pos']) ? absint($_POST['start_pos']) : 0;
332
+ $end_pos = isset($_POST['end_pos']) ? absint($_POST['end_pos']) : '';
333
+
334
+ if ($profile !== '') {
335
+ $profile_array = get_option('wf_user_csv_imp_exp_mapping');
336
+ $profile_array[$profile] = array($mapping, $eval_field);
337
+ update_option('wf_user_csv_imp_exp_mapping', $profile_array);
338
+ }
339
+
340
+ $position = $this->import_start($file, $mapping, $start_pos, $end_pos, $eval_field);
341
+ $this->import();
342
+ $this->import_end();
343
+
344
+ $results = array();
345
+ $results['import_results'] = $this->import_results;
346
+ $results['processed_terms'] = $this->processed_terms;
347
+ $results['processed_posts'] = $this->processed_posts;
348
+
349
+ echo "<!--WC_START-->";
350
+ echo json_encode($results);
351
+ echo "<!--WC_END-->";
352
+ exit;
353
+ break;
354
+ case 4 :
355
+ // Check access - cannot use nonce here as it will expire after multiple requests
356
+ if (function_exists('WC')) {
357
+ if (!current_user_can('manage_woocommerce'))
358
+ die();
359
+ }
360
+
361
+ add_filter('http_request_timeout', array($this, 'bump_request_timeout'));
362
+
363
+ if (function_exists('gc_enable'))
364
+ gc_enable();
365
+
366
+ @set_time_limit(0);
367
+ @ob_flush();
368
+ @flush();
369
+ $wpdb->hide_errors();
370
+
371
+ $this->processed_terms = isset($_POST['processed_terms']) ? $_POST['processed_terms'] : array();
372
+ $this->processed_posts = isset($_POST['processed_posts']) ? $_POST['processed_posts'] : array();
373
+
374
+ _e('Step 1...', 'wf_customer_import_export') . ' ';
375
+
376
+ wp_defer_term_counting(true);
377
+ wp_defer_comment_counting(true);
378
+
379
+ _e('Step 2...', 'wf_customer_import_export') . ' ';
380
+
381
+ echo 'Step 3...' . ' '; // Easter egg
382
+
383
+ _e('Finalizing...', 'wf_customer_import_export') . ' ';
384
+
385
+ // SUCCESS
386
+ _e('Finished. Import complete.', 'wf_customer_import_export');
387
+
388
+ $this->import_end();
389
+ exit;
390
+ break;
391
+ }
392
+
393
+ $this->footer();
394
+ }
395
+
396
+ /**
397
+ * format_data_from_csv
398
+ */
399
+ public function format_data_from_csv($data, $enc) {
400
+ return ( $enc == 'UTF-8' ) ? $data : utf8_encode($data);
401
+ }
402
+
403
+ /**
404
+ * Display pre-import options
405
+ */
406
+ public function import_options() {
407
+ $j = 0;
408
+
409
+ if ($this->id)
410
+ $file = get_attached_file($this->id);
411
+ else if ($this->file_url_import_enabled)
412
+ $file = ABSPATH . $this->file_url;
413
+ else
414
+ return;
415
+
416
+ // Set locale
417
+ $enc = mb_detect_encoding($file, 'UTF-8, ISO-8859-1', true);
418
+ if ($enc)
419
+ setlocale(LC_ALL, 'en_US.' . $enc);
420
+ @ini_set('auto_detect_line_endings', true);
421
+
422
+ // Get headers
423
+ if (( $handle = fopen($file, "r") ) !== FALSE) {
424
+
425
+ $row = $raw_headers = array();
426
+ $header = fgetcsv($handle, 0, $this->delimiter);
427
+
428
+ while (( $postmeta = fgetcsv($handle, 0, $this->delimiter) ) !== FALSE) {
429
+ foreach ($header as $key => $heading) {
430
+ if (!$heading)
431
+ continue;
432
+ $s_heading = $heading;
433
+ $row[$s_heading] = ( isset($postmeta[$key]) ) ? $this->format_data_from_csv($postmeta[$key], $enc) : '';
434
+ $raw_headers[$s_heading] = $heading;
435
+ }
436
+ break;
437
+ }
438
+ fclose($handle);
439
+ }
440
+
441
+ $mapping_from_db = get_option('wf_user_csv_imp_exp_mapping');
442
+
443
+ if ($this->profile !== '' && !empty($_GET['clearmapping'])) {
444
+ unset($mapping_from_db[$this->profile]);
445
+ update_option('wf_user_csv_imp_exp_mapping', $mapping_from_db);
446
+ $this->profile = '';
447
+ }
448
+ if ($this->profile !== '')
449
+ $mapping_from_db = $mapping_from_db[$this->profile];
450
+
451
+ $saved_mapping = null;
452
+ $saved_evaluation = null;
453
+ if ($mapping_from_db && is_array($mapping_from_db) && count($mapping_from_db) == 2 && empty($_GET['clearmapping'])) {
454
+ $reset_action = 'admin.php?clearmapping=1&amp;profile=' . $this->profile . '&amp;import=' . $this->import_page . '&amp;step=1&amp;merge=' . (!empty($_GET['merge']) ? 1 : 0 ) . '&amp;file_url=' . $this->file_url . '&amp;delimiter=' . $this->delimiter . '&amp;merge_empty_cells=' . $this->merge_empty_cells. '&amp;send_mail=' . $this->send_mail . '&amp;file_id=' . $this->id . '';
455
+ $reset_action = esc_attr(wp_nonce_url($reset_action, 'import-upload'));
456
+ echo '<h3>' . __('Columns are pre-selected using the Mapping file: "<b style="color:gray">' . $this->profile . '</b>". <a href="' . $reset_action . '"> Delete</a> this mapping file.', 'wf_customer_import_export') . '</h3>';
457
+ $saved_mapping = $mapping_from_db[0];
458
+ $saved_evaluation = $mapping_from_db[1];
459
+ }
460
+
461
+ $merge = (!empty($_GET['merge']) && $_GET['merge']) ? 1 : 0;
462
+
463
+ include( 'views/html-wf-import-options.php' );
464
+ }
465
+
466
+ /**
467
+ * The main controller for the actual import stage.
468
+ */
469
+ public function import() {
470
+ global $woocommerce, $wpdb;
471
+
472
+ wp_suspend_cache_invalidation(true);
473
+ if ($this->log) {
474
+ $this->hf_log_data_change('user-csv-import', '---');
475
+ $this->hf_log_data_change('user-csv-import', __('Processing users.', 'wf_customer_import_export'));
476
+ }
477
+ $merging = 1;
478
+ $record_offset = 0;
479
+
480
+ $i = 0;
481
+ //echo '<pre>';print_r($this->parsed_data);exit;
482
+ foreach ($this->parsed_data as $key => &$item) {
483
+ $user = $this->parser->parse_users($item, $this->raw_headers, $merging, $record_offset);
484
+ if (!is_wp_error($user))
485
+ $this->process_users($user['user'][0]);
486
+ else
487
+ $this->add_import_result('failed', $user->get_error_message(), 'Not parsed', json_encode($item), '-');
488
+
489
+ unset($item, $user);
490
+ $i++;
491
+ }
492
+ if ($this->log)
493
+ $this->hf_log_data_change('user-csv-import', __('Finished processing Users.', 'wf_customer_import_export'));
494
+ wp_suspend_cache_invalidation(false);
495
+ }
496
+
497
+ /**
498
+ * Parses the CSV file and prepares us for the task of processing parsed data
499
+ *
500
+ * @param string $file Path to the CSV file for importing
501
+ */
502
+ public function import_start($file, $mapping, $start_pos, $end_pos, $eval_field) {
503
+
504
+
505
+ if (function_exists('WC')) {
506
+ if (WC()->version < '2.7.0') {
507
+ $memory = size_format(woocommerce_let_to_num(ini_get('memory_limit')));
508
+ $wp_memory = size_format(woocommerce_let_to_num(WP_MEMORY_LIMIT));
509
+ } else {
510
+ $memory = size_format(wc_let_to_num(ini_get('memory_limit')));
511
+ $wp_memory = size_format(wc_let_to_num(WP_MEMORY_LIMIT));
512
+ }
513
+ }
514
+ if ($this->log) {
515
+ $this->hf_log_data_change('user-csv-import', '---[ New Import ] PHP Memory: ' . $memory . ', WP Memory: ' . $wp_memory);
516
+ $this->hf_log_data_change('user-csv-import', __('Parsing products CSV.', 'wf_customer_import_export'));
517
+ }
518
+ $this->parser = new WF_CSV_Parser('user');
519
+
520
+
521
+ list( $this->parsed_data, $this->raw_headers, $position ) = $this->parser->parse_data($file, $this->delimiter, $mapping, $start_pos, $end_pos, $eval_field);
522
+ if ($this->log)
523
+ $this->hf_log_data_change('user-csv-import', __('Finished parsing products CSV.', 'wf_customer_import_export'));
524
+
525
+ unset($import_data);
526
+
527
+ wp_defer_term_counting(true);
528
+ wp_defer_comment_counting(true);
529
+
530
+ return $position;
531
+ }
532
+
533
+ /**
534
+ * Performs post-import cleanup of files and the cache
535
+ */
536
+ public function import_end() {
537
+
538
+ //wp_cache_flush(); Stops output in some hosting environments
539
+ foreach (get_taxonomies() as $tax) {
540
+ delete_option("{$tax}_children");
541
+ _get_term_hierarchy($tax);
542
+ }
543
+
544
+ wp_defer_term_counting(false);
545
+ wp_defer_comment_counting(false);
546
+
547
+ do_action('import_end');
548
+ }
549
+
550
+ /**
551
+ * Handles the CSV upload and initial parsing of the file to prepare for
552
+ * displaying author import options
553
+ *
554
+ * @return bool False if error uploading or invalid file, true otherwise
555
+ */
556
+ public function handle_upload() {
557
+
558
+ if (empty($_POST['file_url'])) {
559
+
560
+ $file = wp_import_handle_upload();
561
+
562
+ if (isset($file['error'])) {
563
+ echo '<p><strong>' . __('Sorry, there has been an error.', 'wf_customer_import_export') . '</strong><br />';
564
+ echo esc_html($file['error']) . '</p>';
565
+ return false;
566
+ }
567
+
568
+ $this->id = (int) $file['id'];
569
+ return true;
570
+ } else {
571
+
572
+ if (file_exists(ABSPATH . $_POST['file_url'])) {
573
+
574
+ $this->file_url = esc_attr($_POST['file_url']);
575
+ return true;
576
+ } else {
577
+
578
+ echo '<p><strong>' . __('Sorry, there has been an error.', 'wf_customer_import_export') . '</strong></p>';
579
+ return false;
580
+ }
581
+ }
582
+
583
+ return false;
584
+ }
585
+
586
+ /**
587
+ * Create new posts based on import information
588
+ */
589
+ private function process_users($post) {
590
+
591
+
592
+ global $wpdb;
593
+ $this->imported = $this->merged = 0;
594
+
595
+ // plan a dry run
596
+ //$dry_run = isset( $_POST['dry_run'] ) && $_POST['dry_run'] ? true : false;
597
+ $dry_run = 0; //mockup import and check weather the users can be imported without fail
598
+ if ($this->log) {
599
+ $this->hf_log_data_change('user-csv-import', '---');
600
+ $this->hf_log_data_change('user-csv-import', __('Processing users.', 'wf_customer_import_export'));
601
+ }
602
+
603
+ if (empty($post['user_details']['user_email'])) {
604
+ $this->add_import_result('skipped', __('Cannot insert user without email', 'wf_customer_import_export'), 1, 1, 1);
605
+ unset($post);
606
+ return;
607
+ } elseif (!is_email($post['user_details']['user_email'])) {
608
+ $this->add_import_result('skipped', __('skipped: Email is not valid.', 'wf_customer_import_export'), 1, $post['user_details']['user_email'], 1);
609
+ unset($post);
610
+ return;
611
+ }
612
+
613
+ $user_id = $this->hf_check_customer($post);
614
+
615
+ $new_added = false;
616
+
617
+
618
+ if ($user_id) {
619
+ $usr_msg = 'User already exists.';
620
+ $user_info = get_userdata($user_id);
621
+ $user_string = sprintf('<a href="%s">%s</a>', get_edit_user_link($user_id), $user_info->first_name);
622
+ $this->add_import_result('skipped', __($usr_msg, 'wf_customer_import_export'),$user_id , $user_string, $user_id);
623
+ if ($this->log)
624
+ $this->hf_log_data_change('user-csv-import', sprintf(__('> &#8220;%s&#8221;' . $usr_msg, 'wf_customer_import_export'), $user_id), true);
625
+ unset($post);
626
+ return;
627
+ } else{
628
+ $user_id = $this->hf_create_customer($post);
629
+ $new_added = true;
630
+ if (is_wp_error($user_id)) {
631
+ $this->errored++;
632
+ $this->add_import_result('failed', __($user_id->get_error_message(), 'wf_customer_import_export'), 0, 'failed', 1);
633
+ if ($this->log)
634
+ $this->hf_log_data_change('user-csv-import', sprintf(__('> Error inserting %s: %s', 'wf_customer_import_export'), 1, $user_id->get_error_message()), true);
635
+ $skipped++;
636
+ unset($post);
637
+ return;
638
+ } elseif (empty($user_id)) {
639
+ $this->errored++;
640
+ if ($this->log)
641
+ $this->hf_log_data_change('user-csv-import', sprintf(__('An error occurred with the customer information provided.', 'wf_customer_import_export')));
642
+ $this->add_import_result('skipped', __('An error occurred with the customer information provided.', 'wf_customer_import_export'), 0, 'failed', 1);
643
+ $skipped++;
644
+ unset($post);
645
+ return;
646
+ }
647
+ }
648
+
649
+ $out_msg = 'User Imported Successfully.';
650
+
651
+ $user_info = get_userdata($user_id);
652
+ $user_string = sprintf('<a href="%s">%s</a>', get_edit_user_link($user_id), $user_info->first_name);
653
+
654
+
655
+ $this->add_import_result('imported', __($out_msg, 'wf_customer_import_export'), $user_id , $user_string, $user_id);
656
+ if ($this->log)
657
+ $this->hf_log_data_change('user-csv-import', sprintf(__('> &#8220;%s&#8221;' . $out_msg, 'wf_customer_import_export'), $user_id), true);
658
+ $this->imported++;
659
+ if ($this->log) {
660
+ $this->hf_log_data_change('user-csv-import', sprintf(__('> Finished importing user %s', 'wf_customer_import_export'), $dry_run ? "" : $user_id ));
661
+ $this->hf_log_data_change('user-csv-import', __('Finished processing users.', 'wf_customer_import_export'));
662
+ }
663
+
664
+ unset($post);
665
+ }
666
+
667
+ public function hf_check_customer($data) {
668
+ $customer_email = (!empty($data['user_details']['user_email']) ) ? $data['user_details']['user_email'] : '';
669
+ $username = (!empty($data['user_details']['user_login']) ) ? $data['user_details']['user_login'] : '';
670
+ $customer_id = (!empty($data['user_details']['ID']) ) ? $data['user_details']['ID'] : '';
671
+
672
+ $found_customer = false;
673
+
674
+ if (!empty($customer_email)) {
675
+
676
+ if (is_email($customer_email) && false !== email_exists($customer_email)) {
677
+ $found_customer = email_exists($customer_email);
678
+ } elseif (!empty($username) && false !== username_exists($username)) {
679
+ $found_customer = username_exists($username);
680
+ }
681
+ }
682
+ return $found_customer;
683
+ }
684
+
685
+ public function hf_create_customer($data) {
686
+
687
+ $customer_email = (!empty($data['user_details']['user_email']) ) ? $data['user_details']['user_email'] : '';
688
+ $username = (!empty($data['user_details']['user_login']) ) ? $data['user_details']['user_login'] : '';
689
+ $customer_id = (!empty($data['user_details']['ID']) ) ? $data['user_details']['ID'] : '';
690
+
691
+ if (!empty($data['user_details']['user_pass'])) {
692
+ $password = $data['user_details']['user_pass'];
693
+ $password_generated = false;
694
+ } else {
695
+ $password = wp_generate_password(12, true);
696
+ $password_generated = true;
697
+ }
698
+ $found_customer = false;
699
+ if (is_email($customer_email)) {
700
+
701
+
702
+
703
+ // Not in test mode, create a user account for this email
704
+ if (empty($username)) {
705
+
706
+ $maybe_username = explode('@', $customer_email);
707
+ $maybe_username = sanitize_user($maybe_username[0]);
708
+ $counter = 1;
709
+ $username = $maybe_username;
710
+
711
+ while (username_exists($username)) {
712
+ $username = $maybe_username . $counter;
713
+ $counter++;
714
+ }
715
+ }
716
+
717
+ $found_customer = wp_create_user($username, $password, $customer_email);
718
+
719
+ if (!is_wp_error($found_customer)) {
720
+
721
+
722
+ $wp_user_object = new WP_User($found_customer);
723
+
724
+ $roles = explode(',', $data['user_details']['roles']);
725
+ if(!empty($roles)){
726
+ foreach ($roles as $role) {
727
+ $wp_user_object->add_role($role);
728
+ }
729
+ //$wp_user_object->set_role($role);
730
+ }
731
+ $user_nicename = (!empty($data['user_details']['user_nicename'])) ? $data['user_details']['user_nicename'] : '';
732
+ $website = (!empty($data['user_details']['user_url'])) ? $data['user_details']['user_url'] : '';
733
+ $user_registered = (!empty($data['user_details']['user_registered'])) ? $data['user_details']['user_registered'] : '';
734
+ $display_name = (!empty($data['user_details']['display_name'])) ? $data['user_details']['display_name'] : '';
735
+ $first_name = (!empty($data['user_details']['first_name'])) ? $data['user_details']['first_name'] : '';
736
+ $last_name = (!empty($data['user_details']['last_name'])) ? $data['user_details']['last_name'] : '';
737
+ $user_status = (!empty($data['user_details']['user_status'])) ? $data['user_details']['user_status'] : '';
738
+ wp_update_user( array(
739
+ 'ID' => $found_customer,
740
+ 'user_nicename' => $user_nicename,
741
+ 'user_url' => $website,
742
+ 'user_registered' => $user_registered,
743
+ 'display_name' => $display_name,
744
+ 'first_name' => $first_name,
745
+ 'last_name' => $last_name,
746
+ 'user_status' => $user_status,
747
+
748
+ )
749
+ );
750
+
751
+ }
752
+ } else {
753
+
754
+ $found_customer = new WP_Error('hf_invalid_customer', sprintf(__('User could not be created without Email.', 'wf_customer_import_export'), $customer_id));
755
+ }
756
+
757
+ return $found_customer;
758
+ }
759
+
760
+
761
+ /**
762
+ * Log a row's import status
763
+ */
764
+ protected function add_import_result($status, $reason, $post_id = '', $post_title = '', $user_id = '') {
765
+ $this->import_results[] = array(
766
+ 'post_title' => $post_title,
767
+ 'post_id' => $post_id,
768
+ 'user_id' => $user_id,
769
+ 'status' => $status,
770
+ 'reason' => $reason
771
+ );
772
+ }
773
+
774
+ /**
775
+ * Decide what the maximum file size for downloaded attachments is.
776
+ * Default is 0 (unlimited), can be filtered via import_attachment_size_limit
777
+ *
778
+ * @return int Maximum attachment file size to import
779
+ */
780
+ public function max_attachment_size() {
781
+ return apply_filters('import_attachment_size_limit', 0);
782
+ }
783
+
784
+ // Display import page title
785
+ public function header() {
786
+ echo '<div class="wrap"><div class="icon32" id="icon-woocommerce-importer"><br></div>';
787
+ echo '<h2>' . ( empty($_GET['merge']) ? __('Import', 'wf_customer_import_export') : __('Merge Users', 'wf_customer_import_export') ) . '</h2>';
788
+ }
789
+
790
+ // Close div.wrap
791
+ public function footer() {
792
+ echo '</div>';
793
+ }
794
+
795
+ /**
796
+ * Display introductory text and file upload form
797
+ */
798
+ public function greet() {
799
+ $action = 'admin.php?import=wordpress_hf_user_csv&amp;step=1';
800
+ $bytes = apply_filters('import_upload_size_limit', wp_max_upload_size());
801
+ $size = size_format($bytes);
802
+ $upload_dir = wp_upload_dir();
803
+
804
+ include( 'views/html-wf-import-greeting.php' );
805
+ }
806
+
807
+ /**
808
+ * Added to http_request_timeout filter to force timeout at 60 seconds during import
809
+ * @return int 60
810
+ */
811
+ public function bump_request_timeout($val) {
812
+ return 60;
813
+ }
814
+
815
+ public function wf_let_to_num($size) {
816
+ $l = substr($size, -1);
817
+ $ret = substr($size, 0, -1);
818
+ switch (strtoupper($l)) {
819
+ case 'P':
820
+ $ret *= 1024;
821
+ case 'T':
822
+ $ret *= 1024;
823
+ case 'G':
824
+ $ret *= 1024;
825
+ case 'M':
826
+ $ret *= 1024;
827
+ case 'K':
828
+ $ret *= 1024;
829
+ }
830
+ return $ret;
831
+ }
832
+
833
+ }
includes/importer/class-wf-customerimpexpcsv-importer.php CHANGED
@@ -1,41 +1,41 @@
1
- <?php
2
- if ( ! defined( 'ABSPATH' ) ) {
3
- exit;
4
- }
5
-
6
- class WF_CustomerImpExpCsv_Importer {
7
-
8
- /**
9
- * User Exporter Tool
10
- */
11
- public static function load_wp_importer() {
12
- // Load Importer API
13
- require_once ABSPATH . 'wp-admin/includes/import.php';
14
-
15
- if ( ! class_exists( 'WP_Importer' ) ) {
16
- $class_wp_importer = ABSPATH . 'wp-admin/includes/class-wp-importer.php';
17
- if ( file_exists( $class_wp_importer ) ) {
18
- require $class_wp_importer;
19
- }
20
- }
21
- }
22
-
23
- /**
24
- * User Importer Tool
25
- */
26
- public static function customer_importer() {
27
- if ( ! defined( 'WP_LOAD_IMPORTERS' ) ) {
28
- return;
29
- }
30
-
31
- self::load_wp_importer();
32
-
33
- // includes
34
- require_once 'class-wf-customerimpexpcsv-customer-import.php';
35
- require_once 'class-wf-csv-parser.php';
36
-
37
- // Dispatch
38
- $GLOBALS['WF_CSV_Customer_Import'] = new WF_CustomerImpExpCsv_Customer_Import();
39
- $GLOBALS['WF_CSV_Customer_Import'] ->dispatch();
40
- }
41
  }
1
+ <?php
2
+ if ( ! defined( 'ABSPATH' ) ) {
3
+ exit;
4
+ }
5
+
6
+ class WF_CustomerImpExpCsv_Importer {
7
+
8
+ /**
9
+ * User Exporter Tool
10
+ */
11
+ public static function load_wp_importer() {
12
+ // Load Importer API
13
+ require_once ABSPATH . 'wp-admin/includes/import.php';
14
+
15
+ if ( ! class_exists( 'WP_Importer' ) ) {
16
+ $class_wp_importer = ABSPATH . 'wp-admin/includes/class-wp-importer.php';
17
+ if ( file_exists( $class_wp_importer ) ) {
18
+ require $class_wp_importer;
19
+ }
20
+ }
21
+ }
22
+
23
+ /**
24
+ * User Importer Tool
25
+ */
26
+ public static function customer_importer() {
27
+ if ( ! defined( 'WP_LOAD_IMPORTERS' ) ) {
28
+ return;
29
+ }
30
+
31
+ self::load_wp_importer();
32
+
33
+ // includes
34
+ require_once 'class-wf-customerimpexpcsv-customer-import.php';
35
+ require_once 'class-wf-csv-parser.php';
36
+
37
+ // Dispatch
38
+ $GLOBALS['WF_CSV_Customer_Import'] = new WF_CustomerImpExpCsv_Customer_Import();
39
+ $GLOBALS['WF_CSV_Customer_Import'] ->dispatch();
40
+ }
41
  }
includes/importer/data/data-wf-reserved-fields-pair.php CHANGED
@@ -1,21 +1,21 @@
1
- <?php
2
- if (!defined('ABSPATH')) {
3
- exit;
4
- }
5
-
6
- $columns = array(
7
- 'ID' => 'ID | Customer/User ID ',
8
- 'user_login' => 'User Login | User Login',
9
- 'user_pass' => 'user_pass | user_pass',
10
- 'user_nicename' => 'user_nicename | user_nicename',
11
- 'user_email' => 'user_email | user_email',
12
- 'user_url' => 'user_url | user_url',
13
- 'user_registered' => 'user_registered | user_registered',
14
- 'display_name' => 'display_name | display_name',
15
- 'first_name' => 'first_name | first_name',
16
- 'last_name' => 'last_name | last_name',
17
- 'user_status' => 'user_status | user_status',
18
- 'roles' => 'roles | roles'
19
- );
20
-
21
  return apply_filters('hf_csv_customer_import_columns', $columns);
1
+ <?php
2
+ if (!defined('ABSPATH')) {
3
+ exit;
4
+ }
5
+
6
+ $columns = array(
7
+ 'ID' => 'ID | Customer/User ID ',
8
+ 'user_login' => 'User Login | User Login',
9
+ 'user_pass' => 'user_pass | user_pass',
10
+ 'user_nicename' => 'user_nicename | user_nicename',
11
+ 'user_email' => 'user_email | user_email',
12
+ 'user_url' => 'user_url | user_url',
13
+ 'user_registered' => 'user_registered | user_registered',
14
+ 'display_name' => 'display_name | display_name',
15
+ 'first_name' => 'first_name | first_name',
16
+ 'last_name' => 'last_name | last_name',
17
+ 'user_status' => 'user_status | user_status',
18
+ 'roles' => 'roles | roles'
19
+ );
20
+
21
  return apply_filters('hf_csv_customer_import_columns', $columns);
includes/importer/views/html-wf-import-greeting.php CHANGED
@@ -1,29 +1,44 @@
1
- <div>
2
- <p><?php _e('You can import users/customers (in CSV format) in to the shop.', 'wf_customer_import_export'); ?></p>
3
- <?php if (!empty($upload_dir['error'])) : ?>
4
- <div class="error"><p><?php _e('Before you can upload your import file, you will need to fix the following error:', 'wf_customer_import_export'); ?></p>
5
- <p><strong><?php echo $upload_dir['error']; ?></strong></p></div>
6
-
7
- <?php else : ?>
8
- <form enctype="multipart/form-data" id="import-upload-form" method="post" action="<?php echo esc_attr(wp_nonce_url($action, 'import-upload')); ?>">
9
- <table class="form-table">
10
- <tbody>
11
- <tr>
12
- <th>
13
- <label for="upload"><?php _e('Select a file from your computer', 'wf_customer_import_export'); ?></label>
14
- </th>
15
- <td>
16
- <input type="file" id="upload" name="import" size="25" />
17
- <input type="hidden" name="action" value="save" />
18
- <input type="hidden" name="max_file_size" value="<?php echo $bytes; ?>" />
19
- <small><?php printf(__('Maximum size: %s'), $size); ?></small>
20
- </td>
21
- </tr>
22
- </tbody>
23
- </table>
24
- <p class="submit">
25
- <input type="submit" class="button button-primary" value="<?php esc_attr_e('Upload file and import'); ?>" />
26
- </p>
27
- </form>
28
- <?php endif; ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
29
  </div>
1
+
2
+ <div class=" woocommerce">
3
+ <div class="icon32" id="icon-woocommerce-importer"><br></div>
4
+ <h2 class="nav-tab-wrapper woo-nav-tab-wrapper">
5
+ <a href="<?php echo admin_url('admin.php?page=hf_wordpress_customer_im_ex') ?>" class="nav-tab "><?php _e('User/Customer Export', 'wf_customer_import_export'); ?></a>
6
+ <a href="<?php echo admin_url('admin.php?import=wordpress_hf_user_csv') ?>" class="nav-tab nav-tab-active"><?php _e('User/Customer Import', 'wf_customer_import_export'); ?></a>
7
+ <a href="<?php echo admin_url('admin.php?page=hf_wordpress_customer_im_ex&tab=help'); ?>" class="nav-tab"><?php _e('Help', 'wf_csv_import_export'); ?></a>
8
+ <a href="https://www.xadapter.com/product/wordpress-users-woocommerce-customers-import-export/" target="_blank" class="nav-tab nav-tab-premium"><?php _e('Upgrade to Premium for More Features', 'wf_csv_import_export'); ?></a>
9
+ </h2>
10
+ <?php
11
+ include_once("market.php");
12
+ ?>
13
+
14
+ </div>
15
+ <div class="tool-box bg-white p-20p pipe-view">
16
+ <h3 class="title"><?php _e('Import Users in CSV Format:', 'wf_customer_import_export'); ?></h3>
17
+ <p><?php _e('Import Users in CSV format from your computer.You can import users/customers (in CSV format) in to the shop.', 'wf_customer_import_export'); ?></p>
18
+ <?php if (!empty($upload_dir['error'])) : ?>
19
+ <div class="error"><p><?php _e('Before you can upload your import file, you will need to fix the following error:', 'wf_customer_import_export'); ?></p>
20
+ <p><strong><?php echo $upload_dir['error']; ?></strong></p></div>
21
+
22
+ <?php else : ?>
23
+ <form enctype="multipart/form-data" id="import-upload-form" method="post" action="<?php echo esc_attr(wp_nonce_url($action, 'import-upload')); ?>">
24
+ <table class="form-table">
25
+ <tbody>
26
+ <tr>
27
+ <th>
28
+ <label for="upload"><?php _e('Select a file from your computer', 'wf_customer_import_export'); ?></label>
29
+ </th>
30
+ <td>
31
+ <input type="file" id="upload" name="import" size="25" />
32
+ <input type="hidden" name="action" value="save" />
33
+ <input type="hidden" name="max_file_size" value="<?php echo $bytes; ?>" />
34
+ <small><?php printf(__('Maximum size: %s'), $size); ?></small>
35
+ </td>
36
+ </tr>
37
+ </tbody>
38
+ </table>
39
+ <p class="submit">
40
+ <input type="submit" class="button button-primary" value="<?php esc_attr_e('Upload file and import'); ?>" />
41
+ </p>
42
+ </form>
43
+ <?php endif; ?>
44
  </div>
includes/importer/views/html-wf-import-options.php CHANGED
@@ -1,15 +1,15 @@
1
- <form action="<?php echo admin_url('admin.php?import=' . $this->import_page . '&step=2'); ?>" method="post" id="nomap">
2
- <?php wp_nonce_field('import-woocommerce'); ?>
3
- <input type="hidden" name="import_id" value="<?php echo $this->id; ?>" />
4
- <?php if ($this->file_url_import_enabled) : ?>
5
- <input type="hidden" name="import_url" value="<?php echo $this->file_url; ?>" />
6
- <?php endif; ?>
7
- <p class="submit">
8
- <input style="display:none" type="submit" class="button button-primary" value="<?php esc_attr_e('Submit', 'wf_customer_import_export'); ?>" />
9
- </p>
10
- </form>
11
- <script type="text/javascript">
12
- jQuery(document).ready(function(){
13
- jQuery("form#nomap").submit();
14
- });
15
  </script>
1
+ <form action="<?php echo admin_url('admin.php?import=' . $this->import_page . '&step=2'); ?>" method="post" id="nomap">
2
+ <?php wp_nonce_field('import-woocommerce'); ?>
3
+ <input type="hidden" name="import_id" value="<?php echo $this->id; ?>" />
4
+ <?php if ($this->file_url_import_enabled) : ?>
5
+ <input type="hidden" name="import_url" value="<?php echo $this->file_url; ?>" />
6
+ <?php endif; ?>
7
+ <p class="submit">
8
+ <input style="display:none" type="submit" class="button button-primary" value="<?php esc_attr_e('Submit', 'wf_customer_import_export'); ?>" />
9
+ </p>
10
+ </form>
11
+ <script type="text/javascript">
12
+ jQuery(document).ready(function(){
13
+ jQuery("form#nomap").submit();
14
+ });
15
  </script>
includes/importer/views/market.php ADDED
@@ -0,0 +1,115 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if ( ! defined( 'ABSPATH' ) ) {
3
+ exit;
4
+ }
5
+ ?>
6
+
7
+ <style>
8
+ .wf_customer_import_export.market-box{
9
+ width:30%;
10
+ float: right;
11
+ }
12
+
13
+ .wf_customer_import_export .pipe-premium-features{
14
+ background: #fff;
15
+ padding:5px;
16
+ }
17
+ .wf_customer_import_export .pipe-premium-features ul {
18
+ padding-left: 20px;
19
+ padding-right: 20px;
20
+ }
21
+ .wf_customer_import_export .pipe-premium-features li {
22
+ margin-bottom: 15px;
23
+ padding-left: 15px;
24
+ }
25
+ .wf_customer_import_export .pipe-premium-features li:before
26
+ {
27
+ font-family: dashicons;
28
+ text-decoration: inherit;
29
+ font-weight: 400;
30
+ font-style: normal;
31
+ vertical-align: top;
32
+ text-align: center;
33
+ content: "\f147";
34
+ margin-right: 10px;
35
+ margin-left: -25px;
36
+ font-size: 16px;
37
+ color: #3085bb;
38
+ }
39
+ .wf_customer_import_export .pipe-premium-features .button {
40
+ margin-bottom: 20px;
41
+ }
42
+ .wf_customer_import_export .pipe-premium-features .button-go-pro {
43
+ box-shadow: none;
44
+ border: 0;
45
+ text-shadow: none;
46
+ padding: 10px 15px;
47
+ height: auto;
48
+ font-size: 18px;
49
+ border-radius: 4px;
50
+ font-weight: 600;
51
+ background: #00cb95;
52
+ margin-top: 20px;
53
+ }
54
+ .wf_customer_import_export .pipe-premium-features .button-go-pro:hover,
55
+ .wf_customer_import_export .pipe-premium-features .button-go-pro:focus,
56
+ .wf_customer_import_export .pipe-premium-features .button-go-pro:active {
57
+ background: #00a378;
58
+ }
59
+ .wf_customer_import_export .pipe-premium-features .button-doc-demo {
60
+ border: 0;
61
+ background: #d8d8dc;
62
+ box-shadow: none;
63
+ padding: 10px 15px;
64
+ font-size: 15px;
65
+ height: auto;
66
+ margin-left: 10px;
67
+ margin-right: 10px;
68
+ margin-top: 10px;
69
+ }
70
+ .wf_customer_import_export .pipe-premium-features .button-doc-demo:hover,
71
+ .wf_customer_import_export .pipe-premium-features .button-doc-demo:focus,
72
+ .wf_customer_import_export .pipe-premium-features .button-doc-demo:active {
73
+ background: #dfdfe4;
74
+ }
75
+ .wf_customer_import_export .xa-pipe-rating-link{color:#ffc600;}
76
+
77
+ .wf_customer_import_export .pipe-review-widget{
78
+ background: #fff;
79
+ padding: 5px;
80
+ margin-top: 23px;
81
+ }
82
+ .wf_customer_import_export .pipe-review-widget p{
83
+ margin-right:5px;
84
+ margin-left:5px;
85
+ }
86
+ </style>
87
+ <div class="wf_customer_import_export market-box table-box-main">
88
+ <div class="pipe-premium-features">
89
+ <center><a href="http://www.xadapter.com/product/wordpress-users-woocommerce-customers-import-export/" target="_blank" class="button button-primary button-go-pro"><?php _e('Upgrade to Premium Version', 'wf_customer_import_export'); ?></a></center>
90
+ <span>
91
+ <ul>
92
+ <li style='color:red;'><strong><?php _e('Your Business is precious! Go Premium!','wf_customer_import_export'); ?></strong></li>
93
+
94
+ <li><?php _e('HikeForce Import Export Users Plugin Premium version helps you to seamlessly import/export Customer details into your Woocommerce Store.', 'wf_customer_import_export'); ?></li>
95
+
96
+ <li><?php _e('Export/Import WooCommerce Customer details into a CSV file.', 'wf_customer_import_export'); ?><strong><?php _e('( Basic version supports only WordPress User details )', 'wf_customer_import_export'); ?></strong></li>
97
+ <li><?php _e('Various Filter options for exporting Customers.', 'wf_customer_import_export'); ?></li>
98
+ <li><?php _e('Map and Transform fields while Importing Customers.', 'wf_customer_import_export'); ?></li>
99
+ <li><?php _e('Change values while importing Customers using Evaluation Fields.', 'wf_customer_import_export'); ?></li>
100
+ <li><?php _e('Choice to Update or Skip existing imported Customers.', 'wf_customer_import_export'); ?></li>
101
+ <li><?php _e('Choice to Send or Skip Emails for newly imported Customers.', 'wf_customer_import_export'); ?></li>
102
+ <li><?php _e('Import/Export file from/to a remote server via FTP in Scheduled time interval with Cron Job.', 'wf_customer_import_export'); ?></li>
103
+ <li><?php _e('Excellent Support for setting it up!', 'wf_customer_import_export'); ?></li>
104
+ </ul>
105
+ </span>
106
+ <center>
107
+
108
+ <a href="https://www.xadapter.com/category/documentation/wordpress-users-woocommerce-customers-import-export/" target="_blank" class="button button-doc-demo"><?php _e('Documentation', 'wf_customer_import_export'); ?></a></center>
109
+ </div>
110
+ <div class="pipe-review-widget">
111
+ <?php
112
+ echo sprintf(__('<div class=""><p><i>If you like the plugin please leave us a %1$s review!</i><p></div>', 'wf_customer_import_export'), '<a href="https://wordpress.org/support/plugin/users-customers-import-export-for-wp-woocommerce/reviews?rate=5#new-post" target="_blank" class="xa-pipe-rating-link" data-reviewed="' . esc_attr__('Thanks for the review.', 'wf_customer_import_export') . '">&#9733;&#9733;&#9733;&#9733;&#9733;</a>');
113
+ ?>
114
+ </div>
115
+ </div>
includes/settings/class-wf-customerimpexpcsv-settings.php CHANGED
@@ -1,17 +1,17 @@
1
- <?php
2
-
3
- if (!defined('ABSPATH')) {
4
- exit;
5
- }
6
-
7
- class WF_CustomerImpExpCsv_Settings {
8
-
9
- /**
10
- * User Exporter Tool
11
- */
12
- public static function save_settings() {
13
- wp_redirect(admin_url('/admin.php?page=' . HF_WORDPRESS_CUSTOMER_IM_EX . '&tab=settings'));
14
- exit;
15
- }
16
-
17
- }
1
+ <?php
2
+
3
+ if (!defined('ABSPATH')) {
4
+ exit;
5
+ }
6
+
7
+ class WF_CustomerImpExpCsv_Settings {
8
+
9
+ /**
10
+ * User Exporter Tool
11
+ */
12
+ public static function save_settings() {
13
+ wp_redirect(admin_url('/admin.php?page=' . HF_WORDPRESS_CUSTOMER_IM_EX . '&tab=settings'));
14
+ exit;
15
+ }
16
+
17
+ }
includes/views/export/html-wf-export-customers.php CHANGED
@@ -1,85 +1,94 @@
1
- <div class="tool-box">
2
- <h3 class="title"><?php _e('Export Users in CSV Format:', 'wf_customer_import_export'); ?></h3>
3
- <p><?php _e('Export and download your Users in CSV format. This file can be used to import users back into your Website.', 'wf_customer_import_export'); ?></p>
4
- <form action="<?php echo admin_url('admin.php?page=hf_wordpress_customer_im_ex&action=export'); ?>" method="post">
5
-
6
- <table class="form-table">
7
- <tr>
8
- <th>
9
- <label for="v_user_roles"><?php _e('User Roles', 'wf_customer_import_export'); ?></label>
10
- </th>
11
- <td>
12
- <select id="v_user_roles" name="user_roles" >
13
- <?php
14
- global $wp_roles;
15
- foreach ( $wp_roles->role_names as $role => $name ) {
16
- echo '<option value="' . esc_attr( $role ) . '">' . $name . '</option>';
17
- }
18
- ?>
19
- </select>
20
-
21
- <p style="font-size: 12px"><?php _e('Users with these roles will be exported.', 'wf_customer_import_export'); ?></p>
22
- </td>
23
- </tr>
24
- <tr>
25
- <th>
26
- <label for="v_offset"><?php _e('Offset', 'wf_customer_import_export'); ?></label>
27
- </th>
28
- <td>
29
- <input type="text" name="offset" id="v_offset" placeholder="<?php _e('0', 'wf_customer_import_export'); ?>" class="input-text" />
30
- <p style="font-size: 12px"><?php _e('The number of users to skip before returning.', 'wf_customer_import_export'); ?></p>
31
- </td>
32
- </tr>
33
- <tr>
34
- <th>
35
- <label for="v_limit"><?php _e('Limit', 'wf_customer_import_export'); ?></label>
36
- </th>
37
- <td>
38
- <input type="text" name="limit" id="v_limit" placeholder="<?php _e('Unlimited', 'wf_customer_import_export'); ?>" class="input-text" />
39
- <p style="font-size: 12px"><?php _e('The number of users to return.', 'wf_customer_import_export'); ?></p>
40
- </td>
41
- </tr>
42
-
43
-
44
-
45
-
46
-
47
- <tr>
48
- <th>
49
- <label for="v_columns"><?php _e('Columns', 'wf_customer_import_export'); ?></label>
50
- </th>
51
- <table id="datagrid">
52
- <th style="text-align: left;">
53
- <label for="v_columns"><?php _e('Column', 'wf_customer_import_export'); ?></label>
54
- </th>
55
- <th style="text-align: left;">
56
- <label for="v_columns_name"><?php _e('Column Name', 'wf_customer_import_export'); ?></label>
57
- </th>
58
- <?php
59
- ?>
60
- <?php foreach ($post_columns as $pkey => $pcolumn) {
61
-
62
- ?>
63
- <tr>
64
- <td>
65
- <input name= "columns[<?php echo $pkey; ?>]" type="checkbox" value="<?php echo $pkey; ?>" checked>
66
- <label for="columns[<?php echo $pkey; ?>]"><?php _e($pcolumn, 'wf_customer_import_export'); ?></label>
67
- </td>
68
- <td>
69
- <input type="text" name="columns_name[<?php echo $pkey; ?>]" value="<?php echo $pkey; ?>" class="input-text" />
70
- </td>
71
- </tr>
72
- <?php } ?>
73
-
74
- </table><br/>
75
- </tr>
76
-
77
-
78
-
79
-
80
-
81
-
82
- </table>
83
- <p class="submit"><input type="submit" class="button button-primary" value="<?php _e('Export Users', 'wf_customer_import_export'); ?>" /></p>
84
- </form>
85
- </div>
 
 
 
 
 
 
 
 
 
1
+
2
+
3
+ <div class="tool-box bg-white p-20p pipe-view">
4
+ <h3 class="title"><?php _e('Export Users in CSV Format:', 'wf_customer_import_export'); ?></h3>
5
+ <p><?php _e('Export and download your Users in CSV format. This file can be used to import users back into your Website.', 'wf_customer_import_export'); ?></p>
6
+ <form action="<?php echo admin_url('admin.php?page=hf_wordpress_customer_im_ex&action=export'); ?>" method="post">
7
+
8
+ <table class="form-table">
9
+ <tr>
10
+ <th>
11
+ <label for="v_user_roles"><?php _e('User Roles', 'wf_customer_import_export'); ?></label>
12
+ </th>
13
+ <td>
14
+ <select id="v_user_roles" name="user_roles[]" data-placeholder="<?php _e('All Roles', 'wf_customer_import_export'); ?>" class="wc-enhanced-select" multiple="multiple">
15
+
16
+ <?php
17
+ global $wp_roles;
18
+
19
+ foreach ( $wp_roles->role_names as $role => $name ) {
20
+ echo '<option value="' . esc_attr( $role ) . '">' . $name . '</option>';
21
+ }
22
+ ?>
23
+ </select>
24
+
25
+ <p style="font-size: 12px"><?php _e('Users with these roles will be exported.', 'wf_customer_import_export'); ?></p>
26
+ </td>
27
+ </tr>
28
+ <tr>
29
+ <th>
30
+ <label for="v_offset"><?php _e('Offset', 'wf_customer_import_export'); ?></label>
31
+ </th>
32
+ <td>
33
+ <input type="text" name="offset" id="v_offset" placeholder="<?php _e('0', 'wf_customer_import_export'); ?>" class="input-text" />
34
+ <p style="font-size: 12px"><?php _e('The number of users to skip before returning.', 'wf_customer_import_export'); ?></p>
35
+ </td>
36
+ </tr>
37
+ <tr>
38
+ <th>
39
+ <label for="v_limit"><?php _e('Limit', 'wf_customer_import_export'); ?></label>
40
+ </th>
41
+ <td>
42
+ <input type="text" name="limit" id="v_limit" placeholder="<?php _e('Unlimited', 'wf_customer_import_export'); ?>" class="input-text" />
43
+ <p style="font-size: 12px"><?php _e('The number of users to return.', 'wf_customer_import_export'); ?></p>
44
+ </td>
45
+ </tr>
46
+
47
+
48
+
49
+
50
+
51
+ <tr>
52
+ <th>
53
+ <label for="v_columns"><?php _e('Columns', 'wf_customer_import_export'); ?></label>
54
+ </th>
55
+ <table id="datagrid">
56
+ <th style="text-align: left;">
57
+ <label for="v_columns"><?php _e('Column', 'wf_customer_import_export'); ?></label>
58
+ </th>
59
+ <th style="text-align: left;">
60
+ <label for="v_columns_name"><?php _e('Column Name', 'wf_customer_import_export'); ?></label>
61
+ </th>
62
+ <?php
63
+ ?>
64
+ <?php foreach ($post_columns as $pkey => $pcolumn) {
65
+
66
+ ?>
67
+ <tr>
68
+ <td>
69
+ <input name= "columns[<?php echo $pkey; ?>]" type="checkbox" value="<?php echo $pkey; ?>" checked>
70
+ <label for="columns[<?php echo $pkey; ?>]"><?php _e($pcolumn, 'wf_customer_import_export'); ?></label>
71
+ </td>
72
+ <td>
73
+ <input type="text" name="columns_name[<?php echo $pkey; ?>]" value="<?php echo $pkey; ?>" class="input-text" />
74
+ </td>
75
+ </tr>
76
+ <?php } ?>
77
+
78
+ </table><br/>
79
+ </tr>
80
+
81
+
82
+
83
+
84
+
85
+
86
+ </table>
87
+ <p class="submit"><input type="submit" class="button button-primary" value="<?php _e('Export Users', 'wf_customer_import_export'); ?>" /></p>
88
+ </form>
89
+ </div>
90
+ <script>
91
+ jQuery(document).ready(function() {
92
+ jQuery('.wc-enhanced-select').select2();
93
+ });
94
+ </script>
includes/views/export/market.php ADDED
@@ -0,0 +1,115 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if ( ! defined( 'ABSPATH' ) ) {
3
+ exit;
4
+ }
5
+ ?>
6
+
7
+ <style>
8
+ .wf_customer_import_export.market-box{
9
+ width:30%;
10
+ float: right;
11
+ }
12
+
13
+ .wf_customer_import_export .pipe-premium-features{
14
+ background: #fff;
15
+ padding:5px;
16
+ }
17
+ .wf_customer_import_export .pipe-premium-features ul {
18
+ padding-left: 20px;
19
+ padding-right: 20px;
20
+ }
21
+ .wf_customer_import_export .pipe-premium-features li {
22
+ margin-bottom: 15px;
23
+ padding-left: 15px;
24
+ }
25
+ .wf_customer_import_export .pipe-premium-features li:before
26
+ {
27
+ font-family: dashicons;
28
+ text-decoration: inherit;
29
+ font-weight: 400;
30
+ font-style: normal;
31
+ vertical-align: top;
32
+ text-align: center;
33
+ content: "\f147";
34
+ margin-right: 10px;
35
+ margin-left: -25px;
36
+ font-size: 16px;
37
+ color: #3085bb;
38
+ }
39
+ .wf_customer_import_export .pipe-premium-features .button {
40
+ margin-bottom: 20px;
41
+ }
42
+ .wf_customer_import_export .pipe-premium-features .button-go-pro {
43
+ box-shadow: none;
44
+ border: 0;
45
+ text-shadow: none;
46
+ padding: 10px 15px;
47
+ height: auto;
48
+ font-size: 18px;
49
+ border-radius: 4px;
50
+ font-weight: 600;
51
+ background: #00cb95;
52
+ margin-top: 20px;
53
+ }
54
+ .wf_customer_import_export .pipe-premium-features .button-go-pro:hover,
55
+ .wf_customer_import_export .pipe-premium-features .button-go-pro:focus,
56
+ .wf_customer_import_export .pipe-premium-features .button-go-pro:active {
57
+ background: #00a378;
58
+ }
59
+ .wf_customer_import_export .pipe-premium-features .button-doc-demo {
60
+ border: 0;
61
+ background: #d8d8dc;
62
+ box-shadow: none;
63
+ padding: 10px 15px;
64
+ font-size: 15px;
65
+ height: auto;
66
+ margin-left: 10px;
67
+ margin-right: 10px;
68
+ margin-top: 10px;
69
+ }
70
+ .wf_customer_import_export .pipe-premium-features .button-doc-demo:hover,
71
+ .wf_customer_import_export .pipe-premium-features .button-doc-demo:focus,
72
+ .wf_customer_import_export .pipe-premium-features .button-doc-demo:active {
73
+ background: #dfdfe4;
74
+ }
75
+ .wf_customer_import_export .xa-pipe-rating-link{color:#ffc600;}
76
+
77
+ .wf_customer_import_export .pipe-review-widget{
78
+ background: #fff;
79
+ padding: 5px;
80
+ margin-top: 23px;
81
+ }
82
+ .wf_customer_import_export .pipe-review-widget p{
83
+ margin-right:5px;
84
+ margin-left:5px;
85
+ }
86
+ </style>
87
+ <div class="wf_customer_import_export market-box table-box-main">
88
+ <div class="pipe-premium-features">
89
+ <center><a href="http://www.xadapter.com/product/wordpress-users-woocommerce-customers-import-export/" target="_blank" class="button button-primary button-go-pro"><?php _e('Upgrade to Premium Version', 'wf_customer_import_export'); ?></a></center>
90
+ <span>
91
+ <ul>
92
+ <li style='color:red;'><strong><?php _e('Your Business is precious! Go Premium!','wf_customer_import_export'); ?></strong></li>
93
+
94
+ <li><?php _e('HikeForce Import Export Users Plugin Premium version helps you to seamlessly import/export Customer details into your Woocommerce Store.', 'wf_customer_import_export'); ?></li>
95
+
96
+ <li><?php _e('Export/Import WooCommerce Customer details into a CSV file.', 'wf_customer_import_export'); ?><strong><?php _e('( Basic version supports only WordPress User details )', 'wf_customer_import_export'); ?></strong></li>
97
+ <li><?php _e('Various Filter options for exporting Customers.', 'wf_customer_import_export'); ?></li>
98
+ <li><?php _e('Map and Transform fields while Importing Customers.', 'wf_customer_import_export'); ?></li>
99
+ <li><?php _e('Change values while importing Customers using Evaluation Fields.', 'wf_customer_import_export'); ?></li>
100
+ <li><?php _e('Choice to Update or Skip existing imported Customers.', 'wf_customer_import_export'); ?></li>
101
+ <li><?php _e('Choice to Send or Skip Emails for newly imported Customers.', 'wf_customer_import_export'); ?></li>
102
+ <li><?php _e('Import/Export file from/to a remote server via FTP in Scheduled time interval with Cron Job.', 'wf_customer_import_export'); ?></li>
103
+ <li><?php _e('Excellent Support for setting it up!', 'wf_customer_import_export'); ?></li>
104
+ </ul>
105
+ </span>
106
+ <center>
107
+
108
+ <a href="https://www.xadapter.com/category/documentation/wordpress-users-woocommerce-customers-import-export/" target="_blank" class="button button-doc-demo"><?php _e('Documentation', 'wf_customer_import_export'); ?></a></center>
109
+ </div>
110
+ <div class="pipe-review-widget">
111
+ <?php
112
+ echo sprintf(__('<div class=""><p><i>If you like the plugin please leave us a %1$s review!</i><p></div>', 'wf_customer_import_export'), '<a href="https://wordpress.org/support/plugin/users-customers-import-export-for-wp-woocommerce/reviews?rate=5#new-post" target="_blank" class="xa-pipe-rating-link" data-reviewed="' . esc_attr__('Thanks for the review.', 'wf_customer_import_export') . '">&#9733;&#9733;&#9733;&#9733;&#9733;</a>');
113
+ ?>
114
+ </div>
115
+ </div>
includes/views/html-wf-admin-screen.php CHANGED
@@ -1,17 +1,24 @@
1
- <div class="wrap woocommerce">
2
- <div class="icon32" id="icon-woocommerce-importer"><br></div>
3
- <h2 class="nav-tab-wrapper woo-nav-tab-wrapper">
4
- <a href="<?php echo admin_url('admin.php?page=hf_wordpress_customer_im_ex') ?>" class="nav-tab <?php echo ($tab == 'import') ? 'nav-tab-active' : ''; ?>"><?php _e('User/Customer Import / Export', 'wf_customer_import_export'); ?></a>
5
- </h2>
6
-
7
- <?php
8
- switch ($tab) {
9
- case "export" :
10
- $this->admin_export_page();
11
- break;
12
- default :
13
- $this->admin_import_page();
14
- break;
15
- }
16
- ?>
 
 
 
 
 
 
 
17
  </div>
1
+ <div class="wrap woocommerce">
2
+ <div class="icon32" id="icon-woocommerce-importer"><br></div>
3
+ <h2 class="nav-tab-wrapper woo-nav-tab-wrapper">
4
+ <a href="<?php echo admin_url('admin.php?page=hf_wordpress_customer_im_ex') ?>" class="nav-tab <?php echo ($tab == 'export') ? 'nav-tab-active' : ''; ?>"><?php _e('User/Customer Export', 'wf_customer_import_export'); ?></a>
5
+ <a href="<?php echo admin_url('admin.php?import=wordpress_hf_user_csv') ?>" class="nav-tab <?php echo ($tab == 'import') ? 'nav-tab-active' : ''; ?>"><?php _e('User/Customer Import', 'wf_customer_import_export'); ?></a>
6
+ <a href="<?php echo admin_url('admin.php?page=hf_wordpress_customer_im_ex&tab=help'); ?>" class="nav-tab <?php echo ('help' == $tab) ? 'nav-tab-active' : ''; ?>"><?php _e('Help', 'wf_csv_import_export'); ?></a>
7
+ <a href="https://www.xadapter.com/product/wordpress-users-woocommerce-customers-import-export/" target="_blank" class="nav-tab nav-tab-premium"><?php _e('Upgrade to Premium for More Features', 'wf_csv_import_export'); ?></a>
8
+ </h2>
9
+ <?php
10
+ switch ($tab) {
11
+ case "export" :
12
+ $this->admin_export_page();
13
+ include_once("export/market.php");
14
+ break;
15
+ case "help" :
16
+ $this->admin_help_page();
17
+ break;
18
+ default :
19
+ $this->admin_export_page();
20
+ break;
21
+ }
22
+ ?>
23
+
24
  </div>
includes/views/html-wf-help-guide.php ADDED
@@ -0,0 +1,56 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if ( ! defined( 'ABSPATH' ) ) {
3
+ exit;
4
+ }
5
+ ?>
6
+ <style>
7
+ .help-guide .cols {
8
+ display: flex;
9
+ }
10
+ .help-guide .inner-panel {
11
+ padding: 40px;
12
+ background-color: #FFF;
13
+ margin: 15px 10px;
14
+ box-shadow: 1px 1px 5px 1px rgba(0,0,0,.1);
15
+ text-align: center;
16
+ }
17
+ .help-guide .inner-panel p{
18
+ margin-bottom: 20px;
19
+ }
20
+ .help-guide .inner-panel img{
21
+ margin:30px 15px 0;
22
+ }
23
+
24
+ </style>
25
+ <div class="pipe-main-box">
26
+ <div class="tool-box bg-white p-20p pipe-view">
27
+ <div id="tab-help" class="coltwo-col panel help-guide">
28
+ <div class="cols">
29
+ <div class="inner-panel" style="">
30
+ <img src="<?php echo plugins_url(basename(plugin_dir_path(WF_CustomerImpExpCsv_FILE))) . '/images/video.png'; ?>"/>
31
+ <h3><?php _e('How-to-setup', 'wf_customer_import_export'); ?></h3>
32
+ <p style=""><?php _e('Get to know about our produt in 3 minutes with this video', 'wf_customer_import_export'); ?></p>
33
+ <a href="https://www.xadapter.com/setting-wordpress-users-woocommerce-customers-import-export-plugin/" target="_blank" class="button button-primary">
34
+ <?php _e('Setup Guide', 'wf_customer_import_export'); ?></a>
35
+ </div>
36
+
37
+ <div class="inner-panel" style="">
38
+ <img src="<?php echo plugins_url(basename(plugin_dir_path(WF_CustomerImpExpCsv_FILE))) . '/images/documentation.png'; ?>"/>
39
+ <h3><?php _e('Documentation', 'wf_customer_import_export'); ?></h3>
40
+ <p style=""><?php _e('Refer to our documentation to set and get started', 'wf_customer_import_export'); ?></p>
41
+ <a target="_blank" href="https://www.xadapter.com/category/documentation/wordpress-users-woocommerce-customers-import-export/" class="button-primary"><?php _e('Documentation', 'wf_customer_import_export'); ?></a>
42
+ </div>
43
+
44
+ <div class="inner-panel" style="">
45
+ <img src="<?php echo plugins_url(basename(plugin_dir_path(WF_CustomerImpExpCsv_FILE))) . '/images/support.png'; ?>"/>
46
+ <h3><?php _e('Support', 'wf_customer_import_export'); ?></h3>
47
+ <p style=""><?php _e('We would love to help you on any queries or issues.', 'wf_customer_import_export'); ?></p>
48
+ <a href="https://support.xadapter.com/hc/en-us/requests/new?" target="_blank" class="button button-primary">
49
+ <?php _e('Contact Us', 'wf_customer_import_export'); ?></a>
50
+ </div>
51
+ </div>
52
+ </div>
53
+ </div>
54
+ <?php include_once("export/market.php"); ?>
55
+ <div class="clearfix"></div>
56
+ </div>
includes/views/import/html-wf-import-customers.php CHANGED
@@ -1,11 +1,8 @@
1
- <?php
2
- include_once("market.php");
3
- ?>
4
- <div class="tool-box">
5
- <h3 class="title"><?php _e('Import Users in CSV Format:', 'wf_customer_import_export'); ?></h3>
6
- <p><?php _e('Import Users in CSV format from your computer', 'wf_customer_import_export'); ?></p>
7
- <p class="submit">
8
- <?php $import_url = admin_url('admin.php?import=wordpress_hf_user_csv'); ?>
9
- <a class="button button-primary" id="mylink" href="<?php echo $import_url; ?>"><?php _e('Import Users', 'wf_customer_import_export'); ?></a>
10
- </p>
11
  </div>
1
+ <div class="tool-box">
2
+ <h3 class="title"><?php _e('Import Users in CSV Format:', 'wf_customer_import_export'); ?></h3>
3
+ <p><?php _e('Import Users in CSV format from your computer', 'wf_customer_import_export'); ?></p>
4
+ <p class="submit">
5
+ <?php $import_url = admin_url('admin.php?import=wordpress_hf_user_csv'); ?>
6
+ <a class="button button-primary" id="mylink" href="<?php echo $import_url; ?>"><?php _e('Import Users', 'wf_customer_import_export'); ?></a>
7
+ </p>
 
 
 
8
  </div>
includes/views/import/market.php DELETED
@@ -1,93 +0,0 @@
1
- <style>
2
- .box14{
3
- width: 30%;
4
- margin-top:2px;
5
- min-height: 310px;
6
- margin-right: 10px;
7
- padding:10px;
8
- position:absolute;
9
- z-index:1;
10
- right:0px;
11
- float:right;
12
- background: -webkit-gradient(linear, 0% 20%, 0% 92%, from(#fff), to(#f3f3f3), color-stop(.1,#fff));
13
- border: 1px solid #ccc;
14
- -webkit-border-radius: 60px 5px;
15
- -webkit-box-shadow: 0px 0px 35px rgba(0, 0, 0, 0.1) inset;
16
- }
17
- .box14_ribbon{
18
- position:absolute;
19
- top:0; right: 0;
20
- width: 130px;
21
- height: 40px;
22
- background: -webkit-gradient(linear, 555% 20%, 0% 92%, from(rgba(0, 0, 0, 0.1)), to(rgba(0, 0, 0, 0.0)), color-stop(.1,rgba(0, 0, 0, 0.2)));
23
- border-left: 1px dashed rgba(0, 0, 0, 0.1);
24
- border-right: 1px dashed rgba(0, 0, 0, 0.1);
25
- -webkit-box-shadow: 0px 0px 12px rgba(0, 0, 0, 0.2);
26
- -webkit-transform: rotate(6deg) skew(0,0) translate(-60%,-5px);
27
- }
28
- .box14 h3
29
- {
30
- text-align:center;
31
- margin:2px;
32
- }
33
- .box14 p
34
- {
35
- text-align:center;
36
- margin:2px;
37
- border-width:1px;
38
- border-style:solid;
39
- padding:5px;
40
- border-color: rgb(204, 204, 204);
41
- }
42
- .box14 span
43
- {
44
- background:#fff;
45
- padding:5px;
46
- display:block;
47
- box-shadow:green 0px 3px inset;
48
- margin-top:10px;
49
- }
50
- .box14 img {
51
- width: 40%;
52
- padding-left:30%;
53
- margin-top: 5px;
54
- }
55
- .table-box-main {
56
- box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24);
57
- transition: all 0.3s cubic-bezier(.25,.8,.25,1);
58
- }
59
-
60
- .table-box-main:hover {
61
- box-shadow: 0 14px 28px rgba(0,0,0,0.25), 0 10px 10px rgba(0,0,0,0.22);
62
- }
63
- </style>
64
- <div class="box14 table-box-main">
65
- <h3>
66
- <center><a href="https://www.xadapter.com/" target="_blank" style="text-decoration: none;color:black;" >XAdapter</a></center></h3>
67
- <hr>
68
- <img src="https://cdn.xadapter.com/wp-content/uploads/2016/10/4-WordPress-Users-WooCommerce-Customers-Import-Export-Plugin.jpg">
69
- <h3>WordPress Users & WooCommerce Customers Import Export Plugin</h3>
70
-
71
- <br /> <center><a href="http://www.xadapter.com/product/wordpress-users-woocommerce-customers-import-export/" target="_blank" class="button button-primary">Upgrade to Premium Version</a></center>
72
- <span>
73
- <ul style="list-style: disc; margin-left: 1px;">
74
- <li style='color:red;'><strong><?php _e('Your Business is precious! Go Premium!','wf_customer_import_export'); ?></strong></li>
75
-
76
- <li><?php _e('HikeForce Import Export Users Plugin Premium version helps you to seamlessly import/export Customer details into your Woocommerce Store.', 'wf_customer_import_export'); ?></li>
77
-
78
- <li><?php _e('Export/Import WooCommerce Customer details into a CSV file.', 'wf_customer_import_export'); ?><strong><?php _e('( Basic version supports only WordPress User details )', 'wf_customer_import_export'); ?></strong></li>
79
- <li><?php _e('Option to choose All Roles or Multiple Roles while export (Basic Supports only single role at a time).', 'wf_customer_import_export'); ?></li>
80
- <li><?php _e('Various Filter options for exporting Customers.', 'wf_customer_import_export'); ?></li>
81
- <li><?php _e('Various Filter options for exporting Customers.', 'wf_customer_import_export'); ?></li>
82
- <li><?php _e('Map and Transform fields while Importing Customers.', 'wf_customer_import_export'); ?></li>
83
- <li><?php _e('Change values while improting Customers using Evaluation Fields.', 'wf_customer_import_export'); ?></li>
84
- <li><?php _e('Choice to Update or Skip existing imported Customers.', 'wf_customer_import_export'); ?></li>
85
- <li><?php _e('Choice to Send or Skip Emails for newly imported Customers.', 'wf_customer_import_export'); ?></li>
86
- <li><?php _e('WPML Supported. French language support Out of the Box.', 'wf_customer_import_export'); ?></li>
87
- <li><?php _e('Import/Export file from/to a remote server via FTP in Scheduled time interval with Cron Job.', 'wf_customer_import_export'); ?></li>
88
- <li><?php _e('Excellent Support for setting it up!', 'wf_customer_import_export'); ?></li>
89
- </ul>
90
- </span>
91
-
92
- <center> <a href="https://www.xadapter.com/category/documentation/wordpress-users-woocommerce-customers-import-export/" target="_blank" class="button button-primary">Documentation</a> <a href="http://userexportimportwoodemo.hikeforce.com/wp-login.php?redirect_to=http%3A%2F%2Fuserexportimportwoodemo.hikeforce.com%2Fwp-admin%2Fadmin.php%3Fpage%3Dhf_wordpress_customer_im_ex&reauth=1" target="_blank" class="button button-primary">Live Demo</a> <a href="<?php echo plugins_url( 'Sample_Users.csv', WF_CustomerImpExpCsv_FILE ); ?>" target="_blank" class="button button-primary"><?php _e('Sample User CSV', 'wf_customer_import_export'); ?></a></center>
93
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
license.txt CHANGED
@@ -1,708 +1,708 @@
1
- WordPress Users & WooCommerce Customers Import Export
2
-
3
- Copyright 2015 by the contributors
4
-
5
- This program is free software; you can redistribute it and/or modify
6
- it under the terms of the GNU General Public License as published by
7
- the Free Software Foundation; either version 3 of the License, or
8
- (at your option) any later version.
9
-
10
- This program is distributed in the hope that it will be useful,
11
- but WITHOUT ANY WARRANTY; without even the implied warranty of
12
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
- GNU General Public License for more details.
14
-
15
- You should have received a copy of the GNU General Public License
16
- along with this program; if not, write to the Free Software
17
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18
-
19
- This program incorporates work covered by the following copyright and
20
- permission notices:
21
-
22
- WordPress Users & WooCommerce Customers Import Export
23
- Copyright: 2015-2017 Hikeforce.
24
- License: GNU General Public License v3.0
25
- License URI: http://www.gnu.org/licenses/gpl-3.0.html
26
-
27
- and
28
-
29
- HikeForce
30
-
31
- WordPress Users & WooCommerce Customers Import Export is released under the GPL
32
-
33
- =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
34
-
35
- GNU GENERAL PUBLIC LICENSE
36
- Version 3, 29 June 2007
37
-
38
- Copyright © 2007 Free Software Foundation, Inc. <http://fsf.org/>
39
- Everyone is permitted to copy and distribute verbatim copies
40
- of this license document, but changing it is not allowed.
41
-
42
- Preamble
43
-
44
- The GNU General Public License is a free, copyleft license for
45
- software and other kinds of works.
46
-
47
- The licenses for most software and other practical works are designed
48
- to take away your freedom to share and change the works. By contrast,
49
- the GNU General Public License is intended to guarantee your freedom to
50
- share and change all versions of a program--to make sure it remains free
51
- software for all its users. We, the Free Software Foundation, use the
52
- GNU General Public License for most of our software; it applies also to
53
- any other work released this way by its authors. You can apply it to
54
- your programs, too.
55
-
56
- When we speak of free software, we are referring to freedom, not
57
- price. Our General Public Licenses are designed to make sure that you
58
- have the freedom to distribute copies of free software (and charge for
59
- them if you wish), that you receive source code or can get it if you
60
- want it, that you can change the software or use pieces of it in new
61
- free programs, and that you know you can do these things.
62
-
63
- To protect your rights, we need to prevent others from denying you
64
- these rights or asking you to surrender the rights. Therefore, you have
65
- certain responsibilities if you distribute copies of the software, or if
66
- you modify it: responsibilities to respect the freedom of others.
67
-
68
- For example, if you distribute copies of such a program, whether
69
- gratis or for a fee, you must pass on to the recipients the same
70
- freedoms that you received. You must make sure that they, too, receive
71
- or can get the source code. And you must show them these terms so they
72
- know their rights.
73
-
74
- Developers that use the GNU GPL protect your rights with two steps:
75
- (1) assert copyright on the software, and (2) offer you this License
76
- giving you legal permission to copy, distribute and/or modify it.
77
-
78
- For the developers' and authors' protection, the GPL clearly explains
79
- that there is no warranty for this free software. For both users' and
80
- authors' sake, the GPL requires that modified versions be marked as
81
- changed, so that their problems will not be attributed erroneously to
82
- authors of previous versions.
83
-
84
- Some devices are designed to deny users access to install or run
85
- modified versions of the software inside them, although the manufacturer
86
- can do so. This is fundamentally incompatible with the aim of
87
- protecting users' freedom to change the software. The systematic
88
- pattern of such abuse occurs in the area of products for individuals to
89
- use, which is precisely where it is most unacceptable. Therefore, we
90
- have designed this version of the GPL to prohibit the practice for those
91
- products. If such problems arise substantially in other domains, we
92
- stand ready to extend this provision to those domains in future versions
93
- of the GPL, as needed to protect the freedom of users.
94
-
95
- Finally, every program is threatened constantly by software patents.
96
- States should not allow patents to restrict development and use of
97
- software on general-purpose computers, but in those that do, we wish to
98
- avoid the special danger that patents applied to a free program could
99
- make it effectively proprietary. To prevent this, the GPL assures that
100
- patents cannot be used to render the program non-free.
101
-
102
- The precise terms and conditions for copying, distribution and
103
- modification follow.
104
-
105
- TERMS AND CONDITIONS
106
-
107
- 0. Definitions.
108
-
109
- "This License" refers to version 3 of the GNU General Public License.
110
-
111
- "Copyright" also means copyright-like laws that apply to other kinds of
112
- works, such as semiconductor masks.
113
-
114
- "The Program" refers to any copyrightable work licensed under this
115
- License. Each licensee is addressed as "you". "Licensees" and
116
- "recipients" may be individuals or organizations.
117
-
118
- To "modify" a work means to copy from or adapt all or part of the work
119
- in a fashion requiring copyright permission, other than the making of an
120
- exact copy. The resulting work is called a "modified version" of the
121
- earlier work or a work "based on" the earlier work.
122
-
123
- A "covered work" means either the unmodified Program or a work based
124
- on the Program.
125
-
126
- To "propagate" a work means to do anything with it that, without
127
- permission, would make you directly or secondarily liable for
128
- infringement under applicable copyright law, except executing it on a
129
- computer or modifying a private copy. Propagation includes copying,
130
- distribution (with or without modification), making available to the
131
- public, and in some countries other activities as well.
132
-
133
- To "convey" a work means any kind of propagation that enables other
134
- parties to make or receive copies. Mere interaction with a user through
135
- a computer network, with no transfer of a copy, is not conveying.
136
-
137
- An interactive user interface displays "Appropriate Legal Notices"
138
- to the extent that it includes a convenient and prominently visible
139
- feature that (1) displays an appropriate copyright notice, and (2)
140
- tells the user that there is no warranty for the work (except to the
141
- extent that warranties are provided), that licensees may convey the
142
- work under this License, and how to view a copy of this License. If
143
- the interface presents a list of user commands or options, such as a
144
- menu, a prominent item in the list meets this criterion.
145
-
146
- 1. Source Code.
147
-
148
- The "source code" for a work means the preferred form of the work
149
- for making modifications to it. "Object code" means any non-source
150
- form of a work.
151
-
152
- A "Standard Interface" means an interface that either is an official
153
- standard defined by a recognized standards body, or, in the case of
154
- interfaces specified for a particular programming language, one that
155
- is widely used among developers working in that language.
156
-
157
- The "System Libraries" of an executable work include anything, other
158
- than the work as a whole, that (a) is included in the normal form of
159
- packaging a Major Component, but which is not part of that Major
160
- Component, and (b) serves only to enable use of the work with that
161
- Major Component, or to implement a Standard Interface for which an
162
- implementation is available to the public in source code form. A
163
- "Major Component", in this context, means a major essential component
164
- (kernel, window system, and so on) of the specific operating system
165
- (if any) on which the executable work runs, or a compiler used to
166
- produce the work, or an object code interpreter used to run it.
167
-
168
- The "Corresponding Source" for a work in object code form means all
169
- the source code needed to generate, install, and (for an executable
170
- work) run the object code and to modify the work, including scripts to
171
- control those activities. However, it does not include the work's
172
- System Libraries, or general-purpose tools or generally available free
173
- programs which are used unmodified in performing those activities but
174
- which are not part of the work. For example, Corresponding Source
175
- includes interface definition files associated with source files for
176
- the work, and the source code for shared libraries and dynamically
177
- linked subprograms that the work is specifically designed to require,
178
- such as by intimate data communication or control flow between those
179
- subprograms and other parts of the work.
180
-
181
- The Corresponding Source need not include anything that users
182
- can regenerate automatically from other parts of the Corresponding
183
- Source.
184
-
185
- The Corresponding Source for a work in source code form is that
186
- same work.
187
-
188
- 2. Basic Permissions.
189
-
190
- All rights granted under this License are granted for the term of
191
- copyright on the Program, and are irrevocable provided the stated
192
- conditions are met. This License explicitly affirms your unlimited
193
- permission to run the unmodified Program. The output from running a
194
- covered work is covered by this License only if the output, given its
195
- content, constitutes a covered work. This License acknowledges your
196
- rights of fair use or other equivalent, as provided by copyright law.
197
-
198
- You may make, run and propagate covered works that you do not
199
- convey, without conditions so long as your license otherwise remains
200
- in force. You may convey covered works to others for the sole purpose
201
- of having them make modifications exclusively for you, or provide you
202
- with facilities for running those works, provided that you comply with
203
- the terms of this License in conveying all material for which you do
204
- not control copyright. Those thus making or running the covered works
205
- for you must do so exclusively on your behalf, under your direction
206
- and control, on terms that prohibit them from making any copies of
207
- your copyrighted material outside their relationship with you.
208
-
209
- Conveying under any other circumstances is permitted solely under
210
- the conditions stated below. Sublicensing is not allowed; section 10
211
- makes it unnecessary.
212
-
213
- 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
214
-
215
- No covered work shall be deemed part of an effective technological
216
- measure under any applicable law fulfilling obligations under article
217
- 11 of the WIPO copyright treaty adopted on 20 December 1996, or
218
- similar laws prohibiting or restricting circumvention of such
219
- measures.
220
-
221
- When you convey a covered work, you waive any legal power to forbid
222
- circumvention of technological measures to the extent such circumvention
223
- is effected by exercising rights under this License with respect to
224
- the covered work, and you disclaim any intention to limit operation or
225
- modification of the work as a means of enforcing, against the work's
226
- users, your or third parties' legal rights to forbid circumvention of
227
- technological measures.
228
-
229
- 4. Conveying Verbatim Copies.
230
-
231
- You may convey verbatim copies of the Program's source code as you
232
- receive it, in any medium, provided that you conspicuously and
233
- appropriately publish on each copy an appropriate copyright notice;
234
- keep intact all notices stating that this License and any
235
- non-permissive terms added in accord with section 7 apply to the code;
236
- keep intact all notices of the absence of any warranty; and give all
237
- recipients a copy of this License along with the Program.
238
-
239
- You may charge any price or no price for each copy that you convey,
240
- and you may offer support or warranty protection for a fee.
241
-
242
- 5. Conveying Modified Source Versions.
243
-
244
- You may convey a work based on the Program, or the modifications to
245
- produce it from the Program, in the form of source code under the
246
- terms of section 4, provided that you also meet all of these conditions:
247
-
248
- a) The work must carry prominent notices stating that you modified
249
- it, and giving a relevant date.
250
-
251
- b) The work must carry prominent notices stating that it is
252
- released under this License and any conditions added under section
253
- 7. This requirement modifies the requirement in section 4 to
254
- "keep intact all notices".
255
-
256
- c) You must license the entire work, as a whole, under this
257
- License to anyone who comes into possession of a copy. This
258
- License will therefore apply, along with any applicable section 7
259
- additional terms, to the whole of the work, and all its parts,
260
- regardless of how they are packaged. This License gives no
261
- permission to license the work in any other way, but it does not
262
- invalidate such permission if you have separately received it.
263
-
264
- d) If the work has interactive user interfaces, each must display
265
- Appropriate Legal Notices; however, if the Program has interactive
266
- interfaces that do not display Appropriate Legal Notices, your
267
- work need not make them do so.
268
-
269
- A compilation of a covered work with other separate and independent
270
- works, which are not by their nature extensions of the covered work,
271
- and which are not combined with it such as to form a larger program,
272
- in or on a volume of a storage or distribution medium, is called an
273
- "aggregate" if the compilation and its resulting copyright are not
274
- used to limit the access or legal rights of the compilation's users
275
- beyond what the individual works permit. Inclusion of a covered work
276
- in an aggregate does not cause this License to apply to the other
277
- parts of the aggregate.
278
-
279
- 6. Conveying Non-Source Forms.
280
-
281
- You may convey a covered work in object code form under the terms
282
- of sections 4 and 5, provided that you also convey the
283
- machine-readable Corresponding Source under the terms of this License,
284
- in one of these ways:
285
-
286
- a) Convey the object code in, or embodied in, a physical product
287
- (including a physical distribution medium), accompanied by the
288
- Corresponding Source fixed on a durable physical medium
289
- customarily used for software interchange.
290
-
291
- b) Convey the object code in, or embodied in, a physical product
292
- (including a physical distribution medium), accompanied by a
293
- written offer, valid for at least three years and valid for as
294
- long as you offer spare parts or customer support for that product
295
- model, to give anyone who possesses the object code either (1) a
296
- copy of the Corresponding Source for all the software in the
297
- product that is covered by this License, on a durable physical
298
- medium customarily used for software interchange, for a price no
299
- more than your reasonable cost of physically performing this
300
- conveying of source, or (2) access to copy the
301
- Corresponding Source from a network server at no charge.
302
-
303
- c) Convey individual copies of the object code with a copy of the
304
- written offer to provide the Corresponding Source. This
305
- alternative is allowed only occasionally and noncommercially, and
306
- only if you received the object code with such an offer, in accord
307
- with subsection 6b.
308
-
309
- d) Convey the object code by offering access from a designated
310
- place (gratis or for a charge), and offer equivalent access to the
311
- Corresponding Source in the same way through the same place at no
312
- further charge. You need not require recipients to copy the
313
- Corresponding Source along with the object code. If the place to
314
- copy the object code is a network server, the Corresponding Source
315
- may be on a different server (operated by you or a third party)
316
- that supports equivalent copying facilities, provided you maintain
317
- clear directions next to the object code saying where to find the
318
- Corresponding Source. Regardless of what server hosts the
319
- Corresponding Source, you remain obligated to ensure that it is
320
- available for as long as needed to satisfy these requirements.
321
-
322
- e) Convey the object code using peer-to-peer transmission, provided
323
- you inform other peers where the object code and Corresponding
324
- Source of the work are being offered to the general public at no
325
- charge under subsection 6d.
326
-
327
- A separable portion of the object code, whose source code is excluded
328
- from the Corresponding Source as a System Library, need not be
329
- included in conveying the object code work.
330
-
331
- A "User Product" is either (1) a "consumer product", which means any
332
- tangible personal property which is normally used for personal, family,
333
- or household purposes, or (2) anything designed or sold for incorporation
334
- into a dwelling. In determining whether a product is a consumer product,
335
- doubtful cases shall be resolved in favor of coverage. For a particular
336
- product received by a particular user, "normally used" refers to a
337
- typical or common use of that class of product, regardless of the status
338
- of the particular user or of the way in which the particular user
339
- actually uses, or expects or is expected to use, the product. A product
340
- is a consumer product regardless of whether the product has substantial
341
- commercial, industrial or non-consumer uses, unless such uses represent
342
- the only significant mode of use of the product.
343
-
344
- "Installation Information" for a User Product means any methods,
345
- procedures, authorization keys, or other information required to install
346
- and execute modified versions of a covered work in that User Product from
347
- a modified version of its Corresponding Source. The information must
348
- suffice to ensure that the continued functioning of the modified object
349
- code is in no case prevented or interfered with solely because
350
- modification has been made.
351
-
352
- If you convey an object code work under this section in, or with, or
353
- specifically for use in, a User Product, and the conveying occurs as
354
- part of a transaction in which the right of possession and use of the
355
- User Product is transferred to the recipient in perpetuity or for a
356
- fixed term (regardless of how the transaction is characterized), the
357
- Corresponding Source conveyed under this section must be accompanied
358
- by the Installation Information. But this requirement does not apply
359
- if neither you nor any third party retains the ability to install
360
- modified object code on the User Product (for example, the work has
361
- been installed in ROM).
362
-
363
- The requirement to provide Installation Information does not include a
364
- requirement to continue to provide support service, warranty, or updates
365
- for a work that has been modified or installed by the recipient, or for
366
- the User Product in which it has been modified or installed. Access to a
367
- network may be denied when the modification itself materially and
368
- adversely affects the operation of the network or violates the rules and
369
- protocols for communication across the network.
370
-
371
- Corresponding Source conveyed, and Installation Information provided,
372
- in accord with this section must be in a format that is publicly
373
- documented (and with an implementation available to the public in
374
- source code form), and must require no special password or key for
375
- unpacking, reading or copying.
376
-
377
- 7. Additional Terms.
378
-
379
- "Additional permissions" are terms that supplement the terms of this
380
- License by making exceptions from one or more of its conditions.
381
- Additional permissions that are applicable to the entire Program shall
382
- be treated as though they were included in this License, to the extent
383
- that they are valid under applicable law. If additional permissions
384
- apply only to part of the Program, that part may be used separately
385
- under those permissions, but the entire Program remains governed by
386
- this License without regard to the additional permissions.
387
-
388
- When you convey a copy of a covered work, you may at your option
389
- remove any additional permissions from that copy, or from any part of
390
- it. (Additional permissions may be written to require their own
391
- removal in certain cases when you modify the work.) You may place
392
- additional permissions on material, added by you to a covered work,
393
- for which you have or can give appropriate copyright permission.
394
-
395
- Notwithstanding any other provision of this License, for material you
396
- add to a covered work, you may (if authorized by the copyright holders of
397
- that material) supplement the terms of this License with terms:
398
-
399
- a) Disclaiming warranty or limiting liability differently from the
400
- terms of sections 15 and 16 of this License; or
401
-
402
- b) Requiring preservation of specified reasonable legal notices or
403
- author attributions in that material or in the Appropriate Legal
404
- Notices displayed by works containing it; or
405
-
406
- c) Prohibiting misrepresentation of the origin of that material, or
407
- requiring that modified versions of such material be marked in
408
- reasonable ways as different from the original version; or
409
-
410
- d) Limiting the use for publicity purposes of names of licensors or
411
- authors of the material; or
412
-
413
- e) Declining to grant rights under trademark law for use of some
414
- trade names, trademarks, or service marks; or
415
-
416
- f) Requiring indemnification of licensors and authors of that
417
- material by anyone who conveys the material (or modified versions of
418
- it) with contractual assumptions of liability to the recipient, for
419
- any liability that these contractual assumptions directly impose on
420
- those licensors and authors.
421
-
422
- All other non-permissive additional terms are considered "further
423
- restrictions" within the meaning of section 10. If the Program as you
424
- received it, or any part of it, contains a notice stating that it is
425
- governed by this License along with a term that is a further
426
- restriction, you may remove that term. If a license document contains
427
- a further restriction but permits relicensing or conveying under this
428
- License, you may add to a covered work material governed by the terms
429
- of that license document, provided that the further restriction does
430
- not survive such relicensing or conveying.
431
-
432
- If you add terms to a covered work in accord with this section, you
433
- must place, in the relevant source files, a statement of the
434
- additional terms that apply to those files, or a notice indicating
435
- where to find the applicable terms.
436
-
437
- Additional terms, permissive or non-permissive, may be stated in the
438
- form of a separately written license, or stated as exceptions;
439
- the above requirements apply either way.
440
-
441
- 8. Termination.
442
-
443
- You may not propagate or modify a covered work except as expressly
444
- provided under this License. Any attempt otherwise to propagate or
445
- modify it is void, and will automatically terminate your rights under
446
- this License (including any patent licenses granted under the third
447
- paragraph of section 11).
448
-
449
- However, if you cease all violation of this License, then your
450
- license from a particular copyright holder is reinstated (a)
451
- provisionally, unless and until the copyright holder explicitly and
452
- finally terminates your license, and (b) permanently, if the copyright
453
- holder fails to notify you of the violation by some reasonable means
454
- prior to 60 days after the cessation.
455
-
456
- Moreover, your license from a particular copyright holder is
457
- reinstated permanently if the copyright holder notifies you of the
458
- violation by some reasonable means, this is the first time you have
459
- received notice of violation of this License (for any work) from that
460
- copyright holder, and you cure the violation prior to 30 days after
461
- your receipt of the notice.
462
-
463
- Termination of your rights under this section does not terminate the
464
- licenses of parties who have received copies or rights from you under
465
- this License. If your rights have been terminated and not permanently
466
- reinstated, you do not qualify to receive new licenses for the same
467
- material under section 10.
468
-
469
- 9. Acceptance Not Required for Having Copies.
470
-
471
- You are not required to accept this License in order to receive or
472
- run a copy of the Program. Ancillary propagation of a covered work
473
- occurring solely as a consequence of using peer-to-peer transmission
474
- to receive a copy likewise does not require acceptance. However,
475
- nothing other than this License grants you permission to propagate or
476
- modify any covered work. These actions infringe copyright if you do
477
- not accept this License. Therefore, by modifying or propagating a
478
- covered work, you indicate your acceptance of this License to do so.
479
-
480
- 10. Automatic Licensing of Downstream Recipients.
481
-
482
- Each time you convey a covered work, the recipient automatically
483
- receives a license from the original licensors, to run, modify and
484
- propagate that work, subject to this License. You are not responsible
485
- for enforcing compliance by third parties with this License.
486
-
487
- An "entity transaction" is a transaction transferring control of an
488
- organization, or substantially all assets of one, or subdividing an
489
- organization, or merging organizations. If propagation of a covered
490
- work results from an entity transaction, each party to that
491
- transaction who receives a copy of the work also receives whatever
492
- licenses to the work the party's predecessor in interest had or could
493
- give under the previous paragraph, plus a right to possession of the
494
- Corresponding Source of the work from the predecessor in interest, if
495
- the predecessor has it or can get it with reasonable efforts.
496
-
497
- You may not impose any further restrictions on the exercise of the
498
- rights granted or affirmed under this License. For example, you may
499
- not impose a license fee, royalty, or other charge for exercise of
500
- rights granted under this License, and you may not initiate litigation
501
- (including a cross-claim or counterclaim in a lawsuit) alleging that
502
- any patent claim is infringed by making, using, selling, offering for
503
- sale, or importing the Program or any portion of it.
504
-
505
- 11. Patents.
506
-
507
- A "contributor" is a copyright holder who authorizes use under this
508
- License of the Program or a work on which the Program is based. The
509
- work thus licensed is called the contributor's "contributor version".
510
-
511
- A contributor's "essential patent claims" are all patent claims
512
- owned or controlled by the contributor, whether already acquired or
513
- hereafter acquired, that would be infringed by some manner, permitted
514
- by this License, of making, using, or selling its contributor version,
515
- but do not include claims that would be infringed only as a
516
- consequence of further modification of the contributor version. For
517
- purposes of this definition, "control" includes the right to grant
518
- patent sublicenses in a manner consistent with the requirements of
519
- this License.
520
-
521
- Each contributor grants you a non-exclusive, worldwide, royalty-free
522
- patent license under the contributor's essential patent claims, to
523
- make, use, sell, offer for sale, import and otherwise run, modify and
524
- propagate the contents of its contributor version.
525
-
526
- In the following three paragraphs, a "patent license" is any express
527
- agreement or commitment, however denominated, not to enforce a patent
528
- (such as an express permission to practice a patent or covenant not to
529
- sue for patent infringement). To "grant" such a patent license to a
530
- party means to make such an agreement or commitment not to enforce a
531
- patent against the party.
532
-
533
- If you convey a covered work, knowingly relying on a patent license,
534
- and the Corresponding Source of the work is not available for anyone
535
- to copy, free of charge and under the terms of this License, through a
536
- publicly available network server or other readily accessible means,
537
- then you must either (1) cause the Corresponding Source to be so
538
- available, or (2) arrange to deprive yourself of the benefit of the
539
- patent license for this particular work, or (3) arrange, in a manner
540
- consistent with the requirements of this License, to extend the patent
541
- license to downstream recipients. "Knowingly relying" means you have
542
- actual knowledge that, but for the patent license, your conveying the
543
- covered work in a country, or your recipient's use of the covered work
544
- in a country, would infringe one or more identifiable patents in that
545
- country that you have reason to believe are valid.
546
-
547
- If, pursuant to or in connection with a single transaction or
548
- arrangement, you convey, or propagate by procuring conveyance of, a
549
- covered work, and grant a patent license to some of the parties
550
- receiving the covered work authorizing them to use, propagate, modify
551
- or convey a specific copy of the covered work, then the patent license
552
- you grant is automatically extended to all recipients of the covered
553
- work and works based on it.
554
-
555
- A patent license is "discriminatory" if it does not include within
556
- the scope of its coverage, prohibits the exercise of, or is
557
- conditioned on the non-exercise of one or more of the rights that are
558
- specifically granted under this License. You may not convey a covered
559
- work if you are a party to an arrangement with a third party that is
560
- in the business of distributing software, under which you make payment
561
- to the third party based on the extent of your activity of conveying
562
- the work, and under which the third party grants, to any of the
563
- parties who would receive the covered work from you, a discriminatory
564
- patent license (a) in connection with copies of the covered work
565
- conveyed by you (or copies made from those copies), or (b) primarily
566
- for and in connection with specific products or compilations that
567
- contain the covered work, unless you entered into that arrangement,
568
- or that patent license was granted, prior to 28 March 2007.
569
-
570
- Nothing in this License shall be construed as excluding or limiting
571
- any implied license or other defenses to infringement that may
572
- otherwise be available to you under applicable patent law.
573
-
574
- 12. No Surrender of Others' Freedom.
575
-
576
- If conditions are imposed on you (whether by court order, agreement or
577
- otherwise) that contradict the conditions of this License, they do not
578
- excuse you from the conditions of this License. If you cannot convey a
579
- covered work so as to satisfy simultaneously your obligations under this
580
- License and any other pertinent obligations, then as a consequence you may
581
- not convey it at all. For example, if you agree to terms that obligate you
582
- to collect a royalty for further conveying from those to whom you convey
583
- the Program, the only way you could satisfy both those terms and this
584
- License would be to refrain entirely from conveying the Program.
585
-
586
- 13. Use with the GNU Affero General Public License.
587
-
588
- Notwithstanding any other provision of this License, you have
589
- permission to link or combine any covered work with a work licensed
590
- under version 3 of the GNU Affero General Public License into a single
591
- combined work, and to convey the resulting work. The terms of this
592
- License will continue to apply to the part which is the covered work,
593
- but the special requirements of the GNU Affero General Public License,
594
- section 13, concerning interaction through a network will apply to the
595
- combination as such.
596
-
597
- 14. Revised Versions of this License.
598
-
599
- The Free Software Foundation may publish revised and/or new versions of
600
- the GNU General Public License from time to time. Such new versions will
601
- be similar in spirit to the present version, but may differ in detail to
602
- address new problems or concerns.
603
-
604
- Each version is given a distinguishing version number. If the
605
- Program specifies that a certain numbered version of the GNU General
606
- Public License "or any later version" applies to it, you have the
607
- option of following the terms and conditions either of that numbered
608
- version or of any later version published by the Free Software
609
- Foundation. If the Program does not specify a version number of the
610
- GNU General Public License, you may choose any version ever published
611
- by the Free Software Foundation.
612
-
613
- If the Program specifies that a proxy can decide which future
614
- versions of the GNU General Public License can be used, that proxy's
615
- public statement of acceptance of a version permanently authorizes you
616
- to choose that version for the Program.
617
-
618
- Later license versions may give you additional or different
619
- permissions. However, no additional obligations are imposed on any
620
- author or copyright holder as a result of your choosing to follow a
621
- later version.
622
-
623
- 15. Disclaimer of Warranty.
624
-
625
- THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
626
- APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
627
- HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
628
- OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
629
- THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
630
- PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
631
- IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
632
- ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
633
-
634
- 16. Limitation of Liability.
635
-
636
- IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
637
- WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
638
- THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
639
- GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
640
- USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
641
- DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
642
- PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
643
- EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
644
- SUCH DAMAGES.
645
-
646
- 17. Interpretation of Sections 15 and 16.
647
-
648
- If the disclaimer of warranty and limitation of liability provided
649
- above cannot be given local legal effect according to their terms,
650
- reviewing courts shall apply local law that most closely approximates
651
- an absolute waiver of all civil liability in connection with the
652
- Program, unless a warranty or assumption of liability accompanies a
653
- copy of the Program in return for a fee.
654
-
655
- END OF TERMS AND CONDITIONS
656
-
657
- How to Apply These Terms to Your New Programs
658
-
659
- If you develop a new program, and you want it to be of the greatest
660
- possible use to the public, the best way to achieve this is to make it
661
- free software which everyone can redistribute and change under these terms.
662
-
663
- To do so, attach the following notices to the program. It is safest
664
- to attach them to the start of each source file to most effectively
665
- state the exclusion of warranty; and each file should have at least
666
- the "copyright" line and a pointer to where the full notice is found.
667
-
668
- <one line to give the program's name and a brief idea of what it does.>
669
- Copyright © <year> <name of author>
670
-
671
- This program is free software: you can redistribute it and/or modify
672
- it under the terms of the GNU General Public License as published by
673
- the Free Software Foundation, either version 3 of the License, or
674
- (at your option) any later version.
675
-
676
- This program is distributed in the hope that it will be useful,
677
- but WITHOUT ANY WARRANTY; without even the implied warranty of
678
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
679
- GNU General Public License for more details.
680
-
681
- You should have received a copy of the GNU General Public License
682
- along with this program. If not, see <http://www.gnu.org/licenses/>.
683
-
684
- Also add information on how to contact you by electronic and paper mail.
685
-
686
- If the program does terminal interaction, make it output a short
687
- notice like this when it starts in an interactive mode:
688
-
689
- <program> Copyright © <year> <name of author>
690
- This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
691
- This is free software, and you are welcome to redistribute it
692
- under certain conditions; type `show c' for details.
693
-
694
- The hypothetical commands `show w' and `show c' should show the appropriate
695
- parts of the General Public License. Of course, your program's commands
696
- might be different; for a GUI interface, you would use an "about box".
697
-
698
- You should also get your employer (if you work as a programmer) or school,
699
- if any, to sign a "copyright disclaimer" for the program, if necessary.
700
- For more information on this, and how to apply and follow the GNU GPL, see
701
- <http://www.gnu.org/licenses/>.
702
-
703
- The GNU General Public License does not permit incorporating your program
704
- into proprietary programs. If your program is a subroutine library, you
705
- may consider it more useful to permit linking proprietary applications with
706
- the library. If this is what you want to do, use the GNU Lesser General
707
- Public License instead of this License. But first, please read
708
  <http://www.gnu.org/philosophy/why-not-lgpl.html>.
1
+ WordPress Users & WooCommerce Customers Import Export
2
+
3
+ Copyright 2018 by the contributors
4
+
5
+ This program is free software; you can redistribute it and/or modify
6
+ it under the terms of the GNU General Public License as published by
7
+ the Free Software Foundation; either version 3 of the License, or
8
+ (at your option) any later version.
9
+
10
+ This program is distributed in the hope that it will be useful,
11
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ GNU General Public License for more details.
14
+
15
+ You should have received a copy of the GNU General Public License
16
+ along with this program; if not, write to the Free Software
17
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18
+
19
+ This program incorporates work covered by the following copyright and
20
+ permission notices:
21
+
22
+ WordPress Users & WooCommerce Customers Import Export
23
+ Copyright: 2015-2018 Hikeforce.
24
+ License: GNU General Public License v3.0
25
+ License URI: http://www.gnu.org/licenses/gpl-3.0.html
26
+
27
+ and
28
+
29
+ HikeForce
30
+
31
+ WordPress Users & WooCommerce Customers Import Export is released under the GPL
32
+
33
+ =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
34
+
35
+ GNU GENERAL PUBLIC LICENSE
36
+ Version 3, 29 June 2007
37
+
38
+ Copyright © 2007 Free Software Foundation, Inc. <http://fsf.org/>
39
+ Everyone is permitted to copy and distribute verbatim copies
40
+ of this license document, but changing it is not allowed.
41
+
42
+ Preamble
43
+
44
+ The GNU General Public License is a free, copyleft license for
45
+ software and other kinds of works.
46
+
47
+ The licenses for most software and other practical works are designed
48
+ to take away your freedom to share and change the works. By contrast,
49
+ the GNU General Public License is intended to guarantee your freedom to
50
+ share and change all versions of a program--to make sure it remains free
51
+ software for all its users. We, the Free Software Foundation, use the
52
+ GNU General Public License for most of our software; it applies also to
53
+ any other work released this way by its authors. You can apply it to
54
+ your programs, too.
55
+
56
+ When we speak of free software, we are referring to freedom, not
57
+ price. Our General Public Licenses are designed to make sure that you
58
+ have the freedom to distribute copies of free software (and charge for
59
+ them if you wish), that you receive source code or can get it if you
60
+ want it, that you can change the software or use pieces of it in new
61
+ free programs, and that you know you can do these things.
62
+
63
+ To protect your rights, we need to prevent others from denying you
64
+ these rights or asking you to surrender the rights. Therefore, you have
65
+ certain responsibilities if you distribute copies of the software, or if
66
+ you modify it: responsibilities to respect the freedom of others.
67
+
68
+ For example, if you distribute copies of such a program, whether
69
+ gratis or for a fee, you must pass on to the recipients the same
70
+ freedoms that you received. You must make sure that they, too, receive
71
+ or can get the source code. And you must show them these terms so they
72
+ know their rights.
73
+
74
+ Developers that use the GNU GPL protect your rights with two steps:
75
+ (1) assert copyright on the software, and (2) offer you this License
76
+ giving you legal permission to copy, distribute and/or modify it.
77
+
78
+ For the developers' and authors' protection, the GPL clearly explains
79
+ that there is no warranty for this free software. For both users' and
80
+ authors' sake, the GPL requires that modified versions be marked as
81
+ changed, so that their problems will not be attributed erroneously to
82
+ authors of previous versions.
83
+
84
+ Some devices are designed to deny users access to install or run
85
+ modified versions of the software inside them, although the manufacturer
86
+ can do so. This is fundamentally incompatible with the aim of
87
+ protecting users' freedom to change the software. The systematic
88
+ pattern of such abuse occurs in the area of products for individuals to
89
+ use, which is precisely where it is most unacceptable. Therefore, we
90
+ have designed this version of the GPL to prohibit the practice for those
91
+ products. If such problems arise substantially in other domains, we
92
+ stand ready to extend this provision to those domains in future versions
93
+ of the GPL, as needed to protect the freedom of users.
94
+
95
+ Finally, every program is threatened constantly by software patents.
96
+ States should not allow patents to restrict development and use of
97
+ software on general-purpose computers, but in those that do, we wish to
98
+ avoid the special danger that patents applied to a free program could
99
+ make it effectively proprietary. To prevent this, the GPL assures that
100
+ patents cannot be used to render the program non-free.
101
+
102
+ The precise terms and conditions for copying, distribution and
103
+ modification follow.
104
+
105
+ TERMS AND CONDITIONS
106
+
107
+ 0. Definitions.
108
+
109
+ "This License" refers to version 3 of the GNU General Public License.
110
+
111
+ "Copyright" also means copyright-like laws that apply to other kinds of
112
+ works, such as semiconductor masks.
113
+
114
+ "The Program" refers to any copyrightable work licensed under this
115
+ License. Each licensee is addressed as "you". "Licensees" and
116
+ "recipients" may be individuals or organizations.
117
+
118
+ To "modify" a work means to copy from or adapt all or part of the work
119
+ in a fashion requiring copyright permission, other than the making of an
120
+ exact copy. The resulting work is called a "modified version" of the
121
+ earlier work or a work "based on" the earlier work.
122
+
123
+ A "covered work" means either the unmodified Program or a work based
124
+ on the Program.
125
+
126
+ To "propagate" a work means to do anything with it that, without
127
+ permission, would make you directly or secondarily liable for
128
+ infringement under applicable copyright law, except executing it on a
129
+ computer or modifying a private copy. Propagation includes copying,
130
+ distribution (with or without modification), making available to the
131
+ public, and in some countries other activities as well.
132
+
133
+ To "convey" a work means any kind of propagation that enables other
134
+ parties to make or receive copies. Mere interaction with a user through
135
+ a computer network, with no transfer of a copy, is not conveying.
136
+
137
+ An interactive user interface displays "Appropriate Legal Notices"
138
+ to the extent that it includes a convenient and prominently visible
139
+ feature that (1) displays an appropriate copyright notice, and (2)
140
+ tells the user that there is no warranty for the work (except to the
141
+ extent that warranties are provided), that licensees may convey the
142
+ work under this License, and how to view a copy of this License. If
143
+ the interface presents a list of user commands or options, such as a
144
+ menu, a prominent item in the list meets this criterion.
145
+
146
+ 1. Source Code.
147
+
148
+ The "source code" for a work means the preferred form of the work
149
+ for making modifications to it. "Object code" means any non-source
150
+ form of a work.
151
+
152
+ A "Standard Interface" means an interface that either is an official
153
+ standard defined by a recognized standards body, or, in the case of
154
+ interfaces specified for a particular programming language, one that
155
+ is widely used among developers working in that language.
156
+
157
+ The "System Libraries" of an executable work include anything, other
158
+ than the work as a whole, that (a) is included in the normal form of
159
+ packaging a Major Component, but which is not part of that Major
160
+ Component, and (b) serves only to enable use of the work with that
161
+ Major Component, or to implement a Standard Interface for which an
162
+ implementation is available to the public in source code form. A
163
+ "Major Component", in this context, means a major essential component
164
+ (kernel, window system, and so on) of the specific operating system
165
+ (if any) on which the executable work runs, or a compiler used to
166
+ produce the work, or an object code interpreter used to run it.
167
+
168
+ The "Corresponding Source" for a work in object code form means all
169
+ the source code needed to generate, install, and (for an executable
170
+ work) run the object code and to modify the work, including scripts to
171
+ control those activities. However, it does not include the work's
172
+ System Libraries, or general-purpose tools or generally available free
173
+ programs which are used unmodified in performing those activities but
174
+ which are not part of the work. For example, Corresponding Source
175
+ includes interface definition files associated with source files for
176
+ the work, and the source code for shared libraries and dynamically
177
+ linked subprograms that the work is specifically designed to require,
178
+ such as by intimate data communication or control flow between those
179
+ subprograms and other parts of the work.
180
+
181
+ The Corresponding Source need not include anything that users
182
+ can regenerate automatically from other parts of the Corresponding
183
+ Source.
184
+
185
+ The Corresponding Source for a work in source code form is that
186
+ same work.
187
+
188
+ 2. Basic Permissions.
189
+
190
+ All rights granted under this License are granted for the term of
191
+ copyright on the Program, and are irrevocable provided the stated
192
+ conditions are met. This License explicitly affirms your unlimited
193
+ permission to run the unmodified Program. The output from running a
194
+ covered work is covered by this License only if the output, given its
195
+ content, constitutes a covered work. This License acknowledges your
196
+ rights of fair use or other equivalent, as provided by copyright law.
197
+
198
+ You may make, run and propagate covered works that you do not
199
+ convey, without conditions so long as your license otherwise remains
200
+ in force. You may convey covered works to others for the sole purpose
201
+ of having them make modifications exclusively for you, or provide you
202
+ with facilities for running those works, provided that you comply with
203
+ the terms of this License in conveying all material for which you do
204
+ not control copyright. Those thus making or running the covered works
205
+ for you must do so exclusively on your behalf, under your direction
206
+ and control, on terms that prohibit them from making any copies of
207
+ your copyrighted material outside their relationship with you.
208
+
209
+ Conveying under any other circumstances is permitted solely under
210
+ the conditions stated below. Sublicensing is not allowed; section 10
211
+ makes it unnecessary.
212
+
213
+ 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
214
+
215
+ No covered work shall be deemed part of an effective technological
216
+ measure under any applicable law fulfilling obligations under article
217
+ 11 of the WIPO copyright treaty adopted on 20 December 1996, or
218
+ similar laws prohibiting or restricting circumvention of such
219
+ measures.
220
+
221
+ When you convey a covered work, you waive any legal power to forbid
222
+ circumvention of technological measures to the extent such circumvention
223
+ is effected by exercising rights under this License with respect to
224
+ the covered work, and you disclaim any intention to limit operation or
225
+ modification of the work as a means of enforcing, against the work's
226
+ users, your or third parties' legal rights to forbid circumvention of
227
+ technological measures.
228
+
229
+ 4. Conveying Verbatim Copies.
230
+
231
+ You may convey verbatim copies of the Program's source code as you
232
+ receive it, in any medium, provided that you conspicuously and
233
+ appropriately publish on each copy an appropriate copyright notice;
234
+ keep intact all notices stating that this License and any
235
+ non-permissive terms added in accord with section 7 apply to the code;
236
+ keep intact all notices of the absence of any warranty; and give all
237
+ recipients a copy of this License along with the Program.
238
+
239
+ You may charge any price or no price for each copy that you convey,
240
+ and you may offer support or warranty protection for a fee.
241
+
242
+ 5. Conveying Modified Source Versions.
243
+
244
+ You may convey a work based on the Program, or the modifications to
245
+ produce it from the Program, in the form of source code under the
246
+ terms of section 4, provided that you also meet all of these conditions:
247
+
248
+ a) The work must carry prominent notices stating that you modified
249
+ it, and giving a relevant date.
250
+
251
+ b) The work must carry prominent notices stating that it is
252
+ released under this License and any conditions added under section
253
+ 7. This requirement modifies the requirement in section 4 to
254
+ "keep intact all notices".
255
+
256
+ c) You must license the entire work, as a whole, under this
257
+ License to anyone who comes into possession of a copy. This
258
+ License will therefore apply, along with any applicable section 7
259
+ additional terms, to the whole of the work, and all its parts,
260
+ regardless of how they are packaged. This License gives no
261
+ permission to license the work in any other way, but it does not
262
+ invalidate such permission if you have separately received it.
263
+
264
+ d) If the work has interactive user interfaces, each must display
265
+ Appropriate Legal Notices; however, if the Program has interactive
266
+ interfaces that do not display Appropriate Legal Notices, your
267
+ work need not make them do so.
268
+
269
+ A compilation of a covered work with other separate and independent
270
+ works, which are not by their nature extensions of the covered work,
271
+ and which are not combined with it such as to form a larger program,
272
+ in or on a volume of a storage or distribution medium, is called an
273
+ "aggregate" if the compilation and its resulting copyright are not
274
+ used to limit the access or legal rights of the compilation's users
275
+ beyond what the individual works permit. Inclusion of a covered work
276
+ in an aggregate does not cause this License to apply to the other
277
+ parts of the aggregate.
278
+
279
+ 6. Conveying Non-Source Forms.
280
+
281
+ You may convey a covered work in object code form under the terms
282
+ of sections 4 and 5, provided that you also convey the
283
+ machine-readable Corresponding Source under the terms of this License,
284
+ in one of these ways:
285
+
286
+ a) Convey the object code in, or embodied in, a physical product
287
+ (including a physical distribution medium), accompanied by the
288
+ Corresponding Source fixed on a durable physical medium
289
+ customarily used for software interchange.
290
+
291
+ b) Convey the object code in, or embodied in, a physical product
292
+ (including a physical distribution medium), accompanied by a
293
+ written offer, valid for at least three years and valid for as
294
+ long as you offer spare parts or customer support for that product
295
+ model, to give anyone who possesses the object code either (1) a
296
+ copy of the Corresponding Source for all the software in the
297
+ product that is covered by this License, on a durable physical
298
+ medium customarily used for software interchange, for a price no
299
+ more than your reasonable cost of physically performing this
300
+ conveying of source, or (2) access to copy the
301
+ Corresponding Source from a network server at no charge.
302
+
303
+ c) Convey individual copies of the object code with a copy of the
304
+ written offer to provide the Corresponding Source. This
305
+ alternative is allowed only occasionally and noncommercially, and
306
+ only if you received the object code with such an offer, in accord
307
+ with subsection 6b.
308
+
309
+ d) Convey the object code by offering access from a designated
310
+ place (gratis or for a charge), and offer equivalent access to the
311
+ Corresponding Source in the same way through the same place at no
312
+ further charge. You need not require recipients to copy the
313
+ Corresponding Source along with the object code. If the place to
314
+ copy the object code is a network server, the Corresponding Source
315
+ may be on a different server (operated by you or a third party)
316
+ that supports equivalent copying facilities, provided you maintain
317
+ clear directions next to the object code saying where to find the
318
+ Corresponding Source. Regardless of what server hosts the
319
+ Corresponding Source, you remain obligated to ensure that it is
320
+ available for as long as needed to satisfy these requirements.
321
+
322
+ e) Convey the object code using peer-to-peer transmission, provided
323
+ you inform other peers where the object code and Corresponding
324
+ Source of the work are being offered to the general public at no
325
+ charge under subsection 6d.
326
+
327
+ A separable portion of the object code, whose source code is excluded
328
+ from the Corresponding Source as a System Library, need not be
329
+ included in conveying the object code work.
330
+
331
+ A "User Product" is either (1) a "consumer product", which means any
332
+ tangible personal property which is normally used for personal, family,
333
+ or household purposes, or (2) anything designed or sold for incorporation
334
+ into a dwelling. In determining whether a product is a consumer product,
335
+ doubtful cases shall be resolved in favor of coverage. For a particular
336
+ product received by a particular user, "normally used" refers to a
337
+ typical or common use of that class of product, regardless of the status
338
+ of the particular user or of the way in which the particular user
339
+ actually uses, or expects or is expected to use, the product. A product
340
+ is a consumer product regardless of whether the product has substantial
341
+ commercial, industrial or non-consumer uses, unless such uses represent
342
+ the only significant mode of use of the product.
343
+
344
+ "Installation Information" for a User Product means any methods,
345
+ procedures, authorization keys, or other information required to install
346
+ and execute modified versions of a covered work in that User Product from
347
+ a modified version of its Corresponding Source. The information must
348
+ suffice to ensure that the continued functioning of the modified object
349
+ code is in no case prevented or interfered with solely because
350
+ modification has been made.
351
+
352
+ If you convey an object code work under this section in, or with, or
353
+ specifically for use in, a User Product, and the conveying occurs as
354
+ part of a transaction in which the right of possession and use of the
355
+ User Product is transferred to the recipient in perpetuity or for a
356
+ fixed term (regardless of how the transaction is characterized), the
357
+ Corresponding Source conveyed under this section must be accompanied
358
+ by the Installation Information. But this requirement does not apply
359
+ if neither you nor any third party retains the ability to install
360
+ modified object code on the User Product (for example, the work has
361
+ been installed in ROM).
362
+
363
+ The requirement to provide Installation Information does not include a
364
+ requirement to continue to provide support service, warranty, or updates
365
+ for a work that has been modified or installed by the recipient, or for
366
+ the User Product in which it has been modified or installed. Access to a
367
+ network may be denied when the modification itself materially and
368
+ adversely affects the operation of the network or violates the rules and
369
+ protocols for communication across the network.
370
+
371
+ Corresponding Source conveyed, and Installation Information provided,
372
+ in accord with this section must be in a format that is publicly
373
+ documented (and with an implementation available to the public in
374
+ source code form), and must require no special password or key for
375
+ unpacking, reading or copying.
376
+
377
+ 7. Additional Terms.
378
+
379
+ "Additional permissions" are terms that supplement the terms of this
380
+ License by making exceptions from one or more of its conditions.
381
+ Additional permissions that are applicable to the entire Program shall
382
+ be treated as though they were included in this License, to the extent
383
+ that they are valid under applicable law. If additional permissions
384
+ apply only to part of the Program, that part may be used separately
385
+ under those permissions, but the entire Program remains governed by
386
+ this License without regard to the additional permissions.
387
+
388
+ When you convey a copy of a covered work, you may at your option
389
+ remove any additional permissions from that copy, or from any part of
390
+ it. (Additional permissions may be written to require their own
391
+ removal in certain cases when you modify the work.) You may place
392
+ additional permissions on material, added by you to a covered work,
393
+ for which you have or can give appropriate copyright permission.
394
+
395
+ Notwithstanding any other provision of this License, for material you
396
+ add to a covered work, you may (if authorized by the copyright holders of
397
+ that material) supplement the terms of this License with terms:
398
+
399
+ a) Disclaiming warranty or limiting liability differently from the
400
+ terms of sections 15 and 16 of this License; or
401
+
402
+ b) Requiring preservation of specified reasonable legal notices or
403
+ author attributions in that material or in the Appropriate Legal
404
+ Notices displayed by works containing it; or
405
+
406
+ c) Prohibiting misrepresentation of the origin of that material, or
407
+ requiring that modified versions of such material be marked in
408
+ reasonable ways as different from the original version; or
409
+
410
+ d) Limiting the use for publicity purposes of names of licensors or
411
+ authors of the material; or
412
+
413
+ e) Declining to grant rights under trademark law for use of some
414
+ trade names, trademarks, or service marks; or
415
+
416
+ f) Requiring indemnification of licensors and authors of that
417
+ material by anyone who conveys the material (or modified versions of
418
+ it) with contractual assumptions of liability to the recipient, for
419
+ any liability that these contractual assumptions directly impose on
420
+ those licensors and authors.
421
+
422
+ All other non-permissive additional terms are considered "further
423
+ restrictions" within the meaning of section 10. If the Program as you
424
+ received it, or any part of it, contains a notice stating that it is
425
+ governed by this License along with a term that is a further
426
+ restriction, you may remove that term. If a license document contains
427
+ a further restriction but permits relicensing or conveying under this
428
+ License, you may add to a covered work material governed by the terms
429
+ of that license document, provided that the further restriction does
430
+ not survive such relicensing or conveying.
431
+
432
+ If you add terms to a covered work in accord with this section, you
433
+ must place, in the relevant source files, a statement of the
434
+ additional terms that apply to those files, or a notice indicating
435
+ where to find the applicable terms.
436
+
437
+ Additional terms, permissive or non-permissive, may be stated in the
438
+ form of a separately written license, or stated as exceptions;
439
+ the above requirements apply either way.
440
+
441
+ 8. Termination.
442
+
443
+ You may not propagate or modify a covered work except as expressly
444
+ provided under this License. Any attempt otherwise to propagate or
445
+ modify it is void, and will automatically terminate your rights under
446
+ this License (including any patent licenses granted under the third
447
+ paragraph of section 11).
448
+
449
+ However, if you cease all violation of this License, then your
450
+ license from a particular copyright holder is reinstated (a)
451
+ provisionally, unless and until the copyright holder explicitly and
452
+ finally terminates your license, and (b) permanently, if the copyright
453
+ holder fails to notify you of the violation by some reasonable means
454
+ prior to 60 days after the cessation.
455
+
456
+ Moreover, your license from a particular copyright holder is
457
+ reinstated permanently if the copyright holder notifies you of the
458
+ violation by some reasonable means, this is the first time you have
459
+ received notice of violation of this License (for any work) from that
460
+ copyright holder, and you cure the violation prior to 30 days after
461
+ your receipt of the notice.
462
+
463
+ Termination of your rights under this section does not terminate the
464
+ licenses of parties who have received copies or rights from you under
465
+ this License. If your rights have been terminated and not permanently
466
+ reinstated, you do not qualify to receive new licenses for the same
467
+ material under section 10.
468
+
469
+ 9. Acceptance Not Required for Having Copies.
470
+
471
+ You are not required to accept this License in order to receive or
472
+ run a copy of the Program. Ancillary propagation of a covered work
473
+ occurring solely as a consequence of using peer-to-peer transmission
474
+ to receive a copy likewise does not require acceptance. However,
475
+ nothing other than this License grants you permission to propagate or
476
+ modify any covered work. These actions infringe copyright if you do
477
+ not accept this License. Therefore, by modifying or propagating a
478
+ covered work, you indicate your acceptance of this License to do so.
479
+
480
+ 10. Automatic Licensing of Downstream Recipients.
481
+
482
+ Each time you convey a covered work, the recipient automatically
483
+ receives a license from the original licensors, to run, modify and
484
+ propagate that work, subject to this License. You are not responsible
485
+ for enforcing compliance by third parties with this License.
486
+
487
+ An "entity transaction" is a transaction transferring control of an
488
+ organization, or substantially all assets of one, or subdividing an
489
+ organization, or merging organizations. If propagation of a covered
490
+ work results from an entity transaction, each party to that
491
+ transaction who receives a copy of the work also receives whatever
492
+ licenses to the work the party's predecessor in interest had or could
493
+ give under the previous paragraph, plus a right to possession of the
494
+ Corresponding Source of the work from the predecessor in interest, if
495
+ the predecessor has it or can get it with reasonable efforts.
496
+
497
+ You may not impose any further restrictions on the exercise of the
498
+ rights granted or affirmed under this License. For example, you may
499
+ not impose a license fee, royalty, or other charge for exercise of
500
+ rights granted under this License, and you may not initiate litigation
501
+ (including a cross-claim or counterclaim in a lawsuit) alleging that
502
+ any patent claim is infringed by making, using, selling, offering for
503
+ sale, or importing the Program or any portion of it.
504
+
505
+ 11. Patents.
506
+
507
+ A "contributor" is a copyright holder who authorizes use under this
508
+ License of the Program or a work on which the Program is based. The
509
+ work thus licensed is called the contributor's "contributor version".
510
+
511
+ A contributor's "essential patent claims" are all patent claims
512
+ owned or controlled by the contributor, whether already acquired or
513
+ hereafter acquired, that would be infringed by some manner, permitted
514
+ by this License, of making, using, or selling its contributor version,
515
+ but do not include claims that would be infringed only as a
516
+ consequence of further modification of the contributor version. For
517
+ purposes of this definition, "control" includes the right to grant
518
+ patent sublicenses in a manner consistent with the requirements of
519
+ this License.
520
+
521
+ Each contributor grants you a non-exclusive, worldwide, royalty-free
522
+ patent license under the contributor's essential patent claims, to
523
+ make, use, sell, offer for sale, import and otherwise run, modify and
524
+ propagate the contents of its contributor version.
525
+
526
+ In the following three paragraphs, a "patent license" is any express
527
+ agreement or commitment, however denominated, not to enforce a patent
528
+ (such as an express permission to practice a patent or covenant not to
529
+ sue for patent infringement). To "grant" such a patent license to a
530
+ party means to make such an agreement or commitment not to enforce a
531
+ patent against the party.
532
+
533
+ If you convey a covered work, knowingly relying on a patent license,
534
+ and the Corresponding Source of the work is not available for anyone
535
+ to copy, free of charge and under the terms of this License, through a
536
+ publicly available network server or other readily accessible means,
537
+ then you must either (1) cause the Corresponding Source to be so
538
+ available, or (2) arrange to deprive yourself of the benefit of the
539
+ patent license for this particular work, or (3) arrange, in a manner
540
+ consistent with the requirements of this License, to extend the patent
541
+ license to downstream recipients. "Knowingly relying" means you have
542
+ actual knowledge that, but for the patent license, your conveying the
543
+ covered work in a country, or your recipient's use of the covered work
544
+ in a country, would infringe one or more identifiable patents in that
545
+ country that you have reason to believe are valid.
546
+
547
+ If, pursuant to or in connection with a single transaction or
548
+ arrangement, you convey, or propagate by procuring conveyance of, a
549
+ covered work, and grant a patent license to some of the parties
550
+ receiving the covered work authorizing them to use, propagate, modify
551
+ or convey a specific copy of the covered work, then the patent license
552
+ you grant is automatically extended to all recipients of the covered
553
+ work and works based on it.
554
+
555
+ A patent license is "discriminatory" if it does not include within
556
+ the scope of its coverage, prohibits the exercise of, or is
557
+ conditioned on the non-exercise of one or more of the rights that are
558
+ specifically granted under this License. You may not convey a covered
559
+ work if you are a party to an arrangement with a third party that is
560
+ in the business of distributing software, under which you make payment
561
+ to the third party based on the extent of your activity of conveying
562
+ the work, and under which the third party grants, to any of the
563
+ parties who would receive the covered work from you, a discriminatory
564
+ patent license (a) in connection with copies of the covered work
565
+ conveyed by you (or copies made from those copies), or (b) primarily
566
+ for and in connection with specific products or compilations that
567
+ contain the covered work, unless you entered into that arrangement,
568
+ or that patent license was granted, prior to 28 March 2007.
569
+
570
+ Nothing in this License shall be construed as excluding or limiting
571
+ any implied license or other defenses to infringement that may
572
+ otherwise be available to you under applicable patent law.
573
+
574
+ 12. No Surrender of Others' Freedom.
575
+
576
+ If conditions are imposed on you (whether by court order, agreement or
577
+ otherwise) that contradict the conditions of this License, they do not
578
+ excuse you from the conditions of this License. If you cannot convey a
579
+ covered work so as to satisfy simultaneously your obligations under this
580
+ License and any other pertinent obligations, then as a consequence you may
581
+ not convey it at all. For example, if you agree to terms that obligate you
582
+ to collect a royalty for further conveying from those to whom you convey
583
+ the Program, the only way you could satisfy both those terms and this
584
+ License would be to refrain entirely from conveying the Program.
585
+
586
+ 13. Use with the GNU Affero General Public License.
587
+
588
+ Notwithstanding any other provision of this License, you have
589
+ permission to link or combine any covered work with a work licensed
590
+ under version 3 of the GNU Affero General Public License into a single
591
+ combined work, and to convey the resulting work. The terms of this
592
+ License will continue to apply to the part which is the covered work,
593
+ but the special requirements of the GNU Affero General Public License,
594
+ section 13, concerning interaction through a network will apply to the
595
+ combination as such.
596
+
597
+ 14. Revised Versions of this License.
598
+
599
+ The Free Software Foundation may publish revised and/or new versions of
600
+ the GNU General Public License from time to time. Such new versions will
601
+ be similar in spirit to the present version, but may differ in detail to
602
+ address new problems or concerns.
603
+
604
+ Each version is given a distinguishing version number. If the
605
+ Program specifies that a certain numbered version of the GNU General
606
+ Public License "or any later version" applies to it, you have the
607
+ option of following the terms and conditions either of that numbered
608
+ version or of any later version published by the Free Software
609
+ Foundation. If the Program does not specify a version number of the
610
+ GNU General Public License, you may choose any version ever published
611
+ by the Free Software Foundation.
612
+
613
+ If the Program specifies that a proxy can decide which future
614
+ versions of the GNU General Public License can be used, that proxy's
615
+ public statement of acceptance of a version permanently authorizes you
616
+ to choose that version for the Program.
617
+
618
+ Later license versions may give you additional or different
619
+ permissions. However, no additional obligations are imposed on any
620
+ author or copyright holder as a result of your choosing to follow a
621
+ later version.
622
+
623
+ 15. Disclaimer of Warranty.
624
+
625
+ THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
626
+ APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
627
+ HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
628
+ OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
629
+ THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
630
+ PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
631
+ IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
632
+ ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
633
+
634
+ 16. Limitation of Liability.
635
+
636
+ IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
637
+ WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
638
+ THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
639
+ GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
640
+ USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
641
+ DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
642
+ PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
643
+ EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
644
+ SUCH DAMAGES.
645
+
646
+ 17. Interpretation of Sections 15 and 16.
647
+
648
+ If the disclaimer of warranty and limitation of liability provided
649
+ above cannot be given local legal effect according to their terms,
650
+ reviewing courts shall apply local law that most closely approximates
651
+ an absolute waiver of all civil liability in connection with the
652
+ Program, unless a warranty or assumption of liability accompanies a
653
+ copy of the Program in return for a fee.
654
+
655
+ END OF TERMS AND CONDITIONS
656
+
657
+ How to Apply These Terms to Your New Programs
658
+
659
+ If you develop a new program, and you want it to be of the greatest
660
+ possible use to the public, the best way to achieve this is to make it
661
+ free software which everyone can redistribute and change under these terms.
662
+
663
+ To do so, attach the following notices to the program. It is safest
664
+ to attach them to the start of each source file to most effectively
665
+ state the exclusion of warranty; and each file should have at least
666
+ the "copyright" line and a pointer to where the full notice is found.
667
+
668
+ <one line to give the program's name and a brief idea of what it does.>
669
+ Copyright © <year> <name of author>
670
+
671
+ This program is free software: you can redistribute it and/or modify
672
+ it under the terms of the GNU General Public License as published by
673
+ the Free Software Foundation, either version 3 of the License, or
674
+ (at your option) any later version.
675
+
676
+ This program is distributed in the hope that it will be useful,
677
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
678
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
679
+ GNU General Public License for more details.
680
+
681
+ You should have received a copy of the GNU General Public License
682
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
683
+
684
+ Also add information on how to contact you by electronic and paper mail.
685
+
686
+ If the program does terminal interaction, make it output a short
687
+ notice like this when it starts in an interactive mode:
688
+
689
+ <program> Copyright © <year> <name of author>
690
+ This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
691
+ This is free software, and you are welcome to redistribute it
692
+ under certain conditions; type `show c' for details.
693
+
694
+ The hypothetical commands `show w' and `show c' should show the appropriate
695
+ parts of the General Public License. Of course, your program's commands
696
+ might be different; for a GUI interface, you would use an "about box".
697
+
698
+ You should also get your employer (if you work as a programmer) or school,
699
+ if any, to sign a "copyright disclaimer" for the program, if necessary.
700
+ For more information on this, and how to apply and follow the GNU GPL, see
701
+ <http://www.gnu.org/licenses/>.
702
+
703
+ The GNU General Public License does not permit incorporating your program
704
+ into proprietary programs. If your program is a subroutine library, you
705
+ may consider it more useful to permit linking proprietary applications with
706
+ the library. If this is what you want to do, use the GNU Lesser General
707
+ Public License instead of this License. But first, please read
708
  <http://www.gnu.org/philosophy/why-not-lgpl.html>.
readme.txt CHANGED
@@ -1,11 +1,12 @@
1
- === Import Export WordPress Users & WooCommerce Customers ===
2
- Contributors: webtoffee,xadapter,mujeebur
 
3
  Tags: Export Users to CSV, Import Users from CSV, woocommerce export customers, user export, export import users, woocommerce import customers, woocommerce export customer email
4
  Requires at least: 3.0.1
5
- Tested up to: 4.9.6
6
- Stable tag: 1.1.1
7
- License: GPLv2 or later
8
- License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
10
  Import users and export users made simple! Easily Export Users to CSV, Import Users from CSV. Fastest user export import plugin. Export customers in WooCommerce (premium).
11
 
@@ -13,18 +14,18 @@ Import users and export users made simple! Easily Export Users to CSV, Import Us
13
 
14
  = Introduction =
15
 
16
- Import users and export users made fast and simple! Import Export WordPress Users & WooCommerce Customers plugin helps you to easily export and import users in your WordPress. User Export and User import are much required feature while moving Wordpress / WooCommerce websites.
17
 
18
- <ul>
19
- <li>Users Export - Export Users to CSV file.</li>
20
- <li>Users import - Import Users from CSV format to WordPress/WooCommerce Store.</li>
21
- </ul>
22
 
23
  Highlights: WordPress Users Export, WordPress Users CSV Import Suite, Export WordPress Users to CSV. Pro Version supports export and import of all additional user meta like WooCommerce deatils.
24
 
25
  = How does it work? =
26
 
27
- The Import Export WordPress Users & WooCommerce Customers Plugin takes CSV (Comma-Separated Values) file as input. You must create a CSV file and enter the user details in a structured format as explained in the tutorial. This is to match each field of CSV file to the field of a particular user fields , otherwise Admin need to input manually. For example: the user_email field gets mapped to the User Email. For the plugin to work correctly, you must map headers of all of the column correctly and you must ensure that all of the fields you enter must be in the correct format.
28
 
29
  You can create the CSV from the scratch or you can export the users to get the format of CSV. You can use a spreadsheet program, such as Microsoft Excel, OpenOffice, LibreOffice or Google Spreadsheets for creating and modifying the CSV file. Save this file in UTF-8 encoding with extension .CSV. After entering all details about users in spreadsheet, you can bulk import users to your online Site/Store. With this plugin, you can also export and download user details as a CSV file.
30
 
@@ -36,18 +37,17 @@ You can create the CSV from the scratch or you can export the users to get the f
36
 
37
  Import Export WordPress Users & WooCommerce Customers
38
 
39
- <ul>
40
- <li>Export Import WooCommerce Customer details into a CSV file.( Basic version supports only WordPress User Import and User Export )</li>
41
- <li>Option to choose All Roles or Multiple Roles while export (Basic Supports only single role at a time)</li>
42
- <li>Various Filter options for exporting Customers.</li>
43
- <li>Map and Transform fields while Importing Customers.</li>
44
- <li>Change values while improting Customers using Evaluation Fields.</li>
45
- <li>Choice to Update or Skip existing imported Customers.</li>
46
- <li>Choice to Send or Skip Emails for newly imported Customers.</li>
47
- <li>WPML Supported. French language support Out of the Box.</li>
48
- <li>Export Import users to/from a remote server via FTP in Scheduled time interval with Cron Job.</li>
49
- <li>Excellent Support for setting it up!'</li>
50
- </ul>
51
 
52
  Please visit <a rel="nofollow" href="https://www.xadapter.com/product/wordpress-users-woocommerce-customers-import-export/">Import Export WordPress Users & WooCommerce Customers</a> for more details
53
 
@@ -55,16 +55,14 @@ Please visit <a rel="nofollow" href="https://www.xadapter.com/product/wordpress-
55
 
56
  **Use Cases Handled**
57
 
58
- Import Export WordPress Users & WooCommerce Customers Plugin is an ideal plugin for exporting and importing WordPress users or WooCommerce customers details from/to your WooCommerce store for migrating an existing online store.
59
 
60
  The following use cases are handled by the plugin
61
 
62
- <ul>
63
- <li>User Export - WordPress Export Users to CSV.</li>
64
- <li>User Import - WordPress Import Users from CSV.</li>
65
- <li>Customer Export - WooCommerce Export Customers to CSV.</li>
66
- <li>Customer Import - WooCommerce Import Customers from CSV.</li>
67
- </ul>
68
 
69
 
70
  WordPress Export Users to CSV
@@ -83,13 +81,13 @@ You can map your import columns to the appropriate WordPress data to import or m
83
 
84
  For importing WordPress user details to your website, you must create a CSV(Comma-Separated Values) file which contains information about mapping fields in a tabular form. You can create CSV file by using a spreadsheet program, such as Excel, or Google Spreadsheets. Save this file with extension .CSV. After entering all details about WordPress users in the spreadsheet, you can import to your website.
85
 
86
- WooCommerce Export Customers to CSV
87
 
88
  You can export WooCommerce customer list from WordPress/WooCommerce site and generate a CSV file. Use this CSV file to migrate customers to another online store by WordPress import customers functionality or merge customers (update existing customers) functionality of this plugin. If you have hundreds, even thousands, of WooCommerce Customers, this helps to save your effort and time of manually adding the WooCommerce customer list.
89
 
90
  Plugin can easily export customers details to CSV file by filtering customers by user role. Even the plugin automatically upload your exports via FTP.
91
 
92
- WooCommerce Import Customers from CSV
93
 
94
  You can import WooCommerce customers to WordPress/WooCommerce site easily. WooCommerce import customers feature or merge customers feature (update existing customers) help move or update hundreds, even thousands, of customers details using one file which saves your effort and time of manually adding user information.
95
 
@@ -150,6 +148,11 @@ No. You may want to use https://wordpress.org/plugins/order-import-export-for-wo
150
 
151
  == Changelog ==
152
 
 
 
 
 
 
153
  = 1.1.1 =
154
  * Tested OK with WP 4.9.6 and WC 3.3.5.
155
  = 1.1.0 =
@@ -177,5 +180,8 @@ No. You may want to use https://wordpress.org/plugins/order-import-export-for-wo
177
 
178
  == Upgrade Notice ==
179
 
180
- = 1.1.1 =
181
- * Tested OK with WP 4.9.6 and WC 3.3.5.
 
 
 
1
+ === Import Export WordPress Users ===
2
+ Contributors: webtoffee
3
+ Donate link: https://www.webtoffee.com/plugins/
4
  Tags: Export Users to CSV, Import Users from CSV, woocommerce export customers, user export, export import users, woocommerce import customers, woocommerce export customer email
5
  Requires at least: 3.0.1
6
+ Tested up to: 4.9.8
7
+ Stable tag: 1.1.2
8
+ License: GPLv3
9
+ License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
 
11
  Import users and export users made simple! Easily Export Users to CSV, Import Users from CSV. Fastest user export import plugin. Export customers in WooCommerce (premium).
12
 
14
 
15
  = Introduction =
16
 
17
+ Import users and export users made fast and simple! Import Export WordPress Users plugin helps you to easily export and import users in your WordPress. User Export and User import are much required feature while moving Wordpress / WooCommerce websites.
18
 
19
+
20
+ &#128312; Users Export - Export Users to CSV file.</li>
21
+ &#128312; Users import - Import Users from CSV format to WordPress/WooCommerce Store.
22
+ &#128312; Tested OK with WooCommerce 3.4.4.
23
 
24
  Highlights: WordPress Users Export, WordPress Users CSV Import Suite, Export WordPress Users to CSV. Pro Version supports export and import of all additional user meta like WooCommerce deatils.
25
 
26
  = How does it work? =
27
 
28
+ The Import Export WordPress Users Plugin takes CSV (Comma-Separated Values) file as input. You must create a CSV file and enter the user details in a structured format as explained in the tutorial. This is to match each field of CSV file to the field of a particular user fields , otherwise Admin need to input manually. For example: the user_email field gets mapped to the User Email. For the plugin to work correctly, you must map headers of all of the column correctly and you must ensure that all of the fields you enter must be in the correct format.
29
 
30
  You can create the CSV from the scratch or you can export the users to get the format of CSV. You can use a spreadsheet program, such as Microsoft Excel, OpenOffice, LibreOffice or Google Spreadsheets for creating and modifying the CSV file. Save this file in UTF-8 encoding with extension .CSV. After entering all details about users in spreadsheet, you can bulk import users to your online Site/Store. With this plugin, you can also export and download user details as a CSV file.
31
 
37
 
38
  Import Export WordPress Users & WooCommerce Customers
39
 
40
+ &#9989; Export Import WooCommerce Customer details into a CSV file.( Basic version supports only WordPress User Import and User Export )
41
+ &#9989; Option to choose All Roles or Multiple Roles while export (Basic Supports only single role at a time)
42
+ &#9989; Various Filter options for exporting Customers.
43
+ &#9989; Map and Transform fields while Importing Customers.
44
+ &#9989; Change values while improting Customers using Evaluation Fields.
45
+ &#9989; Choice to Update or Skip existing imported Customers.
46
+ &#9989; Choice to Send or Skip Emails for newly imported Customers.
47
+ &#9989; WPML Supported. French language support Out of the Box.
48
+ &#9989; Export Import users to/from a remote server via FTP in Scheduled time interval with Cron Job.
49
+ &#9989; Excellent Support for setting it up!
50
+
 
51
 
52
  Please visit <a rel="nofollow" href="https://www.xadapter.com/product/wordpress-users-woocommerce-customers-import-export/">Import Export WordPress Users & WooCommerce Customers</a> for more details
53
 
55
 
56
  **Use Cases Handled**
57
 
58
+ Import Export WordPress Users Plugin is an ideal plugin for exporting and importing WordPress users or WooCommerce customers details from/to your WooCommerce store for migrating an existing online store.
59
 
60
  The following use cases are handled by the plugin
61
 
62
+ &#9989; User Export - WordPress Export Users to CSV.</li>
63
+ &#9989; User Import - WordPress Import Users from CSV.</li>
64
+ &#9989; Customer Export - WooCommerce Export Customers to CSV.(Premium)</li>
65
+ &#9989; Customer Import - WooCommerce Import Customers from CSV.(Premium)</li>
 
 
66
 
67
 
68
  WordPress Export Users to CSV
81
 
82
  For importing WordPress user details to your website, you must create a CSV(Comma-Separated Values) file which contains information about mapping fields in a tabular form. You can create CSV file by using a spreadsheet program, such as Excel, or Google Spreadsheets. Save this file with extension .CSV. After entering all details about WordPress users in the spreadsheet, you can import to your website.
83
 
84
+ WooCommerce Export Customers to CSV (Premium)
85
 
86
  You can export WooCommerce customer list from WordPress/WooCommerce site and generate a CSV file. Use this CSV file to migrate customers to another online store by WordPress import customers functionality or merge customers (update existing customers) functionality of this plugin. If you have hundreds, even thousands, of WooCommerce Customers, this helps to save your effort and time of manually adding the WooCommerce customer list.
87
 
88
  Plugin can easily export customers details to CSV file by filtering customers by user role. Even the plugin automatically upload your exports via FTP.
89
 
90
+ WooCommerce Import Customers from CSV (Premium)
91
 
92
  You can import WooCommerce customers to WordPress/WooCommerce site easily. WooCommerce import customers feature or merge customers feature (update existing customers) help move or update hundreds, even thousands, of customers details using one file which saves your effort and time of manually adding user information.
93
 
148
 
149
  == Changelog ==
150
 
151
+ = 1.1.2 =
152
+ * Tested OK WC 3.4.4 and WP 4.9.8
153
+ * Warnings fixed.
154
+ * UI Changed.
155
+ * Export multiple roles at a time.
156
  = 1.1.1 =
157
  * Tested OK with WP 4.9.6 and WC 3.3.5.
158
  = 1.1.0 =
180
 
181
  == Upgrade Notice ==
182
 
183
+ = 1.1.2 =
184
+ * Tested OK WC 3.4.4 and WP 4.9.8
185
+ * Warnings fixed.
186
+ * UI Changed.
187
+ * Export multiple roles at a time.
styles/select2.css ADDED
@@ -0,0 +1 @@
 
1
+ .select2-container{box-sizing:border-box;display:inline-block;margin:0;position:relative;vertical-align:middle}.select2-container .select2-selection--single{box-sizing:border-box;cursor:pointer;display:block;height:28px;user-select:none;-webkit-user-select:none}.select2-container .select2-selection--single .select2-selection__rendered{display:block;padding-left:8px;padding-right:20px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.select2-container .select2-selection--single .select2-selection__clear{position:relative}.select2-container[dir="rtl"] .select2-selection--single .select2-selection__rendered{padding-right:8px;padding-left:20px}.select2-container .select2-selection--multiple{box-sizing:border-box;cursor:pointer;display:block;min-height:32px;user-select:none;-webkit-user-select:none}.select2-container .select2-selection--multiple .select2-selection__rendered{display:inline-block;overflow:hidden;padding-left:8px;text-overflow:ellipsis;white-space:nowrap}.select2-container .select2-search--inline{float:left}.select2-container .select2-search--inline .select2-search__field{box-sizing:border-box;border:none;font-size:100%;margin-top:5px;padding:0}.select2-container .select2-search--inline .select2-search__field::-webkit-search-cancel-button{-webkit-appearance:none}.select2-dropdown{background-color:white;border:1px solid #aaa;border-radius:4px;box-sizing:border-box;display:block;position:absolute;left:-100000px;width:100%;z-index:1051}.select2-results{display:block}.select2-results__options{list-style:none;margin:0;padding:0}.select2-results__option{padding:6px;user-select:none;-webkit-user-select:none}.select2-results__option[aria-selected]{cursor:pointer}.select2-container--open .select2-dropdown{left:0}.select2-container--open .select2-dropdown--above{border-bottom:none;border-bottom-left-radius:0;border-bottom-right-radius:0}.select2-container--open .select2-dropdown--below{border-top:none;border-top-left-radius:0;border-top-right-radius:0}.select2-search--dropdown{display:block;padding:4px}.select2-search--dropdown .select2-search__field{padding:4px;width:100%;box-sizing:border-box}.select2-search--dropdown .select2-search__field::-webkit-search-cancel-button{-webkit-appearance:none}.select2-search--dropdown.select2-search--hide{display:none}.select2-close-mask{border:0;margin:0;padding:0;display:block;position:fixed;left:0;top:0;min-height:100%;min-width:100%;height:auto;width:auto;opacity:0;z-index:99;background-color:#fff;filter:alpha(opacity=0)}.select2-hidden-accessible{border:0 !important;clip:rect(0 0 0 0) !important;-webkit-clip-path:inset(50%) !important;clip-path:inset(50%) !important;height:1px !important;overflow:hidden !important;padding:0 !important;position:absolute !important;width:1px !important;white-space:nowrap !important}.select2-container--default .select2-selection--single{background-color:#fff;border:1px solid #aaa;border-radius:4px}.select2-container--default .select2-selection--single .select2-selection__rendered{color:#444;line-height:28px}.select2-container--default .select2-selection--single .select2-selection__clear{cursor:pointer;float:right;font-weight:bold}.select2-container--default .select2-selection--single .select2-selection__placeholder{color:#999}.select2-container--default .select2-selection--single .select2-selection__arrow{height:26px;position:absolute;top:1px;right:1px;width:20px}.select2-container--default .select2-selection--single .select2-selection__arrow b{border-color:#888 transparent transparent transparent;border-style:solid;border-width:5px 4px 0 4px;height:0;left:50%;margin-left:-4px;margin-top:-2px;position:absolute;top:50%;width:0}.select2-container--default[dir="rtl"] .select2-selection--single .select2-selection__clear{float:left}.select2-container--default[dir="rtl"] .select2-selection--single .select2-selection__arrow{left:1px;right:auto}.select2-container--default.select2-container--disabled .select2-selection--single{background-color:#eee;cursor:default}.select2-container--default.select2-container--disabled .select2-selection--single .select2-selection__clear{display:none}.select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow b{border-color:transparent transparent #888 transparent;border-width:0 4px 5px 4px}.select2-container--default .select2-selection--multiple{background-color:white;border:1px solid #aaa;border-radius:4px;cursor:text}.select2-container--default .select2-selection--multiple .select2-selection__rendered{box-sizing:border-box;list-style:none;margin:0;padding:0 5px;width:100%}.select2-container--default .select2-selection--multiple .select2-selection__rendered li{list-style:none}.select2-container--default .select2-selection--multiple .select2-selection__placeholder{color:#999;margin-top:5px;float:left}.select2-container--default .select2-selection--multiple .select2-selection__clear{cursor:pointer;float:right;font-weight:bold;margin-top:5px;margin-right:10px}.select2-container--default .select2-selection--multiple .select2-selection__choice{background-color:#e4e4e4;border:1px solid #aaa;border-radius:4px;cursor:default;float:left;margin-right:5px;margin-top:5px;padding:0 5px}.select2-container--default .select2-selection--multiple .select2-selection__choice__remove{color:#999;cursor:pointer;display:inline-block;font-weight:bold;margin-right:2px}.select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover{color:#333}.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice,.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__placeholder,.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-search--inline{float:right}.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice{margin-left:5px;margin-right:auto}.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice__remove{margin-left:2px;margin-right:auto}.select2-container--default.select2-container--focus .select2-selection--multiple{border:solid black 1px;outline:0}.select2-container--default.select2-container--disabled .select2-selection--multiple{background-color:#eee;cursor:default}.select2-container--default.select2-container--disabled .select2-selection__choice__remove{display:none}.select2-container--default.select2-container--open.select2-container--above .select2-selection--single,.select2-container--default.select2-container--open.select2-container--above .select2-selection--multiple{border-top-left-radius:0;border-top-right-radius:0}.select2-container--default.select2-container--open.select2-container--below .select2-selection--single,.select2-container--default.select2-container--open.select2-container--below .select2-selection--multiple{border-bottom-left-radius:0;border-bottom-right-radius:0}.select2-container--default .select2-search--dropdown .select2-search__field{border:1px solid #aaa}.select2-container--default .select2-search--inline .select2-search__field{background:transparent;border:none;outline:0;box-shadow:none;-webkit-appearance:textfield}.select2-container--default .select2-results>.select2-results__options{max-height:200px;overflow-y:auto}.select2-container--default .select2-results__option[role=group]{padding:0}.select2-container--default .select2-results__option[aria-disabled=true]{color:#999}.select2-container--default .select2-results__option[aria-selected=true]{background-color:#ddd}.select2-container--default .select2-results__option .select2-results__option{padding-left:1em}.select2-container--default .select2-results__option .select2-results__option .select2-results__group{padding-left:0}.select2-container--default .select2-results__option .select2-results__option .select2-results__option{margin-left:-1em;padding-left:2em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-2em;padding-left:3em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-3em;padding-left:4em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-4em;padding-left:5em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-5em;padding-left:6em}.select2-container--default .select2-results__option--highlighted[aria-selected]{background-color:#5897fb;color:white}.select2-container--default .select2-results__group{cursor:default;display:block;padding:6px}.select2-container--classic .select2-selection--single{background-color:#f7f7f7;border:1px solid #aaa;border-radius:4px;outline:0;background-image:-webkit-linear-gradient(top, #fff 50%, #eee 100%);background-image:-o-linear-gradient(top, #fff 50%, #eee 100%);background-image:linear-gradient(to bottom, #fff 50%, #eee 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFFFFFFF', endColorstr='#FFEEEEEE', GradientType=0)}.select2-container--classic .select2-selection--single:focus{border:1px solid #5897fb}.select2-container--classic .select2-selection--single .select2-selection__rendered{color:#444;line-height:28px}.select2-container--classic .select2-selection--single .select2-selection__clear{cursor:pointer;float:right;font-weight:bold;margin-right:10px}.select2-container--classic .select2-selection--single .select2-selection__placeholder{color:#999}.select2-container--classic .select2-selection--single .select2-selection__arrow{background-color:#ddd;border:none;border-left:1px solid #aaa;border-top-right-radius:4px;border-bottom-right-radius:4px;height:26px;position:absolute;top:1px;right:1px;width:20px;background-image:-webkit-linear-gradient(top, #eee 50%, #ccc 100%);background-image:-o-linear-gradient(top, #eee 50%, #ccc 100%);background-image:linear-gradient(to bottom, #eee 50%, #ccc 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFEEEEEE', endColorstr='#FFCCCCCC', GradientType=0)}.select2-container--classic .select2-selection--single .select2-selection__arrow b{border-color:#888 transparent transparent transparent;border-style:solid;border-width:5px 4px 0 4px;height:0;left:50%;margin-left:-4px;margin-top:-2px;position:absolute;top:50%;width:0}.select2-container--classic[dir="rtl"] .select2-selection--single .select2-selection__clear{float:left}.select2-container--classic[dir="rtl"] .select2-selection--single .select2-selection__arrow{border:none;border-right:1px solid #aaa;border-radius:0;border-top-left-radius:4px;border-bottom-left-radius:4px;left:1px;right:auto}.select2-container--classic.select2-container--open .select2-selection--single{border:1px solid #5897fb}.select2-container--classic.select2-container--open .select2-selection--single .select2-selection__arrow{background:transparent;border:none}.select2-container--classic.select2-container--open .select2-selection--single .select2-selection__arrow b{border-color:transparent transparent #888 transparent;border-width:0 4px 5px 4px}.select2-container--classic.select2-container--open.select2-container--above .select2-selection--single{border-top:none;border-top-left-radius:0;border-top-right-radius:0;background-image:-webkit-linear-gradient(top, #fff 0%, #eee 50%);background-image:-o-linear-gradient(top, #fff 0%, #eee 50%);background-image:linear-gradient(to bottom, #fff 0%, #eee 50%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFFFFFFF', endColorstr='#FFEEEEEE', GradientType=0)}.select2-container--classic.select2-container--open.select2-container--below .select2-selection--single{border-bottom:none;border-bottom-left-radius:0;border-bottom-right-radius:0;background-image:-webkit-linear-gradient(top, #eee 50%, #fff 100%);background-image:-o-linear-gradient(top, #eee 50%, #fff 100%);background-image:linear-gradient(to bottom, #eee 50%, #fff 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFEEEEEE', endColorstr='#FFFFFFFF', GradientType=0)}.select2-container--classic .select2-selection--multiple{background-color:white;border:1px solid #aaa;border-radius:4px;cursor:text;outline:0}.select2-container--classic .select2-selection--multiple:focus{border:1px solid #5897fb}.select2-container--classic .select2-selection--multiple .select2-selection__rendered{list-style:none;margin:0;padding:0 5px}.select2-container--classic .select2-selection--multiple .select2-selection__clear{display:none}.select2-container--classic .select2-selection--multiple .select2-selection__choice{background-color:#e4e4e4;border:1px solid #aaa;border-radius:4px;cursor:default;float:left;margin-right:5px;margin-top:5px;padding:0 5px}.select2-container--classic .select2-selection--multiple .select2-selection__choice__remove{color:#888;cursor:pointer;display:inline-block;font-weight:bold;margin-right:2px}.select2-container--classic .select2-selection--multiple .select2-selection__choice__remove:hover{color:#555}.select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice{float:right}.select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice{margin-left:5px;margin-right:auto}.select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice__remove{margin-left:2px;margin-right:auto}.select2-container--classic.select2-container--open .select2-selection--multiple{border:1px solid #5897fb}.select2-container--classic.select2-container--open.select2-container--above .select2-selection--multiple{border-top:none;border-top-left-radius:0;border-top-right-radius:0}.select2-container--classic.select2-container--open.select2-container--below .select2-selection--multiple{border-bottom:none;border-bottom-left-radius:0;border-bottom-right-radius:0}.select2-container--classic .select2-search--dropdown .select2-search__field{border:1px solid #aaa;outline:0}.select2-container--classic .select2-search--inline .select2-search__field{outline:0;box-shadow:none}.select2-container--classic .select2-dropdown{background-color:#fff;border:1px solid transparent}.select2-container--classic .select2-dropdown--above{border-bottom:none}.select2-container--classic .select2-dropdown--below{border-top:none}.select2-container--classic .select2-results>.select2-results__options{max-height:200px;overflow-y:auto}.select2-container--classic .select2-results__option[role=group]{padding:0}.select2-container--classic .select2-results__option[aria-disabled=true]{color:grey}.select2-container--classic .select2-results__option--highlighted[aria-selected]{background-color:#3875d7;color:#fff}.select2-container--classic .select2-results__group{cursor:default;display:block;padding:6px}.select2-container--classic.select2-container--open .select2-dropdown{border-color:#5897fb}
styles/select2.js ADDED
@@ -0,0 +1 @@
 
1
+ /*! Select2 4.0.6-rc.0 | https://github.com/select2/select2/blob/master/LICENSE.md */!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):"object"==typeof module&&module.exports?module.exports=function(b,c){return void 0===c&&(c="undefined"!=typeof window?require("jquery"):require("jquery")(b)),a(c),c}:a(jQuery)}(function(a){var b=function(){if(a&&a.fn&&a.fn.select2&&a.fn.select2.amd)var b=a.fn.select2.amd;var b;return function(){if(!b||!b.requirejs){b?c=b:b={};var a,c,d;!function(b){function e(a,b){return v.call(a,b)}function f(a,b){var c,d,e,f,g,h,i,j,k,l,m,n,o=b&&b.split("/"),p=t.map,q=p&&p["*"]||{};if(a){for(a=a.split("/"),g=a.length-1,t.nodeIdCompat&&x.test(a[g])&&(a[g]=a[g].replace(x,"")),"."===a[0].charAt(0)&&o&&(n=o.slice(0,o.length-1),a=n.concat(a)),k=0;k<a.length;k++)if("."===(m=a[k]))a.splice(k,1),k-=1;else if(".."===m){if(0===k||1===k&&".."===a[2]||".."===a[k-1])continue;k>0&&(a.splice(k-1,2),k-=2)}a=a.join("/")}if((o||q)&&p){for(c=a.split("/"),k=c.length;k>0;k-=1){if(d=c.slice(0,k).join("/"),o)for(l=o.length;l>0;l-=1)if((e=p[o.slice(0,l).join("/")])&&(e=e[d])){f=e,h=k;break}if(f)break;!i&&q&&q[d]&&(i=q[d],j=k)}!f&&i&&(f=i,h=j),f&&(c.splice(0,h,f),a=c.join("/"))}return a}function g(a,c){return function(){var d=w.call(arguments,0);return"string"!=typeof d[0]&&1===d.length&&d.push(null),o.apply(b,d.concat([a,c]))}}function h(a){return function(b){return f(b,a)}}function i(a){return function(b){r[a]=b}}function j(a){if(e(s,a)){var c=s[a];delete s[a],u[a]=!0,n.apply(b,c)}if(!e(r,a)&&!e(u,a))throw new Error("No "+a);return r[a]}function k(a){var b,c=a?a.indexOf("!"):-1;return c>-1&&(b=a.substring(0,c),a=a.substring(c+1,a.length)),[b,a]}function l(a){return a?k(a):[]}function m(a){return function(){return t&&t.config&&t.config[a]||{}}}var n,o,p,q,r={},s={},t={},u={},v=Object.prototype.hasOwnProperty,w=[].slice,x=/\.js$/;p=function(a,b){var c,d=k(a),e=d[0],g=b[1];return a=d[1],e&&(e=f(e,g),c=j(e)),e?a=c&&c.normalize?c.normalize(a,h(g)):f(a,g):(a=f(a,g),d=k(a),e=d[0],a=d[1],e&&(c=j(e))),{f:e?e+"!"+a:a,n:a,pr:e,p:c}},q={require:function(a){return g(a)},exports:function(a){var b=r[a];return void 0!==b?b:r[a]={}},module:function(a){return{id:a,uri:"",exports:r[a],config:m(a)}}},n=function(a,c,d,f){var h,k,m,n,o,t,v,w=[],x=typeof d;if(f=f||a,t=l(f),"undefined"===x||"function"===x){for(c=!c.length&&d.length?["require","exports","module"]:c,o=0;o<c.length;o+=1)if(n=p(c[o],t),"require"===(k=n.f))w[o]=q.require(a);else if("exports"===k)w[o]=q.exports(a),v=!0;else if("module"===k)h=w[o]=q.module(a);else if(e(r,k)||e(s,k)||e(u,k))w[o]=j(k);else{if(!n.p)throw new Error(a+" missing "+k);n.p.load(n.n,g(f,!0),i(k),{}),w[o]=r[k]}m=d?d.apply(r[a],w):void 0,a&&(h&&h.exports!==b&&h.exports!==r[a]?r[a]=h.exports:m===b&&v||(r[a]=m))}else a&&(r[a]=d)},a=c=o=function(a,c,d,e,f){if("string"==typeof a)return q[a]?q[a](c):j(p(a,l(c)).f);if(!a.splice){if(t=a,t.deps&&o(t.deps,t.callback),!c)return;c.splice?(a=c,c=d,d=null):a=b}return c=c||function(){},"function"==typeof d&&(d=e,e=f),e?n(b,a,c,d):setTimeout(function(){n(b,a,c,d)},4),o},o.config=function(a){return o(a)},a._defined=r,d=function(a,b,c){if("string"!=typeof a)throw new Error("See almond README: incorrect module build, no module name");b.splice||(c=b,b=[]),e(r,a)||e(s,a)||(s[a]=[a,b,c])},d.amd={jQuery:!0}}(),b.requirejs=a,b.require=c,b.define=d}}(),b.define("almond",function(){}),b.define("jquery",[],function(){var b=a||$;return null==b&&console&&console.error&&console.error("Select2: An instance of jQuery or a jQuery-compatible library was not found. Make sure that you are including jQuery before Select2 on your web page."),b}),b.define("select2/utils",["jquery"],function(a){function b(a){var b=a.prototype,c=[];for(var d in b){"function"==typeof b[d]&&("constructor"!==d&&c.push(d))}return c}var c={};c.Extend=function(a,b){function c(){this.constructor=a}var d={}.hasOwnProperty;for(var e in b)d.call(b,e)&&(a[e]=b[e]);return c.prototype=b.prototype,a.prototype=new c,a.__super__=b.prototype,a},c.Decorate=function(a,c){function d(){var b=Array.prototype.unshift,d=c.prototype.constructor.length,e=a.prototype.constructor;d>0&&(b.call(arguments,a.prototype.constructor),e=c.prototype.constructor),e.apply(this,arguments)}function e(){this.constructor=d}var f=b(c),g=b(a);c.displayName=a.displayName,d.prototype=new e;for(var h=0;h<g.length;h++){var i=g[h];d.prototype[i]=a.prototype[i]}for(var j=(function(a){var b=function(){};a in d.prototype&&(b=d.prototype[a]);var e=c.prototype[a];return function(){return Array.prototype.unshift.call(arguments,b),e.apply(this,arguments)}}),k=0;k<f.length;k++){var l=f[k];d.prototype[l]=j(l)}return d};var d=function(){this.listeners={}};d.prototype.on=function(a,b){this.listeners=this.listeners||{},a in this.listeners?this.listeners[a].push(b):this.listeners[a]=[b]},d.prototype.trigger=function(a){var b=Array.prototype.slice,c=b.call(arguments,1);this.listeners=this.listeners||{},null==c&&(c=[]),0===c.length&&c.push({}),c[0]._type=a,a in this.listeners&&this.invoke(this.listeners[a],b.call(arguments,1)),"*"in this.listeners&&this.invoke(this.listeners["*"],arguments)},d.prototype.invoke=function(a,b){for(var c=0,d=a.length;c<d;c++)a[c].apply(this,b)},c.Observable=d,c.generateChars=function(a){for(var b="",c=0;c<a;c++){b+=Math.floor(36*Math.random()).toString(36)}return b},c.bind=function(a,b){return function(){a.apply(b,arguments)}},c._convertData=function(a){for(var b in a){var c=b.split("-"),d=a;if(1!==c.length){for(var e=0;e<c.length;e++){var f=c[e];f=f.substring(0,1).toLowerCase()+f.substring(1),f in d||(d[f]={}),e==c.length-1&&(d[f]=a[b]),d=d[f]}delete a[b]}}return a},c.hasScroll=function(b,c){var d=a(c),e=c.style.overflowX,f=c.style.overflowY;return(e!==f||"hidden"!==f&&"visible"!==f)&&("scroll"===e||"scroll"===f||(d.innerHeight()<c.scrollHeight||d.innerWidth()<c.scrollWidth))},c.escapeMarkup=function(a){var b={"\\":"&#92;","&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#47;"};return"string"!=typeof a?a:String(a).replace(/[&<>"'\/\\]/g,function(a){return b[a]})},c.appendMany=function(b,c){if("1.7"===a.fn.jquery.substr(0,3)){var d=a();a.map(c,function(a){d=d.add(a)}),c=d}b.append(c)},c.__cache={};var e=0;return c.GetUniqueElementId=function(a){var b=a.getAttribute("data-select2-id");return null==b&&(a.id?(b=a.id,a.setAttribute("data-select2-id",b)):(a.setAttribute("data-select2-id",++e),b=e.toString())),b},c.StoreData=function(a,b,d){var e=c.GetUniqueElementId(a);c.__cache[e]||(c.__cache[e]={}),c.__cache[e][b]=d},c.GetData=function(b,d){var e=c.GetUniqueElementId(b);return d?c.__cache[e]&&null!=c.__cache[e][d]?c.__cache[e][d]:a(b).data(d):c.__cache[e]},c.RemoveData=function(a){var b=c.GetUniqueElementId(a);null!=c.__cache[b]&&delete c.__cache[b]},c}),b.define("select2/results",["jquery","./utils"],function(a,b){function c(a,b,d){this.$element=a,this.data=d,this.options=b,c.__super__.constructor.call(this)}return b.Extend(c,b.Observable),c.prototype.render=function(){var b=a('<ul class="select2-results__options" role="tree"></ul>');return this.options.get("multiple")&&b.attr("aria-multiselectable","true"),this.$results=b,b},c.prototype.clear=function(){this.$results.empty()},c.prototype.displayMessage=function(b){var c=this.options.get("escapeMarkup");this.clear(),this.hideLoading();var d=a('<li role="treeitem" aria-live="assertive" class="select2-results__option"></li>'),e=this.options.get("translations").get(b.message);d.append(c(e(b.args))),d[0].className+=" select2-results__message",this.$results.append(d)},c.prototype.hideMessages=function(){this.$results.find(".select2-results__message").remove()},c.prototype.append=function(a){this.hideLoading();var b=[];if(null==a.results||0===a.results.length)return void(0===this.$results.children().length&&this.trigger("results:message",{message:"noResults"}));a.results=this.sort(a.results);for(var c=0;c<a.results.length;c++){var d=a.results[c],e=this.option(d);b.push(e)}this.$results.append(b)},c.prototype.position=function(a,b){b.find(".select2-results").append(a)},c.prototype.sort=function(a){return this.options.get("sorter")(a)},c.prototype.highlightFirstItem=function(){var a=this.$results.find(".select2-results__option[aria-selected]"),b=a.filter("[aria-selected=true]");b.length>0?b.first().trigger("mouseenter"):a.first().trigger("mouseenter"),this.ensureHighlightVisible()},c.prototype.setClasses=function(){var c=this;this.data.current(function(d){var e=a.map(d,function(a){return a.id.toString()});c.$results.find(".select2-results__option[aria-selected]").each(function(){var c=a(this),d=b.GetData(this,"data"),f=""+d.id;null!=d.element&&d.element.selected||null==d.element&&a.inArray(f,e)>-1?c.attr("aria-selected","true"):c.attr("aria-selected","false")})})},c.prototype.showLoading=function(a){this.hideLoading();var b=this.options.get("translations").get("searching"),c={disabled:!0,loading:!0,text:b(a)},d=this.option(c);d.className+=" loading-results",this.$results.prepend(d)},c.prototype.hideLoading=function(){this.$results.find(".loading-results").remove()},c.prototype.option=function(c){var d=document.createElement("li");d.className="select2-results__option";var e={role:"treeitem","aria-selected":"false"};c.disabled&&(delete e["aria-selected"],e["aria-disabled"]="true"),null==c.id&&delete e["aria-selected"],null!=c._resultId&&(d.id=c._resultId),c.title&&(d.title=c.title),c.children&&(e.role="group",e["aria-label"]=c.text,delete e["aria-selected"]);for(var f in e){var g=e[f];d.setAttribute(f,g)}if(c.children){var h=a(d),i=document.createElement("strong");i.className="select2-results__group";a(i);this.template(c,i);for(var j=[],k=0;k<c.children.length;k++){var l=c.children[k],m=this.option(l);j.push(m)}var n=a("<ul></ul>",{class:"select2-results__options select2-results__options--nested"});n.append(j),h.append(i),h.append(n)}else this.template(c,d);return b.StoreData(d,"data",c),d},c.prototype.bind=function(c,d){var e=this,f=c.id+"-results";this.$results.attr("id",f),c.on("results:all",function(a){e.clear(),e.append(a.data),c.isOpen()&&(e.setClasses(),e.highlightFirstItem())}),c.on("results:append",function(a){e.append(a.data),c.isOpen()&&e.setClasses()}),c.on("query",function(a){e.hideMessages(),e.showLoading(a)}),c.on("select",function(){c.isOpen()&&(e.setClasses(),e.highlightFirstItem())}),c.on("unselect",function(){c.isOpen()&&(e.setClasses(),e.highlightFirstItem())}),c.on("open",function(){e.$results.attr("aria-expanded","true"),e.$results.attr("aria-hidden","false"),e.setClasses(),e.ensureHighlightVisible()}),c.on("close",function(){e.$results.attr("aria-expanded","false"),e.$results.attr("aria-hidden","true"),e.$results.removeAttr("aria-activedescendant")}),c.on("results:toggle",function(){var a=e.getHighlightedResults();0!==a.length&&a.trigger("mouseup")}),c.on("results:select",function(){var a=e.getHighlightedResults();if(0!==a.length){var c=b.GetData(a[0],"data");"true"==a.attr("aria-selected")?e.trigger("close",{}):e.trigger("select",{data:c})}}),c.on("results:previous",function(){var a=e.getHighlightedResults(),b=e.$results.find("[aria-selected]"),c=b.index(a);if(0!==c){var d=c-1;0===a.length&&(d=0);var f=b.eq(d);f.trigger("mouseenter");var g=e.$results.offset().top,h=f.offset().top,i=e.$results.scrollTop()+(h-g);0===d?e.$results.scrollTop(0):h-g<0&&e.$results.scrollTop(i)}}),c.on("results:next",function(){var a=e.getHighlightedResults(),b=e.$results.find("[aria-selected]"),c=b.index(a),d=c+1;if(!(d>=b.length)){var f=b.eq(d);f.trigger("mouseenter");var g=e.$results.offset().top+e.$results.outerHeight(!1),h=f.offset().top+f.outerHeight(!1),i=e.$results.scrollTop()+h-g;0===d?e.$results.scrollTop(0):h>g&&e.$results.scrollTop(i)}}),c.on("results:focus",function(a){a.element.addClass("select2-results__option--highlighted")}),c.on("results:message",function(a){e.displayMessage(a)}),a.fn.mousewheel&&this.$results.on("mousewheel",function(a){var b=e.$results.scrollTop(),c=e.$results.get(0).scrollHeight-b+a.deltaY,d=a.deltaY>0&&b-a.deltaY<=0,f=a.deltaY<0&&c<=e.$results.height();d?(e.$results.scrollTop(0),a.preventDefault(),a.stopPropagation()):f&&(e.$results.scrollTop(e.$results.get(0).scrollHeight-e.$results.height()),a.preventDefault(),a.stopPropagation())}),this.$results.on("mouseup",".select2-results__option[aria-selected]",function(c){var d=a(this),f=b.GetData(this,"data");if("true"===d.attr("aria-selected"))return void(e.options.get("multiple")?e.trigger("unselect",{originalEvent:c,data:f}):e.trigger("close",{}));e.trigger("select",{originalEvent:c,data:f})}),this.$results.on("mouseenter",".select2-results__option[aria-selected]",function(c){var d=b.GetData(this,"data");e.getHighlightedResults().removeClass("select2-results__option--highlighted"),e.trigger("results:focus",{data:d,element:a(this)})})},c.prototype.getHighlightedResults=function(){return this.$results.find(".select2-results__option--highlighted")},c.prototype.destroy=function(){this.$results.remove()},c.prototype.ensureHighlightVisible=function(){var a=this.getHighlightedResults();if(0!==a.length){var b=this.$results.find("[aria-selected]"),c=b.index(a),d=this.$results.offset().top,e=a.offset().top,f=this.$results.scrollTop()+(e-d),g=e-d;f-=2*a.outerHeight(!1),c<=2?this.$results.scrollTop(0):(g>this.$results.outerHeight()||g<0)&&this.$results.scrollTop(f)}},c.prototype.template=function(b,c){var d=this.options.get("templateResult"),e=this.options.get("escapeMarkup"),f=d(b,c);null==f?c.style.display="none":"string"==typeof f?c.innerHTML=e(f):a(c).append(f)},c}),b.define("select2/keys",[],function(){return{BACKSPACE:8,TAB:9,ENTER:13,SHIFT:16,CTRL:17,ALT:18,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46}}),b.define("select2/selection/base",["jquery","../utils","../keys"],function(a,b,c){function d(a,b){this.$element=a,this.options=b,d.__super__.constructor.call(this)}return b.Extend(d,b.Observable),d.prototype.render=function(){var c=a('<span class="select2-selection" role="combobox" aria-haspopup="true" aria-expanded="false"></span>');return this._tabindex=0,null!=b.GetData(this.$element[0],"old-tabindex")?this._tabindex=b.GetData(this.$element[0],"old-tabindex"):null!=this.$element.attr("tabindex")&&(this._tabindex=this.$element.attr("tabindex")),c.attr("title",this.$element.attr("title")),c.attr("tabindex",this._tabindex),this.$selection=c,c},d.prototype.bind=function(a,b){var d=this,e=(a.id,a.id+"-results");this.container=a,this.$selection.on("focus",function(a){d.trigger("focus",a)}),this.$selection.on("blur",function(a){d._handleBlur(a)}),this.$selection.on("keydown",function(a){d.trigger("keypress",a),a.which===c.SPACE&&a.preventDefault()}),a.on("results:focus",function(a){d.$selection.attr("aria-activedescendant",a.data._resultId)}),a.on("selection:update",function(a){d.update(a.data)}),a.on("open",function(){d.$selection.attr("aria-expanded","true"),d.$selection.attr("aria-owns",e),d._attachCloseHandler(a)}),a.on("close",function(){d.$selection.attr("aria-expanded","false"),d.$selection.removeAttr("aria-activedescendant"),d.$selection.removeAttr("aria-owns"),d.$selection.focus(),d._detachCloseHandler(a)}),a.on("enable",function(){d.$selection.attr("tabindex",d._tabindex)}),a.on("disable",function(){d.$selection.attr("tabindex","-1")})},d.prototype._handleBlur=function(b){var c=this;window.setTimeout(function(){document.activeElement==c.$selection[0]||a.contains(c.$selection[0],document.activeElement)||c.trigger("blur",b)},1)},d.prototype._attachCloseHandler=function(c){a(document.body).on("mousedown.select2."+c.id,function(c){var d=a(c.target),e=d.closest(".select2");a(".select2.select2-container--open").each(function(){a(this),this!=e[0]&&b.GetData(this,"element").select2("close")})})},d.prototype._detachCloseHandler=function(b){a(document.body).off("mousedown.select2."+b.id)},d.prototype.position=function(a,b){b.find(".selection").append(a)},d.prototype.destroy=function(){this._detachCloseHandler(this.container)},d.prototype.update=function(a){throw new Error("The `update` method must be defined in child classes.")},d}),b.define("select2/selection/single",["jquery","./base","../utils","../keys"],function(a,b,c,d){function e(){e.__super__.constructor.apply(this,arguments)}return c.Extend(e,b),e.prototype.render=function(){var a=e.__super__.render.call(this);return a.addClass("select2-selection--single"),a.html('<span class="select2-selection__rendered"></span><span class="select2-selection__arrow" role="presentation"><b role="presentation"></b></span>'),a},e.prototype.bind=function(a,b){var c=this;e.__super__.bind.apply(this,arguments);var d=a.id+"-container";this.$selection.find(".select2-selection__rendered").attr("id",d).attr("role","textbox").attr("aria-readonly","true"),this.$selection.attr("aria-labelledby",d),this.$selection.on("mousedown",function(a){1===a.which&&c.trigger("toggle",{originalEvent:a})}),this.$selection.on("focus",function(a){}),this.$selection.on("blur",function(a){}),a.on("focus",function(b){a.isOpen()||c.$selection.focus()})},e.prototype.clear=function(){var a=this.$selection.find(".select2-selection__rendered");a.empty(),a.removeAttr("title")},e.prototype.display=function(a,b){var c=this.options.get("templateSelection");return this.options.get("escapeMarkup")(c(a,b))},e.prototype.selectionContainer=function(){return a("<span></span>")},e.prototype.update=function(a){if(0===a.length)return void this.clear();var b=a[0],c=this.$selection.find(".select2-selection__rendered"),d=this.display(b,c);c.empty().append(d),c.attr("title",b.title||b.text)},e}),b.define("select2/selection/multiple",["jquery","./base","../utils"],function(a,b,c){function d(a,b){d.__super__.constructor.apply(this,arguments)}return c.Extend(d,b),d.prototype.render=function(){var a=d.__super__.render.call(this);return a.addClass("select2-selection--multiple"),a.html('<ul class="select2-selection__rendered"></ul>'),a},d.prototype.bind=function(b,e){var f=this;d.__super__.bind.apply(this,arguments),this.$selection.on("click",function(a){f.trigger("toggle",{originalEvent:a})}),this.$selection.on("click",".select2-selection__choice__remove",function(b){if(!f.options.get("disabled")){var d=a(this),e=d.parent(),g=c.GetData(e[0],"data");f.trigger("unselect",{originalEvent:b,data:g})}})},d.prototype.clear=function(){var a=this.$selection.find(".select2-selection__rendered");a.empty(),a.removeAttr("title")},d.prototype.display=function(a,b){var c=this.options.get("templateSelection");return this.options.get("escapeMarkup")(c(a,b))},d.prototype.selectionContainer=function(){return a('<li class="select2-selection__choice"><span class="select2-selection__choice__remove" role="presentation">&times;</span></li>')},d.prototype.update=function(a){if(this.clear(),0!==a.length){for(var b=[],d=0;d<a.length;d++){var e=a[d],f=this.selectionContainer(),g=this.display(e,f);f.append(g),f.attr("title",e.title||e.text),c.StoreData(f[0],"data",e),b.push(f)}var h=this.$selection.find(".select2-selection__rendered");c.appendMany(h,b)}},d}),b.define("select2/selection/placeholder",["../utils"],function(a){function b(a,b,c){this.placeholder=this.normalizePlaceholder(c.get("placeholder")),a.call(this,b,c)}return b.prototype.normalizePlaceholder=function(a,b){return"string"==typeof b&&(b={id:"",text:b}),b},b.prototype.createPlaceholder=function(a,b){var c=this.selectionContainer();return c.html(this.display(b)),c.addClass("select2-selection__placeholder").removeClass("select2-selection__choice"),c},b.prototype.update=function(a,b){var c=1==b.length&&b[0].id!=this.placeholder.id;if(b.length>1||c)return a.call(this,b);this.clear();var d=this.createPlaceholder(this.placeholder);this.$selection.find(".select2-selection__rendered").append(d)},b}),b.define("select2/selection/allowClear",["jquery","../keys","../utils"],function(a,b,c){function d(){}return d.prototype.bind=function(a,b,c){var d=this;a.call(this,b,c),null==this.placeholder&&this.options.get("debug")&&window.console&&console.error&&console.error("Select2: The `allowClear` option should be used in combination with the `placeholder` option."),this.$selection.on("mousedown",".select2-selection__clear",function(a){d._handleClear(a)}),b.on("keypress",function(a){d._handleKeyboardClear(a,b)})},d.prototype._handleClear=function(a,b){if(!this.options.get("disabled")){var d=this.$selection.find(".select2-selection__clear");if(0!==d.length){b.stopPropagation();var e=c.GetData(d[0],"data"),f=this.$element.val();this.$element.val(this.placeholder.id);var g={data:e};if(this.trigger("clear",g),g.prevented)return void this.$element.val(f);for(var h=0;h<e.length;h++)if(g={data:e[h]},this.trigger("unselect",g),g.prevented)return void this.$element.val(f);this.$element.trigger("change"),this.trigger("toggle",{})}}},d.prototype._handleKeyboardClear=function(a,c,d){d.isOpen()||c.which!=b.DELETE&&c.which!=b.BACKSPACE||this._handleClear(c)},d.prototype.update=function(b,d){if(b.call(this,d),!(this.$selection.find(".select2-selection__placeholder").length>0||0===d.length)){var e=a('<span class="select2-selection__clear">&times;</span>');c.StoreData(e[0],"data",d),this.$selection.find(".select2-selection__rendered").prepend(e)}},d}),b.define("select2/selection/search",["jquery","../utils","../keys"],function(a,b,c){function d(a,b,c){a.call(this,b,c)}return d.prototype.render=function(b){var c=a('<li class="select2-search select2-search--inline"><input class="select2-search__field" type="search" tabindex="-1" autocomplete="off" autocorrect="off" autocapitalize="none" spellcheck="false" role="textbox" aria-autocomplete="list" /></li>');this.$searchContainer=c,this.$search=c.find("input");var d=b.call(this);return this._transferTabIndex(),d},d.prototype.bind=function(a,d,e){var f=this;a.call(this,d,e),d.on("open",function(){f.$search.trigger("focus")}),d.on("close",function(){f.$search.val(""),f.$search.removeAttr("aria-activedescendant"),f.$search.trigger("focus")}),d.on("enable",function(){f.$search.prop("disabled",!1),f._transferTabIndex()}),d.on("disable",function(){f.$search.prop("disabled",!0)}),d.on("focus",function(a){f.$search.trigger("focus")}),d.on("results:focus",function(a){f.$search.attr("aria-activedescendant",a.id)}),this.$selection.on("focusin",".select2-search--inline",function(a){f.trigger("focus",a)}),this.$selection.on("focusout",".select2-search--inline",function(a){f._handleBlur(a)}),this.$selection.on("keydown",".select2-search--inline",function(a){if(a.stopPropagation(),f.trigger("keypress",a),f._keyUpPrevented=a.isDefaultPrevented(),a.which===c.BACKSPACE&&""===f.$search.val()){var d=f.$searchContainer.prev(".select2-selection__choice");if(d.length>0){var e=b.GetData(d[0],"data");f.searchRemoveChoice(e),a.preventDefault()}}});var g=document.documentMode,h=g&&g<=11;this.$selection.on("input.searchcheck",".select2-search--inline",function(a){if(h)return void f.$selection.off("input.search input.searchcheck");f.$selection.off("keyup.search")}),this.$selection.on("keyup.search input.search",".select2-search--inline",function(a){if(h&&"input"===a.type)return void f.$selection.off("input.search input.searchcheck");var b=a.which;b!=c.SHIFT&&b!=c.CTRL&&b!=c.ALT&&b!=c.TAB&&f.handleSearch(a)})},d.prototype._transferTabIndex=function(a){this.$search.attr("tabindex",this.$selection.attr("tabindex")),this.$selection.attr("tabindex","-1")},d.prototype.createPlaceholder=function(a,b){this.$search.attr("placeholder",b.text)},d.prototype.update=function(a,b){var c=this.$search[0]==document.activeElement;this.$search.attr("placeholder",""),a.call(this,b),this.$selection.find(".select2-selection__rendered").append(this.$searchContainer),this.resizeSearch(),c&&this.$search.focus()},d.prototype.handleSearch=function(){if(this.resizeSearch(),!this._keyUpPrevented){var a=this.$search.val();this.trigger("query",{term:a})}this._keyUpPrevented=!1},d.prototype.searchRemoveChoice=function(a,b){this.trigger("unselect",{data:b}),this.$search.val(b.text),this.handleSearch()},d.prototype.resizeSearch=function(){this.$search.css("width","25px");var a="";if(""!==this.$search.attr("placeholder"))a=this.$selection.find(".select2-selection__rendered").innerWidth();else{a=.75*(this.$search.val().length+1)+"em"}this.$search.css("width",a)},d}),b.define("select2/selection/eventRelay",["jquery"],function(a){function b(){}return b.prototype.bind=function(b,c,d){var e=this,f=["open","opening","close","closing","select","selecting","unselect","unselecting","clear","clearing"],g=["opening","closing","selecting","unselecting","clearing"];b.call(this,c,d),c.on("*",function(b,c){if(-1!==a.inArray(b,f)){c=c||{};var d=a.Event("select2:"+b,{params:c});e.$element.trigger(d),-1!==a.inArray(b,g)&&(c.prevented=d.isDefaultPrevented())}})},b}),b.define("select2/translation",["jquery","require"],function(a,b){function c(a){this.dict=a||{}}return c.prototype.all=function(){return this.dict},c.prototype.get=function(a){return this.dict[a]},c.prototype.extend=function(b){this.dict=a.extend({},b.all(),this.dict)},c._cache={},c.loadPath=function(a){if(!(a in c._cache)){var d=b(a);c._cache[a]=d}return new c(c._cache[a])},c}),b.define("select2/diacritics",[],function(){return{"Ⓐ":"A","A":"A","À":"A","Á":"A","Â":"A","Ầ":"A","Ấ":"A","Ẫ":"A","Ẩ":"A","Ã":"A","Ā":"A","Ă":"A","Ằ":"A","Ắ":"A","Ẵ":"A","Ẳ":"A","Ȧ":"A","Ǡ":"A","Ä":"A","Ǟ":"A","Ả":"A","Å":"A","Ǻ":"A","Ǎ":"A","Ȁ":"A","Ȃ":"A","Ạ":"A","Ậ":"A","Ặ":"A","Ḁ":"A","Ą":"A","Ⱥ":"A","Ɐ":"A","Ꜳ":"AA","Æ":"AE","Ǽ":"AE","Ǣ":"AE","Ꜵ":"AO","Ꜷ":"AU","Ꜹ":"AV","Ꜻ":"AV","Ꜽ":"AY","Ⓑ":"B","B":"B","Ḃ":"B","Ḅ":"B","Ḇ":"B","Ƀ":"B","Ƃ":"B","Ɓ":"B","Ⓒ":"C","C":"C","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","Ç":"C","Ḉ":"C","Ƈ":"C","Ȼ":"C","Ꜿ":"C","Ⓓ":"D","D":"D","Ḋ":"D","Ď":"D","Ḍ":"D","Ḑ":"D","Ḓ":"D","Ḏ":"D","Đ":"D","Ƌ":"D","Ɗ":"D","Ɖ":"D","Ꝺ":"D","DZ":"DZ","DŽ":"DZ","Dz":"Dz","Dž":"Dz","Ⓔ":"E","E":"E","È":"E","É":"E","Ê":"E","Ề":"E","Ế":"E","Ễ":"E","Ể":"E","Ẽ":"E","Ē":"E","Ḕ":"E","Ḗ":"E","Ĕ":"E","Ė":"E","Ë":"E","Ẻ":"E","Ě":"E","Ȅ":"E","Ȇ":"E","Ẹ":"E","Ệ":"E","Ȩ":"E","Ḝ":"E","Ę":"E","Ḙ":"E","Ḛ":"E","Ɛ":"E","Ǝ":"E","Ⓕ":"F","F":"F","Ḟ":"F","Ƒ":"F","Ꝼ":"F","Ⓖ":"G","G":"G","Ǵ":"G","Ĝ":"G","Ḡ":"G","Ğ":"G","Ġ":"G","Ǧ":"G","Ģ":"G","Ǥ":"G","Ɠ":"G","Ꞡ":"G","Ᵹ":"G","Ꝿ":"G","Ⓗ":"H","H":"H","Ĥ":"H","Ḣ":"H","Ḧ":"H","Ȟ":"H","Ḥ":"H","Ḩ":"H","Ḫ":"H","Ħ":"H","Ⱨ":"H","Ⱶ":"H","Ɥ":"H","Ⓘ":"I","I":"I","Ì":"I","Í":"I","Î":"I","Ĩ":"I","Ī":"I","Ĭ":"I","İ":"I","Ï":"I","Ḯ":"I","Ỉ":"I","Ǐ":"I","Ȉ":"I","Ȋ":"I","Ị":"I","Į":"I","Ḭ":"I","Ɨ":"I","Ⓙ":"J","J":"J","Ĵ":"J","Ɉ":"J","Ⓚ":"K","K":"K","Ḱ":"K","Ǩ":"K","Ḳ":"K","Ķ":"K","Ḵ":"K","Ƙ":"K","Ⱪ":"K","Ꝁ":"K","Ꝃ":"K","Ꝅ":"K","Ꞣ":"K","Ⓛ":"L","L":"L","Ŀ":"L","Ĺ":"L","Ľ":"L","Ḷ":"L","Ḹ":"L","Ļ":"L","Ḽ":"L","Ḻ":"L","Ł":"L","Ƚ":"L","Ɫ":"L","Ⱡ":"L","Ꝉ":"L","Ꝇ":"L","Ꞁ":"L","LJ":"LJ","Lj":"Lj","Ⓜ":"M","M":"M","Ḿ":"M","Ṁ":"M","Ṃ":"M","Ɱ":"M","Ɯ":"M","Ⓝ":"N","N":"N","Ǹ":"N","Ń":"N","Ñ":"N","Ṅ":"N","Ň":"N","Ṇ":"N","Ņ":"N","Ṋ":"N","Ṉ":"N","Ƞ":"N","Ɲ":"N","Ꞑ":"N","Ꞥ":"N","NJ":"NJ","Nj":"Nj","Ⓞ":"O","O":"O","Ò":"O","Ó":"O","Ô":"O","Ồ":"O","Ố":"O","Ỗ":"O","Ổ":"O","Õ":"O","Ṍ":"O","Ȭ":"O","Ṏ":"O","Ō":"O","Ṑ":"O","Ṓ":"O","Ŏ":"O","Ȯ":"O","Ȱ":"O","Ö":"O","Ȫ":"O","Ỏ":"O","Ő":"O","Ǒ":"O","Ȍ":"O","Ȏ":"O","Ơ":"O","Ờ":"O","Ớ":"O","Ỡ":"O","Ở":"O","Ợ":"O","Ọ":"O","Ộ":"O","Ǫ":"O","Ǭ":"O","Ø":"O","Ǿ":"O","Ɔ":"O","Ɵ":"O","Ꝋ":"O","Ꝍ":"O","Ƣ":"OI","Ꝏ":"OO","Ȣ":"OU","Ⓟ":"P","P":"P","Ṕ":"P","Ṗ":"P","Ƥ":"P","Ᵽ":"P","Ꝑ":"P","Ꝓ":"P","Ꝕ":"P","Ⓠ":"Q","Q":"Q","Ꝗ":"Q","Ꝙ":"Q","Ɋ":"Q","Ⓡ":"R","R":"R","Ŕ":"R","Ṙ":"R","Ř":"R","Ȑ":"R","Ȓ":"R","Ṛ":"R","Ṝ":"R","Ŗ":"R","Ṟ":"R","Ɍ":"R","Ɽ":"R","Ꝛ":"R","Ꞧ":"R","Ꞃ":"R","Ⓢ":"S","S":"S","ẞ":"S","Ś":"S","Ṥ":"S","Ŝ":"S","Ṡ":"S","Š":"S","Ṧ":"S","Ṣ":"S","Ṩ":"S","Ș":"S","Ş":"S","Ȿ":"S","Ꞩ":"S","Ꞅ":"S","Ⓣ":"T","T":"T","Ṫ":"T","Ť":"T","Ṭ":"T","Ț":"T","Ţ":"T","Ṱ":"T","Ṯ":"T","Ŧ":"T","Ƭ":"T","Ʈ":"T","Ⱦ":"T","Ꞇ":"T","Ꜩ":"TZ","Ⓤ":"U","U":"U","Ù":"U","Ú":"U","Û":"U","Ũ":"U","Ṹ":"U","Ū":"U","Ṻ":"U","Ŭ":"U","Ü":"U","Ǜ":"U","Ǘ":"U","Ǖ":"U","Ǚ":"U","Ủ":"U","Ů":"U","Ű":"U","Ǔ":"U","Ȕ":"U","Ȗ":"U","Ư":"U","Ừ":"U","Ứ":"U","Ữ":"U","Ử":"U","Ự":"U","Ụ":"U","Ṳ":"U","Ų":"U","Ṷ":"U","Ṵ":"U","Ʉ":"U","Ⓥ":"V","V":"V","Ṽ":"V","Ṿ":"V","Ʋ":"V","Ꝟ":"V","Ʌ":"V","Ꝡ":"VY","Ⓦ":"W","W":"W","Ẁ":"W","Ẃ":"W","Ŵ":"W","Ẇ":"W","Ẅ":"W","Ẉ":"W","Ⱳ":"W","Ⓧ":"X","X":"X","Ẋ":"X","Ẍ":"X","Ⓨ":"Y","Y":"Y","Ỳ":"Y","Ý":"Y","Ŷ":"Y","Ỹ":"Y","Ȳ":"Y","Ẏ":"Y","Ÿ":"Y","Ỷ":"Y","Ỵ":"Y","Ƴ":"Y","Ɏ":"Y","Ỿ":"Y","Ⓩ":"Z","Z":"Z","Ź":"Z","Ẑ":"Z","Ż":"Z","Ž":"Z","Ẓ":"Z","Ẕ":"Z","Ƶ":"Z","Ȥ":"Z","Ɀ":"Z","Ⱬ":"Z","Ꝣ":"Z","ⓐ":"a","a":"a","ẚ":"a","à":"a","á":"a","â":"a","ầ":"a","ấ":"a","ẫ":"a","ẩ":"a","ã":"a","ā":"a","ă":"a","ằ":"a","ắ":"a","ẵ":"a","ẳ":"a","ȧ":"a","ǡ":"a","ä":"a","ǟ":"a","ả":"a","å":"a","ǻ":"a","ǎ":"a","ȁ":"a","ȃ":"a","ạ":"a","ậ":"a","ặ":"a","ḁ":"a","ą":"a","ⱥ":"a","ɐ":"a","ꜳ":"aa","æ":"ae","ǽ":"ae","ǣ":"ae","ꜵ":"ao","ꜷ":"au","ꜹ":"av","ꜻ":"av","ꜽ":"ay","ⓑ":"b","b":"b","ḃ":"b","ḅ":"b","ḇ":"b","ƀ":"b","ƃ":"b","ɓ":"b","ⓒ":"c","c":"c","ć":"c","ĉ":"c","ċ":"c","č":"c","ç":"c","ḉ":"c","ƈ":"c","ȼ":"c","ꜿ":"c","ↄ":"c","ⓓ":"d","d":"d","ḋ":"d","ď":"d","ḍ":"d","ḑ":"d","ḓ":"d","ḏ":"d","đ":"d","ƌ":"d","ɖ":"d","ɗ":"d","ꝺ":"d","dz":"dz","dž":"dz","ⓔ":"e","e":"e","è":"e","é":"e","ê":"e","ề":"e","ế":"e","ễ":"e","ể":"e","ẽ":"e","ē":"e","ḕ":"e","ḗ":"e","ĕ":"e","ė":"e","ë":"e","ẻ":"e","ě":"e","ȅ":"e","ȇ":"e","ẹ":"e","ệ":"e","ȩ":"e","ḝ":"e","ę":"e","ḙ":"e","ḛ":"e","ɇ":"e","ɛ":"e","ǝ":"e","ⓕ":"f","f":"f","ḟ":"f","ƒ":"f","ꝼ":"f","ⓖ":"g","g":"g","ǵ":"g","ĝ":"g","ḡ":"g","ğ":"g","ġ":"g","ǧ":"g","ģ":"g","ǥ":"g","ɠ":"g","ꞡ":"g","ᵹ":"g","ꝿ":"g","ⓗ":"h","h":"h","ĥ":"h","ḣ":"h","ḧ":"h","ȟ":"h","ḥ":"h","ḩ":"h","ḫ":"h","ẖ":"h","ħ":"h","ⱨ":"h","ⱶ":"h","ɥ":"h","ƕ":"hv","ⓘ":"i","i":"i","ì":"i","í":"i","î":"i","ĩ":"i","ī":"i","ĭ":"i","ï":"i","ḯ":"i","ỉ":"i","ǐ":"i","ȉ":"i","ȋ":"i","ị":"i","į":"i","ḭ":"i","ɨ":"i","ı":"i","ⓙ":"j","j":"j","ĵ":"j","ǰ":"j","ɉ":"j","ⓚ":"k","k":"k","ḱ":"k","ǩ":"k","ḳ":"k","ķ":"k","ḵ":"k","ƙ":"k","ⱪ":"k","ꝁ":"k","ꝃ":"k","ꝅ":"k","ꞣ":"k","ⓛ":"l","l":"l","ŀ":"l","ĺ":"l","ľ":"l","ḷ":"l","ḹ":"l","ļ":"l","ḽ":"l","ḻ":"l","ſ":"l","ł":"l","ƚ":"l","ɫ":"l","ⱡ":"l","ꝉ":"l","ꞁ":"l","ꝇ":"l","lj":"lj","ⓜ":"m","m":"m","ḿ":"m","ṁ":"m","ṃ":"m","ɱ":"m","ɯ":"m","ⓝ":"n","n":"n","ǹ":"n","ń":"n","ñ":"n","ṅ":"n","ň":"n","ṇ":"n","ņ":"n","ṋ":"n","ṉ":"n","ƞ":"n","ɲ":"n","ʼn":"n","ꞑ":"n","ꞥ":"n","nj":"nj","ⓞ":"o","o":"o","ò":"o","ó":"o","ô":"o","ồ":"o","ố":"o","ỗ":"o","ổ":"o","õ":"o","ṍ":"o","ȭ":"o","ṏ":"o","ō":"o","ṑ":"o","ṓ":"o","ŏ":"o","ȯ":"o","ȱ":"o","ö":"o","ȫ":"o","ỏ":"o","ő":"o","ǒ":"o","ȍ":"o","ȏ":"o","ơ":"o","ờ":"o","ớ":"o","ỡ":"o","ở":"o","ợ":"o","ọ":"o","ộ":"o","ǫ":"o","ǭ":"o","ø":"o","ǿ":"o","ɔ":"o","ꝋ":"o","ꝍ":"o","ɵ":"o","ƣ":"oi","ȣ":"ou","ꝏ":"oo","ⓟ":"p","p":"p","ṕ":"p","ṗ":"p","ƥ":"p","ᵽ":"p","ꝑ":"p","ꝓ":"p","ꝕ":"p","ⓠ":"q","q":"q","ɋ":"q","ꝗ":"q","ꝙ":"q","ⓡ":"r","r":"r","ŕ":"r","ṙ":"r","ř":"r","ȑ":"r","ȓ":"r","ṛ":"r","ṝ":"r","ŗ":"r","ṟ":"r","ɍ":"r","ɽ":"r","ꝛ":"r","ꞧ":"r","ꞃ":"r","ⓢ":"s","s":"s","ß":"s","ś":"s","ṥ":"s","ŝ":"s","ṡ":"s","š":"s","ṧ":"s","ṣ":"s","ṩ":"s","ș":"s","ş":"s","ȿ":"s","ꞩ":"s","ꞅ":"s","ẛ":"s","ⓣ":"t","t":"t","ṫ":"t","ẗ":"t","ť":"t","ṭ":"t","ț":"t","ţ":"t","ṱ":"t","ṯ":"t","ŧ":"t","ƭ":"t","ʈ":"t","ⱦ":"t","ꞇ":"t","ꜩ":"tz","ⓤ":"u","u":"u","ù":"u","ú":"u","û":"u","ũ":"u","ṹ":"u","ū":"u","ṻ":"u","ŭ":"u","ü":"u","ǜ":"u","ǘ":"u","ǖ":"u","ǚ":"u","ủ":"u","ů":"u","ű":"u","ǔ":"u","ȕ":"u","ȗ":"u","ư":"u","ừ":"u","ứ":"u","ữ":"u","ử":"u","ự":"u","ụ":"u","ṳ":"u","ų":"u","ṷ":"u","ṵ":"u","ʉ":"u","ⓥ":"v","v":"v","ṽ":"v","ṿ":"v","ʋ":"v","ꝟ":"v","ʌ":"v","ꝡ":"vy","ⓦ":"w","w":"w","ẁ":"w","ẃ":"w","ŵ":"w","ẇ":"w","ẅ":"w","ẘ":"w","ẉ":"w","ⱳ":"w","ⓧ":"x","x":"x","ẋ":"x","ẍ":"x","ⓨ":"y","y":"y","ỳ":"y","ý":"y","ŷ":"y","ỹ":"y","ȳ":"y","ẏ":"y","ÿ":"y","ỷ":"y","ẙ":"y","ỵ":"y","ƴ":"y","ɏ":"y","ỿ":"y","ⓩ":"z","z":"z","ź":"z","ẑ":"z","ż":"z","ž":"z","ẓ":"z","ẕ":"z","ƶ":"z","ȥ":"z","ɀ":"z","ⱬ":"z","ꝣ":"z","Ά":"Α","Έ":"Ε","Ή":"Η","Ί":"Ι","Ϊ":"Ι","Ό":"Ο","Ύ":"Υ","Ϋ":"Υ","Ώ":"Ω","ά":"α","έ":"ε","ή":"η","ί":"ι","ϊ":"ι","ΐ":"ι","ό":"ο","ύ":"υ","ϋ":"υ","ΰ":"υ","ω":"ω","ς":"σ"}}),b.define("select2/data/base",["../utils"],function(a){function b(a,c){b.__super__.constructor.call(this)}return a.Extend(b,a.Observable),b.prototype.current=function(a){throw new Error("The `current` method must be defined in child classes.")},b.prototype.query=function(a,b){throw new Error("The `query` method must be defined in child classes.")},b.prototype.bind=function(a,b){},b.prototype.destroy=function(){},b.prototype.generateResultId=function(b,c){var d=b.id+"-result-";return d+=a.generateChars(4),null!=c.id?d+="-"+c.id.toString():d+="-"+a.generateChars(4),d},b}),b.define("select2/data/select",["./base","../utils","jquery"],function(a,b,c){function d(a,b){this.$element=a,this.options=b,d.__super__.constructor.call(this)}return b.Extend(d,a),d.prototype.current=function(a){var b=[],d=this;this.$element.find(":selected").each(function(){var a=c(this),e=d.item(a);b.push(e)}),a(b)},d.prototype.select=function(a){var b=this;if(a.selected=!0,c(a.element).is("option"))return a.element.selected=!0,void this.$element.trigger("change");if(this.$element.prop("multiple"))this.current(function(d){var e=[];a=[a],a.push.apply(a,d);for(var f=0;f<a.length;f++){var g=a[f].id;-1===c.inArray(g,e)&&e.push(g)}b.$element.val(e),b.$element.trigger("change")});else{var d=a.id;this.$element.val(d),this.$element.trigger("change")}},d.prototype.unselect=function(a){var b=this;if(this.$element.prop("multiple")){if(a.selected=!1,c(a.element).is("option"))return a.element.selected=!1,void this.$element.trigger("change");this.current(function(d){for(var e=[],f=0;f<d.length;f++){var g=d[f].id;g!==a.id&&-1===c.inArray(g,e)&&e.push(g)}b.$element.val(e),b.$element.trigger("change")})}},d.prototype.bind=function(a,b){var c=this;this.container=a,a.on("select",function(a){c.select(a.data)}),a.on("unselect",function(a){c.unselect(a.data)})},d.prototype.destroy=function(){this.$element.find("*").each(function(){b.RemoveData(this)})},d.prototype.query=function(a,b){var d=[],e=this;this.$element.children().each(function(){var b=c(this);if(b.is("option")||b.is("optgroup")){var f=e.item(b),g=e.matches(a,f);null!==g&&d.push(g)}}),b({results:d})},d.prototype.addOptions=function(a){b.appendMany(this.$element,a)},d.prototype.option=function(a){var d;a.children?(d=document.createElement("optgroup"),d.label=a.text):(d=document.createElement("option"),void 0!==d.textContent?d.textContent=a.text:d.innerText=a.text),void 0!==a.id&&(d.value=a.id),a.disabled&&(d.disabled=!0),a.selected&&(d.selected=!0),a.title&&(d.title=a.title);var e=c(d),f=this._normalizeItem(a);return f.element=d,b.StoreData(d,"data",f),e},d.prototype.item=function(a){var d={};if(null!=(d=b.GetData(a[0],"data")))return d;if(a.is("option"))d={id:a.val(),text:a.text(),disabled:a.prop("disabled"),selected:a.prop("selected"),title:a.prop("title")};else if(a.is("optgroup")){d={text:a.prop("label"),children:[],title:a.prop("title")};for(var e=a.children("option"),f=[],g=0;g<e.length;g++){var h=c(e[g]),i=this.item(h);f.push(i)}d.children=f}return d=this._normalizeItem(d),d.element=a[0],b.StoreData(a[0],"data",d),d},d.prototype._normalizeItem=function(a){a!==Object(a)&&(a={id:a,text:a}),a=c.extend({},{text:""},a);var b={selected:!1,disabled:!1};return null!=a.id&&(a.id=a.id.toString()),null!=a.text&&(a.text=a.text.toString()),null==a._resultId&&a.id&&null!=this.container&&(a._resultId=this.generateResultId(this.container,a)),c.extend({},b,a)},d.prototype.matches=function(a,b){return this.options.get("matcher")(a,b)},d}),b.define("select2/data/array",["./select","../utils","jquery"],function(a,b,c){function d(a,b){var c=b.get("data")||[];d.__super__.constructor.call(this,a,b),this.addOptions(this.convertToOptions(c))}return b.Extend(d,a),d.prototype.select=function(a){var b=this.$element.find("option").filter(function(b,c){return c.value==a.id.toString()});0===b.length&&(b=this.option(a),this.addOptions(b)),d.__super__.select.call(this,a)},d.prototype.convertToOptions=function(a){function d(a){return function(){return c(this).val()==a.id}}for(var e=this,f=this.$element.find("option"),g=f.map(function(){return e.item(c(this)).id}).get(),h=[],i=0;i<a.length;i++){var j=this._normalizeItem(a[i]);if(c.inArray(j.id,g)>=0){var k=f.filter(d(j)),l=this.item(k),m=c.extend(!0,{},j,l),n=this.option(m);k.replaceWith(n)}else{var o=this.option(j);if(j.children){var p=this.convertToOptions(j.children);b.appendMany(o,p)}h.push(o)}}return h},d}),b.define("select2/data/ajax",["./array","../utils","jquery"],function(a,b,c){function d(a,b){this.ajaxOptions=this._applyDefaults(b.get("ajax")),null!=this.ajaxOptions.processResults&&(this.processResults=this.ajaxOptions.processResults),d.__super__.constructor.call(this,a,b)}return b.Extend(d,a),d.prototype._applyDefaults=function(a){var b={data:function(a){return c.extend({},a,{q:a.term})},transport:function(a,b,d){var e=c.ajax(a);return e.then(b),e.fail(d),e}};return c.extend({},b,a,!0)},d.prototype.processResults=function(a){return a},d.prototype.query=function(a,b){function d(){var d=f.transport(f,function(d){var f=e.processResults(d,a);e.options.get("debug")&&window.console&&console.error&&(f&&f.results&&c.isArray(f.results)||console.error("Select2: The AJAX results did not return an array in the `results` key of the response.")),b(f)},function(){"status"in d&&(0===d.status||"0"===d.status)||e.trigger("results:message",{message:"errorLoading"})});e._request=d}var e=this;null!=this._request&&(c.isFunction(this._request.abort)&&this._request.abort(),this._request=null);var f=c.extend({type:"GET"},this.ajaxOptions);"function"==typeof f.url&&(f.url=f.url.call(this.$element,a)),"function"==typeof f.data&&(f.data=f.data.call(this.$element,a)),this.ajaxOptions.delay&&null!=a.term?(this._queryTimeout&&window.clearTimeout(this._queryTimeout),this._queryTimeout=window.setTimeout(d,this.ajaxOptions.delay)):d()},d}),b.define("select2/data/tags",["jquery"],function(a){function b(b,c,d){var e=d.get("tags"),f=d.get("createTag");void 0!==f&&(this.createTag=f);var g=d.get("insertTag");if(void 0!==g&&(this.insertTag=g),b.call(this,c,d),a.isArray(e))for(var h=0;h<e.length;h++){var i=e[h],j=this._normalizeItem(i),k=this.option(j);this.$element.append(k)}}return b.prototype.query=function(a,b,c){function d(a,f){for(var g=a.results,h=0;h<g.length;h++){var i=g[h],j=null!=i.children&&!d({results:i.children},!0);if((i.text||"").toUpperCase()===(b.term||"").toUpperCase()||j)return!f&&(a.data=g,void c(a))}if(f)return!0;var k=e.createTag(b);if(null!=k){var l=e.option(k);l.attr("data-select2-tag",!0),e.addOptions([l]),e.insertTag(g,k)}a.results=g,c(a)}var e=this;if(this._removeOldTags(),null==b.term||null!=b.page)return void a.call(this,b,c);a.call(this,b,d)},b.prototype.createTag=function(b,c){var d=a.trim(c.term);return""===d?null:{id:d,text:d}},b.prototype.insertTag=function(a,b,c){b.unshift(c)},b.prototype._removeOldTags=function(b){this._lastTag;this.$element.find("option[data-select2-tag]").each(function(){this.selected||a(this).remove()})},b}),b.define("select2/data/tokenizer",["jquery"],function(a){function b(a,b,c){var d=c.get("tokenizer");void 0!==d&&(this.tokenizer=d),a.call(this,b,c)}return b.prototype.bind=function(a,b,c){a.call(this,b,c),this.$search=b.dropdown.$search||b.selection.$search||c.find(".select2-search__field")},b.prototype.query=function(b,c,d){function e(b){var c=g._normalizeItem(b);if(!g.$element.find("option").filter(function(){return a(this).val()===c.id}).length){var d=g.option(c);d.attr("data-select2-tag",!0),g._removeOldTags(),g.addOptions([d])}f(c)}function f(a){g.trigger("select",{data:a})}var g=this;c.term=c.term||"";var h=this.tokenizer(c,this.options,e);h.term!==c.term&&(this.$search.length&&(this.$search.val(h.term),this.$search.focus()),c.term=h.term),b.call(this,c,d)},b.prototype.tokenizer=function(b,c,d,e){for(var f=d.get("tokenSeparators")||[],g=c.term,h=0,i=this.createTag||function(a){return{id:a.term,text:a.term}};h<g.length;){var j=g[h];if(-1!==a.inArray(j,f)){var k=g.substr(0,h),l=a.extend({},c,{term:k}),m=i(l);null!=m?(e(m),g=g.substr(h+1)||"",h=0):h++}else h++}return{term:g}},b}),b.define("select2/data/minimumInputLength",[],function(){function a(a,b,c){this.minimumInputLength=c.get("minimumInputLength"),a.call(this,b,c)}return a.prototype.query=function(a,b,c){if(b.term=b.term||"",b.term.length<this.minimumInputLength)return void this.trigger("results:message",{message:"inputTooShort",args:{minimum:this.minimumInputLength,input:b.term,params:b}});a.call(this,b,c)},a}),b.define("select2/data/maximumInputLength",[],function(){function a(a,b,c){this.maximumInputLength=c.get("maximumInputLength"),a.call(this,b,c)}return a.prototype.query=function(a,b,c){if(b.term=b.term||"",this.maximumInputLength>0&&b.term.length>this.maximumInputLength)return void this.trigger("results:message",{message:"inputTooLong",args:{maximum:this.maximumInputLength,input:b.term,params:b}});a.call(this,b,c)},a}),b.define("select2/data/maximumSelectionLength",[],function(){function a(a,b,c){this.maximumSelectionLength=c.get("maximumSelectionLength"),a.call(this,b,c)}return a.prototype.query=function(a,b,c){var d=this;this.current(function(e){var f=null!=e?e.length:0;if(d.maximumSelectionLength>0&&f>=d.maximumSelectionLength)return void d.trigger("results:message",{message:"maximumSelected",args:{maximum:d.maximumSelectionLength}});a.call(d,b,c)})},a}),b.define("select2/dropdown",["jquery","./utils"],function(a,b){function c(a,b){this.$element=a,this.options=b,c.__super__.constructor.call(this)}return b.Extend(c,b.Observable),c.prototype.render=function(){var b=a('<span class="select2-dropdown"><span class="select2-results"></span></span>');return b.attr("dir",this.options.get("dir")),this.$dropdown=b,b},c.prototype.bind=function(){},c.prototype.position=function(a,b){},c.prototype.destroy=function(){this.$dropdown.remove()},c}),b.define("select2/dropdown/search",["jquery","../utils"],function(a,b){function c(){}return c.prototype.render=function(b){var c=b.call(this),d=a('<span class="select2-search select2-search--dropdown"><input class="select2-search__field" type="search" tabindex="-1" autocomplete="off" autocorrect="off" autocapitalize="none" spellcheck="false" role="textbox" /></span>');return this.$searchContainer=d,this.$search=d.find("input"),c.prepend(d),c},c.prototype.bind=function(b,c,d){var e=this;b.call(this,c,d),this.$search.on("keydown",function(a){e.trigger("keypress",a),e._keyUpPrevented=a.isDefaultPrevented()}),this.$search.on("input",function(b){a(this).off("keyup")}),this.$search.on("keyup input",function(a){e.handleSearch(a)}),c.on("open",function(){e.$search.attr("tabindex",0),e.$search.focus(),window.setTimeout(function(){e.$search.focus()},0)}),c.on("close",function(){e.$search.attr("tabindex",-1),e.$search.val(""),e.$search.blur()}),c.on("focus",function(){c.isOpen()||e.$search.focus()}),c.on("results:all",function(a){if(null==a.query.term||""===a.query.term){e.showSearch(a)?e.$searchContainer.removeClass("select2-search--hide"):e.$searchContainer.addClass("select2-search--hide")}})},c.prototype.handleSearch=function(a){if(!this._keyUpPrevented){var b=this.$search.val();this.trigger("query",{term:b})}this._keyUpPrevented=!1},c.prototype.showSearch=function(a,b){return!0},c}),b.define("select2/dropdown/hidePlaceholder",[],function(){function a(a,b,c,d){this.placeholder=this.normalizePlaceholder(c.get("placeholder")),a.call(this,b,c,d)}return a.prototype.append=function(a,b){b.results=this.removePlaceholder(b.results),a.call(this,b)},a.prototype.normalizePlaceholder=function(a,b){return"string"==typeof b&&(b={id:"",text:b}),b},a.prototype.removePlaceholder=function(a,b){for(var c=b.slice(0),d=b.length-1;d>=0;d--){var e=b[d];this.placeholder.id===e.id&&c.splice(d,1)}return c},a}),b.define("select2/dropdown/infiniteScroll",["jquery"],function(a){function b(a,b,c,d){this.lastParams={},a.call(this,b,c,d),this.$loadingMore=this.createLoadingMore(),this.loading=!1}return b.prototype.append=function(a,b){this.$loadingMore.remove(),this.loading=!1,a.call(this,b),this.showLoadingMore(b)&&this.$results.append(this.$loadingMore)},b.prototype.bind=function(b,c,d){var e=this;b.call(this,c,d),c.on("query",function(a){e.lastParams=a,e.loading=!0}),c.on("query:append",function(a){e.lastParams=a,e.loading=!0}),this.$results.on("scroll",function(){var b=a.contains(document.documentElement,e.$loadingMore[0]);if(!e.loading&&b){e.$results.offset().top+e.$results.outerHeight(!1)+50>=e.$loadingMore.offset().top+e.$loadingMore.outerHeight(!1)&&e.loadMore()}})},b.prototype.loadMore=function(){this.loading=!0;var b=a.extend({},{page:1},this.lastParams);b.page++,this.trigger("query:append",b)},b.prototype.showLoadingMore=function(a,b){return b.pagination&&b.pagination.more},b.prototype.createLoadingMore=function(){var b=a('<li class="select2-results__option select2-results__option--load-more"role="treeitem" aria-disabled="true"></li>'),c=this.options.get("translations").get("loadingMore");return b.html(c(this.lastParams)),b},b}),b.define("select2/dropdown/attachBody",["jquery","../utils"],function(a,b){function c(b,c,d){this.$dropdownParent=d.get("dropdownParent")||a(document.body),b.call(this,c,d)}return c.prototype.bind=function(a,b,c){var d=this,e=!1;a.call(this,b,c),b.on("open",function(){d._showDropdown(),d._attachPositioningHandler(b),e||(e=!0,b.on("results:all",function(){d._positionDropdown(),d._resizeDropdown()}),b.on("results:append",function(){d._positionDropdown(),d._resizeDropdown()}))}),b.on("close",function(){d._hideDropdown(),d._detachPositioningHandler(b)}),this.$dropdownContainer.on("mousedown",function(a){a.stopPropagation()})},c.prototype.destroy=function(a){a.call(this),this.$dropdownContainer.remove()},c.prototype.position=function(a,b,c){b.attr("class",c.attr("class")),b.removeClass("select2"),b.addClass("select2-container--open"),b.css({position:"absolute",top:-999999}),this.$container=c},c.prototype.render=function(b){var c=a("<span></span>"),d=b.call(this);return c.append(d),this.$dropdownContainer=c,c},c.prototype._hideDropdown=function(a){this.$dropdownContainer.detach()},c.prototype._attachPositioningHandler=function(c,d){var e=this,f="scroll.select2."+d.id,g="resize.select2."+d.id,h="orientationchange.select2."+d.id,i=this.$container.parents().filter(b.hasScroll);i.each(function(){b.StoreData(this,"select2-scroll-position",{x:a(this).scrollLeft(),y:a(this).scrollTop()})}),i.on(f,function(c){var d=b.GetData(this,"select2-scroll-position");a(this).scrollTop(d.y)}),a(window).on(f+" "+g+" "+h,function(a){e._positionDropdown(),e._resizeDropdown()})},c.prototype._detachPositioningHandler=function(c,d){var e="scroll.select2."+d.id,f="resize.select2."+d.id,g="orientationchange.select2."+d.id;this.$container.parents().filter(b.hasScroll).off(e),a(window).off(e+" "+f+" "+g)},c.prototype._positionDropdown=function(){var b=a(window),c=this.$dropdown.hasClass("select2-dropdown--above"),d=this.$dropdown.hasClass("select2-dropdown--below"),e=null,f=this.$container.offset();f.bottom=f.top+this.$container.outerHeight(!1);var g={height:this.$container.outerHeight(!1)};g.top=f.top,g.bottom=f.top+g.height;var h={height:this.$dropdown.outerHeight(!1)},i={top:b.scrollTop(),bottom:b.scrollTop()+b.height()},j=i.top<f.top-h.height,k=i.bottom>f.bottom+h.height,l={left:f.left,top:g.bottom},m=this.$dropdownParent;"static"===m.css("position")&&(m=m.offsetParent());var n=m.offset();l.top-=n.top,l.left-=n.left,c||d||(e="below"),k||!j||c?!j&&k&&c&&(e="below"):e="above",("above"==e||c&&"below"!==e)&&(l.top=g.top-n.top-h.height),null!=e&&(this.$dropdown.removeClass("select2-dropdown--below select2-dropdown--above").addClass("select2-dropdown--"+e),this.$container.removeClass("select2-container--below select2-container--above").addClass("select2-container--"+e)),this.$dropdownContainer.css(l)},c.prototype._resizeDropdown=function(){var a={width:this.$container.outerWidth(!1)+"px"};this.options.get("dropdownAutoWidth")&&(a.minWidth=a.width,a.position="relative",a.width="auto"),this.$dropdown.css(a)},c.prototype._showDropdown=function(a){this.$dropdownContainer.appendTo(this.$dropdownParent),this._positionDropdown(),this._resizeDropdown()},c}),b.define("select2/dropdown/minimumResultsForSearch",[],function(){function a(b){for(var c=0,d=0;d<b.length;d++){var e=b[d];e.children?c+=a(e.children):c++}return c}function b(a,b,c,d){this.minimumResultsForSearch=c.get("minimumResultsForSearch"),this.minimumResultsForSearch<0&&(this.minimumResultsForSearch=1/0),a.call(this,b,c,d)}return b.prototype.showSearch=function(b,c){return!(a(c.data.results)<this.minimumResultsForSearch)&&b.call(this,c)},b}),b.define("select2/dropdown/selectOnClose",["../utils"],function(a){function b(){}return b.prototype.bind=function(a,b,c){var d=this;a.call(this,b,c),b.on("close",function(a){d._handleSelectOnClose(a)})},b.prototype._handleSelectOnClose=function(b,c){if(c&&null!=c.originalSelect2Event){var d=c.originalSelect2Event;if("select"===d._type||"unselect"===d._type)return}var e=this.getHighlightedResults();if(!(e.length<1)){var f=a.GetData(e[0],"data");null!=f.element&&f.element.selected||null==f.element&&f.selected||this.trigger("select",{data:f})}},b}),b.define("select2/dropdown/closeOnSelect",[],function(){function a(){}return a.prototype.bind=function(a,b,c){var d=this;a.call(this,b,c),b.on("select",function(a){d._selectTriggered(a)}),b.on("unselect",function(a){d._selectTriggered(a)})},a.prototype._selectTriggered=function(a,b){var c=b.originalEvent;c&&c.ctrlKey||this.trigger("close",{originalEvent:c,originalSelect2Event:b})},a}),b.define("select2/i18n/en",[],function(){return{errorLoading:function(){return"The results could not be loaded."},inputTooLong:function(a){var b=a.input.length-a.maximum,c="Please delete "+b+" character";return 1!=b&&(c+="s"),c},inputTooShort:function(a){return"Please enter "+(a.minimum-a.input.length)+" or more characters"},loadingMore:function(){return"Loading more results…"},maximumSelected:function(a){var b="You can only select "+a.maximum+" item";return 1!=a.maximum&&(b+="s"),b},noResults:function(){return"No results found"},searching:function(){return"Searching…"}}}),b.define("select2/defaults",["jquery","require","./results","./selection/single","./selection/multiple","./selection/placeholder","./selection/allowClear","./selection/search","./selection/eventRelay","./utils","./translation","./diacritics","./data/select","./data/array","./data/ajax","./data/tags","./data/tokenizer","./data/minimumInputLength","./data/maximumInputLength","./data/maximumSelectionLength","./dropdown","./dropdown/search","./dropdown/hidePlaceholder","./dropdown/infiniteScroll","./dropdown/attachBody","./dropdown/minimumResultsForSearch","./dropdown/selectOnClose","./dropdown/closeOnSelect","./i18n/en"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C){function D(){this.reset()}return D.prototype.apply=function(l){if(l=a.extend(!0,{},this.defaults,l),null==l.dataAdapter){if(null!=l.ajax?l.dataAdapter=o:null!=l.data?l.dataAdapter=n:l.dataAdapter=m,l.minimumInputLength>0&&(l.dataAdapter=j.Decorate(l.dataAdapter,r)),l.maximumInputLength>0&&(l.dataAdapter=j.Decorate(l.dataAdapter,s)),l.maximumSelectionLength>0&&(l.dataAdapter=j.Decorate(l.dataAdapter,t)),l.tags&&(l.dataAdapter=j.Decorate(l.dataAdapter,p)),null==l.tokenSeparators&&null==l.tokenizer||(l.dataAdapter=j.Decorate(l.dataAdapter,q)),null!=l.query){var C=b(l.amdBase+"compat/query");l.dataAdapter=j.Decorate(l.dataAdapter,C)}if(null!=l.initSelection){var D=b(l.amdBase+"compat/initSelection");l.dataAdapter=j.Decorate(l.dataAdapter,D)}}if(null==l.resultsAdapter&&(l.resultsAdapter=c,null!=l.ajax&&(l.resultsAdapter=j.Decorate(l.resultsAdapter,x)),null!=l.placeholder&&(l.resultsAdapter=j.Decorate(l.resultsAdapter,w)),l.selectOnClose&&(l.resultsAdapter=j.Decorate(l.resultsAdapter,A))),null==l.dropdownAdapter){if(l.multiple)l.dropdownAdapter=u;else{var E=j.Decorate(u,v);l.dropdownAdapter=E}if(0!==l.minimumResultsForSearch&&(l.dropdownAdapter=j.Decorate(l.dropdownAdapter,z)),l.closeOnSelect&&(l.dropdownAdapter=j.Decorate(l.dropdownAdapter,B)),null!=l.dropdownCssClass||null!=l.dropdownCss||null!=l.adaptDropdownCssClass){var F=b(l.amdBase+"compat/dropdownCss");l.dropdownAdapter=j.Decorate(l.dropdownAdapter,F)}l.dropdownAdapter=j.Decorate(l.dropdownAdapter,y)}if(null==l.selectionAdapter){if(l.multiple?l.selectionAdapter=e:l.selectionAdapter=d,null!=l.placeholder&&(l.selectionAdapter=j.Decorate(l.selectionAdapter,f)),l.allowClear&&(l.selectionAdapter=j.Decorate(l.selectionAdapter,g)),l.multiple&&(l.selectionAdapter=j.Decorate(l.selectionAdapter,h)),null!=l.containerCssClass||null!=l.containerCss||null!=l.adaptContainerCssClass){var G=b(l.amdBase+"compat/containerCss");l.selectionAdapter=j.Decorate(l.selectionAdapter,G)}l.selectionAdapter=j.Decorate(l.selectionAdapter,i)}if("string"==typeof l.language)if(l.language.indexOf("-")>0){var H=l.language.split("-"),I=H[0];l.language=[l.language,I]}else l.language=[l.language];if(a.isArray(l.language)){var J=new k;l.language.push("en");for(var K=l.language,L=0;L<K.length;L++){var M=K[L],N={};try{N=k.loadPath(M)}catch(a){try{M=this.defaults.amdLanguageBase+M,N=k.loadPath(M)}catch(a){l.debug&&window.console&&console.warn&&console.warn('Select2: The language file for "'+M+'" could not be automatically loaded. A fallback will be used instead.');continue}}J.extend(N)}l.translations=J}else{var O=k.loadPath(this.defaults.amdLanguageBase+"en"),P=new k(l.language);P.extend(O),l.translations=P}return l},D.prototype.reset=function(){function b(a){function b(a){return l[a]||a}return a.replace(/[^\u0000-\u007E]/g,b)}function c(d,e){if(""===a.trim(d.term))return e;if(e.children&&e.children.length>0){for(var f=a.extend(!0,{},e),g=e.children.length-1;g>=0;g--){null==c(d,e.children[g])&&f.children.splice(g,1)}return f.children.length>0?f:c(d,f)}var h=b(e.text).toUpperCase(),i=b(d.term).toUpperCase();return h.indexOf(i)>-1?e:null}this.defaults={amdBase:"./",amdLanguageBase:"./i18n/",closeOnSelect:!0,debug:!1,dropdownAutoWidth:!1,escapeMarkup:j.escapeMarkup,language:C,matcher:c,minimumInputLength:0,maximumInputLength:0,maximumSelectionLength:0,minimumResultsForSearch:0,selectOnClose:!1,sorter:function(a){return a},templateResult:function(a){return a.text},templateSelection:function(a){return a.text},theme:"default",width:"resolve"}},D.prototype.set=function(b,c){var d=a.camelCase(b),e={};e[d]=c;var f=j._convertData(e);a.extend(!0,this.defaults,f)},new D}),b.define("select2/options",["require","jquery","./defaults","./utils"],function(a,b,c,d){function e(b,e){if(this.options=b,null!=e&&this.fromElement(e),this.options=c.apply(this.options),e&&e.is("input")){var f=a(this.get("amdBase")+"compat/inputData");this.options.dataAdapter=d.Decorate(this.options.dataAdapter,f)}}return e.prototype.fromElement=function(a){var c=["select2"];null==this.options.multiple&&(this.options.multiple=a.prop("multiple")),null==this.options.disabled&&(this.options.disabled=a.prop("disabled")),null==this.options.language&&(a.prop("lang")?this.options.language=a.prop("lang").toLowerCase():a.closest("[lang]").prop("lang")&&(this.options.language=a.closest("[lang]").prop("lang"))),null==this.options.dir&&(a.prop("dir")?this.options.dir=a.prop("dir"):a.closest("[dir]").prop("dir")?this.options.dir=a.closest("[dir]").prop("dir"):this.options.dir="ltr"),a.prop("disabled",this.options.disabled),a.prop("multiple",this.options.multiple),d.GetData(a[0],"select2Tags")&&(this.options.debug&&window.console&&console.warn&&console.warn('Select2: The `data-select2-tags` attribute has been changed to use the `data-data` and `data-tags="true"` attributes and will be removed in future versions of Select2.'),d.StoreData(a[0],"data",d.GetData(a[0],"select2Tags")),d.StoreData(a[0],"tags",!0)),d.GetData(a[0],"ajaxUrl")&&(this.options.debug&&window.console&&console.warn&&console.warn("Select2: The `data-ajax-url` attribute has been changed to `data-ajax--url` and support for the old attribute will be removed in future versions of Select2."),a.attr("ajax--url",d.GetData(a[0],"ajaxUrl")),d.StoreData(a[0],"ajax-Url",d.GetData(a[0],"ajaxUrl")));var e={};e=b.fn.jquery&&"1."==b.fn.jquery.substr(0,2)&&a[0].dataset?b.extend(!0,{},a[0].dataset,d.GetData(a[0])):d.GetData(a[0]);var f=b.extend(!0,{},e);f=d._convertData(f);for(var g in f)b.inArray(g,c)>-1||(b.isPlainObject(this.options[g])?b.extend(this.options[g],f[g]):this.options[g]=f[g]);return this},e.prototype.get=function(a){return this.options[a]},e.prototype.set=function(a,b){this.options[a]=b},e}),b.define("select2/core",["jquery","./options","./utils","./keys"],function(a,b,c,d){var e=function(a,d){null!=c.GetData(a[0],"select2")&&c.GetData(a[0],"select2").destroy(),this.$element=a,this.id=this._generateId(a),d=d||{},this.options=new b(d,a),e.__super__.constructor.call(this);var f=a.attr("tabindex")||0;c.StoreData(a[0],"old-tabindex",f),a.attr("tabindex","-1");var g=this.options.get("dataAdapter");this.dataAdapter=new g(a,this.options);var h=this.render();this._placeContainer(h);var i=this.options.get("selectionAdapter");this.selection=new i(a,this.options),this.$selection=this.selection.render(),this.selection.position(this.$selection,h);var j=this.options.get("dropdownAdapter");this.dropdown=new j(a,this.options),this.$dropdown=this.dropdown.render(),this.dropdown.position(this.$dropdown,h);var k=this.options.get("resultsAdapter");this.results=new k(a,this.options,this.dataAdapter),this.$results=this.results.render(),this.results.position(this.$results,this.$dropdown);var l=this;this._bindAdapters(),this._registerDomEvents(),this._registerDataEvents(),this._registerSelectionEvents(),this._registerDropdownEvents(),this._registerResultsEvents(),this._registerEvents(),this.dataAdapter.current(function(a){l.trigger("selection:update",{data:a})}),a.addClass("select2-hidden-accessible"),a.attr("aria-hidden","true"),this._syncAttributes(),c.StoreData(a[0],"select2",this)};return c.Extend(e,c.Observable),e.prototype._generateId=function(a){var b="";return b=null!=a.attr("id")?a.attr("id"):null!=a.attr("name")?a.attr("name")+"-"+c.generateChars(2):c.generateChars(4),b=b.replace(/(:|\.|\[|\]|,)/g,""),b="select2-"+b},e.prototype._placeContainer=function(a){a.insertAfter(this.$element);var b=this._resolveWidth(this.$element,this.options.get("width"));null!=b&&a.css("width",b)},e.prototype._resolveWidth=function(a,b){var c=/^width:(([-+]?([0-9]*\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/i;if("resolve"==b){var d=this._resolveWidth(a,"style");return null!=d?d:this._resolveWidth(a,"element")}if("element"==b){var e=a.outerWidth(!1);return e<=0?"auto":e+"px"}if("style"==b){var f=a.attr("style");if("string"!=typeof f)return null;for(var g=f.split(";"),h=0,i=g.length;h<i;h+=1){var j=g[h].replace(/\s/g,""),k=j.match(c);if(null!==k&&k.length>=1)return k[1]}return null}return b},e.prototype._bindAdapters=function(){this.dataAdapter.bind(this,this.$container),this.selection.bind(this,this.$container),this.dropdown.bind(this,this.$container),this.results.bind(this,this.$container)},e.prototype._registerDomEvents=function(){var b=this;this.$element.on("change.select2",function(){b.dataAdapter.current(function(a){b.trigger("selection:update",{data:a})})}),this.$element.on("focus.select2",function(a){b.trigger("focus",a)}),this._syncA=c.bind(this._syncAttributes,this),this._syncS=c.bind(this._syncSubtree,this),this.$element[0].attachEvent&&this.$element[0].attachEvent("onpropertychange",this._syncA);var d=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver;null!=d?(this._observer=new d(function(c){a.each(c,b._syncA),a.each(c,b._syncS)}),this._observer.observe(this.$element[0],{attributes:!0,childList:!0,subtree:!1})):this.$element[0].addEventListener&&(this.$element[0].addEventListener("DOMAttrModified",b._syncA,!1),this.$element[0].addEventListener("DOMNodeInserted",b._syncS,!1),this.$element[0].addEventListener("DOMNodeRemoved",b._syncS,!1))},e.prototype._registerDataEvents=function(){var a=this;this.dataAdapter.on("*",function(b,c){a.trigger(b,c)})},e.prototype._registerSelectionEvents=function(){var b=this,c=["toggle","focus"];this.selection.on("toggle",function(){b.toggleDropdown()}),this.selection.on("focus",function(a){b.focus(a)}),this.selection.on("*",function(d,e){-1===a.inArray(d,c)&&b.trigger(d,e)})},e.prototype._registerDropdownEvents=function(){var a=this;this.dropdown.on("*",function(b,c){a.trigger(b,c)})},e.prototype._registerResultsEvents=function(){var a=this;this.results.on("*",function(b,c){a.trigger(b,c)})},e.prototype._registerEvents=function(){var a=this;this.on("open",function(){a.$container.addClass("select2-container--open")}),this.on("close",function(){a.$container.removeClass("select2-container--open")}),this.on("enable",function(){a.$container.removeClass("select2-container--disabled")}),this.on("disable",function(){a.$container.addClass("select2-container--disabled")}),this.on("blur",function(){a.$container.removeClass("select2-container--focus")}),this.on("query",function(b){a.isOpen()||a.trigger("open",{}),this.dataAdapter.query(b,function(c){a.trigger("results:all",{data:c,query:b})})}),this.on("query:append",function(b){this.dataAdapter.query(b,function(c){a.trigger("results:append",{data:c,query:b})})}),this.on("keypress",function(b){var c=b.which;a.isOpen()?c===d.ESC||c===d.TAB||c===d.UP&&b.altKey?(a.close(),b.preventDefault()):c===d.ENTER?(a.trigger("results:select",{}),b.preventDefault()):c===d.SPACE&&b.ctrlKey?(a.trigger("results:toggle",{}),b.preventDefault()):c===d.UP?(a.trigger("results:previous",{}),b.preventDefault()):c===d.DOWN&&(a.trigger("results:next",{}),b.preventDefault()):(c===d.ENTER||c===d.SPACE||c===d.DOWN&&b.altKey)&&(a.open(),b.preventDefault())})},e.prototype._syncAttributes=function(){this.options.set("disabled",this.$element.prop("disabled")),this.options.get("disabled")?(this.isOpen()&&this.close(),this.trigger("disable",{})):this.trigger("enable",{})},e.prototype._syncSubtree=function(a,b){var c=!1,d=this;if(!a||!a.target||"OPTION"===a.target.nodeName||"OPTGROUP"===a.target.nodeName){if(b)if(b.addedNodes&&b.addedNodes.length>0)for(var e=0;e<b.addedNodes.length;e++){var f=b.addedNodes[e];f.selected&&(c=!0)}else b.removedNodes&&b.removedNodes.length>0&&(c=!0);else c=!0;c&&this.dataAdapter.current(function(a){d.trigger("selection:update",{data:a})})}},e.prototype.trigger=function(a,b){var c=e.__super__.trigger,d={open:"opening",close:"closing",select:"selecting",unselect:"unselecting",clear:"clearing"};if(void 0===b&&(b={}),a in d){var f=d[a],g={prevented:!1,name:a,args:b};if(c.call(this,f,g),g.prevented)return void(b.prevented=!0)}c.call(this,a,b)},e.prototype.toggleDropdown=function(){this.options.get("disabled")||(this.isOpen()?this.close():this.open())},e.prototype.open=function(){this.isOpen()||this.trigger("query",{})},e.prototype.close=function(){this.isOpen()&&this.trigger("close",{})},e.prototype.isOpen=function(){return this.$container.hasClass("select2-container--open")},e.prototype.hasFocus=function(){return this.$container.hasClass("select2-container--focus")},e.prototype.focus=function(a){this.hasFocus()||(this.$container.addClass("select2-container--focus"),this.trigger("focus",{}))},e.prototype.enable=function(a){this.options.get("debug")&&window.console&&console.warn&&console.warn('Select2: The `select2("enable")` method has been deprecated and will be removed in later Select2 versions. Use $element.prop("disabled") instead.'),null!=a&&0!==a.length||(a=[!0]);var b=!a[0];this.$element.prop("disabled",b)},e.prototype.data=function(){this.options.get("debug")&&arguments.length>0&&window.console&&console.warn&&console.warn('Select2: Data can no longer be set using `select2("data")`. You should consider setting the value instead using `$element.val()`.');var a=[];return this.dataAdapter.current(function(b){a=b}),a},e.prototype.val=function(b){if(this.options.get("debug")&&window.console&&console.warn&&console.warn('Select2: The `select2("val")` method has been deprecated and will be removed in later Select2 versions. Use $element.val() instead.'),null==b||0===b.length)return this.$element.val();var c=b[0];a.isArray(c)&&(c=a.map(c,function(a){return a.toString()})),this.$element.val(c).trigger("change")},e.prototype.destroy=function(){this.$container.remove(),this.$element[0].detachEvent&&this.$element[0].detachEvent("onpropertychange",this._syncA),null!=this._observer?(this._observer.disconnect(),this._observer=null):this.$element[0].removeEventListener&&(this.$element[0].removeEventListener("DOMAttrModified",this._syncA,!1),this.$element[0].removeEventListener("DOMNodeInserted",this._syncS,!1),this.$element[0].removeEventListener("DOMNodeRemoved",this._syncS,!1)),this._syncA=null,this._syncS=null,this.$element.off(".select2"),this.$element.attr("tabindex",c.GetData(this.$element[0],"old-tabindex")),this.$element.removeClass("select2-hidden-accessible"),this.$element.attr("aria-hidden","false"),c.RemoveData(this.$element[0]),this.dataAdapter.destroy(),this.selection.destroy(),this.dropdown.destroy(),this.results.destroy(),this.dataAdapter=null,this.selection=null,this.dropdown=null,this.results=null},e.prototype.render=function(){var b=a('<span class="select2 select2-container"><span class="selection"></span><span class="dropdown-wrapper" aria-hidden="true"></span></span>');return b.attr("dir",this.options.get("dir")),this.$container=b,this.$container.addClass("select2-container--"+this.options.get("theme")),c.StoreData(b[0],"element",this.$element),b},e}),b.define("jquery-mousewheel",["jquery"],function(a){return a}),b.define("jquery.select2",["jquery","jquery-mousewheel","./select2/core","./select2/defaults","./select2/utils"],function(a,b,c,d,e){if(null==a.fn.select2){var f=["open","close","destroy"];a.fn.select2=function(b){if("object"==typeof(b=b||{}))return this.each(function(){var d=a.extend(!0,{},b);new c(a(this),d)}),this;if("string"==typeof b){var d,g=Array.prototype.slice.call(arguments,1);return this.each(function(){var a=e.GetData(this,"select2");null==a&&window.console&&console.error&&console.error("The select2('"+b+"') method was called on an element that is not using Select2."),d=a[b].apply(a,g)}),a.inArray(b,f)>-1?this:d}throw new Error("Invalid arguments for Select2: "+b)}}return null==a.fn.select2.defaults&&(a.fn.select2.defaults=d),c}),{define:b.define,require:b.require}}(),c=b.require("jquery.select2");return a.fn.select2.amd=b,c});
styles/wf-style.css CHANGED
@@ -1,125 +1,145 @@
1
- #icon-woocommerce-importer {
2
- background-image: url(../images/wf-import.png) !important;
3
- background-position: -3px -5px;
4
- }
5
- .widefat_importer td {
6
- vertical-align: middle;
7
- padding: 5px 9px;
8
- }
9
- #import-progress {
10
- width: 100%;
11
- }
12
- #import-progress td, #import-progress th {
13
- padding: .5em 1em;
14
- }
15
- #import-progress td.status, #import-progress th.status {
16
- width: 32px;
17
- }
18
- #import-progress td.row, #import-progress th.row {
19
- width: 3em;
20
- text-align: center;
21
- }
22
- #import-progress td.reason, #import-progress th.reason {
23
- text-align: right;
24
- }
25
- #import-progress tr.importer-loading td {
26
- background: url(../images/wf-ajax-loader.gif) no-repeat center center;
27
- height: 32px;
28
- }
29
- #import-progress .merged td,
30
- #import-progress .imported td {
31
- }
32
- #import-progress .skipped td {
33
- border-bottom-color: #dbcb83;
34
- background: #f2ecd2;
35
- }
36
- #import-progress .failed td {
37
- border-bottom-color: #e6adaa;
38
- background: #f2d3d2;
39
- }
40
- #import-progress mark.result {
41
- height: 0;
42
- display: block;
43
- line-height: 16px;
44
- overflow: hidden;
45
- padding: 16px 0 0 0;
46
- }
47
- #import-progress .skipped mark.result {
48
- background: url(../images/wf-notice.png) no-repeat center top;
49
- }
50
- #import-progress .merged mark.result,
51
- #import-progress .imported mark.result {
52
- background: url(../images/wf-success.png) no-repeat center top;
53
- }
54
- #import-progress .failed mark.result {
55
- background: url(../images/wf-failed.png) no-repeat center top;
56
- }
57
- #import-progress .complete td {
58
- background: #000;
59
- border-color: #000;
60
- border-top: 4px solid #000;
61
- color: #fff;
62
- font-size: 1.5em;
63
- padding: .95em 1em 1em;
64
- text-align: center;
65
- }
66
- #import-progress .regenerating td {
67
- padding: 0;
68
- }
69
- #import-progress .regenerating div.progress {
70
- background: #464646;
71
- padding: .95em 1em 1em;
72
- color: #fff;
73
- overflow: hidden;
74
- width: 0;
75
- float: left;
76
- text-align: left;
77
- white-space: nowrap;
78
- }
79
- .update{
80
- background: #fff;
81
- border-left: 4px solid #fff;
82
- padding: 1px 12px;
83
- border-left-color: #46b450;
84
- margin-top: 10px;
85
- }
86
- #datagrid { border-collapse: collapse; text-align: left; width: 80%; }
87
- #datagrid {
88
- background: #fff; overflow: hidden;
89
- }
90
- #datagrid td{ padding: 3px 10px; }
91
- #datagrid th { padding: 3px 25px; color: #fff; background-color: #ccc; font-weight: bold;font-size: 15px; }
92
-
93
- .woocommerce-message a.button-primary, .woocommerce-message button.button-primary{
94
- background: #0085ba none repeat scroll 0 0 !important;
95
- border-color: #0073aa #006799 #006799 !important;}
96
- .woocommerce-message{border-left-color:#46b450 !important;}
97
- .chosen-container-multi .chosen-choices li.search-field{
98
- padding: 5px !important;
99
- }
100
- .chosen-container-multi .chosen-choices li.search-field input[type="text"]{
101
- padding: 1px !important;
102
- }
103
- .order_actions .download_to_csv_wf {
104
- display: block;
105
- height: 2em !important;
106
- padding: 0 !important;
107
- position: relative;
108
- text-indent: -9999px;
109
- width: 2em;
110
- }
111
- .order_actions .download_to_csv_wf::after {
112
- content: "";
113
- font-family: "dashicons";
114
- font-variant: normal;
115
- font-weight: normal;
116
- height: 100%;
117
- left: 0;
118
- margin: 0;
119
- position: absolute;
120
- text-align: center;
121
- text-indent: 0;
122
- text-transform: none;
123
- top: 0;
124
- width: 100%;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
125
  }
1
+ #icon-woocommerce-importer {
2
+ background-image: url(../images/wf-import.png) !important;
3
+ background-position: -3px -5px;
4
+ }
5
+ .widefat_importer td {
6
+ vertical-align: middle;
7
+ padding: 5px 9px;
8
+ }
9
+ #import-progress {
10
+ width: 100%;
11
+ }
12
+ #import-progress td, #import-progress th {
13
+ padding: .5em 1em;
14
+ }
15
+ #import-progress td.status, #import-progress th.status {
16
+ width: 32px;
17
+ }
18
+ #import-progress td.row, #import-progress th.row {
19
+ width: 3em;
20
+ text-align: center;
21
+ }
22
+ #import-progress td.reason, #import-progress th.reason {
23
+ text-align: right;
24
+ }
25
+ #import-progress tr.importer-loading td {
26
+ background: url(../images/wf-ajax-loader.gif) no-repeat center center;
27
+ height: 32px;
28
+ }
29
+ #import-progress .merged td,
30
+ #import-progress .imported td {
31
+ }
32
+ #import-progress .skipped td {
33
+ border-bottom-color: #dbcb83;
34
+ background: #f2ecd2;
35
+ }
36
+ #import-progress .failed td {
37
+ border-bottom-color: #e6adaa;
38
+ background: #f2d3d2;
39
+ }
40
+ #import-progress mark.result {
41
+ height: 0;
42
+ display: block;
43
+ line-height: 16px;
44
+ overflow: hidden;
45
+ padding: 16px 0 0 0;
46
+ }
47
+ #import-progress .skipped mark.result {
48
+ background: url(../images/wf-notice.png) no-repeat center top;
49
+ }
50
+ #import-progress .merged mark.result,
51
+ #import-progress .imported mark.result {
52
+ background: url(../images/wf-success.png) no-repeat center top;
53
+ }
54
+ #import-progress .failed mark.result {
55
+ background: url(../images/wf-failed.png) no-repeat center top;
56
+ }
57
+ #import-progress .complete td {
58
+ background: #000;
59
+ border-color: #000;
60
+ border-top: 4px solid #000;
61
+ color: #fff;
62
+ font-size: 1.5em;
63
+ padding: .95em 1em 1em;
64
+ text-align: center;
65
+ }
66
+ #import-progress .regenerating td {
67
+ padding: 0;
68
+ }
69
+ #import-progress .regenerating div.progress {
70
+ background: #464646;
71
+ padding: .95em 1em 1em;
72
+ color: #fff;
73
+ overflow: hidden;
74
+ width: 0;
75
+ float: left;
76
+ text-align: left;
77
+ white-space: nowrap;
78
+ }
79
+ .update{
80
+ background: #fff;
81
+ border-left: 4px solid #fff;
82
+ padding: 1px 12px;
83
+ border-left-color: #46b450;
84
+ margin-top: 10px;
85
+ }
86
+ #datagrid { border-collapse: collapse; text-align: left; width: 80%; }
87
+ #datagrid {
88
+ background: #fff; overflow: hidden;
89
+ }
90
+ #datagrid td{ padding: 3px 10px; }
91
+ #datagrid th { padding: 8px 25px; color: #fff; background-color: #ccc; font-weight: bold;font-size: 15px; }
92
+
93
+ .woocommerce-message a.button-primary, .woocommerce-message button.button-primary{
94
+ background: #0085ba none repeat scroll 0 0 !important;
95
+ border-color: #0073aa #006799 #006799 !important;}
96
+ .woocommerce-message{border-left-color:#46b450 !important;}
97
+ .chosen-container-multi .chosen-choices li.search-field{
98
+ padding: 5px !important;
99
+ }
100
+ .chosen-container-multi .chosen-choices li.search-field input[type="text"]{
101
+ padding: 1px !important;
102
+ }
103
+ .order_actions .download_to_csv_wf {
104
+ display: block;
105
+ height: 2em !important;
106
+ padding: 0 !important;
107
+ position: relative;
108
+ text-indent: -9999px;
109
+ width: 2em;
110
+ }
111
+ .order_actions .download_to_csv_wf::after {
112
+ content: "";
113
+ font-family: "dashicons";
114
+ font-variant: normal;
115
+ font-weight: normal;
116
+ height: 100%;
117
+ left: 0;
118
+ margin: 0;
119
+ position: absolute;
120
+ text-align: center;
121
+ text-indent: 0;
122
+ text-transform: none;
123
+ top: 0;
124
+ width: 100%;
125
+ }
126
+ .pipe-view {
127
+ width: 65%;
128
+ float: left;
129
+ }
130
+ #datagrid td input {
131
+ margin-top: 4px;
132
+ box-shadow: none;
133
+ padding: 7px 10px;
134
+ }
135
+ .bg-white{
136
+ background: #fff;
137
+ }
138
+ .p-20p{
139
+ padding: 20px;
140
+ }
141
+ .nav-tab-wrapper .nav-tab-premium {
142
+ background: #5ccc96;
143
+ color: white;
144
+ border-color: #5ccc96;
145
  }