WooCommerce – Store Exporter - Version 1.8.1

Version Description

  • Adeded: Export modules to the Export screen
Download this release

Release Info

Developer visser
Plugin Icon 128x128 WooCommerce – Store Exporter
Version 1.8.1
Comparing to
See all releases

Version 1.8.1

Files changed (59) hide show
  1. common/common.php +83 -0
  2. exporter.php +547 -0
  3. includes/admin.php +613 -0
  4. includes/brands.php +114 -0
  5. includes/categories.php +197 -0
  6. includes/common-dashboard_widgets.php +52 -0
  7. includes/coupons.php +187 -0
  8. includes/customers.php +210 -0
  9. includes/export-csv.php +49 -0
  10. includes/formatting.php +471 -0
  11. includes/functions.php +870 -0
  12. includes/install.php +41 -0
  13. includes/legacy.php +10 -0
  14. includes/orders.php +1187 -0
  15. includes/product_vendors.php +85 -0
  16. includes/products.php +1380 -0
  17. includes/settings.php +278 -0
  18. includes/subscriptions.php +108 -0
  19. includes/tags.php +164 -0
  20. includes/users.php +270 -0
  21. js/jquery-ui.js +48 -0
  22. js/jquery.chosen.js +988 -0
  23. js/jquery.csvToTable.js +154 -0
  24. js/ui-datepicker.js +84 -0
  25. languages/woo_ce-en_GB.mo +0 -0
  26. languages/woo_ce-en_GB.po +97 -0
  27. license.txt +281 -0
  28. readme.txt +562 -0
  29. templates/admin/chosen-sprite.png +0 -0
  30. templates/admin/chosen.css +397 -0
  31. templates/admin/export.css +103 -0
  32. templates/admin/export.js +336 -0
  33. templates/admin/images/animated-overlay.gif +0 -0
  34. templates/admin/images/progress.gif +0 -0
  35. templates/admin/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
  36. templates/admin/images/ui-bg_flat_75_ffffff_40x100.png +0 -0
  37. templates/admin/images/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
  38. templates/admin/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
  39. templates/admin/images/ui-bg_glass_75_dadada_1x400.png +0 -0
  40. templates/admin/images/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
  41. templates/admin/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
  42. templates/admin/images/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
  43. templates/admin/images/ui-icons_222222_256x240.png +0 -0
  44. templates/admin/images/ui-icons_2e83ff_256x240.png +0 -0
  45. templates/admin/images/ui-icons_454545_256x240.png +0 -0
  46. templates/admin/images/ui-icons_888888_256x240.png +0 -0
  47. templates/admin/images/ui-icons_cd0a0a_256x240.png +0 -0
  48. templates/admin/jquery-csvtable.css +40 -0
  49. templates/admin/jquery-ui-datepicker.css +347 -0
  50. templates/admin/media-csv_file.php +12 -0
  51. templates/admin/media-export_details.php +54 -0
  52. templates/admin/tabs-archive.php +79 -0
  53. templates/admin/tabs-export.php +777 -0
  54. templates/admin/tabs-fields.php +28 -0
  55. templates/admin/tabs-overview.php +98 -0
  56. templates/admin/tabs-settings.php +149 -0
  57. templates/admin/tabs-tools.php +30 -0
  58. templates/admin/tabs.php +13 -0
  59. templates/admin/woocommerce-admin_dashboard_vm-plugins.css +55 -0
common/common.php ADDED
@@ -0,0 +1,83 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ *
4
+ * Filename: common.php
5
+ * Description: common.php loads commonly accessed functions across the Visser Labs suite.
6
+ *
7
+ * - woo_get_action
8
+ * - woo_is_wpsc_activated
9
+ * - woo_is_woo_activated
10
+ * - woo_is_jigo_activated
11
+ * - woo_get_woo_version
12
+ */
13
+
14
+ if( is_admin() ) {
15
+
16
+ /* Start of: WordPress Administration */
17
+
18
+ // Load Dashboard widgets
19
+ include_once( WOO_CE_PATH . 'includes/common-dashboard_widgets.php' );
20
+
21
+ /* End of: WordPress Administration */
22
+
23
+ }
24
+
25
+ if( !function_exists( 'woo_get_action' ) ) {
26
+ function woo_get_action( $prefer_get = false ) {
27
+
28
+ if ( isset( $_GET['action'] ) && $prefer_get )
29
+ return $_GET['action'];
30
+
31
+ if ( isset( $_POST['action'] ) )
32
+ return $_POST['action'];
33
+
34
+ if ( isset( $_GET['action'] ) )
35
+ return $_GET['action'];
36
+
37
+ return false;
38
+
39
+ }
40
+ }
41
+
42
+ if( !function_exists( 'woo_is_wpsc_activated' ) ) {
43
+ function woo_is_wpsc_activated() {
44
+
45
+ if( class_exists( 'WP_eCommerce' ) || defined( 'WPSC_VERSION' ) )
46
+ return true;
47
+
48
+ }
49
+ }
50
+
51
+ if( !function_exists( 'woo_is_woo_activated' ) ) {
52
+ function woo_is_woo_activated() {
53
+
54
+ if( class_exists( 'Woocommerce' ) )
55
+ return true;
56
+
57
+ }
58
+ }
59
+
60
+ if( !function_exists( 'woo_is_jigo_activated' ) ) {
61
+ function woo_is_jigo_activated() {
62
+
63
+ if( function_exists( 'jigoshop_init' ) )
64
+ return true;
65
+
66
+ }
67
+ }
68
+
69
+ if( !function_exists( 'woo_get_woo_version' ) ) {
70
+ function woo_get_woo_version() {
71
+
72
+ $version = false;
73
+ if( defined( 'WC_VERSION' ) ) {
74
+ $version = WC_VERSION;
75
+ // Backwards compatibility
76
+ } else if( defined( 'WOOCOMMERCE_VERSION' ) ) {
77
+ $version = WOOCOMMERCE_VERSION;
78
+ }
79
+ return $version;
80
+
81
+ }
82
+ }
83
+ ?>
exporter.php ADDED
@@ -0,0 +1,547 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ Plugin Name: WooCommerce - Store Exporter
4
+ Plugin URI: http://www.visser.com.au/woocommerce/plugins/exporter/
5
+ Description: Export store details out of WooCommerce into simple formatted files (e.g. CSV, XML, Excel 2007 XLS, etc.).
6
+ Version: 1.8.1
7
+ Author: Visser Labs
8
+ Author URI: http://www.visser.com.au/about/
9
+ License: GPL2
10
+ */
11
+
12
+ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
13
+
14
+ define( 'WOO_CE_DIRNAME', basename( dirname( __FILE__ ) ) );
15
+ define( 'WOO_CE_RELPATH', basename( dirname( __FILE__ ) ) . '/' . basename( __FILE__ ) );
16
+ define( 'WOO_CE_PATH', plugin_dir_path( __FILE__ ) );
17
+ define( 'WOO_CE_PREFIX', 'woo_ce' );
18
+
19
+ // Turn this on to enable additional debugging options at export time
20
+ define( 'WOO_CE_DEBUG', false );
21
+
22
+ // Avoid conflicts if Store Exporter Deluxe is activated
23
+ include_once( WOO_CE_PATH . 'common/common.php' );
24
+ if( defined( 'WOO_CD_PREFIX' ) == false ) {
25
+ include_once( WOO_CE_PATH . 'includes/functions.php' );
26
+ }
27
+
28
+ function woo_ce_i18n() {
29
+
30
+ load_plugin_textdomain( 'woo_ce', false, dirname( plugin_basename( __FILE__ ) ) . '/languages' );
31
+
32
+ }
33
+ add_action( 'init', 'woo_ce_i18n' );
34
+
35
+ if( is_admin() ) {
36
+
37
+ /* Start of: WordPress Administration */
38
+
39
+ include_once( WOO_CE_PATH . 'includes/install.php' );
40
+ register_activation_hook( __FILE__, 'woo_ce_install' );
41
+
42
+ // Initial scripts and export process
43
+ function woo_ce_admin_init() {
44
+
45
+ global $export, $wp_roles;
46
+
47
+ // Now is the time to de-activate Store Exporter if Store Exporter Deluxe is activated
48
+ if( defined( 'WOO_CD_PREFIX' ) ) {
49
+ include_once( WOO_CE_PATH . 'includes/install.php' );
50
+ woo_ce_deactivate_ce();
51
+ }
52
+
53
+ // Check that we are on the Store Exporter screen
54
+ $page = ( isset($_GET['page'] ) ? sanitize_text_field( $_GET['page'] ) : false );
55
+ if( $page != strtolower( WOO_CE_PREFIX ) )
56
+ return;
57
+
58
+ // Detect other platform versions
59
+ woo_ce_detect_non_woo_install();
60
+
61
+ // Add Store Exporter widgets to Export screen
62
+ add_action( 'woo_ce_export_product_options_before_table', 'woo_ce_products_filter_by_product_category' );
63
+ add_action( 'woo_ce_export_product_options_before_table', 'woo_ce_products_filter_by_product_tag' );
64
+ add_action( 'woo_ce_export_product_options_before_table', 'woo_ce_products_filter_by_product_status' );
65
+ add_action( 'woo_ce_export_product_options_before_table', 'woo_ce_products_filter_by_product_type' );
66
+ add_action( 'woo_ce_export_product_options_before_table', 'woo_ce_products_filter_by_stock_status' );
67
+ add_action( 'woo_ce_export_product_options_after_table', 'woo_ce_products_product_sorting' );
68
+ add_action( 'woo_ce_export_category_options_after_table', 'woo_ce_category_order_sorting' );
69
+ add_action( 'woo_ce_export_tag_options_after_table', 'woo_ce_tag_order_sorting' );
70
+ add_action( 'woo_ce_export_user_options_after_table', 'woo_ce_users_user_sorting' );
71
+ add_action( 'woo_ce_export_options', 'woo_ce_products_upsells_formatting' );
72
+ add_action( 'woo_ce_export_options', 'woo_ce_products_crosssells_formatting' );
73
+ add_action( 'woo_ce_export_after_form', 'woo_ce_products_custom_fields' );
74
+
75
+ // Add Store Exporter Deluxe widgets to Export screen
76
+ add_action( 'woo_ce_export_brand_options_before_table', 'woo_ce_brands_brand_sorting' );
77
+ add_action( 'woo_ce_export_order_options_before_table', 'woo_ce_orders_filter_by_date' );
78
+ add_action( 'woo_ce_export_order_options_before_table', 'woo_ce_orders_filter_by_status' );
79
+ add_action( 'woo_ce_export_order_options_before_table', 'woo_ce_orders_filter_by_customer' );
80
+ add_action( 'woo_ce_export_order_options_before_table', 'woo_ce_orders_filter_by_user_role' );
81
+ add_action( 'woo_ce_export_order_options_before_table', 'woo_ce_orders_filter_by_coupon' );
82
+ add_action( 'woo_ce_export_order_options_before_table', 'woo_ce_orders_filter_by_product_category' );
83
+ add_action( 'woo_ce_export_order_options_before_table', 'woo_ce_orders_filter_by_product_tag' );
84
+ add_action( 'woo_ce_export_order_options_after_table', 'woo_ce_orders_order_sorting' );
85
+ add_action( 'woo_ce_export_customer_options_before_table', 'woo_ce_customers_filter_by_status' );
86
+ add_action( 'woo_ce_export_coupon_options_before_table', 'woo_ce_coupons_coupon_sorting' );
87
+ add_action( 'woo_ce_export_options', 'woo_ce_orders_items_formatting' );
88
+ add_action( 'woo_ce_export_options', 'woo_ce_orders_max_order_items' );
89
+ add_action( 'woo_ce_export_options', 'woo_ce_orders_items_types' );
90
+ add_action( 'woo_ce_export_after_form', 'woo_ce_orders_custom_fields' );
91
+ add_action( 'woo_ce_export_options', 'woo_ce_export_options_export_format' );
92
+ add_action( 'woo_ce_export_options', 'woo_ce_export_options_gallery_format' );
93
+
94
+ // Add Store Exporter Deluxe options to Settings screen
95
+ add_action( 'woo_ce_export_settings_top', 'woo_ce_export_settings_quicklinks' );
96
+ add_action( 'woo_ce_export_settings_general', 'woo_ce_export_settings_additional' );
97
+ add_action( 'woo_ce_export_settings_after', 'woo_ce_export_settings_cron' );
98
+
99
+ $action = woo_get_action();
100
+ switch( $action ) {
101
+
102
+ // Prompt on Export screen when insufficient memory (less than 64M is allocated)
103
+ case 'dismiss_memory_prompt':
104
+ woo_ce_update_option( 'dismiss_memory_prompt', 1 );
105
+ $url = add_query_arg( 'action', null );
106
+ wp_redirect( $url );
107
+ exit();
108
+ break;
109
+
110
+ // Prompt on Export screen when insufficient memory (less than 64M is allocated)
111
+ case 'dismiss_php_legacy':
112
+ woo_ce_update_option( 'dismiss_php_legacy', 1 );
113
+ $url = add_query_arg( 'action', null );
114
+ wp_redirect( $url );
115
+ exit();
116
+ break;
117
+
118
+ // Save skip overview preference
119
+ case 'skip_overview':
120
+ $skip_overview = false;
121
+ if( isset( $_POST['skip_overview'] ) )
122
+ $skip_overview = 1;
123
+ woo_ce_update_option( 'skip_overview', $skip_overview );
124
+
125
+ if( $skip_overview == 1 ) {
126
+ $url = add_query_arg( 'tab', 'export' );
127
+ wp_redirect( $url );
128
+ exit();
129
+ }
130
+ break;
131
+
132
+ // This is where the magic happens
133
+ case 'export':
134
+
135
+ // Set up the basic export options
136
+ $export = new stdClass();
137
+ $export->cron = 0;
138
+ $export->start_time = time();
139
+ $export->idle_memory_start = woo_ce_current_memory_usage();
140
+ $export->delete_file = woo_ce_get_option( 'delete_file', 0 );
141
+ $export->encoding = woo_ce_get_option( 'encoding', get_option( 'blog_charset', 'UTF-8' ) );
142
+ // Check for bad encoding
143
+ if( $export->encoding == '' || $export->encoding == false || $export->encoding == 'System default' )
144
+ $export->encoding = 'UTF-8';
145
+ $export->delimiter = woo_ce_get_option( 'delimiter', ',' );
146
+ $export->category_separator = woo_ce_get_option( 'category_separator', '|' );
147
+ $export->bom = woo_ce_get_option( 'bom', 1 );
148
+ $export->escape_formatting = woo_ce_get_option( 'escape_formatting', 'all' );
149
+ $export->date_format = woo_ce_get_option( 'date_format', 'd/m/Y' );
150
+ if( $export->date_format == 1 || $export->date_format == '' )
151
+ $export->date_format = 'd/m/Y';
152
+
153
+ // Save export option changes made on the Export screen
154
+ $export->limit_volume = ( isset( $_POST['limit_volume'] ) ? sanitize_text_field( $_POST['limit_volume'] ) : '' );
155
+ woo_ce_update_option( 'limit_volume', $export->limit_volume );
156
+ if( $export->limit_volume == '' )
157
+ $export->limit_volume = -1;
158
+ $export->offset = ( isset( $_POST['offset'] ) ? sanitize_text_field( $_POST['offset'] ) : '' );
159
+ woo_ce_update_option( 'offset', $export->offset );
160
+ if( $export->offset == '' )
161
+ $export->offset = 0;
162
+
163
+ // Set default values for all export options to be later passed onto the export process
164
+ $export->fields = false;
165
+ $export->fields_order = false;
166
+ $export->export_format = 'csv';
167
+
168
+ // Product sorting
169
+ $export->product_categories = false;
170
+ $export->product_tags = false;
171
+ $export->product_status = false;
172
+ $export->product_type = false;
173
+ $export->product_orderby = false;
174
+ $export->product_order = false;
175
+ $export->upsell_formatting = false;
176
+ $export->crosssell_formatting = false;
177
+
178
+ // Category sorting
179
+ $export->category_orderby = false;
180
+ $export->category_order = false;
181
+
182
+ // Tag sorting
183
+ $export->tag_orderby = false;
184
+ $export->tag_order = false;
185
+
186
+ // User sorting
187
+ $export->user_orderby = false;
188
+ $export->user_order = false;
189
+
190
+ $export->type = ( isset( $_POST['dataset'] ) ? sanitize_text_field( $_POST['dataset'] ) : false );
191
+ if( $export->type )
192
+ woo_ce_update_option( 'last_export', $export->type );
193
+ switch( $export->type ) {
194
+
195
+ case 'product':
196
+ // Set up dataset specific options
197
+ $export->fields = ( isset( $_POST['product_fields'] ) ? array_map( 'sanitize_text_field', $_POST['product_fields'] ) : false );
198
+ $export->fields_order = ( isset( $_POST['product_fields_order'] ) ? array_map( 'absint', $_POST['product_fields_order'] ) : false );
199
+ $export->product_categories = ( isset( $_POST['product_filter_category'] ) ? woo_ce_format_product_filters( array_map( 'absint', $_POST['product_filter_category'] ) ) : false );
200
+ $export->product_tags = ( isset( $_POST['product_filter_tag'] ) ? woo_ce_format_product_filters( array_map( 'absint', $_POST['product_filter_tag'] ) ) : false );
201
+ $export->product_status = ( isset( $_POST['product_filter_status'] ) ? woo_ce_format_product_filters( array_map( 'sanitize_text_field', $_POST['product_filter_status'] ) ) : false );
202
+ $export->product_type = ( isset( $_POST['product_filter_type'] ) ? woo_ce_format_product_filters( array_map( 'sanitize_text_field', $_POST['product_filter_type'] ) ) : false );
203
+ $export->product_orderby = ( isset( $_POST['product_orderby'] ) ? sanitize_text_field( $_POST['product_orderby'] ) : false );
204
+ $export->product_order = ( isset( $_POST['product_order'] ) ? sanitize_text_field( $_POST['product_order'] ) : false );
205
+ $export->upsell_formatting = ( isset( $_POST['product_upsell_formatting'] ) ? absint( $_POST['product_upsell_formatting'] ) : false );
206
+ $export->crosssell_formatting = ( isset( $_POST['product_crosssell_formatting'] ) ? absint( $_POST['product_crosssell_formatting'] ) : false );
207
+
208
+ // Save dataset export specific options
209
+ if( $export->product_orderby <> woo_ce_get_option( 'product_orderby' ) )
210
+ woo_ce_update_option( 'product_orderby', $export->product_orderby );
211
+ if( $export->product_order <> woo_ce_get_option( 'product_order' ) )
212
+ woo_ce_update_option( 'product_order', $export->product_order );
213
+ if( $export->upsell_formatting <> woo_ce_get_option( 'upsell_formatting' ) )
214
+ woo_ce_update_option( 'upsell_formatting', $export->upsell_formatting );
215
+ if( $export->crosssell_formatting <> woo_ce_get_option( 'crosssell_formatting' ) )
216
+ woo_ce_update_option( 'crosssell_formatting', $export->crosssell_formatting );
217
+ break;
218
+
219
+ case 'category':
220
+ // Set up dataset specific options
221
+ $export->fields = ( isset( $_POST['category_fields'] ) ? array_map( 'sanitize_text_field', $_POST['category_fields'] ) : false );
222
+ $export->fields_order = ( isset( $_POST['category_fields_order'] ) ? array_map( 'absint', $_POST['category_fields_order'] ) : false );
223
+ $export->category_orderby = ( isset( $_POST['category_orderby'] ) ? sanitize_text_field( $_POST['category_orderby'] ) : false );
224
+ $export->category_order = ( isset( $_POST['category_order'] ) ? sanitize_text_field( $_POST['category_order'] ) : false );
225
+
226
+ // Save dataset export specific options
227
+ if( $export->category_orderby <> woo_ce_get_option( 'category_orderby' ) )
228
+ woo_ce_update_option( 'category_orderby', $export->category_orderby );
229
+ if( $export->category_order <> woo_ce_get_option( 'category_order' ) )
230
+ woo_ce_update_option( 'category_order', $export->category_order );
231
+ break;
232
+
233
+ case 'tag':
234
+ // Set up dataset specific options
235
+ $export->fields = ( isset( $_POST['tag_fields'] ) ? array_map( 'sanitize_text_field', $_POST['tag_fields'] ) : false );
236
+ $export->fields_order = ( isset( $_POST['tag_fields_order'] ) ? array_map( 'absint', $_POST['tag_fields_order'] ) : false );
237
+ $export->tag_orderby = ( isset( $_POST['tag_orderby'] ) ? sanitize_text_field( $_POST['tag_orderby'] ) : false );
238
+ $export->tag_order = ( isset( $_POST['tag_order'] ) ? sanitize_text_field( $_POST['tag_order'] ) : false );
239
+
240
+ // Save dataset export specific options
241
+ if( $export->tag_orderby <> woo_ce_get_option( 'tag_orderby' ) )
242
+ woo_ce_update_option( 'tag_orderby', $export->tag_orderby );
243
+ if( $export->tag_order <> woo_ce_get_option( 'tag_order' ) )
244
+ woo_ce_update_option( 'tag_order', $export->tag_order );
245
+ break;
246
+
247
+ case 'user':
248
+ // Set up dataset specific options
249
+ $export->fields = array_map( 'sanitize_text_field', $_POST['user_fields'] );
250
+ $export->fields_order = ( isset( $_POST['user_fields_order'] ) ? array_map( 'absint', $_POST['user_fields_order'] ) : false );
251
+ $export->user_orderby = ( isset( $_POST['user_orderby'] ) ? sanitize_text_field( $_POST['user_orderby'] ) : false );
252
+ $export->user_order = ( isset( $_POST['user_order'] ) ? sanitize_text_field( $_POST['user_order'] ) : false );
253
+
254
+ // Save dataset export specific options
255
+ if( $export->user_orderby <> woo_ce_get_option( 'user_orderby' ) )
256
+ woo_ce_update_option( 'user_orderby', $export->user_orderby );
257
+ if( $export->user_order <> woo_ce_get_option( 'user_order' ) )
258
+ woo_ce_update_option( 'user_order', $export->user_order );
259
+ break;
260
+
261
+ }
262
+ if( $export->type ) {
263
+
264
+ $timeout = 600;
265
+ if( isset( $_POST['timeout'] ) ) {
266
+ $timeout = absint( (int)$_POST['timeout'] );
267
+ if( $timeout <> woo_ce_get_option( 'timeout' ) )
268
+ woo_ce_update_option( 'timeout', $timeout );
269
+ }
270
+ if( !ini_get( 'safe_mode' ) )
271
+ @set_time_limit( (int)$timeout );
272
+
273
+ @ini_set( 'memory_limit', WP_MAX_MEMORY_LIMIT );
274
+ @ini_set( 'max_execution_time', (int)$timeout );
275
+
276
+ $export->args = array(
277
+ 'limit_volume' => $export->limit_volume,
278
+ 'offset' => $export->offset,
279
+ 'encoding' => $export->encoding,
280
+ 'date_format' => $export->date_format,
281
+ 'product_categories' => $export->product_categories,
282
+ 'product_tags' => $export->product_tags,
283
+ 'product_status' => $export->product_status,
284
+ 'product_type' => $export->product_type,
285
+ 'product_orderby' => $export->product_orderby,
286
+ 'product_order' => $export->product_order,
287
+ 'category_orderby' => $export->category_orderby,
288
+ 'category_order' => $export->category_order,
289
+ 'tag_orderby' => $export->tag_orderby,
290
+ 'tag_order' => $export->tag_order,
291
+ 'user_orderby' => $export->user_orderby,
292
+ 'user_order' => $export->user_order
293
+ );
294
+ woo_ce_save_fields( $export->type, $export->fields, $export->fields_order );
295
+
296
+ if( $export->export_format == 'csv' ) {
297
+ $export->filename = woo_ce_generate_csv_filename( $export->type );
298
+ }
299
+
300
+ // Print file contents to debug export screen
301
+ if( WOO_CE_DEBUG ) {
302
+
303
+ if( in_array( $export->export_format, array( 'csv' ) ) ) {
304
+ woo_ce_export_dataset( $export->type );
305
+ }
306
+ $export->idle_memory_end = woo_ce_current_memory_usage();
307
+ $export->end_time = time();
308
+
309
+ // Print file contents to browser
310
+ } else {
311
+ if( in_array( $export->export_format, array( 'csv' ) ) ) {
312
+
313
+ // Generate CSV contents
314
+ $bits = woo_ce_export_dataset( $export->type );
315
+ unset( $export->fields );
316
+ if( !$bits ) {
317
+ $message = __( 'No export entries were found, please try again with different export filters.', 'woo_ce' );
318
+ woo_ce_admin_notice( $message, 'error' );
319
+ return;
320
+ }
321
+ if( $export->delete_file ) {
322
+
323
+ // Print to browser
324
+ if( $export->export_format == 'csv' )
325
+ woo_ce_generate_csv_header( $export->type );
326
+ echo $bits;
327
+ exit();
328
+
329
+ } else {
330
+
331
+ // Save to file and insert to WordPress Media
332
+ if( $export->filename && $bits ) {
333
+ if( $export->export_format == 'csv' )
334
+ $post_ID = woo_ce_save_file_attachment( $export->filename, 'text/csv' );
335
+ $upload = wp_upload_bits( $export->filename, null, $bits );
336
+ if( ( $post_ID == false ) || $upload['error'] ) {
337
+ wp_delete_attachment( $post_ID, true );
338
+ if( isset( $upload['error'] ) )
339
+ wp_redirect( add_query_arg( array( 'failed' => true, 'message' => urlencode( $upload['error'] ) ) ) );
340
+ else
341
+ wp_redirect( add_query_arg( array( 'failed' => true ) ) );
342
+ return;
343
+ }
344
+ $attach_data = wp_generate_attachment_metadata( $post_ID, $upload['file'] );
345
+ wp_update_attachment_metadata( $post_ID, $attach_data );
346
+ update_attached_file( $post_ID, $upload['file'] );
347
+ if( $post_ID ) {
348
+ woo_ce_save_file_guid( $post_ID, $export->type, $upload['url'] );
349
+ woo_ce_save_file_details( $post_ID );
350
+ }
351
+ $export_type = $export->type;
352
+ unset( $export );
353
+
354
+ // The end memory usage and time is collected at the very last opportunity prior to the CSV header being rendered to the screen
355
+ woo_ce_update_file_detail( $post_ID, '_woo_idle_memory_end', woo_ce_current_memory_usage() );
356
+ woo_ce_update_file_detail( $post_ID, '_woo_end_time', time() );
357
+
358
+ // Generate CSV header
359
+ woo_ce_generate_csv_header( $export_type );
360
+ unset( $export_type );
361
+
362
+ // Print file contents to screen
363
+ if( $upload['file'] )
364
+ readfile( $upload['file'] );
365
+ else
366
+ wp_redirect( add_query_arg( 'failed', true ) );
367
+ unset( $upload );
368
+ } else {
369
+ wp_redirect( add_query_arg( 'failed', true ) );
370
+ }
371
+
372
+ }
373
+
374
+ }
375
+ exit();
376
+ }
377
+ }
378
+ break;
379
+
380
+ // Save changes on Settings screen
381
+ case 'save-settings':
382
+ // Sanitize each setting field as needed
383
+ woo_ce_update_option( 'export_filename', strip_tags( (string)$_POST['export_filename'] ) );
384
+ woo_ce_update_option( 'delete_file', sanitize_text_field( (int)$_POST['delete_file'] ) );
385
+ woo_ce_update_option( 'encoding', sanitize_text_field( (string)$_POST['encoding'] ) );
386
+ woo_ce_update_option( 'delimiter', sanitize_text_field( (string)$_POST['delimiter'] ) );
387
+ woo_ce_update_option( 'category_separator', sanitize_text_field( (string)$_POST['category_separator'] ) );
388
+ woo_ce_update_option( 'bom', absint( (int)$_POST['bom'] ) );
389
+ woo_ce_update_option( 'escape_formatting', sanitize_text_field( (string)$_POST['escape_formatting'] ) );
390
+ if( $_POST['date_format'] == 'custom' && !empty( $_POST['date_format_custom'] ) )
391
+ woo_ce_update_option( 'date_format', sanitize_text_field( (string)$_POST['date_format_custom'] ) );
392
+ else
393
+ woo_ce_update_option( 'date_format', sanitize_text_field( (string)$_POST['date_format'] ) );
394
+
395
+ $message = __( 'Changes have been saved.', 'woo_ce' );
396
+ woo_ce_admin_notice( $message );
397
+ break;
398
+
399
+ // Save changes on Field Editor screen
400
+ case 'save-fields':
401
+ $fields = ( isset( $_POST['fields'] ) ? array_filter( $_POST['fields'] ) : array() );
402
+ $types = array_keys( woo_ce_return_export_types() );
403
+ $export_type = ( isset( $_POST['type'] ) ? sanitize_text_field( $_POST['type'] ) : '' );
404
+ if( in_array( $export_type, $types ) ) {
405
+ woo_ce_update_option( $export_type . '_labels', $fields );
406
+ $message = __( 'Changes have been saved.', 'woo_ce' );
407
+ woo_ce_admin_notice( $message );
408
+ } else {
409
+ $message = __( 'Changes could not be saved.', 'woo_ce' );
410
+ woo_ce_admin_notice( $message, 'error' );
411
+ }
412
+ break;
413
+
414
+ }
415
+
416
+ }
417
+ add_action( 'admin_init', 'woo_ce_admin_init', 11 );
418
+
419
+ // HTML templates and form processor for Store Exporter screen
420
+ function woo_ce_html_page() {
421
+
422
+ global $wpdb, $export;
423
+
424
+ $title = apply_filters( 'woo_ce_template_header', __( 'Store Exporter', 'woo_ce' ) );
425
+ woo_ce_template_header( $title );
426
+ woo_ce_support_donate();
427
+ $action = woo_get_action();
428
+ switch( $action ) {
429
+
430
+ case 'export':
431
+ $message = __( 'Chosen WooCommerce details have been exported from your store.', 'woo_ce' );
432
+ woo_ce_admin_notice( $message );
433
+ if( WOO_CE_DEBUG ) {
434
+ $output = '';
435
+ $troubleshooting_url = 'http://www.visser.com.au/documentation/store-exporter-deluxe/usage/';
436
+ if( false === ( $export_log = get_transient( WOO_CE_PREFIX . '_debug_log' ) ) ) {
437
+ $export_log = __( 'No export entries were found, please try again with different export filters.', 'woo_ce' );
438
+ } else {
439
+ $export_log = base64_decode( $export_log );
440
+ delete_transient( WOO_CE_PREFIX . '_debug_log' );
441
+ }
442
+ $output = '
443
+ <h3>' . sprintf( __( 'Export Details: %s', 'woo_ce' ), esc_attr( $export->filename ) ) . '</h3>
444
+ <p>' . __( 'This prints the $export global that contains the different export options and filters to help reproduce this on another instance of WordPress. Very useful for debugging blank or unexpected exports.', 'woo_ce' ) . '</p>
445
+ <textarea id="export_log">' . esc_textarea( print_r( $export, true ) ) . '</textarea>
446
+ <hr />';
447
+ if( in_array( $export->export_format, array( 'csv' ) ) ) {
448
+ $output .= '
449
+ <script>
450
+ $j(function() {
451
+ $j(\'#export_sheet\').CSVToTable(\'\', { startLine: 0 });
452
+ });
453
+ </script>
454
+ <h3>' . __( 'Export', 'woo_ce' ) . '</h3>
455
+ <p>' . __( 'We use the <a href="http://code.google.com/p/jquerycsvtotable/" target="_blank"><em>CSV to Table plugin</em></a> to see first hand formatting errors or unexpected values within the export file.', 'woo_ce' ) . '</p>
456
+ <div id="export_sheet">' . esc_textarea( $export_log ) . '</div>
457
+ <p class="description">' . __( 'This jQuery plugin can fail with <code>\'Item count (#) does not match header count\'</code> notices which simply mean the number of headers detected does not match the number of cell contents.', 'woo_ce' ) . '</p>
458
+ <hr />';
459
+ }
460
+ $output .= '
461
+ <h3>' . __( 'Export Log', 'woo_ce' ) . '</h3>
462
+ <p>' . __( 'This prints the raw export contents and is helpful when the jQuery plugin above fails due to major formatting errors.', 'woo_ce' ) . '</p>
463
+ <textarea id="export_log" wrap="off">' . esc_textarea( $export_log ) . '</textarea>
464
+ <hr />
465
+ ';
466
+ echo $output;
467
+ }
468
+
469
+ woo_ce_manage_form();
470
+ break;
471
+
472
+ case 'update':
473
+ // Save Custom Product Meta
474
+ if( isset( $_POST['custom_products'] ) ) {
475
+ $custom_products = $_POST['custom_products'];
476
+ $custom_products = explode( "\n", trim( $custom_products ) );
477
+ $size = count( $custom_products );
478
+ if( $size ) {
479
+ for( $i = 0; $i < $size; $i++ )
480
+ $custom_products[$i] = sanitize_text_field( trim( $custom_products[$i] ) );
481
+ woo_ce_update_option( 'custom_products', $custom_products );
482
+ }
483
+ }
484
+
485
+ // Save Custom Order Meta
486
+ if( isset( $_POST['custom_orders'] ) ) {
487
+ $custom_orders = $_POST['custom_orders'];
488
+ $custom_orders = explode( "\n", trim( $custom_orders ) );
489
+ $size = count( $custom_orders );
490
+ if( $size ) {
491
+ for( $i = 0; $i < $size; $i++ )
492
+ $custom_orders[$i] = sanitize_text_field( trim( $custom_orders[$i] ) );
493
+ woo_ce_update_option( 'custom_orders', $custom_orders );
494
+ }
495
+ }
496
+
497
+ // Save Custom Order Item Meta
498
+ if( isset( $_POST['custom_order_items'] ) ) {
499
+ $custom_order_items = $_POST['custom_order_items'];
500
+ if( !empty( $custom_order_items ) ) {
501
+ $custom_order_items = explode( "\n", trim( $custom_order_items ) );
502
+ $size = count( $custom_order_items );
503
+ if( $size ) {
504
+ for( $i = 0; $i < $size; $i++ )
505
+ $custom_order_items[$i] = sanitize_text_field( trim( $custom_order_items[$i] ) );
506
+ woo_ce_update_option( 'custom_order_items', $custom_order_items );
507
+ }
508
+ } else {
509
+ woo_ce_update_option( 'custom_order_items', '' );
510
+ }
511
+ }
512
+
513
+ $message = __( 'Custom Fields saved.', 'woo_ce' );
514
+ woo_ce_admin_notice( $message );
515
+ woo_ce_manage_form();
516
+ break;
517
+
518
+ default:
519
+ woo_ce_manage_form();
520
+ break;
521
+
522
+ }
523
+ woo_ce_template_footer();
524
+
525
+ }
526
+
527
+ // HTML template for Export screen
528
+ function woo_ce_manage_form() {
529
+
530
+ $tab = false;
531
+ if( isset( $_GET['tab'] ) ) {
532
+ $tab = sanitize_text_field( $_GET['tab'] );
533
+ // If Skip Overview is set then jump to Export screen
534
+ } else if( woo_ce_get_option( 'skip_overview', false ) ) {
535
+ $tab = 'export';
536
+ }
537
+ $url = add_query_arg( 'page', 'woo_ce' );
538
+ woo_ce_fail_notices();
539
+
540
+ include_once( WOO_CE_PATH . 'templates/admin/tabs.php' );
541
+
542
+ }
543
+
544
+ /* End of: WordPress Administration */
545
+
546
+ }
547
+ ?>
includes/admin.php ADDED
@@ -0,0 +1,613 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ // Display admin notice on screen load
3
+ function woo_ce_admin_notice( $message = '', $priority = 'updated', $screen = '' ) {
4
+
5
+ if( $priority == false || $priority == '' )
6
+ $priority = 'updated';
7
+ if( $message <> '' ) {
8
+ ob_start();
9
+ woo_ce_admin_notice_html( $message, $priority, $screen );
10
+ $output = ob_get_contents();
11
+ ob_end_clean();
12
+ // Check if an existing notice is already in queue
13
+ $existing_notice = get_transient( WOO_CE_PREFIX . '_notice' );
14
+ if( $existing_notice !== false ) {
15
+ $existing_notice = base64_decode( $existing_notice );
16
+ $output = $existing_notice . $output;
17
+ }
18
+ set_transient( WOO_CE_PREFIX . '_notice', base64_encode( $output ), MINUTE_IN_SECONDS );
19
+ add_action( 'admin_notices', 'woo_ce_admin_notice_print' );
20
+ }
21
+
22
+ }
23
+
24
+ // HTML template for admin notice
25
+ function woo_ce_admin_notice_html( $message = '', $priority = 'updated', $screen = '' ) {
26
+
27
+ // Display admin notice on specific screen
28
+ if( !empty( $screen ) ) {
29
+
30
+ global $pagenow;
31
+
32
+ if( is_array( $screen ) ) {
33
+ if( in_array( $pagenow, $screen ) == false )
34
+ return;
35
+ } else {
36
+ if( $pagenow <> $screen )
37
+ return;
38
+ }
39
+
40
+ } ?>
41
+ <div id="message" class="<?php echo $priority; ?>">
42
+ <p><?php echo $message; ?></p>
43
+ </div>
44
+ <?php
45
+
46
+ }
47
+
48
+ // Grabs the WordPress transient that holds the admin notice and prints it
49
+ function woo_ce_admin_notice_print() {
50
+
51
+ $output = get_transient( WOO_CE_PREFIX . '_notice' );
52
+ if( $output !== false ) {
53
+ delete_transient( WOO_CE_PREFIX . '_notice' );
54
+ $output = base64_decode( $output );
55
+ echo $output;
56
+ }
57
+
58
+ }
59
+
60
+ // HTML template header on Store Exporter screen
61
+ function woo_ce_template_header( $title = '', $icon = 'woocommerce' ) {
62
+
63
+ if( $title )
64
+ $output = $title;
65
+ else
66
+ $output = __( 'Store Export', 'woo_ce' ); ?>
67
+ <div id="woo-ce" class="wrap">
68
+ <div id="icon-<?php echo $icon; ?>" class="icon32 icon32-woocommerce-importer"><br /></div>
69
+ <h2>
70
+ <?php echo $output; ?>
71
+ <a href="<?php echo add_query_arg( array( 'tab' => 'export', 'empty' => null ) ); ?>" class="add-new-h2"><?php _e( 'Add New', 'woo_ce' ); ?></a>
72
+ </h2>
73
+ <?php
74
+
75
+ }
76
+
77
+ // HTML template footer on Store Exporter screen
78
+ function woo_ce_template_footer() { ?>
79
+ </div>
80
+ <!-- .wrap -->
81
+ <?php
82
+
83
+ }
84
+
85
+ // Add Export and Docs links to the Plugins screen
86
+ function woo_ce_add_settings_link( $links, $file ) {
87
+
88
+ // Manually force slug
89
+ $this_plugin = WOO_CE_RELPATH;
90
+
91
+ if( $file == $this_plugin ) {
92
+ $docs_url = 'http://www.visser.com.au/docs/';
93
+ $docs_link = sprintf( '<a href="%s" target="_blank">' . __( 'Docs', 'woo_ce' ) . '</a>', $docs_url );
94
+ $export_link = sprintf( '<a href="%s">' . __( 'Export', 'woo_ce' ) . '</a>', add_query_arg( 'page', 'woo_ce', 'admin.php' ) );
95
+ array_unshift( $links, $docs_link );
96
+ array_unshift( $links, $export_link );
97
+ }
98
+ return $links;
99
+
100
+ }
101
+ add_filter( 'plugin_action_links', 'woo_ce_add_settings_link', 10, 2 );
102
+
103
+ // Add Store Export page to WooCommerce screen IDs
104
+ function woo_ce_wc_screen_ids( $screen_ids = array() ) {
105
+
106
+ $screen_ids[] = 'woocommerce_page_woo_ce';
107
+ return $screen_ids;
108
+
109
+ }
110
+ add_filter( 'woocommerce_screen_ids', 'woo_ce_wc_screen_ids', 10, 1 );
111
+
112
+ // Add Store Export to WordPress Administration menu
113
+ function woo_ce_admin_menu() {
114
+
115
+ $page = add_submenu_page( 'woocommerce', __( 'Store Exporter', 'woo_ce' ), __( 'Store Export', 'woo_ce' ), 'view_woocommerce_reports', 'woo_ce', 'woo_ce_html_page' );
116
+ add_action( 'admin_print_styles-' . $page, 'woo_ce_enqueue_scripts' );
117
+
118
+ }
119
+ add_action( 'admin_menu', 'woo_ce_admin_menu', 11 );
120
+
121
+ // Load CSS and jQuery scripts for Store Exporter screen
122
+ function woo_ce_enqueue_scripts( $hook ) {
123
+
124
+ // Simple check that WooCommerce is activated
125
+ if( class_exists( 'WooCommerce' ) ) {
126
+
127
+ global $woocommerce;
128
+
129
+ // Load WooCommerce default Admin styling
130
+ wp_enqueue_style( 'woocommerce_admin_styles', $woocommerce->plugin_url() . '/assets/css/admin.css' );
131
+
132
+ }
133
+
134
+ // Date Picker
135
+ wp_enqueue_script( 'jquery-ui-datepicker' );
136
+ wp_enqueue_style( 'jquery-ui-datepicker', plugins_url( '/templates/admin/jquery-ui-datepicker.css', WOO_CE_RELPATH ) );
137
+
138
+ // Chosen
139
+ wp_enqueue_style( 'jquery-chosen', plugins_url( '/templates/admin/chosen.css', WOO_CE_RELPATH ) );
140
+ wp_enqueue_script( 'jquery-chosen', plugins_url( '/js/jquery.chosen.js', WOO_CE_RELPATH ), array( 'jquery' ) );
141
+
142
+ // Common
143
+ wp_enqueue_style( 'woo_ce_styles', plugins_url( '/templates/admin/export.css', WOO_CE_RELPATH ) );
144
+ wp_enqueue_script( 'woo_ce_scripts', plugins_url( '/templates/admin/export.js', WOO_CE_RELPATH ), array( 'jquery', 'jquery-ui-sortable' ) );
145
+ wp_enqueue_style( 'dashicons' );
146
+
147
+ if( WOO_CE_DEBUG ) {
148
+ wp_enqueue_style( 'jquery-csvToTable', plugins_url( '/templates/admin/jquery-csvtable.css', WOO_CE_RELPATH ) );
149
+ wp_enqueue_script( 'jquery-csvToTable', plugins_url( '/js/jquery.csvToTable.js', WOO_CE_RELPATH ), array( 'jquery' ) );
150
+ }
151
+ wp_enqueue_style( 'woo_vm_styles', plugins_url( '/templates/admin/woocommerce-admin_dashboard_vm-plugins.css', WOO_CE_RELPATH ) );
152
+
153
+ }
154
+
155
+ // HTML active class for the currently selected tab on the Store Exporter screen
156
+ function woo_ce_admin_active_tab( $tab_name = null, $tab = null ) {
157
+
158
+ if( isset( $_GET['tab'] ) && !$tab )
159
+ $tab = $_GET['tab'];
160
+ else if( !isset( $_GET['tab'] ) && woo_ce_get_option( 'skip_overview', false ) )
161
+ $tab = 'export';
162
+ else
163
+ $tab = 'overview';
164
+
165
+ $output = '';
166
+ if( isset( $tab_name ) && $tab_name ) {
167
+ if( $tab_name == $tab )
168
+ $output = ' nav-tab-active';
169
+ }
170
+ echo $output;
171
+
172
+ }
173
+
174
+ // HTML template for each tab on the Store Exporter screen
175
+ function woo_ce_tab_template( $tab = '' ) {
176
+
177
+ if( !$tab )
178
+ $tab = 'overview';
179
+
180
+ // Store Exporter Deluxe
181
+ $woo_cd_url = 'http://www.visser.com.au/woocommerce/plugins/exporter-deluxe/';
182
+ $woo_cd_link = sprintf( '<a href="%s" target="_blank">' . __( 'Store Exporter Deluxe', 'woo_ce' ) . '</a>', $woo_cd_url );
183
+
184
+ $troubleshooting_url = 'http://www.visser.com.au/documentation/store-exporter-deluxe/';
185
+
186
+ switch( $tab ) {
187
+
188
+ case 'overview':
189
+ $skip_overview = woo_ce_get_option( 'skip_overview', false );
190
+ break;
191
+
192
+ case 'export':
193
+ $export_type = sanitize_text_field( ( isset( $_POST['dataset'] ) ? $_POST['dataset'] : woo_ce_get_option( 'last_export', 'product' ) ) );
194
+ $types = array_keys( woo_ce_return_export_types() );
195
+ // Check if the default export type exists
196
+ if( !in_array( $export_type, $types ) )
197
+ $export_type = 'product';
198
+
199
+ $products = woo_ce_return_count( 'product' );
200
+ $categories = woo_ce_return_count( 'category' );
201
+ $tags = woo_ce_return_count( 'tag' );
202
+ $brands = '999';
203
+ $orders = '999';
204
+ $customers = '999';
205
+ $users = woo_ce_return_count( 'user' );
206
+ $coupons = '999';
207
+ $attributes = '999';
208
+ $subscriptions = '999';
209
+ $product_vendors = '999';
210
+
211
+ if( $product_fields = woo_ce_get_product_fields() ) {
212
+ foreach( $product_fields as $key => $product_field )
213
+ $product_fields[$key]['disabled'] = ( isset( $product_field['disabled'] ) ? $product_field['disabled'] : 0 );
214
+ }
215
+ if( $category_fields = woo_ce_get_category_fields() ) {
216
+ foreach( $category_fields as $key => $category_field )
217
+ $category_fields[$key]['disabled'] = ( isset( $category_field['disabled'] ) ? $category_field['disabled'] : 0 );
218
+ }
219
+ if( $tag_fields = woo_ce_get_tag_fields() ) {
220
+ foreach( $tag_fields as $key => $tag_field )
221
+ $tag_fields[$key]['disabled'] = ( isset( $tag_field['disabled'] ) ? $tag_field['disabled'] : 0 );
222
+ }
223
+ if( $brand_fields = woo_ce_get_brand_fields() ) {
224
+ foreach( $brand_fields as $key => $brand_field )
225
+ $brand_fields[$key]['disabled'] = ( isset( $brand_field['disabled'] ) ? $brand_field['disabled'] : 0 );
226
+ }
227
+ $order_fields = woo_ce_get_order_fields();
228
+ $customer_fields = woo_ce_get_customer_fields();
229
+ if( $user_fields = woo_ce_get_user_fields() ) {
230
+ foreach( $user_fields as $key => $user_field )
231
+ $user_fields[$key]['disabled'] = ( isset( $user_field['disabled'] ) ? $user_field['disabled'] : 0 );
232
+ }
233
+ $coupon_fields = woo_ce_get_coupon_fields();
234
+ $subscription_fields = woo_ce_get_subscription_fields();
235
+ $product_vendor_fields = woo_ce_get_product_vendor_fields();
236
+ $attribute_fields = false;
237
+
238
+ // Export modules
239
+ $modules = woo_ce_modules_list();
240
+
241
+ // Export options
242
+ $limit_volume = woo_ce_get_option( 'limit_volume' );
243
+ $offset = woo_ce_get_option( 'offset' );
244
+ break;
245
+
246
+ case 'fields':
247
+ $export_type = ( isset( $_GET['type'] ) ? sanitize_text_field( $_GET['type'] ) : '' );
248
+ $types = array_keys( woo_ce_return_export_types() );
249
+ $fields = array();
250
+ if( in_array( $export_type, $types ) ) {
251
+ if( has_filter( 'woo_ce_' . $export_type . '_fields', 'woo_ce_override_' . $export_type . '_field_labels' ) )
252
+ remove_filter( 'woo_ce_' . $export_type . '_fields', 'woo_ce_override_' . $export_type . '_field_labels', 11 );
253
+ if( function_exists( sprintf( 'woo_ce_get_%s_fields', $export_type ) ) )
254
+ $fields = call_user_func( 'woo_ce_get_' . $export_type . '_fields' );
255
+ $labels = woo_ce_get_option( $export_type . '_labels', array() );
256
+ }
257
+ break;
258
+
259
+ case 'archive':
260
+ if( isset( $_GET['deleted'] ) ) {
261
+ $message = __( 'Archived export has been deleted.', 'woo_ce' );
262
+ woo_ce_admin_notice( $message );
263
+ }
264
+ if( $files = woo_ce_get_archive_files() ) {
265
+ foreach( $files as $key => $file )
266
+ $files[$key] = woo_ce_get_archive_file( $file );
267
+ }
268
+ break;
269
+
270
+ case 'settings':
271
+ $export_filename = woo_ce_get_option( 'export_filename', '' );
272
+ // Default export filename
273
+ if( empty( $export_filename ) )
274
+ $export_filename = 'woo-export_%dataset%-%date%.csv';
275
+ $delete_file = woo_ce_get_option( 'delete_file', 0 );
276
+ $timeout = woo_ce_get_option( 'timeout', 0 );
277
+ $encoding = woo_ce_get_option( 'encoding', 'UTF-8' );
278
+ $bom = woo_ce_get_option( 'bom', 1 );
279
+ $delimiter = woo_ce_get_option( 'delimiter', ',' );
280
+ $category_separator = woo_ce_get_option( 'category_separator', '|' );
281
+ $escape_formatting = woo_ce_get_option( 'escape_formatting', 'all' );
282
+ $date_format = woo_ce_get_option( 'date_format', 'd/m/Y' );
283
+ if( $date_format == 1 || $date_format == '' )
284
+ $date_format = 'd/m/Y';
285
+ $file_encodings = ( function_exists( 'mb_list_encodings' ) ? mb_list_encodings() : false );
286
+ break;
287
+
288
+ case 'tools':
289
+ // Product Importer Deluxe
290
+ $woo_pd_url = 'http://www.visser.com.au/woocommerce/plugins/product-importer-deluxe/';
291
+ $woo_pd_target = ' target="_blank"';
292
+ if( function_exists( 'woo_pd_init' ) ) {
293
+ $woo_pd_url = add_query_arg( array( 'page' => 'woo_pd', 'tab' => null ) );
294
+ $woo_pd_target = false;
295
+ }
296
+
297
+ // Store Toolkit
298
+ $woo_st_url = 'http://www.visser.com.au/woocommerce/plugins/store-toolkit/';
299
+ $woo_st_target = ' target="_blank"';
300
+ if( function_exists( 'woo_st_admin_init' ) ) {
301
+ $woo_st_url = add_query_arg( array( 'page' => 'woo_st', 'tab' => null ) );
302
+ $woo_st_target = false;
303
+ }
304
+ break;
305
+
306
+ }
307
+ if( $tab ) {
308
+ if( file_exists( WOO_CE_PATH . 'templates/admin/tabs-' . $tab . '.php' ) ) {
309
+ include_once( WOO_CE_PATH . 'templates/admin/tabs-' . $tab . '.php' );
310
+ } else {
311
+ $message = sprintf( __( 'We couldn\'t load the export template file <code>%s</code> within <code>%s</code>, this file should be present.', 'woo_ce' ), 'tabs-' . $tab . '.php', WOO_CE_PATH . 'templates/admin/...' );
312
+ woo_ce_admin_notice_html( $message, 'error' );
313
+ ob_start(); ?>
314
+ <p><?php _e( 'You can see this error for one of a few common reasons', 'woo_ce' ); ?>:</p>
315
+ <ul class="ul-disc">
316
+ <li><?php _e( 'WordPress was unable to create this file when the Plugin was installed or updated', 'woo_ce' ); ?></li>
317
+ <li><?php _e( 'The Plugin files have been recently changed and there has been a file conflict', 'woo_ce' ); ?></li>
318
+ <li><?php _e( 'The Plugin file has been locked and cannot be opened by WordPress', 'woo_ce' ); ?></li>
319
+ </ul>
320
+ <p><?php _e( 'Jump onto our website and download a fresh copy of this Plugin as it might be enough to fix this issue. If this persists get in touch with us.', 'woo_ce' ); ?></p>
321
+ <?php
322
+ ob_end_flush();
323
+ }
324
+ }
325
+
326
+ }
327
+
328
+ // List of WordPress Plugins that Product Importer Deluxe integrates with
329
+ function woo_ce_modules_list( $modules = array() ) {
330
+
331
+ $modules[] = array(
332
+ 'name' => 'aioseop',
333
+ 'title' => __( 'All in One SEO Pack', 'woo_ce' ),
334
+ 'description' => __( 'Optimize your WooCommerce Products for Search Engines. Requires Store Toolkit for All in One SEO Pack integration.', 'woo_ce' ),
335
+ 'url' => 'http://wordpress.org/extend/plugins/all-in-one-seo-pack/',
336
+ 'slug' => 'all-in-one-seo-pack',
337
+ 'function' => 'aioseop_activate'
338
+ );
339
+ $modules[] = array(
340
+ 'name' => 'store_toolkit',
341
+ 'title' => __( 'Store Toolkit', 'woo_ce' ),
342
+ 'description' => __( 'Store Toolkit includes a growing set of commonly-used WooCommerce administration tools aimed at web developers and store maintainers.', 'woo_ce' ),
343
+ 'url' => 'http://wordpress.org/extend/plugins/woocommerce-store-toolkit/',
344
+ 'slug' => 'woocommerce-store-toolkit',
345
+ 'function' => 'woo_st_admin_init'
346
+ );
347
+ $modules[] = array(
348
+ 'name' => 'ultimate_seo',
349
+ 'title' => __( 'SEO Ultimate', 'woo_ce' ),
350
+ 'description' => __( 'This all-in-one SEO plugin gives you control over Product details.', 'woo_ce' ),
351
+ 'url' => 'http://wordpress.org/extend/plugins/seo-ultimate/',
352
+ 'slug' => 'seo-ultimate',
353
+ 'function' => 'su_wp_incompat_notice'
354
+ );
355
+ $modules[] = array(
356
+ 'name' => 'gpf',
357
+ 'title' => __( 'Advanced Google Product Feed', 'woo_ce' ),
358
+ 'description' => __( 'Easily configure data to be added to your Google Merchant Centre feed.', 'woo_ce' ),
359
+ 'url' => 'http://www.leewillis.co.uk/wordpress-plugins/',
360
+ 'function' => 'woocommerce_gpf_install'
361
+ );
362
+ $modules[] = array(
363
+ 'name' => 'wpseo',
364
+ 'title' => __( 'WordPress SEO by Yoast', 'woo_ce' ),
365
+ 'description' => __( 'The first true all-in-one SEO solution for WordPress.', 'woo_ce' ),
366
+ 'url' => 'http://yoast.com/wordpress/seo/#utm_source=wpadmin&utm_medium=plugin&utm_campaign=wpseoplugin',
367
+ 'slug' => 'wordpress-seo',
368
+ 'function' => 'wpseo_admin_init'
369
+ );
370
+ $modules[] = array(
371
+ 'name' => 'msrp',
372
+ 'title' => __( 'WooCommerce MSRP Pricing', 'woo_ce' ),
373
+ 'description' => __( 'Define and display MSRP prices (Manufacturer\'s suggested retail price) to your customers.', 'woo_ce' ),
374
+ 'url' => 'http://www.woothemes.com/products/msrp-pricing/',
375
+ 'function' => 'woocommerce_msrp_activate'
376
+ );
377
+ $modules[] = array(
378
+ 'name' => 'wc_brands',
379
+ 'title' => __( 'WooCommerce Brands Addon', 'woo_ce' ),
380
+ 'description' => __( 'Create, assign and list brands for products, and allow customers to filter by brand.', 'woo_ce' ),
381
+ 'url' => 'http://www.woothemes.com/products/brands/',
382
+ 'class' => 'WC_Brands'
383
+ );
384
+ $modules[] = array(
385
+ 'name' => 'wc_cog',
386
+ 'title' => __( 'Cost of Goods', 'woo_ce' ),
387
+ 'description' => __( 'Easily track total profit and cost of goods by adding a Cost of Good field to simple and variable products.', 'woo_ce' ),
388
+ 'url' => 'http://www.skyverge.com/product/woocommerce-cost-of-goods-tracking/',
389
+ 'class' => 'WC_COG'
390
+ );
391
+ $modules[] = array(
392
+ 'name' => 'per_product_shipping',
393
+ 'title' => __( 'Per-Product Shipping', 'woo_ce' ),
394
+ 'description' => __( 'Define separate shipping costs per product which are combined at checkout to provide a total shipping cost.', 'woo_ce' ),
395
+ 'url' => 'http://www.woothemes.com/products/per-product-shipping/',
396
+ 'function' => 'woocommerce_per_product_shipping_init'
397
+ );
398
+ $modules[] = array(
399
+ 'name' => 'vendors',
400
+ 'title' => __( 'Product Vendors', 'woo_ce' ),
401
+ 'description' => __( 'Turn your store into a multi-vendor marketplace (such as Etsy or Creative Market).', 'woo_ce' ),
402
+ 'url' => 'http://www.woothemes.com/products/product-vendors/',
403
+ 'class' => 'WooCommerce_Product_Vendors'
404
+ );
405
+ $modules[] = array(
406
+ 'name' => 'acf',
407
+ 'title' => __( 'Advanced Custom Fields', 'woo_ce' ),
408
+ 'description' => __( 'Powerful fields for WordPress developers.', 'woo_ce' ),
409
+ 'url' => 'http://www.advancedcustomfields.com',
410
+ 'class' => 'acf'
411
+ );
412
+ $modules[] = array(
413
+ 'name' => 'product_addons',
414
+ 'title' => __( 'Product Add-ons', 'woo_ce' ),
415
+ 'description' => __( 'Allow your customers to customise your products by adding input boxes, dropdowns or a field set of checkboxes.', 'woo_ce' ),
416
+ 'url' => 'http://www.woothemes.com/products/product-add-ons/',
417
+ 'class' => 'Product_Addon_Admin'
418
+ );
419
+ $modules[] = array(
420
+ 'name' => 'seq',
421
+ 'title' => __( 'WooCommerce Sequential Order Numbers', 'woo_ce' ),
422
+ 'description' => __( 'This plugin extends the WooCommerce e-commerce plugin by setting sequential order numbers for new orders.', 'woo_ce' ),
423
+ 'url' => 'https://wordpress.org/plugins/woocommerce-sequential-order-numbers/',
424
+ 'slug' => 'woocommerce-sequential-order-numbers',
425
+ 'class' => 'WC_Seq_Order_Number'
426
+ );
427
+ $modules[] = array(
428
+ 'name' => 'seq_pro',
429
+ 'title' => __( 'WooCommerce Sequential Order Numbers Pro', 'woo_ce' ),
430
+ 'description' => __( 'Tame your WooCommerce Order Numbers.', 'woo_ce' ),
431
+ 'url' => 'http://www.woothemes.com/products/sequential-order-numbers-pro/',
432
+ 'class' => 'WC_Seq_Order_Number'
433
+ );
434
+ $modules[] = array(
435
+ 'name' => 'print_invoice_delivery_note',
436
+ 'title' => __( 'WooCommerce Print Invoice & Delivery Note', 'woo_ce' ),
437
+ 'description' => __( 'Print invoices and delivery notes for WooCommerce orders.', 'woo_ce' ),
438
+ 'url' => 'http://wordpress.org/plugins/woocommerce-delivery-notes/',
439
+ 'slug' => 'woocommerce-delivery-notes',
440
+ 'class' => 'WooCommerce_Delivery_Notes'
441
+ );
442
+ $modules[] = array(
443
+ 'name' => 'pdf_invoices_packing_slips',
444
+ 'title' => __( 'WooCommerce PDF Invoices & Packing Slips', 'woo_ce' ),
445
+ 'description' => __( 'Create, print & automatically email PDF invoices & packing slips for WooCommerce orders.', 'woo_ce' ),
446
+ 'url' => 'https://wordpress.org/plugins/woocommerce-pdf-invoices-packing-slips/',
447
+ 'slug' => 'woocommerce-pdf-invoices-packing-slips',
448
+ 'class' => 'WooCommerce_PDF_Invoices'
449
+ );
450
+ $modules[] = array(
451
+ 'name' => 'checkout_manager',
452
+ 'title' => __( 'WooCommerce Checkout Manager', 'woo_ce' ),
453
+ 'description' => __( 'Manages WooCommerce Checkout.', 'woo_ce' ),
454
+ 'url' => 'http://wordpress.org/plugins/woocommerce-checkout-manager/',
455
+ 'slug' => 'woocommerce-checkout-manager',
456
+ 'function' => 'wccs_install'
457
+ );
458
+ $modules[] = array(
459
+ 'name' => 'checkout_manager_pro',
460
+ 'title' => __( 'WooCommerce Checkout Manager Pro', 'woo_ce' ),
461
+ 'description' => __( 'Manages the WooCommerce Checkout page and WooCommerce Checkout processes.', 'woo_ce' ),
462
+ 'url' => 'http://www.trottyzone.com/product/woocommerce-checkout-manager-pro',
463
+ 'function' => 'wccs_install'
464
+ );
465
+ $modules[] = array(
466
+ 'name' => 'pgsk',
467
+ 'title' => __( 'Poor Guys Swiss Knife', 'woo_ce' ),
468
+ 'description' => __( 'A Swiss Knife for WooCommerce.', 'woo_ce' ),
469
+ 'url' => 'http://wordpress.org/plugins/woocommerce-poor-guys-swiss-knife/',
470
+ 'slug' => 'woocommerce-poor-guys-swiss-knife',
471
+ 'function' => 'wcpgsk_init'
472
+ );
473
+ $modules[] = array(
474
+ 'name' => 'checkout_field_editor',
475
+ 'title' => __( 'Checkout Field Editor', 'woo_ce' ),
476
+ 'description' => __( 'Add, edit and remove fields shown on your WooCommerce checkout page.', 'woo_ce' ),
477
+ 'url' => 'http://www.woothemes.com/products/woocommerce-checkout-field-editor/',
478
+ 'function' => 'woocommerce_init_checkout_field_editor'
479
+ );
480
+ $modules[] = array(
481
+ 'name' => 'checkout_field_manager',
482
+ 'title' => __( 'Checkout Field Manager', 'woo_ce' ),
483
+ 'description' => __( 'Quickly and effortlessly add, remove and re-orders fields in the checkout process.', 'woo_ce' ),
484
+ 'url' => 'http://61extensions.com/shop/woocommerce-checkout-field-manager/',
485
+ 'function' => 'sod_woocommerce_checkout_manager_settings'
486
+ );
487
+ $modules[] = array(
488
+ 'name' => 'checkout_addons',
489
+ 'title' => __( 'WooCommerce Checkout Add-Ons', 'woo_ce' ),
490
+ 'description' => __( 'Add fields at checkout for add-on products and services while optionally setting a cost for each add-on.', 'woo_ce' ),
491
+ 'url' => 'http://www.skyverge.com/product/woocommerce-checkout-add-ons/',
492
+ 'function' => 'init_woocommerce_checkout_add_ons'
493
+ );
494
+ $modules[] = array(
495
+ 'name' => 'local_pickup_plus',
496
+ 'title' => __( 'Local Pickup Plus', 'woo_ce' ),
497
+ 'description' => __( 'Let customers pick up products from specific locations.', 'woo_ce' ),
498
+ 'url' => 'http://www.woothemes.com/products/local-pickup-plus/',
499
+ 'class' => 'WC_Local_Pickup_Plus'
500
+ );
501
+ $modules[] = array(
502
+ 'name' => 'gravity_forms',
503
+ 'title' => __( 'Gravity Forms', 'woo_ce' ),
504
+ 'description' => __( 'Gravity Forms is hands down the best contact form plugin for WordPress powered websites.', 'woo_ce' ),
505
+ 'url' => 'http://woothemes.com/woocommerce',
506
+ 'class' => 'RGForms'
507
+ );
508
+ $modules[] = array(
509
+ 'name' => 'currency_switcher',
510
+ 'title' => __( 'WooCommerce Currency Switcher', 'woo_ce' ),
511
+ 'description' => __( 'Currency Switcher for WooCommerce allows your shop to display prices and accept payments in multiple currencies.', 'woo_ce' ),
512
+ 'url' => 'http://aelia.co/shop/currency-switcher-woocommerce/',
513
+ 'class' => 'WC_Aelia_CurrencySwitcher'
514
+ );
515
+ $modules[] = array(
516
+ 'name' => 'subscriptions',
517
+ 'title' => __( 'WooCommerce Subscriptions', 'woo_ce' ),
518
+ 'description' => __( 'WC Subscriptions makes it easy to create and manage products with recurring payments.', 'woo_ce' ),
519
+ 'url' => 'http://www.woothemes.com/products/woocommerce-subscriptions/',
520
+ 'class' => 'WC_Subscriptions_Manager'
521
+ );
522
+
523
+ /*
524
+ $modules[] = array(
525
+ 'name' => '',
526
+ 'title' => __( '', 'woo_ce' ),
527
+ 'description' => __( '', 'woo_ce' ),
528
+ 'url' => '',
529
+ 'slug' => '', // Define this if the Plugin is hosted on the WordPress repo
530
+ 'function' => ''
531
+ );
532
+ */
533
+
534
+ $modules = apply_filters( 'woo_ce_modules_addons', $modules );
535
+
536
+ if( !empty( $modules ) ) {
537
+ foreach( $modules as $key => $module ) {
538
+ $modules[$key]['status'] = 'inactive';
539
+ // Check if each module is activated
540
+ if( isset( $module['function'] ) ) {
541
+ if( function_exists( $module['function'] ) )
542
+ $modules[$key]['status'] = 'active';
543
+ } else if( isset( $module['class'] ) ) {
544
+ if( class_exists( $module['class'] ) )
545
+ $modules[$key]['status'] = 'active';
546
+ }
547
+ // Check if the Plugin has a slug and if current user can install Plugins
548
+ if( current_user_can( 'install_plugins' ) && isset( $module['slug'] ) )
549
+ $modules[$key]['url'] = admin_url( sprintf( 'plugin-install.php?tab=search&type=tag&s=%s', $module['slug'] ) );
550
+ }
551
+ }
552
+ return $modules;
553
+
554
+ }
555
+
556
+ function woo_ce_modules_status_class( $status = 'inactive' ) {
557
+
558
+ $output = '';
559
+ switch( $status ) {
560
+
561
+ case 'active':
562
+ $output = 'green';
563
+ break;
564
+
565
+ case 'inactive':
566
+ $output = 'yellow';
567
+ break;
568
+
569
+ }
570
+ echo $output;
571
+
572
+ }
573
+
574
+ function woo_ce_modules_status_label( $status = 'inactive' ) {
575
+
576
+ $output = '';
577
+ switch( $status ) {
578
+
579
+ case 'active':
580
+ $output = __( 'OK', 'woo_ce' );
581
+ break;
582
+
583
+ case 'inactive':
584
+ $output = __( 'Install', 'woo_ce' );
585
+ break;
586
+
587
+ }
588
+ echo $output;
589
+
590
+ }
591
+
592
+ // HTML template for header prompt on Store Exporter screen
593
+ function woo_ce_support_donate() {
594
+
595
+ $output = '';
596
+ $show = true;
597
+ if( function_exists( 'woo_vl_we_love_your_plugins' ) ) {
598
+ if( in_array( WOO_CE_DIRNAME, woo_vl_we_love_your_plugins() ) )
599
+ $show = false;
600
+ }
601
+ if( $show ) {
602
+ $donate_url = 'http://www.visser.com.au/donate/';
603
+ $rate_url = 'http://wordpress.org/support/view/plugin-reviews/' . WOO_CE_DIRNAME;
604
+ $output = '
605
+ <div id="support-donate_rate" class="support-donate_rate">
606
+ <p>' . sprintf( __( '<strong>Like this Plugin?</strong> %s and %s.', 'woo_ce' ), '<a href="' . $donate_url . '" target="_blank">' . __( 'Donate to support this Plugin', 'woo_ce' ) . '</a>', '<a href="' . add_query_arg( array( 'rate' => '5' ), $rate_url ) . '#postform" target="_blank">rate / review us on WordPress.org</a>' ) . '</p>
607
+ </div>
608
+ ';
609
+ }
610
+ echo $output;
611
+
612
+ }
613
+ ?>
includes/brands.php ADDED
@@ -0,0 +1,114 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if( is_admin() ) {
3
+
4
+ /* Start of: WordPress Administration */
5
+
6
+ // HTML template for Coupon Sorting widget on Store Exporter screen
7
+ function woo_ce_brands_brand_sorting() {
8
+
9
+ $orderby = woo_ce_get_option( 'brand_orderby', 'ID' );
10
+ $order = woo_ce_get_option( 'brand_order', 'DESC' );
11
+
12
+ ob_start(); ?>
13
+ <p><label><?php _e( 'Brand Sorting', 'woo_ce' ); ?></label></p>
14
+ <div>
15
+ <select name="brand_orderby" disabled="disabled">
16
+ <option value="id"><?php _e( 'Term ID', 'woo_ce' ); ?></option>
17
+ <option value="name"><?php _e( 'Brand Name', 'woo_ce' ); ?></option>
18
+ </select>
19
+ <select name="brand_order" disabled="disabled">
20
+ <option value="ASC"><?php _e( 'Ascending', 'woo_ce' ); ?></option>
21
+ <option value="DESC"><?php _e( 'Descending', 'woo_ce' ); ?></option>
22
+ </select>
23
+ <p class="description"><?php _e( 'Select the sorting of Brands within the exported file. By default this is set to export Product Brands by Term ID in Desending order.', 'woo_ce' ); ?></p>
24
+ </div>
25
+ <?php
26
+ ob_end_flush();
27
+
28
+ }
29
+
30
+ /* End of: WordPress Administration */
31
+
32
+ }
33
+
34
+ // Returns a list of Brand export columns
35
+ function woo_ce_get_brand_fields( $format = 'full' ) {
36
+
37
+ $export_type = 'brand';
38
+
39
+ $fields = array();
40
+ $fields[] = array(
41
+ 'name' => 'term_id',
42
+ 'label' => __( 'Term ID', 'woo_ce' )
43
+ );
44
+ $fields[] = array(
45
+ 'name' => 'name',
46
+ 'label' => __( 'Brand Name', 'woo_ce' )
47
+ );
48
+ $fields[] = array(
49
+ 'name' => 'slug',
50
+ 'label' => __( 'Brand Slug', 'woo_ce' )
51
+ );
52
+ $fields[] = array(
53
+ 'name' => 'parent_id',
54
+ 'label' => __( 'Parent Term ID', 'woo_ce' )
55
+ );
56
+ $fields[] = array(
57
+ 'name' => 'description',
58
+ 'label' => __( 'Brand Description', 'woo_ce' )
59
+ );
60
+ $fields[] = array(
61
+ 'name' => 'image',
62
+ 'label' => __( 'Brand Image', 'woo_ce' )
63
+ );
64
+
65
+ /*
66
+ $fields[] = array(
67
+ 'name' => '',
68
+ 'label' => __( '', 'woo_ce' )
69
+ );
70
+ */
71
+
72
+ // Allow Plugin/Theme authors to add support for additional columns
73
+ $fields = apply_filters( 'woo_ce_' . $export_type . '_fields', $fields, $export_type );
74
+
75
+ switch( $format ) {
76
+
77
+ case 'summary':
78
+ $output = array();
79
+ $size = count( $fields );
80
+ for( $i = 0; $i < $size; $i++ ) {
81
+ if( isset( $fields[$i] ) )
82
+ $output[$fields[$i]['name']] = 'on';
83
+ }
84
+ return $output;
85
+ break;
86
+
87
+ case 'full':
88
+ default:
89
+ $sorting = woo_ce_get_option( $export_type . '_sorting', array() );
90
+ $size = count( $fields );
91
+ for( $i = 0; $i < $size; $i++ )
92
+ $fields[$i]['order'] = ( isset( $sorting[$fields[$i]['name']] ) ? $sorting[$fields[$i]['name']] : $i );
93
+ usort( $fields, woo_ce_sort_fields( 'order' ) );
94
+ return $fields;
95
+ break;
96
+
97
+ }
98
+
99
+ }
100
+
101
+ function woo_ce_override_brand_field_labels( $fields = array() ) {
102
+
103
+ $labels = woo_ce_get_option( 'brand_labels', array() );
104
+ if( !empty( $labels ) ) {
105
+ foreach( $fields as $key => $field ) {
106
+ if( isset( $labels[$field['name']] ) )
107
+ $fields[$key]['label'] = $labels[$field['name']];
108
+ }
109
+ }
110
+ return $fields;
111
+
112
+ }
113
+ add_filter( 'woo_ce_brand_fields', 'woo_ce_override_brand_field_labels', 11 );
114
+ ?>
includes/categories.php ADDED
@@ -0,0 +1,197 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if( is_admin() ) {
3
+
4
+ /* Start of: WordPress Administration */
5
+
6
+ // HTML template for Category Sorting widget on Store Exporter screen
7
+ function woo_ce_category_order_sorting() {
8
+
9
+ $category_orderby = woo_ce_get_option( 'category_orderby', 'ID' );
10
+ $category_order = woo_ce_get_option( 'category_order', 'DESC' );
11
+
12
+ ob_start(); ?>
13
+ <p><label><?php _e( 'Category Sorting', 'woo_ce' ); ?></label></p>
14
+ <div>
15
+ <select name="category_orderby">
16
+ <option value="id"<?php selected( 'id', $category_orderby ); ?>><?php _e( 'Term ID', 'woo_ce' ); ?></option>
17
+ <option value="name"<?php selected( 'name', $category_orderby ); ?>><?php _e( 'Category Name', 'woo_ce' ); ?></option>
18
+ </select>
19
+ <select name="category_order">
20
+ <option value="ASC"<?php selected( 'ASC', $category_order ); ?>><?php _e( 'Ascending', 'woo_ce' ); ?></option>
21
+ <option value="DESC"<?php selected( 'DESC', $category_order ); ?>><?php _e( 'Descending', 'woo_ce' ); ?></option>
22
+ </select>
23
+ <p class="description"><?php _e( 'Select the sorting of Categories within the exported file. By default this is set to export Categories by Term ID in Desending order.', 'woo_ce' ); ?></p>
24
+ </div>
25
+ <?php
26
+ ob_end_flush();
27
+
28
+ }
29
+
30
+ /* End of: WordPress Administration */
31
+
32
+ }
33
+
34
+ // Returns a list of Category export columns
35
+ function woo_ce_get_category_fields( $format = 'full' ) {
36
+
37
+ $export_type = 'category';
38
+
39
+ $fields = array();
40
+ $fields[] = array(
41
+ 'name' => 'term_id',
42
+ 'label' => __( 'Term ID', 'woo_ce' )
43
+ );
44
+ $fields[] = array(
45
+ 'name' => 'name',
46
+ 'label' => __( 'Category Name', 'woo_ce' )
47
+ );
48
+ $fields[] = array(
49
+ 'name' => 'slug',
50
+ 'label' => __( 'Category Slug', 'woo_ce' )
51
+ );
52
+ $fields[] = array(
53
+ 'name' => 'parent_id',
54
+ 'label' => __( 'Parent Term ID', 'woo_ce' )
55
+ );
56
+ $fields[] = array(
57
+ 'name' => 'description',
58
+ 'label' => __( 'Category Description', 'woo_ce' )
59
+ );
60
+ $fields[] = array(
61
+ 'name' => 'display_type',
62
+ 'label' => __( 'Display Type', 'woo_ce' )
63
+ );
64
+ $fields[] = array(
65
+ 'name' => 'image',
66
+ 'label' => __( 'Category Image', 'woo_ce' )
67
+ );
68
+
69
+ /*
70
+ $fields[] = array(
71
+ 'name' => '',
72
+ 'label' => __( '', 'woo_ce' )
73
+ );
74
+ */
75
+
76
+ // Allow Plugin/Theme authors to add support for additional columns
77
+ $fields = apply_filters( 'woo_ce_' . $export_type . '_fields', $fields, $export_type );
78
+
79
+ if( $remember = woo_ce_get_option( $export_type . '_fields', array() ) ) {
80
+ $remember = maybe_unserialize( $remember );
81
+ $size = count( $fields );
82
+ for( $i = 0; $i < $size; $i++ ) {
83
+ $fields[$i]['disabled'] = ( isset( $fields[$i]['disabled'] ) ? $fields[$i]['disabled'] : 0 );
84
+ $fields[$i]['default'] = 1;
85
+ if( !array_key_exists( $fields[$i]['name'], $remember ) )
86
+ $fields[$i]['default'] = 0;
87
+ }
88
+ }
89
+
90
+ switch( $format ) {
91
+
92
+ case 'summary':
93
+ $output = array();
94
+ $size = count( $fields );
95
+ for( $i = 0; $i < $size; $i++ ) {
96
+ if( isset( $fields[$i] ) )
97
+ $output[$fields[$i]['name']] = 'on';
98
+ }
99
+ return $output;
100
+ break;
101
+
102
+ case 'full':
103
+ default:
104
+ $sorting = woo_ce_get_option( $export_type . '_sorting', array() );
105
+ $size = count( $fields );
106
+ for( $i = 0; $i < $size; $i++ )
107
+ $fields[$i]['order'] = ( isset( $sorting[$fields[$i]['name']] ) ? $sorting[$fields[$i]['name']] : $i );
108
+ usort( $fields, woo_ce_sort_fields( 'order' ) );
109
+ return $fields;
110
+ break;
111
+
112
+ }
113
+
114
+ }
115
+
116
+ function woo_ce_override_category_field_labels( $fields = array() ) {
117
+
118
+ $labels = woo_ce_get_option( 'category_labels', array() );
119
+ if( !empty( $labels ) ) {
120
+ foreach( $fields as $key => $field ) {
121
+ if( isset( $labels[$field['name']] ) )
122
+ $fields[$key]['label'] = $labels[$field['name']];
123
+ }
124
+ }
125
+ return $fields;
126
+
127
+ }
128
+ add_filter( 'woo_ce_category_fields', 'woo_ce_override_category_field_labels', 11 );
129
+
130
+ // Returns the export column header label based on an export column slug
131
+ function woo_ce_get_category_field( $name = null, $format = 'name' ) {
132
+
133
+ $output = '';
134
+ if( $name ) {
135
+ $fields = woo_ce_get_category_fields();
136
+ $size = count( $fields );
137
+ for( $i = 0; $i < $size; $i++ ) {
138
+ if( $fields[$i]['name'] == $name ) {
139
+ switch( $format ) {
140
+
141
+ case 'name':
142
+ $output = $fields[$i]['label'];
143
+ break;
144
+
145
+ case 'full':
146
+ $output = $fields[$i];
147
+ break;
148
+
149
+ }
150
+ $i = $size;
151
+ }
152
+ }
153
+ }
154
+ return $output;
155
+
156
+ }
157
+
158
+ // Returns a list of WooCommerce Product Categories to export process
159
+ function woo_ce_get_product_categories( $args = array() ) {
160
+
161
+ $term_taxonomy = 'product_cat';
162
+ $defaults = array(
163
+ 'orderby' => 'name',
164
+ 'order' => 'ASC',
165
+ 'hide_empty' => 0
166
+ );
167
+ $args = wp_parse_args( $args, $defaults );
168
+ $categories = get_terms( $term_taxonomy, $args );
169
+ if( !empty( $categories ) && is_wp_error( $categories ) == false ) {
170
+ foreach( $categories as $key => $category ) {
171
+ $categories[$key]->parent_name = '';
172
+ if( $categories[$key]->parent_id = $category->parent ) {
173
+ if( $parent_category = get_term( $categories[$key]->parent_id, $term_taxonomy ) ) {
174
+ $categories[$key]->parent_name = $parent_category->name;
175
+ }
176
+ unset( $parent_category );
177
+ } else {
178
+ $categories[$key]->parent_id = '';
179
+ }
180
+ $categories[$key]->image = woo_ce_get_category_thumbnail_url( $category->term_id );
181
+ $categories[$key]->display_type = get_woocommerce_term_meta( $category->term_id, 'display_type', true );
182
+ }
183
+ return $categories;
184
+ }
185
+
186
+ }
187
+
188
+ function woo_ce_get_category_thumbnail_url( $category_id = 0, $size = 'full' ) {
189
+
190
+ if ( $thumbnail_id = get_woocommerce_term_meta( $category_id, 'thumbnail_id', true ) ) {
191
+ $image_attributes = wp_get_attachment_image_src( $thumbnail_id, $size );
192
+ if( is_array( $image_attributes ) )
193
+ return current( $image_attributes );
194
+ }
195
+
196
+ }
197
+ ?>
includes/common-dashboard_widgets.php ADDED
@@ -0,0 +1,52 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+
4
+ Filename: common-dashboard_widgets.php
5
+ Description: common-dashboard_widgets.php loads commonly access Dashboard widgets across the Visser Labs suite.
6
+ Version: 1.3
7
+
8
+ */
9
+
10
+ /* Start of: WooCommerce News - by Visser Labs */
11
+
12
+ if( !function_exists( 'woo_vl_dashboard_setup' ) ) {
13
+
14
+ function woo_vl_dashboard_setup() {
15
+
16
+ wp_add_dashboard_widget( 'woo_vl_news_widget', __( 'Plugin News - by Visser Labs', 'woo_vl' ), 'woo_vl_news_widget' );
17
+
18
+ }
19
+ add_action( 'wp_dashboard_setup', 'woo_vl_dashboard_setup' );
20
+
21
+ function woo_vl_news_widget() {
22
+
23
+ include_once( ABSPATH . WPINC . '/feed.php' );
24
+
25
+ $rss = fetch_feed( 'http://www.visser.com.au/blog/category/woocommerce/feed/' );
26
+ $output = '<div class="rss-widget">';
27
+ if( !is_wp_error( $rss ) ) {
28
+ $maxitems = $rss->get_item_quantity( 5 );
29
+ $rss_items = $rss->get_items( 0, $maxitems );
30
+ $output .= '<ul>';
31
+ foreach ( $rss_items as $item ) :
32
+ $output .= '<li>';
33
+ $output .= '<a href="' . $item->get_permalink() . '" title="' . 'Posted ' . $item->get_date( 'j F Y | g:i a' ) . '" class="rsswidget">' . $item->get_title() . '</a>';
34
+ $output .= '<span class="rss-date">' . $item->get_date( 'j F, Y' ) . '</span>';
35
+ $output .= '<div class="rssSummary">' . $item->get_description() . '</div>';
36
+ $output .= '</li>';
37
+ endforeach;
38
+ $output .= '</ul>';
39
+ } else {
40
+ $message = __( 'Connection failed. Please check your network settings.', 'woo_vl' );
41
+ $output .= '<p>' . $message . '</p>';
42
+ }
43
+ $output .= '</div>';
44
+
45
+ echo $output;
46
+
47
+ }
48
+
49
+ }
50
+
51
+ /* End of: WooCommerce News - by Visser Labs */
52
+ ?>
includes/coupons.php ADDED
@@ -0,0 +1,187 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if( is_admin() ) {
3
+
4
+ /* Start of: WordPress Administration */
5
+
6
+ // HTML template for disabled Coupon Sorting widget on Store Exporter screen
7
+ function woo_ce_coupons_coupon_sorting() {
8
+
9
+ ob_start(); ?>
10
+ <p><label><?php _e( 'Coupon Sorting', 'woo_ce' ); ?></label></p>
11
+ <div>
12
+ <select name="coupon_orderby" disabled="disabled">
13
+ <option value="ID"><?php _e( 'Coupon ID', 'woo_ce' ); ?></option>
14
+ <option value="title"><?php _e( 'Coupon Code', 'woo_ce' ); ?></option>
15
+ <option value="date"><?php _e( 'Date Created', 'woo_ce' ); ?></option>
16
+ <option value="modified"><?php _e( 'Date Modified', 'woo_ce' ); ?></option>
17
+ <option value="rand"><?php _e( 'Random', 'woo_ce' ); ?></option>
18
+ </select>
19
+ <select name="coupon_order" disabled="disabled">
20
+ <option value="ASC"><?php _e( 'Ascending', 'woo_ce' ); ?></option>
21
+ <option value="DESC"><?php _e( 'Descending', 'woo_ce' ); ?></option>
22
+ </select>
23
+ <p class="description"><?php _e( 'Select the sorting of Coupons within the exported file. By default this is set to export Coupons by Coupon ID in Desending order.', 'woo_ce' ); ?></p>
24
+ </div>
25
+ <?php
26
+ ob_end_flush();
27
+
28
+ }
29
+
30
+ /* End of: WordPress Administration */
31
+
32
+ }
33
+
34
+ // Returns a list of Coupon export columns
35
+ function woo_ce_get_coupon_fields( $format = 'full' ) {
36
+
37
+ $export_type = 'coupon';
38
+
39
+ $fields = array();
40
+ $fields[] = array(
41
+ 'name' => 'coupon_code',
42
+ 'label' => __( 'Coupon Code', 'woo_ce' )
43
+ );
44
+ $fields[] = array(
45
+ 'name' => 'coupon_description',
46
+ 'label' => __( 'Coupon Description', 'woo_ce' )
47
+ );
48
+ $fields[] = array(
49
+ 'name' => 'discount_type',
50
+ 'label' => __( 'Discount Type', 'woo_ce' )
51
+ );
52
+ $fields[] = array(
53
+ 'name' => 'coupon_amount',
54
+ 'label' => __( 'Coupon Amount', 'woo_ce' )
55
+ );
56
+ $fields[] = array(
57
+ 'name' => 'individual_use',
58
+ 'label' => __( 'Individual Use', 'woo_ce' )
59
+ );
60
+ $fields[] = array(
61
+ 'name' => 'apply_before_tax',
62
+ 'label' => __( 'Apply before tax', 'woo_ce' )
63
+ );
64
+ $fields[] = array(
65
+ 'name' => 'exclude_sale_items',
66
+ 'label' => __( 'Exclude sale items', 'woo_ce' )
67
+ );
68
+ $fields[] = array(
69
+ 'name' => 'minimum_amount',
70
+ 'label' => __( 'Minimum Amount', 'woo_ce' )
71
+ );
72
+ $fields[] = array(
73
+ 'name' => 'product_ids',
74
+ 'label' => __( 'Products', 'woo_ce' )
75
+ );
76
+ $fields[] = array(
77
+ 'name' => 'exclude_product_ids',
78
+ 'label' => __( 'Exclude Products', 'woo_ce' )
79
+ );
80
+ $fields[] = array(
81
+ 'name' => 'product_categories',
82
+ 'label' => __( 'Product Categories', 'woo_ce' )
83
+ );
84
+ $fields[] = array(
85
+ 'name' => 'exclude_product_categories',
86
+ 'label' => __( 'Exclude Product Categories', 'woo_ce' )
87
+ );
88
+ $fields[] = array(
89
+ 'name' => 'customer_email',
90
+ 'label' => __( 'Customer e-mails', 'woo_ce' )
91
+ );
92
+ $fields[] = array(
93
+ 'name' => 'usage_limit',
94
+ 'label' => __( 'Usage Limit', 'woo_ce' )
95
+ );
96
+ $fields[] = array(
97
+ 'name' => 'expiry_date',
98
+ 'label' => __( 'Expiry Date', 'woo_ce' )
99
+ );
100
+
101
+ /*
102
+ $fields[] = array(
103
+ 'name' => '',
104
+ 'label' => __( '', 'woo_ce' )
105
+ );
106
+ */
107
+
108
+ // Allow Plugin/Theme authors to add support for additional columns
109
+ $fields = apply_filters( 'woo_ce_' . $export_type . '_fields', $fields, $export_type );
110
+
111
+ switch( $format ) {
112
+
113
+ case 'summary':
114
+ $output = array();
115
+ $size = count( $fields );
116
+ for( $i = 0; $i < $size; $i++ ) {
117
+ if( isset( $fields[$i] ) )
118
+ $output[$fields[$i]['name']] = 'on';
119
+ }
120
+ return $output;
121
+ break;
122
+
123
+ case 'full':
124
+ default:
125
+ $sorting = woo_ce_get_option( $export_type . '_sorting', array() );
126
+ $size = count( $fields );
127
+ for( $i = 0; $i < $size; $i++ )
128
+ $fields[$i]['order'] = ( isset( $sorting[$fields[$i]['name']] ) ? $sorting[$fields[$i]['name']] : $i );
129
+ usort( $fields, woo_ce_sort_fields( 'order' ) );
130
+ return $fields;
131
+ break;
132
+
133
+ }
134
+
135
+ }
136
+
137
+ function woo_ce_override_coupon_field_labels( $fields = array() ) {
138
+
139
+ $labels = woo_ce_get_option( 'coupon_labels', array() );
140
+ if( !empty( $labels ) ) {
141
+ foreach( $fields as $key => $field ) {
142
+ if( isset( $labels[$field['name']] ) )
143
+ $fields[$key]['label'] = $labels[$field['name']];
144
+ }
145
+ }
146
+ return $fields;
147
+
148
+ }
149
+ add_filter( 'woo_ce_coupon_fields', 'woo_ce_override_coupon_field_labels', 11 );
150
+
151
+ // Returns a list of Coupon IDs
152
+ function woo_ce_get_coupons( $args = array() ) {
153
+
154
+ global $export;
155
+
156
+ $limit_volume = -1;
157
+ $offset = 0;
158
+
159
+ if( $args ) {
160
+ $limit_volume = ( isset( $args['limit_volume'] ) ? $args['limit_volume'] : false );
161
+ $offset = ( isset( $args['offset'] ) ? $args['offset'] : false );
162
+ $orderby = ( isset( $args['coupon_orderby'] ) ? $args['coupon_orderby'] : 'ID' );
163
+ $order = ( isset( $args['coupon_order'] ) ? $args['coupon_order'] : 'ASC' );
164
+ }
165
+
166
+ $post_type = 'shop_coupon';
167
+ $args = array(
168
+ 'post_type' => $post_type,
169
+ 'orderby' => $orderby,
170
+ 'order' => $order,
171
+ 'offset' => $offset,
172
+ 'posts_per_page' => $limit_volume,
173
+ 'post_status' => woo_ce_post_statuses(),
174
+ 'fields' => 'ids'
175
+ );
176
+ $coupons = array();
177
+ $coupon_ids = new WP_Query( $args );
178
+ if( $coupon_ids->posts ) {
179
+ foreach( $coupon_ids->posts as $coupon_id )
180
+ $coupons[] = $coupon_id;
181
+ unset( $coupon_ids, $coupon_id );
182
+ }
183
+ return $coupons;
184
+
185
+ }
186
+
187
+ ?>
includes/customers.php ADDED
@@ -0,0 +1,210 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if( is_admin() ) {
3
+
4
+ /* Start of: WordPress Administration */
5
+
6
+ // HTML template for disabled Filter Customers by Order Status widget on Store Exporter screen
7
+ function woo_ce_customers_filter_by_status() {
8
+
9
+ $woo_cd_url = 'http://www.visser.com.au/woocommerce/plugins/exporter-deluxe/';
10
+ $woo_cd_link = sprintf( '<a href="%s" target="_blank">' . __( 'Store Exporter Deluxe', 'woo_ce' ) . '</a>', $woo_cd_url );
11
+
12
+ $order_statuses = woo_ce_get_order_statuses();
13
+
14
+ ob_start(); ?>
15
+ <p><label><input type="checkbox" id="customers-filters-status" /> <?php _e( 'Filter Customers by Order Status', 'woo_ce' ); ?><span class="description"> - <?php printf( __( 'available in %s', 'woo_ce' ), $woo_cd_link ); ?></span></label></p>
16
+ <div id="export-customers-filters-status" class="separator">
17
+ <ul>
18
+ <?php if( $order_statuses ) { ?>
19
+ <?php foreach( $order_statuses as $order_status ) { ?>
20
+ <li><label><input type="checkbox" name="customer_filter_status[<?php echo $order_status->name; ?>]" value="<?php echo $order_status->name; ?>" disabled="disabled" /> <?php echo ucfirst( $order_status->name ); ?></label></li>
21
+ <?php } ?>
22
+ <?php } else { ?>
23
+ <li><?php _e( 'No Order Status\'s were found.', 'jigo_ce' ); ?></li>
24
+ <?php } ?>
25
+ </ul>
26
+ <p class="description"><?php _e( 'Select the Order Status you want to filter exported Customers by. Default is to include all Order Status options.', 'woo_ce' ); ?></p>
27
+ </div>
28
+ <!-- #export-customers-filters-status -->
29
+ <?php
30
+ ob_end_flush();
31
+
32
+ }
33
+
34
+ /* End of: WordPress Administration */
35
+
36
+ }
37
+
38
+ // Returns a list of Customer export columns
39
+ function woo_ce_get_customer_fields( $format = 'full' ) {
40
+
41
+ $export_type = 'customer';
42
+
43
+ $fields = array();
44
+ $fields[] = array(
45
+ 'name' => 'user_id',
46
+ 'label' => __( 'User ID', 'woo_ce' )
47
+ );
48
+ $fields[] = array(
49
+ 'name' => 'user_name',
50
+ 'label' => __( 'Username', 'woo_ce' )
51
+ );
52
+ $fields[] = array(
53
+ 'name' => 'user_role',
54
+ 'label' => __( 'User Role', 'woo_ce' )
55
+ );
56
+ $fields[] = array(
57
+ 'name' => 'billing_full_name',
58
+ 'label' => __( 'Billing: Full Name', 'woo_ce' )
59
+ );
60
+ $fields[] = array(
61
+ 'name' => 'billing_first_name',
62
+ 'label' => __( 'Billing: First Name', 'woo_ce' )
63
+ );
64
+ $fields[] = array(
65
+ 'name' => 'billing_last_name',
66
+ 'label' => __( 'Billing: Last Name', 'woo_ce' )
67
+ );
68
+ $fields[] = array(
69
+ 'name' => 'billing_company',
70
+ 'label' => __( 'Billing: Company', 'woo_ce' )
71
+ );
72
+ $fields[] = array(
73
+ 'name' => 'billing_address',
74
+ 'label' => __( 'Billing: Street Address', 'woo_ce' )
75
+ );
76
+ $fields[] = array(
77
+ 'name' => 'billing_city',
78
+ 'label' => __( 'Billing: City', 'woo_ce' )
79
+ );
80
+ $fields[] = array(
81
+ 'name' => 'billing_postcode',
82
+ 'label' => __( 'Billing: ZIP Code', 'woo_ce' )
83
+ );
84
+ $fields[] = array(
85
+ 'name' => 'billing_state',
86
+ 'label' => __( 'Billing: State (prefix)', 'woo_ce' )
87
+ );
88
+ $fields[] = array(
89
+ 'name' => 'billing_state_full',
90
+ 'label' => __( 'Billing: State', 'woo_ce' )
91
+ );
92
+ $fields[] = array(
93
+ 'name' => 'billing_country',
94
+ 'label' => __( 'Billing: Country', 'woo_ce' )
95
+ );
96
+ $fields[] = array(
97
+ 'name' => 'billing_phone',
98
+ 'label' => __( 'Billing: Phone Number', 'woo_ce' )
99
+ );
100
+ $fields[] = array(
101
+ 'name' => 'billing_email',
102
+ 'label' => __( 'Billing: E-mail Address', 'woo_ce' )
103
+ );
104
+ $fields[] = array(
105
+ 'name' => 'shipping_full_name',
106
+ 'label' => __( 'Shipping: Full Name', 'woo_ce' )
107
+ );
108
+ $fields[] = array(
109
+ 'name' => 'shipping_first_name',
110
+ 'label' => __( 'Shipping: First Name', 'woo_ce' )
111
+ );
112
+ $fields[] = array(
113
+ 'name' => 'shipping_last_name',
114
+ 'label' => __( 'Shipping: Last Name', 'woo_ce' )
115
+ );
116
+ $fields[] = array(
117
+ 'name' => 'shipping_company',
118
+ 'label' => __( 'Shipping: Company', 'woo_ce' )
119
+ );
120
+ $fields[] = array(
121
+ 'name' => 'shipping_address',
122
+ 'label' => __( 'Shipping: Street Address', 'woo_ce' )
123
+ );
124
+ $fields[] = array(
125
+ 'name' => 'shipping_city',
126
+ 'label' => __( 'Shipping: City', 'woo_ce' )
127
+ );
128
+ $fields[] = array(
129
+ 'name' => 'shipping_postcode',
130
+ 'label' => __( 'Shipping: ZIP Code', 'woo_ce' )
131
+ );
132
+ $fields[] = array(
133
+ 'name' => 'shipping_state',
134
+ 'label' => __( 'Shipping: State (prefix)', 'woo_ce' )
135
+ );
136
+ $fields[] = array(
137
+ 'name' => 'shipping_state_full',
138
+ 'label' => __( 'Shipping: State', 'woo_ce' )
139
+ );
140
+ $fields[] = array(
141
+ 'name' => 'shipping_country',
142
+ 'label' => __( 'Shipping: Country (prefix)', 'woo_ce' )
143
+ );
144
+ $fields[] = array(
145
+ 'name' => 'shipping_country_full',
146
+ 'label' => __( 'Shipping: Country', 'woo_ce' )
147
+ );
148
+ $fields[] = array(
149
+ 'name' => 'total_spent',
150
+ 'label' => __( 'Total Spent', 'woo_ce' )
151
+ );
152
+ $fields[] = array(
153
+ 'name' => 'completed_orders',
154
+ 'label' => __( 'Completed Orders', 'woo_ce' )
155
+ );
156
+ $fields[] = array(
157
+ 'name' => 'total_orders',
158
+ 'label' => __( 'Total Orders', 'woo_ce' )
159
+ );
160
+
161
+ /*
162
+ $fields[] = array(
163
+ 'name' => '',
164
+ 'label' => __( '', 'woo_ce' )
165
+ );
166
+ */
167
+
168
+ // Allow Plugin/Theme authors to add support for additional columns
169
+ $fields = apply_filters( 'woo_ce_' . $export_type . '_fields', $fields, $export_type );
170
+
171
+ switch( $format ) {
172
+
173
+ case 'summary':
174
+ $output = array();
175
+ $size = count( $fields );
176
+ for( $i = 0; $i < $size; $i++ ) {
177
+ if( isset( $fields[$i] ) )
178
+ $output[$fields[$i]['name']] = 'on';
179
+ }
180
+ return $output;
181
+ break;
182
+
183
+ case 'full':
184
+ default:
185
+ $sorting = woo_ce_get_option( $export_type . '_sorting', array() );
186
+ $size = count( $fields );
187
+ for( $i = 0; $i < $size; $i++ )
188
+ $fields[$i]['order'] = ( isset( $sorting[$fields[$i]['name']] ) ? $sorting[$fields[$i]['name']] : $i );
189
+ usort( $fields, woo_ce_sort_fields( 'order' ) );
190
+ return $fields;
191
+ break;
192
+
193
+ }
194
+
195
+ }
196
+
197
+ function woo_ce_override_customer_field_labels( $fields = array() ) {
198
+
199
+ $labels = woo_ce_get_option( 'customer_labels', array() );
200
+ if( !empty( $labels ) ) {
201
+ foreach( $fields as $key => $field ) {
202
+ if( isset( $labels[$field['name']] ) )
203
+ $fields[$key]['label'] = $labels[$field['name']];
204
+ }
205
+ }
206
+ return $fields;
207
+
208
+ }
209
+ add_filter( 'woo_ce_customer_fields', 'woo_ce_override_customer_field_labels', 11 );
210
+ ?>
includes/export-csv.php ADDED
@@ -0,0 +1,49 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ // Function to generate filename of CSV file based on the Export type
3
+ function woo_ce_generate_csv_filename( $export_type = '' ) {
4
+
5
+ // Get the filename from WordPress options
6
+ $filename = woo_ce_get_option( 'export_filename', 'woo-export_%dataset%-%date%.csv' );
7
+
8
+ // Strip other file extensions if present
9
+ $filename = str_replace( array( 'xml', 'xls' ), 'csv', $filename );
10
+ if( ( strpos( $filename, '.xml' ) !== false ) || ( strpos( $filename, '.xls' ) !== false ) )
11
+ $filename = str_replace( array( '.xml', '.xls' ), '.csv', $filename );
12
+
13
+ // Add file extension if it has been removed
14
+ if( strpos( $filename, '.csv' ) === false )
15
+ $filename .= '.csv';
16
+
17
+ // Populate the available tags
18
+ $date = date( 'Y_m_d' );
19
+ $time = date( 'H_i_s' );
20
+ $store_name = sanitize_title( get_bloginfo( 'name' ) );
21
+
22
+ // Switch out the tags for filled values
23
+ $filename = str_replace( '%dataset%', $export_type, $filename );
24
+ $filename = str_replace( '%date%', $date, $filename );
25
+ $filename = str_replace( '%time%', $time, $filename );
26
+ $filename = str_replace( '%store_name%', $store_name, $filename );
27
+
28
+ // Return the filename
29
+ return $filename;
30
+
31
+ }
32
+
33
+ // File output header for CSV file
34
+ function woo_ce_generate_csv_header( $export_type = '' ) {
35
+
36
+ global $export;
37
+
38
+ if( $filename = woo_ce_generate_csv_filename( $export_type ) ) {
39
+ $mime_type = 'text/csv';
40
+ header( sprintf( 'Content-Encoding: %s', esc_attr( $export->encoding ) ) );
41
+ header( sprintf( 'Content-Type: %s; charset=%s', $mime_type, esc_attr( $export->encoding ) ) );
42
+ header( 'Content-Transfer-Encoding: binary' );
43
+ header( sprintf( 'Content-Disposition: attachment; filename=%s', $filename ) );
44
+ header( 'Pragma: no-cache' );
45
+ header( 'Expires: 0' );
46
+ }
47
+
48
+ }
49
+ ?>
includes/formatting.php ADDED
@@ -0,0 +1,471 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ function woo_ce_file_encoding( $content = '' ) {
3
+
4
+ global $export;
5
+
6
+ if( function_exists( 'mb_convert_encoding' ) ) {
7
+ $to_encoding = $export->encoding;
8
+ $from_encoding = 'auto';
9
+ if( !empty( $to_encoding ) )
10
+ $content = mb_convert_encoding( trim( $content ), $to_encoding, $from_encoding );
11
+ if( $to_encoding <> 'UTF-8' )
12
+ $content = utf8_encode( $content );
13
+ }
14
+ return $content;
15
+
16
+ }
17
+
18
+ function woo_ce_display_memory( $memory = 0 ) {
19
+
20
+ $output = '-';
21
+ if( !empty( $output ) )
22
+ $output = sprintf( __( '%s MB', 'woo_ce' ), $memory );
23
+ echo $output;
24
+
25
+ }
26
+
27
+ function woo_ce_display_time_elapsed( $from, $to ) {
28
+
29
+ $output = __( '1 second', 'woo_ce' );
30
+ $time = $to - $from;
31
+ $tokens = array (
32
+ 31536000 => __( 'year', 'woo_ce' ),
33
+ 2592000 => __( 'month', 'woo_ce' ),
34
+ 604800 => __( 'week', 'woo_ce' ),
35
+ 86400 => __( 'day', 'woo_ce' ),
36
+ 3600 => __( 'hour', 'woo_ce' ),
37
+ 60 => __( 'minute', 'woo_ce' ),
38
+ 1 => __( 'second', 'woo_ce' )
39
+ );
40
+ foreach ($tokens as $unit => $text) {
41
+ if ($time < $unit) continue;
42
+ $numberOfUnits = floor($time / $unit);
43
+ $output = $numberOfUnits . ' ' . $text . ( ( $numberOfUnits > 1 ) ? 's' : '' );
44
+ }
45
+ return $output;
46
+
47
+ }
48
+
49
+ // This function escapes all cells in 'Excel' CSV escape formatting of a CSV file, also converts HTML entities to plain-text
50
+ function woo_ce_escape_csv_value( $string = '', $delimiter = ',', $format = 'all' ) {
51
+
52
+ $string = str_replace( '"', '""', $string );
53
+ $string = wp_specialchars_decode( $string );
54
+ $string = str_replace( PHP_EOL, "\r\n", $string );
55
+ switch( $format ) {
56
+
57
+ case 'all':
58
+ $string = '"' . $string . '"';
59
+ break;
60
+
61
+ case 'excel':
62
+ if( strpos( $string, '"' ) !== false or strpos( $string, ',' ) !== false or strpos( $string, "\r" ) !== false or strpos( $string, "\n" ) !== false )
63
+ $string = '"' . $string . '"';
64
+ break;
65
+
66
+ }
67
+ return $string;
68
+
69
+ }
70
+
71
+ function woo_ce_count_object( $object = 0, $exclude_post_types = array() ) {
72
+
73
+ $count = 0;
74
+ if( is_object( $object ) ) {
75
+ if( $exclude_post_types ) {
76
+ $size = count( $exclude_post_types );
77
+ for( $i = 0; $i < $size; $i++ ) {
78
+ if( isset( $object->$exclude_post_types[$i] ) )
79
+ unset( $object->$exclude_post_types[$i] );
80
+ }
81
+ }
82
+ if( !empty( $object ) ) {
83
+ foreach( $object as $key => $item )
84
+ $count = $item + $count;
85
+ }
86
+ } else {
87
+ $count = $object;
88
+ }
89
+ return $count;
90
+
91
+ }
92
+
93
+ function woo_ce_convert_product_ids( $product_ids = null ) {
94
+
95
+ global $export;
96
+
97
+ $output = '';
98
+ if( $product_ids ) {
99
+ if( is_array( $product_ids ) ) {
100
+ $size = count( $product_ids );
101
+ for( $i = 0; $i < $size; $i++ )
102
+ $output .= $product_ids[$i] . $export->category_separator;
103
+ $output = substr( $output, 0, -1 );
104
+ } else if( strstr( $product_ids, ',' ) ) {
105
+ $output = str_replace( ',', $export->category_separator, $product_ids );
106
+ }
107
+ }
108
+ return $output;
109
+
110
+ }
111
+
112
+ function woo_ce_format_visibility( $visibility = '' ) {
113
+
114
+ $output = '';
115
+ if( $visibility ) {
116
+ switch( $visibility ) {
117
+
118
+ case 'visible':
119
+ $output = __( 'Catalog & Search', 'woo_ce' );
120
+ break;
121
+
122
+ case 'catalog':
123
+ $output = __( 'Catalog', 'woo_ce' );
124
+ break;
125
+
126
+ case 'search':
127
+ $output = __( 'Search', 'woo_ce' );
128
+ break;
129
+
130
+ case 'hidden':
131
+ $output = __( 'Hidden', 'woo_ce' );
132
+ break;
133
+
134
+ }
135
+ }
136
+ return $output;
137
+
138
+ }
139
+
140
+ function woo_ce_format_download_type( $download_type = '' ) {
141
+
142
+ $output = __( 'Standard', 'woo_ce' );
143
+ if( $download_type ) {
144
+ switch( $download_type ) {
145
+
146
+ case 'application':
147
+ $output = __( 'Application', 'woo_ce' );
148
+ break;
149
+
150
+ case 'music':
151
+ $output = __( 'Music', 'woo_ce' );
152
+ break;
153
+
154
+ }
155
+ }
156
+ return $output;
157
+
158
+ }
159
+
160
+ function woo_ce_format_product_status( $product_status = '' ) {
161
+
162
+ $output = $product_status;
163
+ switch( $product_status ) {
164
+
165
+ case 'publish':
166
+ $output = __( 'Publish', 'woo_ce' );
167
+ break;
168
+
169
+ case 'draft':
170
+ $output = __( 'Draft', 'woo_ce' );
171
+ break;
172
+
173
+ case 'trash':
174
+ $output = __( 'Trash', 'woo_ce' );
175
+ break;
176
+
177
+ }
178
+ return $output;
179
+
180
+ }
181
+
182
+ function woo_ce_format_comment_status( $comment_status ) {
183
+
184
+ $output = $comment_status;
185
+ switch( $comment_status ) {
186
+
187
+ case 'open':
188
+ $output = __( 'Open', 'woo_ce' );
189
+ break;
190
+
191
+ case 'closed':
192
+ $output = __( 'Closed', 'woo_ce' );
193
+ break;
194
+
195
+ }
196
+ return $output;
197
+
198
+ }
199
+
200
+ function woo_ce_format_switch( $input = '', $output_format = 'answer' ) {
201
+
202
+ $input = strtolower( $input );
203
+ switch( $input ) {
204
+
205
+ case '1':
206
+ case 'yes':
207
+ case 'on':
208
+ case 'open':
209
+ case 'active':
210
+ $input = '1';
211
+ break;
212
+
213
+ case '0':
214
+ case 'no':
215
+ case 'off':
216
+ case 'closed':
217
+ case 'inactive':
218
+ default:
219
+ $input = '0';
220
+ break;
221
+
222
+ }
223
+ $output = '';
224
+ switch( $output_format ) {
225
+
226
+ case 'int':
227
+ $output = $input;
228
+ break;
229
+
230
+ case 'answer':
231
+ switch( $input ) {
232
+
233
+ case '1':
234
+ $output = __( 'Yes', 'woo_ce' );
235
+ break;
236
+
237
+ case '0':
238
+ $output = __( 'No', 'woo_ce' );
239
+ break;
240
+
241
+ }
242
+ break;
243
+
244
+ case 'boolean':
245
+ switch( $input ) {
246
+
247
+ case '1':
248
+ $output = 'on';
249
+ break;
250
+
251
+ case '0':
252
+ $output = 'off';
253
+ break;
254
+
255
+ }
256
+ break;
257
+
258
+ }
259
+ return $output;
260
+
261
+ }
262
+
263
+ function woo_ce_format_stock_status( $stock_status = '', $stock = '' ) {
264
+
265
+ $output = '';
266
+ if( empty( $stock_status ) && !empty( $stock ) ) {
267
+ if( $stock )
268
+ $stock_status = 'instock';
269
+ else
270
+ $stock_status = 'outofstock';
271
+ }
272
+ if( $stock_status ) {
273
+ switch( $stock_status ) {
274
+
275
+ case 'instock':
276
+ $output = __( 'In Stock', 'woo_ce' );
277
+ break;
278
+
279
+ case 'outofstock':
280
+ $output = __( 'Out of Stock', 'woo_ce' );
281
+ break;
282
+
283
+ }
284
+ }
285
+ return $output;
286
+
287
+ }
288
+
289
+ function woo_ce_format_tax_status( $tax_status = null ) {
290
+
291
+ $output = '';
292
+ if( $tax_status ) {
293
+ switch( $tax_status ) {
294
+
295
+ case 'taxable':
296
+ $output = __( 'Taxable', 'woo_ce' );
297
+ break;
298
+
299
+ case 'shipping':
300
+ $output = __( 'Shipping Only', 'woo_ce' );
301
+ break;
302
+
303
+ case 'none':
304
+ $output = __( 'None', 'woo_ce' );
305
+ break;
306
+
307
+ }
308
+ }
309
+ return $output;
310
+
311
+ }
312
+
313
+ function woo_ce_format_tax_class( $tax_class = '' ) {
314
+
315
+ global $export;
316
+
317
+ $output = '';
318
+ if( $tax_class ) {
319
+ switch( $tax_class ) {
320
+
321
+ case '*':
322
+ $tax_class = __( 'Standard', 'woo_ce' );
323
+ break;
324
+
325
+ case 'reduced-rate':
326
+ $tax_class = __( 'Reduced Rate', 'woo_ce' );
327
+ break;
328
+
329
+ case 'zero-rate':
330
+ $tax_class = __( 'Zero Rate', 'woo_ce' );
331
+ break;
332
+
333
+ }
334
+ $output = $tax_class;
335
+ }
336
+ return $output;
337
+
338
+ }
339
+
340
+ function woo_ce_format_product_filters( $product_filters = array() ) {
341
+
342
+ $output = array();
343
+ if( !empty( $product_filters ) ) {
344
+ foreach( $product_filters as $product_filter )
345
+ $output[] = $product_filter;
346
+ }
347
+ return $output;
348
+
349
+ }
350
+
351
+ function woo_ce_format_user_role_filters( $user_role_filters = array() ) {
352
+
353
+ $output = array();
354
+ if( !empty( $user_role_filters ) ) {
355
+ foreach( $user_role_filters as $user_role_filter )
356
+ $output[] = $user_role_filter;
357
+ }
358
+ return $output;
359
+
360
+ }
361
+
362
+ function woo_ce_format_user_role_label( $user_role = '' ) {
363
+
364
+ global $wp_roles;
365
+
366
+ $output = $user_role;
367
+ if( $user_role ) {
368
+ $user_roles = woo_ce_get_user_roles();
369
+ if( isset( $user_roles[$user_role] ) )
370
+ $output = ucfirst( $user_roles[$user_role]['name'] );
371
+ unset( $user_roles );
372
+ }
373
+ return $output;
374
+
375
+ }
376
+
377
+ function woo_ce_format_product_type( $type_id = '' ) {
378
+
379
+ $output = $type_id;
380
+ if( $output ) {
381
+ $product_types = apply_filters( 'woo_ce_format_product_types', array(
382
+ 'simple' => __( 'Simple Product', 'woocommerce' ),
383
+ 'downloadable' => __( 'Downloadable', 'woocommerce' ),
384
+ 'grouped' => __( 'Grouped Product', 'woocommerce' ),
385
+ 'virtual' => __( 'Virtual', 'woocommerce' ),
386
+ 'variable' => __( 'Variable', 'woocommerce' ),
387
+ 'external' => __( 'External/Affiliate Product', 'woocommerce' ),
388
+ 'variation' => __( 'Variation', 'woo_ce' )
389
+ ) );
390
+ if( isset( $product_types[$type_id] ) )
391
+ $output = $product_types[$type_id];
392
+ }
393
+ return $output;
394
+
395
+ }
396
+
397
+ function woo_ce_format_price( $price = '' ) {
398
+
399
+ // Check that a valid price has been provided and that wc_format_localized_price() exists
400
+ if( isset( $price ) && $price != '' && function_exists( 'wc_format_localized_price' ) )
401
+ return wc_format_localized_price( $price );
402
+ else
403
+ return $price;
404
+
405
+ }
406
+
407
+ function woo_ce_format_sale_price_dates( $sale_date = '' ) {
408
+
409
+ $output = $sale_date;
410
+ if( $sale_date )
411
+ $output = woo_ce_format_date( date( 'Y-m-d H:i:s', $sale_date ) );
412
+ return $output;
413
+
414
+ }
415
+
416
+ function woo_ce_format_date( $date = '' ) {
417
+
418
+ $output = $date;
419
+ $date_format = woo_ce_get_option( 'date_format', 'd/m/Y' );
420
+ if( !empty( $date ) && $date_format != '' )
421
+ $output = mysql2date( $date_format, $date );
422
+ return $output;
423
+
424
+ }
425
+
426
+ function woo_ce_format_product_category_label( $product_category = '', $parent_category = '' ) {
427
+
428
+ $output = $product_category;
429
+ if( !empty( $parent_category ) )
430
+ $output .= ' &raquo; ' . $parent_category;
431
+ return $output;
432
+
433
+ }
434
+
435
+ if( !function_exists( 'woo_ce_expand_state_name' ) ) {
436
+ function woo_ce_expand_state_name( $country_prefix = '', $state_prefix = '' ) {
437
+
438
+ global $woocommerce;
439
+
440
+ $output = $state_prefix;
441
+ if( $output ) {
442
+ if( isset( $woocommerce->countries ) ) {
443
+ if( $states = $woocommerce->countries->get_states( $country_prefix ) ) {
444
+ if( isset( $states[$state_prefix] ) )
445
+ $output = $states[$state_prefix];
446
+ }
447
+ unset( $states );
448
+ }
449
+ }
450
+ return $output;
451
+
452
+ }
453
+ }
454
+
455
+ if( !function_exists( 'woo_ce_expand_country_name' ) ) {
456
+ function woo_ce_expand_country_name( $country_prefix = '' ) {
457
+
458
+ global $woocommerce;
459
+
460
+ $output = $country_prefix;
461
+ if( $output && method_exists( $woocommerce, 'countries' ) ) {
462
+ $countries = $woocommerce->countries;
463
+ if( isset( $countries[$country_prefix] ) )
464
+ $output = $countries[$country_prefix];
465
+ unset( $countries );
466
+ }
467
+ return $output;
468
+
469
+ }
470
+ }
471
+ ?>
includes/functions.php ADDED
@@ -0,0 +1,870 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ include_once( WOO_CE_PATH . 'includes/products.php' );
3
+ include_once( WOO_CE_PATH . 'includes/categories.php' );
4
+ include_once( WOO_CE_PATH . 'includes/tags.php' );
5
+ include_once( WOO_CE_PATH . 'includes/brands.php' );
6
+ include_once( WOO_CE_PATH . 'includes/orders.php' );
7
+ include_once( WOO_CE_PATH . 'includes/customers.php' );
8
+ include_once( WOO_CE_PATH . 'includes/users.php' );
9
+ include_once( WOO_CE_PATH . 'includes/coupons.php' );
10
+ include_once( WOO_CE_PATH . 'includes/subscriptions.php' );
11
+ include_once( WOO_CE_PATH . 'includes/product_vendors.php' );
12
+
13
+ if( version_compare( phpversion(), '5.3', '>=' ) )
14
+ include_once( WOO_CE_PATH . 'includes/legacy.php' );
15
+ include_once( WOO_CE_PATH . 'includes/formatting.php' );
16
+
17
+ include_once( WOO_CE_PATH . 'includes/export-csv.php' );
18
+
19
+ if( is_admin() ) {
20
+
21
+ /* Start of: WordPress Administration */
22
+
23
+ include_once( WOO_CE_PATH . 'includes/admin.php' );
24
+ include_once( WOO_CE_PATH . 'includes/settings.php' );
25
+
26
+ function woo_ce_detect_non_woo_install() {
27
+
28
+ $troubleshooting_url = 'http://www.visser.com.au/documentation/store-exporter-deluxe/usage/';
29
+ if( !woo_is_woo_activated() && ( woo_is_jigo_activated() || woo_is_wpsc_activated() ) ) {
30
+ $message = sprintf( __( 'We have detected another e-Commerce Plugin than WooCommerce activated, please check that you are using Store Exporter Deluxe for the correct platform. <a href="%s" target="_blank">Need help?</a>', 'woo_ce' ), $troubleshooting_url );
31
+ woo_ce_admin_notice( $message, 'error', 'plugins.php' );
32
+ } else if( !woo_is_woo_activated() ) {
33
+ $message = sprintf( __( 'We have been unable to detect the WooCommerce Plugin activated on this WordPress site, please check that you are using Store Exporter Deluxe for the correct platform. <a href="%s" target="_blank">Need help?</a>', 'woo_ce' ), $troubleshooting_url );
34
+ woo_ce_admin_notice( $message, 'error', 'plugins.php' );
35
+ }
36
+ woo_ce_plugin_page_notices();
37
+
38
+ }
39
+
40
+ // Displays a HTML notice when a WordPress or Store Exporter error is encountered
41
+ function woo_ce_fail_notices() {
42
+
43
+ woo_ce_memory_prompt();
44
+
45
+ $troubleshooting_url = 'http://www.visser.com.au/documentation/store-exporter-deluxe/usage/';
46
+ if( isset( $_GET['failed'] ) ) {
47
+ $message = '';
48
+ if( isset( $_GET['message'] ) )
49
+ $message = urldecode( $_GET['message'] );
50
+ if( $message )
51
+ $message = sprintf( __( 'A WordPress or server error caused the exporter to fail, the exporter was provided with a reason: <em>%s</em>', 'woo_ce' ), $message ) . ' (<a href="' . $troubleshooting_url . '" target="_blank">' . __( 'Need help?', 'woo_ce' ) . '</a>)';
52
+ else
53
+ $message = __( 'A WordPress or server error caused the exporter to fail, no reason was provided, please get in touch so we can reproduce and resolve this.', 'woo_ce' ) . ' (<a href="' . $troubleshooting_url . '" target="_blank">' . __( 'Need help?', 'woo_ce' ) . '</a>)';
54
+ woo_ce_admin_notice_html( $message, 'error' );
55
+ }
56
+ if( get_transient( WOO_CE_PREFIX . '_running' ) ) {
57
+ $message = __( 'A WordPress or server error caused the exporter to fail with a blank screen, this is either a memory or timeout issue, please get in touch so we can reproduce and resolve this.', 'woo_ce' ) . ' (<a href="' . $troubleshooting_url . '" target="_blank">' . __( 'Need help?', 'woo_ce' ) . '</a>)';
58
+ woo_ce_admin_notice_html( $message, 'error' );
59
+ delete_transient( WOO_CE_PREFIX . '_running' );
60
+ }
61
+
62
+ }
63
+
64
+ function woo_ce_memory_prompt() {
65
+
66
+ $troubleshooting_url = 'http://www.visser.com.au/documentation/store-exporter-deluxe/usage/';
67
+
68
+ // Displays a HTML notice where the memory allocated to WordPress falls below 64MB
69
+ $memory_limit = (int)( ini_get( 'memory_limit' ) );
70
+ $minimum_memory_limit = 64;
71
+ if( ( $memory_limit < $minimum_memory_limit ) && !woo_ce_get_option( 'dismiss_memory_prompt', 0 ) ) {
72
+ $dismiss_url = add_query_arg( 'action', 'dismiss_memory_prompt' );
73
+ $message = sprintf( __( 'We recommend setting memory to at least %dMB, your site has only %dMB allocated to it. See: <a href="%s" target="_blank">Increasing memory allocated to PHP</a>', 'woo_ce' ), $minimum_memory_limit, $memory_limit, $troubleshooting_url ) . '<span style="float:right;"><a href="' . $dismiss_url . '">' . __( 'Dismiss', 'woo_ce' ) . '</a></span>';
74
+ woo_ce_admin_notice_html( $message, 'error' );
75
+ }
76
+
77
+ if( version_compare( phpversion(), '5.3', '<' ) && !woo_ce_get_option( 'dismiss_php_legacy', 0 ) ) {
78
+ $dismiss_url = add_query_arg( 'action', 'dismiss_php_legacy' );
79
+ $message = sprintf( __( 'Your PHP version (%s) is not supported and is very much out of date, since 2010 all users are strongly encouraged to upgrade to PHP 5.3+ and above. Contact your hosting provider to make this happen. See: <a href="%s" target="_blank">Migrating from PHP 5.2 to 5.3</a>', 'woo_ce' ), phpversion(), $troubleshooting_url ) . '<span style="float:right;"><a href="' . $dismiss_url . '">' . __( 'Dismiss', 'woo_ce' ) . '</a></span>';
80
+ woo_ce_admin_notice_html( $message, 'error' );
81
+ }
82
+
83
+ }
84
+
85
+ function woo_ce_plugin_page_notices() {
86
+
87
+ global $pagenow;
88
+
89
+ if( $pagenow == 'plugins.php' ) {
90
+ if( woo_is_jigo_activated() || woo_is_wpsc_activated() ) {
91
+ $r_plugins = array(
92
+ 'woocommerce-exporter/exporter.php',
93
+ 'woocommerce-store-exporter/exporter.php'
94
+ );
95
+ $i_plugins = get_plugins();
96
+ foreach( $r_plugins as $path ) {
97
+ if( isset( $i_plugins[$path] ) ) {
98
+ add_action( 'after_plugin_row_' . $path, 'woo_ce_plugin_page_notice', 10, 3 );
99
+ break;
100
+ }
101
+ }
102
+ }
103
+ }
104
+ }
105
+
106
+ function woo_ce_plugin_page_notice( $file, $data, $context ) {
107
+
108
+ if( is_plugin_active( $file ) ) { ?>
109
+ <tr class='plugin-update-tr su-plugin-notice'>
110
+ <td colspan='3' class='plugin-update colspanchange'>
111
+ <div class='update-message'>
112
+ <?php printf( __( '%1$s is intended to be used with a WooCommerce store, please check that you are using Store Exporter with the correct e-Commerce platform.', 'woo_ce' ), $data['Name'] ); ?>
113
+ </div>
114
+ </td>
115
+ </tr>
116
+ <?php
117
+ }
118
+
119
+ }
120
+
121
+ // Saves the state of Export fields for next export
122
+ function woo_ce_save_fields( $type = '', $fields = array(), $sorting = array() ) {
123
+
124
+ if( $fields == false )
125
+ $fields = array();
126
+ $types = array_keys( woo_ce_return_export_types() );
127
+ if( in_array( $type, $types ) && !empty( $fields ) ) {
128
+ woo_ce_update_option( $type . '_fields', array_map( 'sanitize_text_field', $fields ) );
129
+ woo_ce_update_option( $type . '_sorting', array_map( 'absint', $sorting ) );
130
+ }
131
+
132
+ }
133
+
134
+ // Returns number of an Export type prior to export, used on Store Exporter screen
135
+ function woo_ce_return_count( $export_type = '', $args = array() ) {
136
+
137
+ global $wpdb;
138
+
139
+ $count_sql = null;
140
+ switch( $export_type ) {
141
+
142
+ case 'product':
143
+ $post_type = array( 'product', 'product_variation' );
144
+ $args = array(
145
+ 'post_type' => $post_type,
146
+ 'posts_per_page' => 1,
147
+ 'fields' => 'ids'
148
+ );
149
+ $query = new WP_Query( $args );
150
+ $count = $query->found_posts;
151
+ break;
152
+
153
+ case 'category':
154
+ $term_taxonomy = 'product_cat';
155
+ $count = wp_count_terms( $term_taxonomy );
156
+ break;
157
+
158
+ case 'tag':
159
+ $term_taxonomy = 'product_tag';
160
+ $count = wp_count_terms( $term_taxonomy );
161
+ break;
162
+
163
+ case 'brand':
164
+ $term_taxonomy = apply_filters( 'woo_ce_return_count_brand', 'product_brand' );
165
+ $count = wp_count_terms( $term_taxonomy );
166
+ break;
167
+
168
+ case 'order':
169
+ $post_type = 'shop_order';
170
+ $args = array(
171
+ 'post_type' => $post_type,
172
+ 'posts_per_page' => 1,
173
+ 'fields' => 'ids'
174
+ );
175
+ $query = new WP_Query( $args );
176
+ $count = $query->found_posts;
177
+ break;
178
+
179
+ case 'customer':
180
+ if( $users = woo_ce_return_count( 'user' ) > 1000 ) {
181
+ $count = sprintf( '~%s+', 1000 );
182
+ } else {
183
+ $post_type = 'shop_order';
184
+ $args = array(
185
+ 'post_type' => $post_type,
186
+ 'posts_per_page' => -1,
187
+ 'fields' => 'ids'
188
+ );
189
+ // Check if this is a WooCommerce 2.2+ instance (new Post Status)
190
+ $woocommerce_version = woo_get_woo_version();
191
+ if( version_compare( $woocommerce_version, '2.2', '>=' ) ) {
192
+ $args['post_status'] = apply_filters( 'woo_ce_customer_post_status', array( 'wc-pending', 'wc-on-hold', 'wc-processing', 'wc-completed' ) );
193
+ } else {
194
+ $args['post_status'] = apply_filters( 'woo_ce_customer_post_status', woo_ce_post_statuses() );
195
+ $args['tax_query'] = array(
196
+ array(
197
+ 'taxonomy' => 'shop_order_status',
198
+ 'field' => 'slug',
199
+ 'terms' => array( 'pending', 'on-hold', 'processing', 'completed' )
200
+ ),
201
+ );
202
+ }
203
+ $orders = new WP_Query( $args );
204
+ $count = $orders->found_posts;
205
+ if( $count > 100 ) {
206
+ $count = sprintf( '~%s', $count );
207
+ } else {
208
+ $customers = array();
209
+ if ( $orders->have_posts() ) {
210
+ while ( $orders->have_posts() ) {
211
+ $orders->the_post();
212
+ $email = get_post_meta( get_the_ID(), '_billing_email', true );
213
+ if( !in_array( $email, $customers ) ) {
214
+ $customers[get_the_ID()] = $email;
215
+ }
216
+ unset( $email );
217
+ }
218
+ $count = count( $customers );
219
+ }
220
+ wp_reset_postdata();
221
+ }
222
+ }
223
+ /*
224
+ if( false ) {
225
+ $orders = get_posts( $args );
226
+ if( $orders ) {
227
+ $customers = array();
228
+ foreach( $orders as $order ) {
229
+ $order->email = get_post_meta( $order->ID, '_billing_email', true );
230
+ if( empty( $order->email ) ) {
231
+ if( $order->user_id = get_post_meta( $order->ID, '_customer_user', true ) ) {
232
+ $user = get_userdata( $order->user_id );
233
+ if( $user )
234
+ $order->email = $user->user_email;
235
+ unset( $user );
236
+ } else {
237
+ $order->email = '-';
238
+ }
239
+ }
240
+ if( !in_array( $order->email, $customers ) ) {
241
+ $customers[$order->ID] = $order->email;
242
+ $count++;
243
+ }
244
+ }
245
+ unset( $orders, $order );
246
+ }
247
+ }
248
+ */
249
+ break;
250
+
251
+ case 'user':
252
+ if( $users = count_users() )
253
+ $count = $users['total_users'];
254
+ break;
255
+
256
+ case 'coupon':
257
+ $post_type = 'shop_coupon';
258
+ $count = wp_count_posts( $post_type );
259
+ break;
260
+
261
+ case 'subscription':
262
+ $count = 0;
263
+ // Check that WooCommerce Subscriptions exists
264
+ if( class_exists( 'WC_Subscriptions_Manager' ) ) {
265
+ // Check that the get_all_users_subscriptions() function exists
266
+ if( method_exists( 'WC_Subscriptions_Manager', 'get_all_users_subscriptions' ) ) {
267
+ if( $subscriptions = WC_Subscriptions_Manager::get_all_users_subscriptions() ) {
268
+ foreach( $subscriptions as $key => $user_subscription ) {
269
+ if( !empty( $user_subscription ) ) {
270
+ foreach( $user_subscription as $subscription )
271
+ $count++;
272
+ }
273
+ }
274
+ unset( $subscriptions, $subscription, $user_subscription );
275
+ }
276
+ }
277
+ }
278
+ break;
279
+
280
+ case 'product_vendors':
281
+ $term_taxonomy = 'shop_vendor';
282
+ $count = wp_count_terms( $term_taxonomy );
283
+ break;
284
+
285
+ case 'attribute':
286
+ $attributes = ( function_exists( 'wc_get_attribute_taxonomies' ) ? wc_get_attribute_taxonomies() : array() );
287
+ $count = count( $attributes );
288
+ break;
289
+
290
+ }
291
+ if( isset( $count ) || $count_sql ) {
292
+ if( isset( $count ) ) {
293
+ if( is_object( $count ) ) {
294
+ $count = (array)$count;
295
+ $count = (int)array_sum( $count );
296
+ }
297
+ return $count;
298
+ } else {
299
+ if( $count_sql )
300
+ $count = $wpdb->get_var( $count_sql );
301
+ else
302
+ $count = 0;
303
+ }
304
+ return $count;
305
+ } else {
306
+ return 0;
307
+ }
308
+
309
+ }
310
+
311
+ // In-line display of export file and export details when viewed via WordPress Media screen
312
+ function woo_ce_read_csv_file( $post = null ) {
313
+
314
+ if( !$post ) {
315
+ if( isset( $_GET['post'] ) )
316
+ $post = get_post( $_GET['post'] );
317
+ }
318
+
319
+ if( $post->post_type != 'attachment' )
320
+ return false;
321
+
322
+ if( !in_array( $post->post_mime_type, array( 'text/csv', 'xml/application', 'application/vnd.ms-excel' ) ) )
323
+ return false;
324
+
325
+ $filename = $post->post_name;
326
+ $filepath = get_attached_file( $post->ID );
327
+ $contents = __( 'No export entries were found, please try again with different export filters.', 'woo_ce' );
328
+ if( file_exists( $filepath ) ) {
329
+ $handle = fopen( $filepath, "r" );
330
+ $contents = stream_get_contents( $handle );
331
+ fclose( $handle );
332
+ } else {
333
+ // This resets the _wp_attached_file Post meta key to the correct value
334
+ update_attached_file( $post->ID, $post->guid );
335
+ // Try grabbing the file contents again
336
+ $filepath = get_attached_file( $post->ID );
337
+ if( file_exists( $filepath ) ) {
338
+ $handle = fopen( $filepath, "r" );
339
+ $contents = stream_get_contents( $handle );
340
+ fclose( $handle );
341
+ }
342
+ }
343
+ if( !empty( $contents ) )
344
+ include_once( WOO_CE_PATH . 'templates/admin/media-csv_file.php' );
345
+
346
+ $export_type = get_post_meta( $post->ID, '_woo_export_type', true );
347
+ $columns = get_post_meta( $post->ID, '_woo_columns', true );
348
+ $rows = get_post_meta( $post->ID, '_woo_rows', true );
349
+ $start_time = get_post_meta( $post->ID, '_woo_start_time', true );
350
+ $end_time = get_post_meta( $post->ID, '_woo_end_time', true );
351
+ $idle_memory_start = get_post_meta( $post->ID, '_woo_idle_memory_start', true );
352
+ $data_memory_start = get_post_meta( $post->ID, '_woo_data_memory_start', true );
353
+ $data_memory_end = get_post_meta( $post->ID, '_woo_data_memory_end', true );
354
+ $idle_memory_end = get_post_meta( $post->ID, '_woo_idle_memory_end', true );
355
+
356
+ include_once( WOO_CE_PATH . 'templates/admin/media-export_details.php' );
357
+
358
+ }
359
+ add_action( 'edit_form_after_editor', 'woo_ce_read_csv_file' );
360
+
361
+ // Returns label of Export type slug used on Store Exporter screen
362
+ function woo_ce_export_type_label( $export_type = '', $echo = false ) {
363
+
364
+ $output = '';
365
+ if( !empty( $export_type ) ) {
366
+ $export_types = woo_ce_return_export_types();
367
+ if( array_key_exists( $export_type, $export_types ) )
368
+ $output = $export_types[$export_type];
369
+ }
370
+ if( $echo )
371
+ echo $output;
372
+ else
373
+ return $output;
374
+
375
+ }
376
+
377
+ function woo_ce_export_options_export_format() {
378
+
379
+ $woo_cd_url = 'http://www.visser.com.au/woocommerce/plugins/exporter-deluxe/';
380
+ $woo_cd_link = sprintf( '<a href="%s" target="_blank">' . __( 'Store Exporter Deluxe', 'woo_ce' ) . '</a>', $woo_cd_url );
381
+
382
+ ob_start(); ?>
383
+ <tr>
384
+ <th>
385
+ <label><?php _e( 'Export format', 'woo_ce' ); ?></label>
386
+ </th>
387
+ <td>
388
+ <label><input type="radio" name="export_format" value="csv"<?php checked( 'csv', 'csv' ); ?> /> <?php _e( 'CSV', 'woo_ce' ); ?> <span class="description"><?php _e( '(Comma separated values)', 'woo_ce' ); ?></span></label><br />
389
+ <label><input type="radio" name="export_format" value="xml" disabled="disabled" /> <?php _e( 'XML', 'woo_ce' ); ?> <span class="description"><?php _e( '(EXtensible Markup Language)', 'woo_ce' ); ?> <span class="description"> - <?php printf( __( 'available in %s', 'woo_ce' ), $woo_cd_link ); ?></span></label><br />
390
+ <label><input type="radio" name="export_format" value="xls" disabled="disabled" /> <?php _e( 'Excel (XLS)', 'woo_ce' ); ?> <span class="description"><?php _e( '(Microsoft Excel 2007)', 'woo_ce' ); ?> <span class="description"> - <?php printf( __( 'available in %s', 'woo_ce' ), $woo_cd_link ); ?></span></label>
391
+ <p class="description"><?php _e( 'Adjust the export format to generate different export file formats.', 'woo_ce' ); ?></p>
392
+ </td>
393
+ </tr>
394
+ <?php
395
+ ob_end_flush();
396
+
397
+ }
398
+
399
+ function woo_ce_export_options_gallery_format() {
400
+
401
+ $woo_cd_url = 'http://www.visser.com.au/woocommerce/plugins/exporter-deluxe/';
402
+ $woo_cd_link = sprintf( '<a href="%s" target="_blank">' . __( 'Store Exporter Deluxe', 'woo_ce' ) . '</a>', $woo_cd_url );
403
+
404
+ ob_start(); ?>
405
+ <tr class="export-options product-options">
406
+ <th><label for=""><?php _e( 'Product gallery formatting', 'woo_ce' ); ?></label></th>
407
+ <td>
408
+ <label><input type="radio" name="product_gallery_formatting" value="0"<?php checked( 0, 0 ); ?> />&nbsp;<?php _e( 'Export Product Gallery as Post ID', 'woo_ce' ); ?></label><br />
409
+ <label><input type="radio" name="product_gallery_formatting" value="1" disabled="disabled" />&nbsp;<?php _e( 'Export Product Gallery as Image URL', 'woo_ce' ); ?> <span class="description"> - <?php printf( __( 'available in %s', 'woo_ce' ), $woo_cd_link ); ?></span></label>
410
+ <p class="description"><?php _e( 'Choose the product gallery formatting that is accepted by your WooCommerce import Plugin (e.g. Product Importer Deluxe, Product Import Suite, etc.).', 'woo_ce' ); ?></p>
411
+ </td>
412
+ </tr>
413
+ <?php
414
+ ob_end_flush();
415
+
416
+ }
417
+
418
+ // Returns a list of archived exports
419
+ function woo_ce_get_archive_files() {
420
+
421
+ $post_type = 'attachment';
422
+ $meta_key = '_woo_export_type';
423
+ $args = array(
424
+ 'post_type' => $post_type,
425
+ 'post_mime_type' => array( 'text/csv', 'xml/application', 'application/vnd.ms-excel' ),
426
+ 'meta_key' => $meta_key,
427
+ 'meta_value' => null,
428
+ 'posts_per_page' => -1
429
+ );
430
+ if( isset( $_GET['filter'] ) ) {
431
+ $filter = $_GET['filter'];
432
+ if( !empty( $filter ) )
433
+ $args['meta_value'] = $filter;
434
+ }
435
+ $files = get_posts( $args );
436
+ return $files;
437
+
438
+ }
439
+
440
+ // Returns an archived export with additional details
441
+ function woo_ce_get_archive_file( $file = '' ) {
442
+
443
+ $wp_upload_dir = wp_upload_dir();
444
+ $file->export_type = get_post_meta( $file->ID, '_woo_export_type', true );
445
+ $file->export_type_label = woo_ce_export_type_label( $file->export_type );
446
+ if( empty( $file->export_type ) )
447
+ $file->export_type = __( 'Unassigned', 'woo_ce' );
448
+ if( empty( $file->guid ) )
449
+ $file->guid = $wp_upload_dir['url'] . '/' . basename( $file->post_title );
450
+ $file->post_mime_type = get_post_mime_type( $file->ID );
451
+ if( !$file->post_mime_type )
452
+ $file->post_mime_type = __( 'N/A', 'woo_ce' );
453
+ $file->media_icon = wp_get_attachment_image( $file->ID, array( 80, 60 ), true );
454
+ if( $author_name = get_user_by( 'id', $file->post_author ) )
455
+ $file->post_author_name = $author_name->display_name;
456
+ $t_time = strtotime( $file->post_date, current_time( 'timestamp' ) );
457
+ $time = get_post_time( 'G', true, $file->ID, false );
458
+ if( ( abs( $t_diff = time() - $time ) ) < 86400 )
459
+ $file->post_date = sprintf( __( '%s ago' ), human_time_diff( $time ) );
460
+ else
461
+ $file->post_date = mysql2date( __( 'Y/m/d' ), $file->post_date );
462
+ unset( $author_name, $t_time, $time );
463
+ return $file;
464
+
465
+ }
466
+
467
+ // HTML template for displaying the current export type filter on the Archives screen
468
+ function woo_ce_archives_quicklink_current( $current = '' ) {
469
+
470
+ $output = '';
471
+ if( isset( $_GET['filter'] ) ) {
472
+ $filter = $_GET['filter'];
473
+ if( $filter == $current )
474
+ $output = ' class="current"';
475
+ } else if( $current == 'all' ) {
476
+ $output = ' class="current"';
477
+ }
478
+ echo $output;
479
+
480
+ }
481
+
482
+ // HTML template for displaying the number of each export type filter on the Archives screen
483
+ function woo_ce_archives_quicklink_count( $type = '' ) {
484
+
485
+ $output = '0';
486
+ $post_type = 'attachment';
487
+ $meta_key = '_woo_export_type';
488
+ $args = array(
489
+ 'post_type' => $post_type,
490
+ 'meta_key' => $meta_key,
491
+ 'meta_value' => null,
492
+ 'numberposts' => -1
493
+ );
494
+ if( $type )
495
+ $args['meta_value'] = $type;
496
+ if( $posts = get_posts( $args ) )
497
+ $output = count( $posts );
498
+ echo $output;
499
+
500
+ }
501
+
502
+ /* End of: WordPress Administration */
503
+
504
+ }
505
+
506
+ // Export process for CSV file
507
+ function woo_ce_export_dataset( $export_type = null, &$output = null ) {
508
+
509
+ global $export;
510
+
511
+ $separator = $export->delimiter;
512
+ $export->columns = array();
513
+ $export->total_rows = 0;
514
+ $export->total_columns = 0;
515
+ set_transient( WOO_CE_PREFIX . '_running', time(), woo_ce_get_option( 'timeout', MINUTE_IN_SECONDS ) );
516
+
517
+ switch( $export_type ) {
518
+
519
+ // Products
520
+ case 'product':
521
+ $fields = woo_ce_get_product_fields( 'summary' );
522
+ if( $export->fields = array_intersect_assoc( (array)$export->fields, $fields ) ) {
523
+ foreach( $export->fields as $key => $field )
524
+ $export->columns[] = woo_ce_get_product_field( $key );
525
+ }
526
+ $export->data_memory_start = woo_ce_current_memory_usage();
527
+ if( $products = woo_ce_get_products( $export->args ) ) {
528
+ $export->total_rows = count( $products );
529
+ $export->total_columns = $size = count( $export->columns );
530
+ if( in_array( $export->export_format, array( 'csv' ) ) ) {
531
+ for( $i = 0; $i < $size; $i++ ) {
532
+ if( $i == ( $size - 1 ) )
533
+ $output .= woo_ce_escape_csv_value( $export->columns[$i], $export->delimiter, $export->escape_formatting ) . "\n";
534
+ else
535
+ $output .= woo_ce_escape_csv_value( $export->columns[$i], $export->delimiter, $export->escape_formatting ) . $separator;
536
+ }
537
+ }
538
+ $weight_unit = get_option( 'woocommerce_weight_unit' );
539
+ $dimension_unit = get_option( 'woocommerce_dimension_unit' );
540
+ $height_unit = $dimension_unit;
541
+ $width_unit = $dimension_unit;
542
+ $length_unit = $dimension_unit;
543
+ if( !empty( $export->fields ) ) {
544
+ foreach( $products as $product ) {
545
+
546
+ $product = woo_ce_get_product_data( $product, $export->args );
547
+ foreach( $export->fields as $key => $field ) {
548
+ if( isset( $product->$key ) ) {
549
+ if( is_array( $field ) ) {
550
+ foreach( $field as $array_key => $array_value ) {
551
+ if( !is_array( $array_value ) ) {
552
+ if( in_array( $export->export_format, array( 'csv' ) ) )
553
+ $output .= woo_ce_escape_csv_value( $array_value, $export->delimiter, $export->escape_formatting );
554
+ }
555
+ }
556
+ } else {
557
+ if( in_array( $export->export_format, array( 'csv' ) ) )
558
+ $output .= woo_ce_escape_csv_value( $product->$key, $export->delimiter, $export->escape_formatting );
559
+ }
560
+ }
561
+ if( in_array( $export->export_format, array( 'csv' ) ) )
562
+ $output .= $separator;
563
+ }
564
+
565
+ if( in_array( $export->export_format, array( 'csv' ) ) )
566
+ $output = substr( $output, 0, -1 ) . "\n";
567
+ }
568
+ }
569
+ unset( $products, $product );
570
+ }
571
+ $export->data_memory_end = woo_ce_current_memory_usage();
572
+ break;
573
+
574
+ // Categories
575
+ case 'category':
576
+ $fields = woo_ce_get_category_fields( 'summary' );
577
+ if( $export->fields = array_intersect_assoc( (array)$export->fields, $fields ) ) {
578
+ foreach( $export->fields as $key => $field )
579
+ $export->columns[] = woo_ce_get_category_field( $key );
580
+ }
581
+ $export->data_memory_start = woo_ce_current_memory_usage();
582
+ $category_args = array(
583
+ 'orderby' => ( isset( $export->args['category_orderby'] ) ? $export->args['category_orderby'] : 'ID' ),
584
+ 'order' => ( isset( $export->args['category_order'] ) ? $export->args['category_order'] : 'ASC' ),
585
+ );
586
+ if( $categories = woo_ce_get_product_categories( $category_args ) ) {
587
+ $export->total_rows = count( $categories );
588
+ $export->total_columns = $size = count( $export->columns );
589
+ if( in_array( $export->export_format, array( 'csv' ) ) ) {
590
+ for( $i = 0; $i < $size; $i++ ) {
591
+ if( $i == ( $size - 1 ) )
592
+ $output .= woo_ce_escape_csv_value( $export->columns[$i], $export->delimiter, $export->escape_formatting ) . "\n";
593
+ else
594
+ $output .= woo_ce_escape_csv_value( $export->columns[$i], $export->delimiter, $export->escape_formatting ) . $separator;
595
+ }
596
+ }
597
+ if( !empty( $export->fields ) ) {
598
+ foreach( $categories as $category ) {
599
+
600
+ foreach( $export->fields as $key => $field ) {
601
+ if( isset( $category->$key ) ) {
602
+ if( in_array( $export->export_format, array( 'csv' ) ) )
603
+ $output .= woo_ce_escape_csv_value( $category->$key, $export->delimiter, $export->escape_formatting );
604
+ }
605
+ if( in_array( $export->export_format, array( 'csv' ) ) )
606
+ $output .= $separator;
607
+ }
608
+ if( in_array( $export->export_format, array( 'csv' ) ) )
609
+ $output = substr( $output, 0, -1 ) . "\n";
610
+ }
611
+ }
612
+ unset( $categories, $category );
613
+ }
614
+ $export->data_memory_end = woo_ce_current_memory_usage();
615
+ break;
616
+
617
+ // Tags
618
+ case 'tag':
619
+ $fields = woo_ce_get_tag_fields( 'summary' );
620
+ if( $export->fields = array_intersect_assoc( (array)$export->fields, $fields ) ) {
621
+ foreach( $export->fields as $key => $field )
622
+ $export->columns[] = woo_ce_get_tag_field( $key );
623
+ }
624
+ $export->data_memory_start = woo_ce_current_memory_usage();
625
+ $tag_args = array(
626
+ 'orderby' => ( isset( $export->args['tag_orderby'] ) ? $export->args['tag_orderby'] : 'ID' ),
627
+ 'order' => ( isset( $export->args['tag_order'] ) ? $export->args['tag_order'] : 'ASC' ),
628
+ );
629
+ if( $tags = woo_ce_get_product_tags( $tag_args ) ) {
630
+ $export->total_rows = count( $tags );
631
+ $export->total_columns = $size = count( $export->columns );
632
+ if( in_array( $export->export_format, array( 'csv' ) ) ) {
633
+ for( $i = 0; $i < $size; $i++ ) {
634
+ if( $i == ( $size - 1 ) )
635
+ $output .= woo_ce_escape_csv_value( $export->columns[$i], $export->delimiter, $export->escape_formatting ) . "\n";
636
+ else
637
+ $output .= woo_ce_escape_csv_value( $export->columns[$i], $export->delimiter, $export->escape_formatting ) . $separator;
638
+ }
639
+ }
640
+ if( !empty( $export->fields ) ) {
641
+ foreach( $tags as $tag ) {
642
+
643
+ foreach( $export->fields as $key => $field ) {
644
+ if( isset( $tag->$key ) ) {
645
+ if( in_array( $export->export_format, array( 'csv' ) ) )
646
+ $output .= woo_ce_escape_csv_value( $tag->$key, $export->delimiter, $export->escape_formatting );
647
+ }
648
+ if( in_array( $export->export_format, array( 'csv' ) ) )
649
+ $output .= $separator;
650
+ }
651
+ if( in_array( $export->export_format, array( 'csv' ) ) )
652
+ $output = substr( $output, 0, -1 ) . "\n";
653
+ }
654
+ }
655
+ unset( $tags, $tag );
656
+ }
657
+ $export->data_memory_end = woo_ce_current_memory_usage();
658
+ break;
659
+
660
+ // Users
661
+ case 'user':
662
+ $fields = woo_ce_get_user_fields( 'summary' );
663
+ if( $export->fields = array_intersect_assoc( (array)$export->fields, $fields ) ) {
664
+ foreach( $export->fields as $key => $field )
665
+ $export->columns[] = woo_ce_get_user_field( $key );
666
+ }
667
+ $export->data_memory_start = woo_ce_current_memory_usage();
668
+ if( $users = woo_ce_get_users( $export->args ) ) {
669
+ $export->total_columns = $size = count( $export->columns );
670
+ if( in_array( $export->export_format, array( 'csv' ) ) ) {
671
+ $i = 0;
672
+ foreach( $export->columns as $column ) {
673
+ if( $i == ( $size - 1 ) )
674
+ $output .= woo_ce_escape_csv_value( $column, $export->delimiter, $export->escape_formatting ) . "\n";
675
+ else
676
+ $output .= woo_ce_escape_csv_value( $column, $export->delimiter, $export->escape_formatting ) . $separator;
677
+ $i++;
678
+ }
679
+ }
680
+ if( !empty( $export->fields ) ) {
681
+ foreach( $users as $user ) {
682
+
683
+ $user = woo_ce_get_user_data( $user, $export->args );
684
+
685
+ foreach( $export->fields as $key => $field ) {
686
+ if( isset( $user->$key ) ) {
687
+ if( in_array( $export->export_format, array( 'csv' ) ) )
688
+ $output .= woo_ce_escape_csv_value( $user->$key, $export->delimiter, $export->escape_formatting );
689
+ }
690
+ if( in_array( $export->export_format, array( 'csv' ) ) )
691
+ $output .= $separator;
692
+ }
693
+ if( in_array( $export->export_format, array( 'csv' ) ) )
694
+ $output = substr( $output, 0, -1 ) . "\n";
695
+
696
+ }
697
+ }
698
+ unset( $users, $user );
699
+ }
700
+ $export->data_memory_end = woo_ce_current_memory_usage();
701
+ break;
702
+
703
+ }
704
+ // Export completed successfully
705
+ delete_transient( WOO_CE_PREFIX . '_running' );
706
+ // Check that the export file is populated, export columns have been assigned and rows counted
707
+ if( $output && $export->total_rows && $export->total_columns ) {
708
+ if( in_array( $export->export_format, array( 'csv' ) ) ) {
709
+ $output = woo_ce_file_encoding( $output );
710
+ if( $export->export_format == 'csv' && $export->bom && ( WOO_CE_DEBUG == false ) )
711
+ $output = "\xEF\xBB\xBF" . $output;
712
+ }
713
+ if( WOO_CE_DEBUG && !$export->cron )
714
+ set_transient( WOO_CE_PREFIX . '_debug_log', base64_encode( $output ), woo_ce_get_option( 'timeout', MINUTE_IN_SECONDS ) );
715
+ else
716
+ return $output;
717
+ }
718
+
719
+ }
720
+
721
+ // List of Export types used on Store Exporter screen
722
+ function woo_ce_return_export_types() {
723
+
724
+ $types = array();
725
+ $types['product'] = __( 'Products', 'woo_ce' );
726
+ $types['category'] = __( 'Categories', 'woo_ce' );
727
+ $types['tag'] = __( 'Tags', 'woo_ce' );
728
+ $types['user'] = __( 'Users', 'woo_ce' );
729
+ $types = apply_filters( 'woo_ce_types', $types );
730
+ return $types;
731
+
732
+ }
733
+
734
+ // Returns the Post object of the export file saved as an attachment to the WordPress Media library
735
+ function woo_ce_save_file_attachment( $filename = '', $post_mime_type = 'text/csv' ) {
736
+
737
+ if( !empty( $filename ) ) {
738
+ $post_type = 'woo-export';
739
+ $args = array(
740
+ 'post_title' => $filename,
741
+ 'post_type' => $post_type,
742
+ 'post_mime_type' => $post_mime_type
743
+ );
744
+ $post_ID = wp_insert_attachment( $args, $filename );
745
+ if( is_wp_error( $post_ID ) )
746
+ error_log( sprintf( '[store-exporter-deluxe] save_file_attachment() - $s: %s', $filename, $result->get_error_message() ) );
747
+ else
748
+ return $post_ID;
749
+ }
750
+
751
+ }
752
+
753
+ // Updates the GUID of the export file attachment to match the correct file URL
754
+ function woo_ce_save_file_guid( $post_ID, $export_type, $upload_url = '' ) {
755
+
756
+ add_post_meta( $post_ID, '_woo_export_type', $export_type );
757
+ if( !empty( $upload_url ) ) {
758
+ $args = array(
759
+ 'ID' => $post_ID,
760
+ 'guid' => $upload_url
761
+ );
762
+ wp_update_post( $args );
763
+ }
764
+
765
+ }
766
+
767
+ // Save critical export details against the archived export
768
+ function woo_ce_save_file_details( $post_ID ) {
769
+
770
+ global $export;
771
+
772
+ add_post_meta( $post_ID, '_woo_start_time', $export->start_time );
773
+ add_post_meta( $post_ID, '_woo_idle_memory_start', $export->idle_memory_start );
774
+ add_post_meta( $post_ID, '_woo_columns', $export->total_columns );
775
+ add_post_meta( $post_ID, '_woo_rows', $export->total_rows );
776
+ add_post_meta( $post_ID, '_woo_data_memory_start', $export->data_memory_start );
777
+ add_post_meta( $post_ID, '_woo_data_memory_end', $export->data_memory_end );
778
+
779
+ }
780
+
781
+ // Update detail of existing archived export
782
+ function woo_ce_update_file_detail( $post_ID, $detail, $value ) {
783
+
784
+ if( strstr( $detail, '_woo_' ) !== false )
785
+ update_post_meta( $post_ID, $detail, $value );
786
+
787
+ }
788
+
789
+ // Returns a list of allowed Export type statuses, can be overridden on a per-Export type basis
790
+ function woo_ce_post_statuses( $extra_status = array(), $override = false ) {
791
+
792
+ $output = array(
793
+ 'publish',
794
+ 'pending',
795
+ 'draft',
796
+ 'future',
797
+ 'private',
798
+ 'trash'
799
+ );
800
+ if( $override ) {
801
+ $output = $extra_status;
802
+ } else {
803
+ if( $extra_status )
804
+ $output = array_merge( $output, $extra_status );
805
+ }
806
+ return $output;
807
+
808
+ }
809
+
810
+ function woo_ce_add_missing_mime_type( $mime_types = array() ) {
811
+
812
+ // Add CSV mime type if it has been removed
813
+ if( !isset( $mime_types['csv'] ) )
814
+ $mime_types['csv'] = 'text/csv';
815
+ return $mime_types;
816
+
817
+ }
818
+ add_filter( 'upload_mimes', 'woo_ce_add_missing_mime_type', 10, 1 );
819
+
820
+ if( !function_exists( 'woo_ce_sort_fields' ) ) {
821
+ function woo_ce_sort_fields( $key ) {
822
+
823
+ return $key;
824
+
825
+ }
826
+ }
827
+
828
+
829
+ // Add Store Export to filter types on the WordPress Media screen
830
+ function woo_ce_add_post_mime_type( $post_mime_types = array() ) {
831
+
832
+ $post_mime_types['text/csv'] = array( __( 'Store Exports (CSV)', 'woo_ce' ), __( 'Manage Store Exports (CSV)', 'woo_ce' ), _n_noop( 'Store Export - CSV <span class="count">(%s)</span>', 'Store Exports - CSV <span class="count">(%s)</span>' ) );
833
+ return $post_mime_types;
834
+
835
+ }
836
+ add_filter( 'post_mime_types', 'woo_ce_add_post_mime_type' );
837
+
838
+ function woo_ce_current_memory_usage() {
839
+
840
+ $output = '';
841
+ if( function_exists( 'memory_get_usage' ) )
842
+ $output = round( memory_get_usage( true ) / 1024 / 1024, 2 );
843
+ return $output;
844
+
845
+ }
846
+
847
+ function woo_ce_get_option( $option = null, $default = false, $allow_empty = false ) {
848
+
849
+ $output = '';
850
+ if( isset( $option ) ) {
851
+ $separator = '_';
852
+ $output = get_option( WOO_CE_PREFIX . $separator . $option, $default );
853
+ if( $allow_empty == false && $output != 0 && ( $output == false || $output == '' ) )
854
+ $output = $default;
855
+ }
856
+ return $output;
857
+
858
+ }
859
+
860
+ function woo_ce_update_option( $option = null, $value = null ) {
861
+
862
+ $output = false;
863
+ if( isset( $option ) && isset( $value ) ) {
864
+ $separator = '_';
865
+ $output = update_option( WOO_CE_PREFIX . $separator . $option, $value );
866
+ }
867
+ return $output;
868
+
869
+ }
870
+ ?>
includes/install.php ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ // De-activate Store Exporter to limit conflicts
3
+ function woo_ce_deactivate_ce() {
4
+
5
+ $plugins = array(
6
+ 'woocommerce-exporter/exporter.php',
7
+ 'woocommerce-store-exporter/exporter.php'
8
+ );
9
+ deactivate_plugins( $plugins, true );
10
+
11
+ }
12
+
13
+ function woo_ce_install() {
14
+
15
+ woo_ce_create_options();
16
+
17
+ }
18
+
19
+ // Trigger the creation of Admin options for this Plugin
20
+ function woo_ce_create_options() {
21
+
22
+ $prefix = 'woo_ce';
23
+ if( !get_option( $prefix . '_export_filename' ) )
24
+ add_option( $prefix . '_export_filename', 'export_%dataset%-%date%-%time%.csv' );
25
+ if( !get_option( $prefix . '_delete_file' ) )
26
+ add_option( $prefix . '_delete_file', 0 );
27
+ if( !get_option( $prefix . '_delimiter' ) )
28
+ add_option( $prefix . '_delimiter', ',' );
29
+ if( !get_option( $prefix . '_category_separator' ) )
30
+ add_option( $prefix . '_category_separator', '|' );
31
+ if( !get_option( $prefix . '_bom' ) )
32
+ add_option( $prefix . '_bom', 1 );
33
+ if( !get_option( $prefix . '_encoding' ) )
34
+ add_option( $prefix . '_encoding', get_option( 'blog_charset', 'UTF-8' ) );
35
+ if( !get_option( $prefix . '_escape_formatting' ) )
36
+ add_option( $prefix . '_escape_formatting', 'all' );
37
+ if( !get_option( $prefix . '_date_format' ) )
38
+ add_option( $prefix . '_date_format', 1 );
39
+
40
+ }
41
+ ?>
includes/legacy.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ // Makes use of closure/anonymous functions available in PHP 5.3+
3
+ function woo_ce_sort_fields( $key ) {
4
+
5
+ return function( $a, $b ) use ( $key ) {
6
+ return strnatcmp( $a[$key], $b[$key] );
7
+ };
8
+
9
+ }
10
+ ?>
includes/orders.php ADDED
@@ -0,0 +1,1187 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if( is_admin() ) {
3
+
4
+ /* Start of: WordPress Administration */
5
+
6
+ // HTML template for disabled Filter Orders by Date widget on Store Exporter screen
7
+ function woo_ce_orders_filter_by_date() {
8
+
9
+ $woo_cd_url = 'http://www.visser.com.au/woocommerce/plugins/exporter-deluxe/';
10
+ $woo_cd_link = sprintf( '<a href="%s" target="_blank">' . __( 'Store Exporter Deluxe', 'woo_ce' ) . '</a>', $woo_cd_url );
11
+
12
+ $current_month = date( 'F' );
13
+ $last_month = date( 'F', mktime( 0, 0, 0, date( 'n' )-1, 1, date( 'Y' ) ) );
14
+ $order_dates_from = '-';
15
+ $order_dates_to = '-';
16
+
17
+ ob_start(); ?>
18
+ <p><label><input type="checkbox" id="orders-filters-date" /> <?php _e( 'Filter Orders by Order Date', 'woo_ce' ); ?><span class="description"> - <?php printf( __( 'available in %s', 'woo_ce' ), $woo_cd_link ); ?></span></label></p>
19
+ <div id="export-orders-filters-date" class="separator">
20
+ <ul>
21
+ <li>
22
+ <label><input type="radio" name="order_dates_filter" value="current_month" disabled="disabled" /> <?php _e( 'Current month', 'woo_ce' ); ?> (<?php echo $current_month; ?>)</label>
23
+ </li>
24
+ <li>
25
+ <label><input type="radio" name="order_dates_filter" value="last_month" disabled="disabled" /> <?php _e( 'Last month', 'woo_ce' ); ?> (<?php echo $last_month; ?>)</label>
26
+ </li>
27
+ <li>
28
+ <label><input type="radio" name="order_dates_filter" value="last_quarter" disabled="disabled" /> <?php _e( 'Last quarter', 'woo_ce' ); ?> (Nov. - Jan.)</label>
29
+ </li>
30
+ <li>
31
+ <label><input type="radio" name="order_dates_filter" value="manual" disabled="disabled" /> <?php _e( 'Manual', 'woo_ce' ); ?></label>
32
+ <div style="margin-top:0.2em;">
33
+ <input type="text" size="10" maxlength="10" id="order_dates_from" name="order_dates_from" value="<?php echo esc_attr( $order_dates_from ); ?>" class="text" disabled="disabled" /> to <input type="text" size="10" maxlength="10" id="order_dates_to" name="order_dates_to" value="<?php echo esc_attr( $order_dates_to ); ?>" class="text" disabled="disabled" />
34
+ <p class="description"><?php _e( 'Filter the dates of Orders to be included in the export. Default is the date of the first order to today.', 'woo_ce' ); ?></p>
35
+ </div>
36
+ </li>
37
+ </ul>
38
+ </div>
39
+ <!-- #export-orders-filters-date -->
40
+ <?php
41
+ ob_end_flush();
42
+
43
+ }
44
+
45
+ // HTML template for disabled Filter Orders by Customer widget on Store Exporter screen
46
+ function woo_ce_orders_filter_by_customer() {
47
+
48
+ $woo_cd_url = 'http://www.visser.com.au/woocommerce/plugins/exporter-deluxe/';
49
+ $woo_cd_link = sprintf( '<a href="%s" target="_blank">' . __( 'Store Exporter Deluxe', 'woo_ce' ) . '</a>', $woo_cd_url );
50
+
51
+ ob_start(); ?>
52
+ <p><label><input type="checkbox" id="orders-filters-customer" /> <?php _e( 'Filter Orders by Customer', 'woo_ce' ); ?><span class="description"> - <?php printf( __( 'available in %s', 'woo_ce' ), $woo_cd_link ); ?></span></label></p>
53
+ <div id="export-orders-filters-customer" class="separator">
54
+ <select id="order_customer" name="order_customer" disabled="disabled">
55
+ <option value=""><?php _e( 'Show all customers', 'woo_ce' ); ?></option>
56
+ </select>
57
+ <p class="description"><?php _e( 'Filter Orders by Customer (unique e-mail address) to be included in the export. Default is to include all Orders.', 'woo_ce' ); ?></p>
58
+ </div>
59
+ <!-- #export-orders-filters-customer -->
60
+ <?php
61
+ ob_end_flush();
62
+
63
+ }
64
+
65
+ // HTML template for disabled Filter Orders by User Role widget on Store Exporter screen
66
+ function woo_ce_orders_filter_by_user_role() {
67
+
68
+ $woo_cd_url = 'http://www.visser.com.au/woocommerce/plugins/exporter-deluxe/';
69
+ $woo_cd_link = sprintf( '<a href="%s" target="_blank">' . __( 'Store Exporter Deluxe', 'woo_ce' ) . '</a>', $woo_cd_url );
70
+
71
+ $user_roles = woo_ce_get_user_roles();
72
+
73
+ ob_start(); ?>
74
+ <p><label><input type="checkbox" id="orders-filters-user_role" /> <?php _e( 'Filter Orders by User Role', 'woo_ce' ); ?><span class="description"> - <?php printf( __( 'available in %s', 'woo_ce' ), $woo_cd_link ); ?></span></label></p>
75
+ <div id="export-orders-filters-user_role" class="separator">
76
+ <ul>
77
+ <?php if( $user_roles ) { ?>
78
+ <?php foreach( $user_roles as $key => $user_role ) { ?>
79
+ <li><label><input type="checkbox" name="order_filter_user_role[<?php echo $key; ?>]" value="<?php echo $key; ?>" disabled="disabled" /> <?php echo ucfirst( $user_role['name'] ); ?></label></li>
80
+ <?php } ?>
81
+ <?php } else { ?>
82
+ <li><?php _e( 'No User Roles were found.', 'woo_ce' ); ?></li>
83
+ <?php } ?>
84
+ </ul>
85
+ <p class="description"><?php _e( 'Select the User Roles you want to filter exported Orders by. Default is to include all User Role options.', 'woo_ce' ); ?></p>
86
+ </div>
87
+ <!-- #export-orders-filters-user_role -->
88
+ <?php
89
+ ob_end_flush();
90
+
91
+ }
92
+
93
+ // HTML template for disabled Filter Orders by Coupon Code widget on Store Exporter screen
94
+ function woo_ce_orders_filter_by_coupon() {
95
+
96
+ $woo_cd_url = 'http://www.visser.com.au/woocommerce/plugins/exporter-deluxe/';
97
+ $woo_cd_link = sprintf( '<a href="%s" target="_blank">' . __( 'Store Exporter Deluxe', 'woo_ce' ) . '</a>', $woo_cd_url );
98
+
99
+ $args = array(
100
+ 'coupon_orderby' => 'ID',
101
+ 'coupon_order' => 'DESC'
102
+ );
103
+ $coupons = woo_ce_get_coupons( $args );
104
+
105
+ ob_start(); ?>
106
+ <p><label><input type="checkbox" id="orders-filters-coupon" /> <?php _e( 'Filter Orders by Coupon Code', 'woo_ce' ); ?><span class="description"> - <?php printf( __( 'available in %s', 'woo_ce' ), $woo_cd_link ); ?></span></label></p>
107
+ <div id="export-orders-filters-coupon" class="separator">
108
+ <ul>
109
+ <?php foreach( $coupons as $key => $coupon ) { ?>
110
+ <li><label><input type="checkbox" name="order_filter_coupon[<?php echo $key; ?>]" disabled="disabled" /> <?php echo get_the_title( $coupon ); ?></label></li>
111
+ <?php } ?>
112
+ </ul>
113
+ <p class="description"><?php _e( 'Select the Coupon Codes you want to filter exported Orders by. Default is to include all Orders with and without assigned Coupon Codes.', 'woo_ce' ); ?></p>
114
+ </div>
115
+ <!-- #export-orders-filters-coupon -->
116
+ <?php
117
+ ob_end_flush();
118
+
119
+ }
120
+
121
+ // HTML template for disabled Order Items Formatting on Store Exporter screen
122
+ function woo_ce_orders_items_formatting() {
123
+
124
+ $woo_cd_url = 'http://www.visser.com.au/woocommerce/plugins/exporter-deluxe/';
125
+ $woo_cd_link = sprintf( '<a href="%s" target="_blank">' . __( 'Store Exporter Deluxe', 'woo_ce' ) . '</a>', $woo_cd_url );
126
+
127
+ ob_start(); ?>
128
+ <tr class="export-options order-options">
129
+ <th><label for="order_items"><?php _e( 'Order items formatting', 'woo_ce' ); ?></label></th>
130
+ <td>
131
+ <ul>
132
+ <li>
133
+ <label><input type="radio" name="order_items" value="combined" disabled="disabled" />&nbsp;<?php _e( 'Place Order Items within a grouped single Order row', 'woo_ce' ); ?><span class="description"> - <?php printf( __( 'available in %s', 'woo_ce' ), $woo_cd_link ); ?></span></label>
134
+ <p class="description"><?php _e( 'For example: <code>Order Items: SKU</code> cell might contain <code>SPECK-IPHONE|INCASE-NANO|-</code> for 3 Order items within an Order', 'woo_ce' ); ?></p>
135
+ </li>
136
+ <li>
137
+ <label><input type="radio" name="order_items" value="unique" disabled="disabled" />&nbsp;<?php _e( 'Place Order Items on individual cells within a single Order row', 'woo_ce' ); ?><span class="description"> - <?php printf( __( 'available in %s', 'woo_ce' ), $woo_cd_link ); ?></span></label>
138
+ <p class="description"><?php _e( 'For example: <code>Order Items: SKU</code> would become <code>Order Item #1: SKU</code> with <codeSPECK-IPHONE</code> for the first Order item within an Order', 'woo_ce' ); ?></p>
139
+ </li>
140
+ <li>
141
+ <label><input type="radio" name="order_items" value="individual" disabled="disabled" />&nbsp;<?php _e( 'Place each Order Item within their own Order row', 'woo_ce' ); ?><span class="description"> - <?php printf( __( 'available in %s', 'woo_ce' ), $woo_cd_link ); ?></span></label>
142
+ <p class="description"><?php _e( 'For example: An Order with 3 Order items will display a single Order item on each row', 'woo_ce' ); ?></p>
143
+ </li>
144
+ </ul>
145
+ <p class="description"><?php _e( 'Choose how you would like Order Items to be presented within Orders.', 'woo_ce' ); ?></p>
146
+ </td>
147
+ </tr>
148
+ <?php
149
+ ob_end_flush();
150
+
151
+ }
152
+
153
+ // HTML template for disabled Max Order Items widget on Store Exporter screen
154
+ function woo_ce_orders_max_order_items() {
155
+
156
+ $woo_cd_url = 'http://www.visser.com.au/woocommerce/plugins/exporter-deluxe/';
157
+ $woo_cd_link = sprintf( '<a href="%s" target="_blank">' . __( 'Store Exporter Deluxe', 'woo_ce' ) . '</a>', $woo_cd_url );
158
+
159
+ $max_size = 10;
160
+
161
+ ob_start(); ?>
162
+ <tr id="max_order_items_option" class="export-options order-options">
163
+ <th>
164
+ <label for="max_order_items"><?php _e( 'Max unique Order items', 'woo_ce' ); ?>: </label>
165
+ </th>
166
+ <td>
167
+ <input type="text" id="max_order_items" name="max_order_items" size="3" class="text" value="<?php echo esc_attr( $max_size ); ?>" disabled="disabled" /><span class="description"> - <?php printf( __( 'available in %s', 'woo_ce' ), $woo_cd_link ); ?></span>
168
+ <p class="description"><?php _e( 'Manage the number of Order Item colums displayed when the \'Place Order Items on individual cells within a single Order row\' Order items formatting option is selected.', 'woo_ce' ); ?></p>
169
+ </td>
170
+ </tr>
171
+ <?php
172
+ ob_end_flush();
173
+
174
+ }
175
+
176
+ // HTML template for disabled Order Items Types on Store Exporter screen
177
+ function woo_ce_orders_items_types() {
178
+
179
+ $woo_cd_url = 'http://www.visser.com.au/woocommerce/plugins/exporter-deluxe/';
180
+ $woo_cd_link = sprintf( '<a href="%s" target="_blank">' . __( 'Store Exporter Deluxe', 'woo_ce' ) . '</a>', $woo_cd_url );
181
+
182
+ $types = woo_ce_get_order_items_types();
183
+ $order_items_types = woo_ce_get_option( 'order_items_types', array() );
184
+
185
+ ob_start(); ?>
186
+ <tr class="export-options order-options">
187
+ <th><label><?php _e( 'Order items types', 'woo_ce' ); ?></label></th>
188
+ <td>
189
+ <ul>
190
+ <?php foreach( $types as $key => $type ) { ?>
191
+ <li><label><input type="checkbox" name="order_filter_order_item_types[<?php echo $key; ?>]" value="<?php echo $key; ?>" disabled="disabled" /> <?php echo ucfirst( $type ); ?><span class="description"> - <?php printf( __( 'available in %s', 'woo_ce' ), $woo_cd_link ); ?></span></label></li>
192
+ <?php } ?>
193
+ </ul>
194
+ <p class="description"><?php _e( 'Choose what Order Item types are included within the Orders export. Default is to include all Order Item types.', 'woo_ce' ); ?></p>
195
+ </td>
196
+ </tr>
197
+ <?php
198
+ ob_end_flush();
199
+
200
+ }
201
+
202
+ // HTML template for disabled Filter Orders by Order Status widget on Store Exporter screen
203
+ function woo_ce_orders_filter_by_status() {
204
+
205
+ $woo_cd_url = 'http://www.visser.com.au/woocommerce/plugins/exporter-deluxe/';
206
+ $woo_cd_link = sprintf( '<a href="%s" target="_blank">' . __( 'Store Exporter Deluxe', 'woo_ce' ) . '</a>', $woo_cd_url );
207
+
208
+ $order_statuses = woo_ce_get_order_statuses();
209
+
210
+ ob_start(); ?>
211
+ <p><label><input type="checkbox" id="orders-filters-status" /> <?php _e( 'Filter Orders by Order Status', 'woo_ce' ); ?><span class="description"> - <?php printf( __( 'available in %s', 'woo_ce' ), $woo_cd_link ); ?></span></label></p>
212
+ <div id="export-orders-filters-status" class="separator">
213
+ <ul>
214
+ <?php if( $order_statuses ) { ?>
215
+ <?php foreach( $order_statuses as $order_status ) { ?>
216
+ <li>
217
+ <label><input type="checkbox" name="order_filter_status[<?php echo $order_status->slug; ?>]" value="<?php echo $order_status->slug; ?>" disabled="disabled" /> <?php echo ucfirst( $order_status->name ); ?></label>
218
+ <span class="description">(<?php echo $order_status->count; ?>)</span>
219
+ </li>
220
+ <?php } ?>
221
+ <?php } else { ?>
222
+ <li><?php _e( 'No Order Status\'s were found.', 'woo_ce' ); ?></li>
223
+ <?php } ?>
224
+ </ul>
225
+ <p class="description"><?php _e( 'Select the Order Status you want to filter exported Orders by. Default is to include all Order Status options.', 'woo_ce' ); ?></p>
226
+ </div>
227
+ <!-- #export-orders-filters-status -->
228
+ <?php
229
+ ob_end_flush();
230
+
231
+ }
232
+
233
+ // HTML template for disabled Filter Orders by Product Category widget on Store Exporter screen
234
+ function woo_ce_orders_filter_by_product_category() {
235
+
236
+ $woo_cd_url = 'http://www.visser.com.au/woocommerce/plugins/exporter-deluxe/';
237
+ $woo_cd_link = sprintf( '<a href="%s" target="_blank">' . __( 'Store Exporter Deluxe', 'woo_ce' ) . '</a>', $woo_cd_url );
238
+
239
+ $args = array(
240
+ 'hide_empty' => 1
241
+ );
242
+ $product_categories = woo_ce_get_product_categories( $args );
243
+
244
+ ob_start(); ?>
245
+ <p><label><input type="checkbox" id="orders-filters-category" /> <?php _e( 'Filter Orders by Product Category', 'woo_ce' ); ?><span class="description"> - <?php printf( __( 'available in %s', 'woo_ce' ), $woo_cd_link ); ?></span></label></p>
246
+ <div id="export-orders-filters-category" class="separator">
247
+ <ul>
248
+ <?php if( $product_categories ) { ?>
249
+ <?php foreach( $product_categories as $product_category ) { ?>
250
+ <li>
251
+ <label><input type="checkbox" name="order_filter_category[<?php echo $product_category->name; ?>]" value="<?php echo $product_category->term_id; ?>" title="<?php printf( __( 'Term ID: %d', 'woo_ce' ), $product_category->term_id ); ?>" disabled="disabled" /> <?php echo woo_ce_format_product_category_label( $product_category->name, $product_category->parent_name ); ?></label>
252
+ </li>
253
+ <?php } ?>
254
+ <?php } else { ?>
255
+ <li><?php _e( 'No Product Categories were found.', 'woo_ce' ); ?></li>
256
+ <?php } ?>
257
+ </ul>
258
+ <p class="description"><?php _e( 'Select the Product Categories you want to filter exported Orders by. Default is to include all Product Categories.', 'woo_ce' ); ?></p>
259
+ </div>
260
+ <!-- #export-orders-filters-category -->
261
+ <?php
262
+ ob_end_flush();
263
+
264
+ }
265
+
266
+ // HTML template for disabled Filter Orders by Product Tag widget on Store Exporter screen
267
+ function woo_ce_orders_filter_by_product_tag() {
268
+
269
+ $woo_cd_url = 'http://www.visser.com.au/woocommerce/plugins/exporter-deluxe/';
270
+ $woo_cd_link = sprintf( '<a href="%s" target="_blank">' . __( 'Store Exporter Deluxe', 'woo_ce' ) . '</a>', $woo_cd_url );
271
+
272
+ $args = array(
273
+ 'hide_empty' => 1
274
+ );
275
+ $product_tags = woo_ce_get_product_tags( $args );
276
+
277
+ ob_start(); ?>
278
+ <p><label><input type="checkbox" id="orders-filters-tag" /> <?php _e( 'Filter Orders by Product Tag', 'woo_ce' ); ?><span class="description"> - <?php printf( __( 'available in %s', 'woo_ce' ), $woo_cd_link ); ?></span></label></p>
279
+ <div id="export-orders-filters-tag" class="separator">
280
+ <ul>
281
+ <?php if( $product_tags ) { ?>
282
+ <?php foreach( $product_tags as $product_tag ) { ?>
283
+ <li>
284
+ <label><input type="checkbox" name="order_filter_tag[<?php echo $product_tag->name; ?>]" value="<?php echo $product_tag->name; ?>" title="<?php printf( __( 'Term ID: %d', 'woo_ce' ), $product_tag->term_id ); ?>" disabled="disabled" /> <?php echo $product_tag->name; ?></label>
285
+ <span class="description">(<?php echo $product_tag->count; ?>)</span>
286
+ </li>
287
+ <?php } ?>
288
+ <?php } else { ?>
289
+ <li><?php _e( 'No Product Tags have been found.', 'jigo_ce' ); ?></li>
290
+ <?php } ?>
291
+ </ul>
292
+ <p class="description"><?php _e( 'Select the Product Tags you want to filter exported Orders by. Default is to include all Product Tags.', 'woo_ce' ); ?></p>
293
+ </div>
294
+ <!-- #export-orders-filters-tag -->
295
+ <?php
296
+ ob_end_flush();
297
+
298
+ }
299
+
300
+ // HTML template for disabled Order Sorting widget on Store Exporter screen
301
+ function woo_ce_orders_order_sorting() {
302
+
303
+ ob_start(); ?>
304
+ <p><label><?php _e( 'Order Sorting', 'woo_ce' ); ?></label></p>
305
+ <div>
306
+ <select name="order_orderby" disabled="disabled">
307
+ <option value="ID"><?php _e( 'Order ID', 'woo_ce' ); ?></option>
308
+ <option value="title"><?php _e( 'Order Name', 'woo_ce' ); ?></option>
309
+ <option value="date"><?php _e( 'Date Created', 'woo_ce' ); ?></option>
310
+ <option value="modified"><?php _e( 'Date Modified', 'woo_ce' ); ?></option>
311
+ <option value="rand"><?php _e( 'Random', 'woo_ce' ); ?></option>
312
+ </select>
313
+ <select name="order_order" disabled="disabled">
314
+ <option value="ASC"><?php _e( 'Ascending', 'woo_ce' ); ?></option>
315
+ <option value="DESC"><?php _e( 'Descending', 'woo_ce' ); ?></option>
316
+ </select>
317
+ <p class="description"><?php _e( 'Select the sorting of Orders within the exported file. By default this is set to export Orders by Order ID in Desending order.', 'woo_ce' ); ?></p>
318
+ </div>
319
+ <?php
320
+ ob_end_flush();
321
+
322
+ }
323
+
324
+ // HTML template for disabled Custom Orders widget on Store Exporter screen
325
+ function woo_ce_orders_custom_fields() {
326
+
327
+ $custom_orders = '-';
328
+ $custom_order_items = '-';
329
+
330
+ $troubleshooting_url = 'http://www.visser.com.au/documentation/store-exporter-deluxe/usage/';
331
+
332
+ ob_start(); ?>
333
+ <form method="post" id="export-orders-custom-fields" class="export-options order-options">
334
+ <div id="poststuff">
335
+
336
+ <div class="postbox" id="export-options">
337
+ <h3 class="hndle"><?php _e( 'Custom Order Fields', 'woo_ce' ); ?></h3>
338
+ <div class="inside">
339
+ <p class="description"><?php _e( 'To include additional custom Order and Order Item meta in the Export Orders table above fill the Orders and Order Items text box then click Save Custom Fields.', 'woo_ce' ); ?></p>
340
+ <table class="form-table">
341
+
342
+ <tr>
343
+ <th>
344
+ <label><?php _e( 'Order meta', 'woo_ce' ); ?></label>
345
+ </th>
346
+ <td>
347
+ <textarea name="custom_orders" rows="5" cols="70" disabled="disabled"><?php echo esc_textarea( $custom_orders ); ?></textarea>
348
+ <p class="description"><?php _e( 'Include additional custom Order meta in your export file by adding each custom Order meta name to a new line above.<br />For example: <code>Customer UA, Customer IP Address</code>', 'woo_ce' ); ?></p>
349
+ </td>
350
+ </tr>
351
+
352
+ <tr>
353
+ <th>
354
+ <label><?php _e( 'Order Item meta', 'woo_ce' ); ?></label>
355
+ </th>
356
+ <td>
357
+ <textarea name="custom_order_items" rows="5" cols="70" disabled="disabled"><?php echo esc_textarea( $custom_order_items ); ?></textarea>
358
+ <p class="description"><?php _e( 'Include additional custom Order Item meta in your export file by adding each custom Order Item meta name to a new line above.<br />For example: <code>Personalized Message</code>.', 'woo_ce' ); ?></p>
359
+ </td>
360
+ </tr>
361
+
362
+ </table>
363
+ <p class="submit">
364
+ <input type="submit" value="<?php _e( 'Save Custom Fields', 'woo_ce' ); ?>" class="button-primary" />
365
+ </p>
366
+ <p class="description"><?php printf( __( 'For more information on custom Order and Order Item meta consult our <a href="%s" target="_blank">online documentation</a>.', 'woo_ce' ), $troubleshooting_url ); ?></p>
367
+ </div>
368
+ <!-- .inside -->
369
+ </div>
370
+ <!-- .postbox -->
371
+
372
+ </div>
373
+ <!-- #poststuff -->
374
+ <input type="hidden" name="action" value="update" />
375
+ </form>
376
+ <!-- #export-orders-custom-fields -->
377
+ <?php
378
+ ob_end_flush();
379
+
380
+ }
381
+
382
+ /* End of: WordPress Administration */
383
+
384
+ }
385
+
386
+ // Returns a list of Order export columns
387
+ function woo_ce_get_order_fields( $format = 'full' ) {
388
+
389
+ $export_type = 'order';
390
+
391
+ $fields = array();
392
+ $fields[] = array(
393
+ 'name' => 'purchase_id',
394
+ 'label' => __( 'Purchase ID', 'woo_ce' )
395
+ );
396
+ $fields[] = array(
397
+ 'name' => 'purchase_total',
398
+ 'label' => __( 'Order Total', 'woo_ce' )
399
+ );
400
+ $fields[] = array(
401
+ 'name' => 'order_discount',
402
+ 'label' => __( 'Order Discount', 'woo_ce' )
403
+ );
404
+ $fields[] = array(
405
+ 'name' => 'coupon_code',
406
+ 'label' => __( 'Coupon Code', 'woo_ce' )
407
+ );
408
+ /*
409
+ $fields[] = array(
410
+ 'name' => 'order_incl_tax',
411
+ 'label' => __( 'Order Incl. Tax', 'woo_ce' )
412
+ );
413
+ */
414
+ $fields[] = array(
415
+ 'name' => 'order_excl_tax',
416
+ 'label' => __( 'Order Excl. Tax', 'woo_ce' )
417
+ );
418
+ /*
419
+ $fields[] = array(
420
+ 'name' => 'order_tax_rate',
421
+ 'label' => __( 'Order Tax Rate', 'woo_ce' )
422
+ );
423
+ */
424
+ $fields[] = array(
425
+ 'name' => 'order_sales_tax',
426
+ 'label' => __( 'Sales Tax Total', 'woo_ce' )
427
+ );
428
+ $fields[] = array(
429
+ 'name' => 'order_shipping_tax',
430
+ 'label' => __( 'Shipping Tax Total', 'woo_ce' )
431
+ );
432
+ $fields[] = array(
433
+ 'name' => 'payment_gateway_id',
434
+ 'label' => __( 'Payment Gateway ID', 'woo_ce' )
435
+ );
436
+ $fields[] = array(
437
+ 'name' => 'payment_gateway',
438
+ 'label' => __( 'Payment Gateway', 'woo_ce' )
439
+ );
440
+ $fields[] = array(
441
+ 'name' => 'shipping_method_id',
442
+ 'label' => __( 'Shipping Method ID', 'woo_ce' )
443
+ );
444
+ $fields[] = array(
445
+ 'name' => 'shipping_method',
446
+ 'label' => __( 'Shipping Method', 'woo_ce' )
447
+ );
448
+ $fields[] = array(
449
+ 'name' => 'shipping_cost',
450
+ 'label' => __( 'Shipping Cost', 'woo_ce' )
451
+ );
452
+ $fields[] = array(
453
+ 'name' => 'shipping_weight',
454
+ 'label' => __( 'Shipping Weight', 'woo_ce' )
455
+ );
456
+ $fields[] = array(
457
+ 'name' => 'payment_status',
458
+ 'label' => __( 'Order Status', 'woo_ce' )
459
+ );
460
+ $fields[] = array(
461
+ 'name' => 'post_status',
462
+ 'label' => __( 'Post Status', 'woo_ce' )
463
+ );
464
+ $fields[] = array(
465
+ 'name' => 'order_key',
466
+ 'label' => __( 'Order Key', 'woo_ce' )
467
+ );
468
+ $fields[] = array(
469
+ 'name' => 'purchase_date',
470
+ 'label' => __( 'Purchase Date', 'woo_ce' )
471
+ );
472
+ $fields[] = array(
473
+ 'name' => 'purchase_time',
474
+ 'label' => __( 'Purchase Time', 'woo_ce' )
475
+ );
476
+ $fields[] = array(
477
+ 'name' => 'customer_message',
478
+ 'label' => __( 'Customer Message', 'woo_ce' )
479
+ );
480
+ $fields[] = array(
481
+ 'name' => 'customer_note',
482
+ 'label' => __( 'Customer Note', 'woo_ce' )
483
+ );
484
+ $fields[] = array(
485
+ 'name' => 'order_notes',
486
+ 'label' => __( 'Order Notes', 'woo_ce' )
487
+ );
488
+ $fields[] = array(
489
+ 'name' => 'user_id',
490
+ 'label' => __( 'User ID', 'woo_ce' )
491
+ );
492
+ $fields[] = array(
493
+ 'name' => 'user_name',
494
+ 'label' => __( 'Username', 'woo_ce' )
495
+ );
496
+ $fields[] = array(
497
+ 'name' => 'user_role',
498
+ 'label' => __( 'User Role', 'woo_ce' )
499
+ );
500
+ $fields[] = array(
501
+ 'name' => 'ip_address',
502
+ 'label' => __( 'Checkout IP Address', 'woo_ce' )
503
+ );
504
+ $fields[] = array(
505
+ 'name' => 'browser_agent',
506
+ 'label' => __( 'Checkout Browser Agent', 'woo_ce' )
507
+ );
508
+ $fields[] = array(
509
+ 'name' => 'billing_full_name',
510
+ 'label' => __( 'Billing: Full Name', 'woo_ce' )
511
+ );
512
+ $fields[] = array(
513
+ 'name' => 'billing_first_name',
514
+ 'label' => __( 'Billing: First Name', 'woo_ce' )
515
+ );
516
+ $fields[] = array(
517
+ 'name' => 'billing_last_name',
518
+ 'label' => __( 'Billing: Last Name', 'woo_ce' )
519
+ );
520
+ $fields[] = array(
521
+ 'name' => 'billing_company',
522
+ 'label' => __( 'Billing: Company', 'woo_ce' )
523
+ );
524
+ $fields[] = array(
525
+ 'name' => 'billing_address',
526
+ 'label' => __( 'Billing: Street Address (Full)', 'woo_ce' )
527
+ );
528
+ $fields[] = array(
529
+ 'name' => 'billing_address_1',
530
+ 'label' => __( 'Billing: Street Address 1', 'woo_ce' )
531
+ );
532
+ $fields[] = array(
533
+ 'name' => 'billing_address_2',
534
+ 'label' => __( 'Billing: Street Address 2', 'woo_ce' )
535
+ );
536
+ $fields[] = array(
537
+ 'name' => 'billing_city',
538
+ 'label' => __( 'Billing: City', 'woo_ce' )
539
+ );
540
+ $fields[] = array(
541
+ 'name' => 'billing_postcode',
542
+ 'label' => __( 'Billing: ZIP Code', 'woo_ce' )
543
+ );
544
+ $fields[] = array(
545
+ 'name' => 'billing_state',
546
+ 'label' => __( 'Billing: State (prefix)', 'woo_ce' )
547
+ );
548
+ $fields[] = array(
549
+ 'name' => 'billing_state_full',
550
+ 'label' => __( 'Billing: State', 'woo_ce' )
551
+ );
552
+ $fields[] = array(
553
+ 'name' => 'billing_country',
554
+ 'label' => __( 'Billing: Country (prefix)', 'woo_ce' )
555
+ );
556
+ $fields[] = array(
557
+ 'name' => 'billing_country_full',
558
+ 'label' => __( 'Billing: Country', 'woo_ce' )
559
+ );
560
+ $fields[] = array(
561
+ 'name' => 'billing_phone',
562
+ 'label' => __( 'Billing: Phone Number', 'woo_ce' )
563
+ );
564
+ $fields[] = array(
565
+ 'name' => 'billing_email',
566
+ 'label' => __( 'Billing: E-mail Address', 'woo_ce' )
567
+ );
568
+ $fields[] = array(
569
+ 'name' => 'shipping_full_name',
570
+ 'label' => __( 'Shipping: Full Name', 'woo_ce' )
571
+ );
572
+ $fields[] = array(
573
+ 'name' => 'shipping_first_name',
574
+ 'label' => __( 'Shipping: First Name', 'woo_ce' )
575
+ );
576
+ $fields[] = array(
577
+ 'name' => 'shipping_last_name',
578
+ 'label' => __( 'Shipping: Last Name', 'woo_ce' )
579
+ );
580
+ $fields[] = array(
581
+ 'name' => 'shipping_company',
582
+ 'label' => __( 'Shipping: Company', 'woo_ce' )
583
+ );
584
+ $fields[] = array(
585
+ 'name' => 'shipping_address',
586
+ 'label' => __( 'Shipping: Street Address (Full)', 'woo_ce' )
587
+ );
588
+ $fields[] = array(
589
+ 'name' => 'shipping_address_1',
590
+ 'label' => __( 'Shipping: Street Address 1', 'woo_ce' )
591
+ );
592
+ $fields[] = array(
593
+ 'name' => 'shipping_address_2',
594
+ 'label' => __( 'Shipping: Street Address 2', 'woo_ce' )
595
+ );
596
+ $fields[] = array(
597
+ 'name' => 'shipping_city',
598
+ 'label' => __( 'Shipping: City', 'woo_ce' )
599
+ );
600
+ $fields[] = array(
601
+ 'name' => 'shipping_postcode',
602
+ 'label' => __( 'Shipping: ZIP Code', 'woo_ce' )
603
+ );
604
+ $fields[] = array(
605
+ 'name' => 'shipping_state',
606
+ 'label' => __( 'Shipping: State (prefix)', 'woo_ce' )
607
+ );
608
+ $fields[] = array(
609
+ 'name' => 'shipping_state_full',
610
+ 'label' => __( 'Shipping: State', 'woo_ce' )
611
+ );
612
+ $fields[] = array(
613
+ 'name' => 'shipping_country',
614
+ 'label' => __( 'Shipping: Country (prefix)', 'woo_ce' )
615
+ );
616
+ $fields[] = array(
617
+ 'name' => 'shipping_country_full',
618
+ 'label' => __( 'Shipping: Country', 'woo_ce' )
619
+ );
620
+ $fields[] = array(
621
+ 'name' => 'order_items_product_id',
622
+ 'label' => __( 'Order Items: Product ID', 'woo_ce' )
623
+ );
624
+ $fields[] = array(
625
+ 'name' => 'order_items_variation_id',
626
+ 'label' => __( 'Order Items: Variation ID', 'woo_ce' )
627
+ );
628
+ $fields[] = array(
629
+ 'name' => 'order_items_sku',
630
+ 'label' => __( 'Order Items: SKU', 'woo_ce' )
631
+ );
632
+ $fields[] = array(
633
+ 'name' => 'order_items_name',
634
+ 'label' => __( 'Order Items: Product Name', 'woo_ce' )
635
+ );
636
+ $fields[] = array(
637
+ 'name' => 'order_items_variation',
638
+ 'label' => __( 'Order Items: Product Variation', 'woo_ce' )
639
+ );
640
+ $fields[] = array(
641
+ 'name' => 'order_items_tax_class',
642
+ 'label' => __( 'Order Items: Tax Class', 'woo_ce' )
643
+ );
644
+ $fields[] = array(
645
+ 'name' => 'order_items_quantity',
646
+ 'label' => __( 'Order Items: Quantity', 'woo_ce' )
647
+ );
648
+ $fields[] = array(
649
+ 'name' => 'order_items_total',
650
+ 'label' => __( 'Order Items: Total', 'woo_ce' )
651
+ );
652
+ $fields[] = array(
653
+ 'name' => 'order_items_subtotal',
654
+ 'label' => __( 'Order Items: Subtotal', 'woo_ce' )
655
+ );
656
+ $fields[] = array(
657
+ 'name' => 'order_items_tax',
658
+ 'label' => __( 'Order Items: Tax', 'woo_ce' )
659
+ );
660
+ $fields[] = array(
661
+ 'name' => 'order_items_tax_subtotal',
662
+ 'label' => __( 'Order Items: Tax Subtotal', 'woo_ce' )
663
+ );
664
+ $fields[] = array(
665
+ 'name' => 'order_items_type',
666
+ 'label' => __( 'Order Items: Type', 'woo_ce' )
667
+ );
668
+ $fields[] = array(
669
+ 'name' => 'order_items_category',
670
+ 'label' => __( 'Order Items: Category', 'woo_ce' )
671
+ );
672
+ $fields[] = array(
673
+ 'name' => 'order_items_tag',
674
+ 'label' => __( 'Order Items: Tag', 'woo_ce' )
675
+ );
676
+ $fields[] = array(
677
+ 'name' => 'order_items_weight',
678
+ 'label' => __( 'Order Items: Weight', 'woo_ce' )
679
+ );
680
+ $fields[] = array(
681
+ 'name' => 'order_items_total_weight',
682
+ 'label' => __( 'Order Items: Total Weight', 'woo_ce' )
683
+ );
684
+ $fields[] = array(
685
+ 'name' => 'order_items_stock',
686
+ 'label' => __( 'Order Items: Stock', 'woo_ce' )
687
+ );
688
+
689
+ /*
690
+ $fields[] = array(
691
+ 'name' => '',
692
+ 'label' => __( '', 'woo_ce' )
693
+ );
694
+ */
695
+
696
+ // Allow Plugin/Theme authors to add support for additional columns
697
+ $fields = apply_filters( 'woo_ce_' . $export_type . '_fields', $fields, $export_type );
698
+
699
+ switch( $format ) {
700
+
701
+ case 'summary':
702
+ $output = array();
703
+ $size = count( $fields );
704
+ for( $i = 0; $i < $size; $i++ ) {
705
+ if( isset( $fields[$i] ) )
706
+ $output[$fields[$i]['name']] = 'on';
707
+ }
708
+ return $output;
709
+ break;
710
+
711
+ case 'full':
712
+ default:
713
+ $sorting = woo_ce_get_option( $export_type . '_sorting', array() );
714
+ $size = count( $fields );
715
+ for( $i = 0; $i < $size; $i++ )
716
+ $fields[$i]['order'] = ( isset( $sorting[$fields[$i]['name']] ) ? $sorting[$fields[$i]['name']] : $i );
717
+ usort( $fields, woo_ce_sort_fields( 'order' ) );
718
+ return $fields;
719
+ break;
720
+
721
+ }
722
+
723
+ }
724
+
725
+ function woo_ce_override_order_field_labels( $fields = array() ) {
726
+
727
+ $labels = woo_ce_get_option( 'order_labels', array() );
728
+ if( !empty( $labels ) ) {
729
+ foreach( $fields as $key => $field ) {
730
+ if( isset( $labels[$field['name']] ) )
731
+ $fields[$key]['label'] = $labels[$field['name']];
732
+ }
733
+ }
734
+ return $fields;
735
+
736
+ }
737
+ add_filter( 'woo_ce_order_fields', 'woo_ce_override_order_field_labels', 11 );
738
+
739
+ // Adds custom Order and Order Item columns to the Order fields list
740
+ function woo_ce_extend_order_fields( $fields = array() ) {
741
+
742
+ // Product Addons - http://www.woothemes.com/
743
+ if( class_exists( 'Product_Addon_Admin' ) || class_exists( 'Product_Addon_Display' ) ) {
744
+ $product_addons = woo_ce_get_product_addons();
745
+ if( !empty( $product_addons ) ) {
746
+ foreach( $product_addons as $product_addon ) {
747
+ if( !empty( $product_addon ) ) {
748
+ $fields[] = array(
749
+ 'name' => sprintf( 'order_items_product_addon_%s', $product_addon->post_name ),
750
+ 'label' => sprintf( __( 'Order Items: %s', 'woo_ce' ), ucfirst( $product_addon->post_title ) )
751
+ );
752
+ }
753
+ }
754
+ }
755
+ unset( $product_addons, $product_addon );
756
+ }
757
+
758
+ // WooCommerce Sequential Order Numbers - http://www.skyverge.com/blog/woocommerce-sequential-order-numbers/
759
+ // Sequential Order Numbers Pro - http://www.woothemes.com/products/sequential-order-numbers-pro/
760
+ if( class_exists( 'WC_Seq_Order_Number' ) || class_exists( 'WC_Seq_Order_Number_Pro' ) ) {
761
+ $fields[] = array(
762
+ 'name' => 'order_number',
763
+ 'label' => __( 'Order Number', 'woo_ce' )
764
+ );
765
+ }
766
+
767
+ // WooCommerce Print Invoice & Delivery Note - https://wordpress.org/plugins/woocommerce-delivery-notes/
768
+ if( class_exists( 'WooCommerce_Delivery_Notes' ) ) {
769
+ $fields[] = array(
770
+ 'name' => 'invoice_number',
771
+ 'label' => __( 'Invoice Number', 'woo_ce' )
772
+ );
773
+ $fields[] = array(
774
+ 'name' => 'invoice_date',
775
+ 'label' => __( 'Invoice Date', 'woo_ce' )
776
+ );
777
+ }
778
+
779
+ // WooCommerce PDF Invoices & Packing Slips - http://www.wpovernight.com
780
+ if( class_exists( 'WooCommerce_PDF_Invoices' ) ) {
781
+ $fields[] = array(
782
+ 'name' => 'pdf_invoice_number',
783
+ 'label' => __( 'PDF Invoice Number', 'woo_ce' )
784
+ );
785
+ $fields[] = array(
786
+ 'name' => 'pdf_invoice_date',
787
+ 'label' => __( 'PDF Invoice Date', 'woo_ce' )
788
+ );
789
+ }
790
+
791
+ // WooCommerce Checkout Manager - http://wordpress.org/plugins/woocommerce-checkout-manager/
792
+ // WooCommerce Checkout Manager Pro - http://www.trottyzone.com/product/woocommerce-checkout-manager-pro
793
+ if( function_exists( 'wccs_install' ) ) {
794
+ $options = get_option( 'wccs_settings' );
795
+ if( isset( $options['buttons'] ) ) {
796
+ $buttons = $options['buttons'];
797
+ if( !empty( $buttons ) ) {
798
+ foreach( $buttons as $button ) {
799
+ $fields[] = array(
800
+ 'name' => $button['label'],
801
+ 'label' => ucfirst( $button['label'] )
802
+ );
803
+ }
804
+ unset( $buttons, $button );
805
+ }
806
+ }
807
+ unset( $options );
808
+ }
809
+
810
+ // Poor Guys Swiss Knife - http://wordpress.org/plugins/woocommerce-poor-guys-swiss-knife/
811
+ if( function_exists( 'wcpgsk_init' ) ) {
812
+ $options = get_option( 'wcpgsk_settings' );
813
+ $billing_fields = ( isset( $options['woofields']['billing'] ) ? $options['woofields']['billing'] : array() );
814
+ $shipping_fields = ( isset( $options['woofields']['shipping'] ) ? $options['woofields']['shipping'] : array() );
815
+
816
+ // Custom billing fields
817
+ if( !empty( $billing_fields ) ) {
818
+ foreach( $billing_fields as $key => $billing_field ) {
819
+ $fields[] = array(
820
+ 'name' => $key,
821
+ 'label' => $options['woofields']['label_' . $key]
822
+ );
823
+ }
824
+ unset( $billing_fields, $billing_field );
825
+ }
826
+
827
+ // Custom shipping fields
828
+ if( !empty( $shipping_fields ) ) {
829
+ foreach( $shipping_fields as $key => $shipping_field ) {
830
+ $fields[] = array(
831
+ 'name' => $key,
832
+ 'label' => $options['woofields']['label_' . $key]
833
+ );
834
+ }
835
+ unset( $shipping_fields, $shipping_field );
836
+ }
837
+
838
+ unset( $options );
839
+ }
840
+
841
+ // Checkout Field Editor - http://woothemes.com/woocommerce/
842
+ if( function_exists( 'woocommerce_init_checkout_field_editor' ) ) {
843
+ $billing_fields = get_option( 'wc_fields_billing', array() );
844
+ $shipping_fields = get_option( 'wc_fields_shipping', array() );
845
+ $custom_fields = get_option( 'wc_fields_additional', array() );
846
+
847
+ // Custom billing fields
848
+ if( !empty( $billing_fields ) ) {
849
+ foreach( $billing_fields as $key => $billing_field ) {
850
+ // Only add non-default Checkout fields to export columns list
851
+ if( $billing_field['custom'] == 1 ) {
852
+ $fields[] = array(
853
+ 'name' => sprintf( 'wc_billing_%s', $key ),
854
+ 'label' => sprintf( __( 'Billing: %s', 'woo_ce' ), ucfirst( $billing_field['label'] ) )
855
+ );
856
+ }
857
+ }
858
+ }
859
+ unset( $billing_fields, $billing_field );
860
+
861
+ // Custom shipping fields
862
+ if( !empty( $shipping_fields ) ) {
863
+ foreach( $shipping_fields as $key => $shipping_field ) {
864
+ // Only add non-default Checkout fields to export columns list
865
+ if( $shipping_field['custom'] == 1 ) {
866
+ $fields[] = array(
867
+ 'name' => sprintf( 'wc_shipping_%s', $key ),
868
+ 'label' => sprintf( __( 'Shipping: %s', 'woo_ce' ), ucfirst( $shipping_field['label'] ) )
869
+ );
870
+ }
871
+ }
872
+ }
873
+ unset( $shipping_fields, $shipping_field );
874
+
875
+ // Custom fields
876
+ if( !empty( $custom_fields ) ) {
877
+ foreach( $custom_fields as $key => $custom_field ) {
878
+ // Only add non-default Checkout fields to export columns list
879
+ if( $billing_field['custom'] == 1 ) {
880
+ $fields[] = array(
881
+ 'name' => sprintf( 'wc_additional_%s', $key ),
882
+ 'label' => sprintf( __( 'Additional: %s', 'woo_ce' ), ucfirst( $custom_field['label'] ) )
883
+ );
884
+ }
885
+ }
886
+ }
887
+ unset( $custom_fields, $custom_field );
888
+ }
889
+
890
+ // Checkout Field Manager - http://61extensions.com
891
+ if( function_exists( 'sod_woocommerce_checkout_manager_settings' ) ) {
892
+ $billing_fields = get_option( 'woocommerce_checkout_billing_fields', array() );
893
+ $shipping_fields = get_option( 'woocommerce_checkout_shipping_fields', array() );
894
+ $custom_fields = get_option( 'woocommerce_checkout_additional_fields', array() );
895
+
896
+ // Custom billing fields
897
+ if( !empty( $billing_fields ) ) {
898
+ foreach( $billing_fields as $key => $billing_field ) {
899
+ // Only add non-default Checkout fields to export columns list
900
+ if( strtolower( $billing_field['default_field'] ) != 'on' ) {
901
+ $fields[] = array(
902
+ 'name' => sprintf( 'sod_billing_%s', $billing_field['name'] ),
903
+ 'label' => sprintf( __( 'Billing: %s', 'woo_ce' ), ucfirst( $billing_field['label'] ) )
904
+ );
905
+ }
906
+ }
907
+ }
908
+ unset( $billing_fields, $billing_field );
909
+
910
+ // Custom shipping fields
911
+ if( !empty( $shipping_fields ) ) {
912
+ foreach( $shipping_fields as $key => $shipping_field ) {
913
+ // Only add non-default Checkout fields to export columns list
914
+ if( strtolower( $shipping_field['default_field'] ) != 'on' ) {
915
+ $fields[] = array(
916
+ 'name' => sprintf( 'sod_shipping_%s', $shipping_field['name'] ),
917
+ 'label' => sprintf( __( 'Shipping: %s', 'woo_ce' ), ucfirst( $shipping_field['label'] ) )
918
+ );
919
+ }
920
+ }
921
+ }
922
+ unset( $shipping_fields, $shipping_field );
923
+
924
+ // Custom fields
925
+ if( !empty( $custom_fields ) ) {
926
+ foreach( $custom_fields as $key => $custom_field ) {
927
+ // Only add non-default Checkout fields to export columns list
928
+ if( strtolower( $custom_field['default_field'] ) != 'on' ) {
929
+ $fields[] = array(
930
+ 'name' => sprintf( 'sod_additional_%s', $custom_field['name'] ),
931
+ 'label' => sprintf( __( 'Additional: %s', 'woo_ce' ), ucfirst( $custom_field['label'] ) )
932
+ );
933
+ }
934
+ }
935
+ }
936
+ unset( $custom_fields, $custom_field );
937
+ }
938
+
939
+ // WooCommerce Checkout Add-Ons - http://www.skyverge.com/product/woocommerce-checkout-add-ons/
940
+ if( function_exists( 'init_woocommerce_checkout_add_ons' ) ) {
941
+ $fields[] = array(
942
+ 'name' => 'order_items_checkout_addon_id',
943
+ 'label' => __( 'Order Items: Checkout Add-ons ID', 'woo_ce' )
944
+ );
945
+ $fields[] = array(
946
+ 'name' => 'order_items_checkout_addon_label',
947
+ 'label' => __( 'Order Items: Checkout Add-ons Label', 'woo_ce' )
948
+ );
949
+ $fields[] = array(
950
+ 'name' => 'order_items_checkout_addon_value',
951
+ 'label' => __( 'Order Items: Checkout Add-ons Value', 'woo_ce' )
952
+ );
953
+ }
954
+
955
+ // WooCommerce Brands Addon - http://woothemes.com/woocommerce/
956
+ if( class_exists( 'WC_Brands' ) ) {
957
+ $fields[] = array(
958
+ 'name' => 'order_items_brand',
959
+ 'label' => __( 'Order Items: Brand', 'woo_ce' )
960
+ );
961
+ }
962
+
963
+ // Product Vendors - http://www.woothemes.com/products/product-vendors/
964
+ if( class_exists( 'WooCommerce_Product_Vendors' ) ) {
965
+ $fields[] = array(
966
+ 'name' => 'order_items_vendor',
967
+ 'label' => __( 'Order Items: Product Vendor', 'woo_ce' )
968
+ );
969
+ }
970
+
971
+ // Cost of Goods - http://www.skyverge.com/product/woocommerce-cost-of-goods-tracking/
972
+ if( class_exists( 'WC_COG' ) ) {
973
+ $fields[] = array(
974
+ 'name' => 'total_cost_of_goods',
975
+ 'label' => __( 'Total Cost of Goods', 'woo_ce' )
976
+ );
977
+ $fields[] = array(
978
+ 'name' => 'order_items_cost_of_goods',
979
+ 'label' => __( 'Order Items: Cost of Goods', 'woo_ce' )
980
+ );
981
+ }
982
+
983
+ // Local Pickup Plus - http://www.woothemes.com/products/local-pickup-plus/
984
+ if( class_exists( 'WC_Local_Pickup_Plus' ) ) {
985
+ $fields[] = array(
986
+ 'name' => 'order_items_pickup_location',
987
+ 'label' => __( 'Order Items: Pickup Location', 'woo_ce' )
988
+ );
989
+ }
990
+
991
+ // Gravity Forms - http://woothemes.com/woocommerce
992
+ if( class_exists( 'RGForms' ) && class_exists( 'woocommerce_gravityforms' ) ) {
993
+ // Check if there are any Products linked to Gravity Forms
994
+ if( $gf_fields = woo_ce_get_gravity_form_fields() ) {
995
+ $fields[] = array(
996
+ 'name' => 'order_items_gf_form_id',
997
+ 'label' => __( 'Order Items: Gravity Form ID', 'woo_ce' )
998
+ );
999
+ $fields[] = array(
1000
+ 'name' => 'order_items_gf_form_label',
1001
+ 'label' => __( 'Order Items: Gravity Form Label', 'woo_ce' )
1002
+ );
1003
+ foreach( $gf_fields as $key => $gf_field ) {
1004
+ $fields[] = array(
1005
+ 'name' => sprintf( 'order_items_gf_%d_%s', $gf_field['formId'], $gf_field['id'] ),
1006
+ 'label' => sprintf( __( 'Order Items: %s', 'woo_ce' ), ucfirst( $gf_field['label'] ) )
1007
+ );
1008
+ }
1009
+ }
1010
+ }
1011
+
1012
+ // WooCommerce Currency Switcher - http://dev.pathtoenlightenment.net/shop
1013
+ if( class_exists( 'WC_Aelia_CurrencySwitcher' ) ) {
1014
+ $fields[] = array(
1015
+ 'name' => 'order_currency',
1016
+ 'label' => __( 'Order Currency', 'woo_ce' )
1017
+ );
1018
+ }
1019
+
1020
+ // Custom Order fields
1021
+ $custom_orders = woo_ce_get_option( 'custom_orders', '' );
1022
+ if( !empty( $custom_orders ) ) {
1023
+ foreach( $custom_orders as $custom_order ) {
1024
+ if( !empty( $custom_order ) ) {
1025
+ $fields[] = array(
1026
+ 'name' => $custom_order,
1027
+ 'label' => ucfirst( $custom_order )
1028
+ );
1029
+ }
1030
+ }
1031
+ unset( $custom_orders, $custom_order );
1032
+ }
1033
+
1034
+
1035
+ // Custom Order Items fields
1036
+ $custom_order_items = woo_ce_get_option( 'custom_order_items', '' );
1037
+ if( !empty( $custom_order_items ) ) {
1038
+ foreach( $custom_order_items as $custom_order_item ) {
1039
+ if( !empty( $custom_order_item ) ) {
1040
+ $fields[] = array(
1041
+ 'name' => sprintf( 'order_items_%s', $custom_order_item ),
1042
+ 'label' => sprintf( __( 'Order Items: %s', 'woo_ce' ), $custom_order_item )
1043
+ );
1044
+ }
1045
+ }
1046
+ }
1047
+
1048
+ return $fields;
1049
+
1050
+ }
1051
+ add_filter( 'woo_ce_order_fields', 'woo_ce_extend_order_fields' );
1052
+
1053
+ function woo_ce_get_gravity_forms_products() {
1054
+
1055
+ global $wpdb;
1056
+
1057
+ $meta_key = '_gravity_form_data';
1058
+ $post_ids_sql = $wpdb->prepare( "SELECT `post_id`, `meta_value` FROM `$wpdb->postmeta` WHERE `meta_key` = %s GROUP BY `meta_value`", $meta_key );
1059
+ return $wpdb->get_results( $post_ids_sql );
1060
+
1061
+ }
1062
+
1063
+ function woo_ce_get_gravity_form_fields() {
1064
+
1065
+ if( $gf_products = woo_ce_get_gravity_forms_products() ) {
1066
+ $fields = array();
1067
+ foreach( $gf_products as $gf_product ) {
1068
+ if( $gf_product_data = maybe_unserialize( get_post_meta( $gf_product->post_id, '_gravity_form_data', true ) ) ) {
1069
+ // Check the class and method for Gravity Forms exists
1070
+ if( class_exists( 'RGFormsModel' ) && method_exists( 'RGFormsModel', 'get_form_meta' ) ) {
1071
+ // Check the form exists
1072
+ $gf_form_meta = RGFormsModel::get_form_meta( $gf_product_data['id'] );
1073
+ if( !empty( $gf_form_meta ) ) {
1074
+ // Check that the form has fields assigned to it
1075
+ if( !empty( $gf_form_meta['fields'] ) ) {
1076
+ foreach( $gf_form_meta['fields'] as $gf_form_field ) {
1077
+ // Check for duplicate Gravity Form fields
1078
+ $gf_form_field['formTitle'] = $gf_form_meta['title'];
1079
+ $fields[] = $gf_form_field;
1080
+ }
1081
+ }
1082
+ }
1083
+ }
1084
+ }
1085
+ }
1086
+ return $fields;
1087
+ }
1088
+
1089
+ }
1090
+
1091
+ function woo_ce_format_order_date( $date ) {
1092
+
1093
+ $output = $date;
1094
+ if( $date )
1095
+ $output = str_replace( '/', '-', $date );
1096
+ return $output;
1097
+
1098
+ }
1099
+
1100
+ // Returns a list of WooCommerce Order statuses
1101
+ function woo_ce_get_order_statuses() {
1102
+
1103
+ $terms = false;
1104
+ // Check if this is a WooCommerce 2.2+ instance (new Post Status)
1105
+ $woocommerce_version = woo_get_woo_version();
1106
+ if( version_compare( $woocommerce_version, '2.2', '>=' ) ) {
1107
+ // Convert Order Status array into our magic sauce
1108
+ $order_statuses = ( function_exists( 'wc_get_order_statuses' ) ? wc_get_order_statuses() : false );
1109
+ if( !empty( $order_statuses ) ) {
1110
+ $terms = array();
1111
+ $post_type = 'shop_order';
1112
+ $posts_count = wp_count_posts( $post_type );
1113
+ foreach( $order_statuses as $key => $order_status ) {
1114
+ $terms[] = (object)array(
1115
+ 'name' => $order_status,
1116
+ 'slug' => $key,
1117
+ 'count' => ( isset( $posts_count->$key ) ? $posts_count->$key : 0 )
1118
+ );
1119
+ }
1120
+ }
1121
+ } else {
1122
+ $args = array(
1123
+ 'hide_empty' => false
1124
+ );
1125
+ $terms = get_terms( 'shop_order_status', $args );
1126
+ if( empty( $terms ) || ( is_wp_error( $terms ) == true ) )
1127
+ $terms = false;
1128
+ }
1129
+ return $terms;
1130
+
1131
+ }
1132
+
1133
+ function woo_ce_get_order_items_types() {
1134
+
1135
+ $types = array(
1136
+ 'line_item' => __( 'Line Item', 'woo_ce' ),
1137
+ 'coupon' => __( 'Coupon', 'woo_ce' ),
1138
+ 'fee' => __( 'Fee', 'woo_ce' ),
1139
+ 'tax' => __( 'Tax', 'woo_ce' ),
1140
+ 'shipping' => __( 'Shipping', 'woo_ce' )
1141
+ );
1142
+ $types = apply_filters( 'woo_ce_order_item_types', $types );
1143
+ return $types;
1144
+
1145
+ }
1146
+
1147
+ // Returns list of Product Addon columns
1148
+ function woo_ce_get_product_addons() {
1149
+
1150
+ $output = array();
1151
+
1152
+ // Product Addons - http://www.woothemes.com/
1153
+ if( class_exists( 'Product_Addon_Admin' ) || class_exists( 'Product_Addon_Display' ) ) {
1154
+ $post_type = 'global_product_addon';
1155
+ $args = array(
1156
+ 'post_type' => $post_type,
1157
+ 'numberposts' => -1
1158
+ );
1159
+ if( $product_addons = get_posts( $args ) ) {
1160
+ foreach( $product_addons as $product_addon ) {
1161
+ if( $meta = maybe_unserialize( get_post_meta( $product_addon->ID, '_product_addons', true ) ) ) {
1162
+ $size = count( $meta );
1163
+ for( $i = 0; $i < $size; $i++ ) {
1164
+ $output[] = (object)array(
1165
+ 'post_name' => $meta[$i]['name'],
1166
+ 'post_title' => $meta[$i]['name']
1167
+ );
1168
+ }
1169
+ }
1170
+ }
1171
+ }
1172
+ }
1173
+
1174
+ // Custom Order Items
1175
+ if( $custom_order_items = woo_ce_get_option( 'custom_order_items', '' ) ) {
1176
+ foreach( $custom_order_items as $custom_order_item ) {
1177
+ $output[] = (object)array(
1178
+ 'post_name' => $custom_order_item,
1179
+ 'post_title' => $custom_order_item
1180
+ );
1181
+ }
1182
+ }
1183
+
1184
+ return $output;
1185
+
1186
+ }
1187
+ ?>
includes/product_vendors.php ADDED
@@ -0,0 +1,85 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ function woo_ce_get_product_vendor_fields( $format = 'full' ) {
3
+
4
+ $export_type = 'product_vendor';
5
+
6
+ $fields = array();
7
+ $fields[] = array(
8
+ 'name' => 'title',
9
+ 'label' => __( 'Name', 'woo_ce' )
10
+ );
11
+ $fields[] = array(
12
+ 'name' => 'slug',
13
+ 'label' => __( 'Slug', 'woo_ce' )
14
+ );
15
+ $fields[] = array(
16
+ 'name' => 'description',
17
+ 'label' => __( 'Description', 'woo_ce' )
18
+ );
19
+ $fields[] = array(
20
+ 'name' => 'commission',
21
+ 'label' => __( 'Commission', 'woo_ce' )
22
+ );
23
+ $fields[] = array(
24
+ 'name' => 'paypal_email',
25
+ 'label' => __( 'PayPal E-mail Address', 'woo_ce' )
26
+ );
27
+ $fields[] = array(
28
+ 'name' => 'user_name',
29
+ 'label' => __( 'Vendor Username', 'woo_ce' )
30
+ );
31
+ $fields[] = array(
32
+ 'name' => 'user_id',
33
+ 'label' => __( 'Vendor User ID', 'woo_ce' )
34
+ );
35
+
36
+ /*
37
+ $fields[] = array(
38
+ 'name' => '',
39
+ 'label' => __( '', 'woo_ce' )
40
+ );
41
+ */
42
+
43
+ // Allow Plugin/Theme authors to add support for additional columns
44
+ $fields = apply_filters( 'woo_ce_' . $export_type . '_fields', $fields, $export_type );
45
+
46
+ switch( $format ) {
47
+
48
+ case 'summary':
49
+ $output = array();
50
+ $size = count( $fields );
51
+ for( $i = 0; $i < $size; $i++ ) {
52
+ if( isset( $fields[$i] ) )
53
+ $output[$fields[$i]['name']] = 'on';
54
+ }
55
+ return $output;
56
+ break;
57
+
58
+ case 'full':
59
+ default:
60
+ $sorting = woo_ce_get_option( $export_type . '_sorting', array() );
61
+ $size = count( $fields );
62
+ for( $i = 0; $i < $size; $i++ )
63
+ $fields[$i]['order'] = ( isset( $sorting[$fields[$i]['name']] ) ? $sorting[$fields[$i]['name']] : $i );
64
+ usort( $fields, woo_ce_sort_fields( 'order' ) );
65
+ return $fields;
66
+ break;
67
+
68
+ }
69
+
70
+ }
71
+
72
+ function woo_ce_override_product_vendor_field_labels( $fields = array() ) {
73
+
74
+ $labels = woo_ce_get_option( 'product_vendor_labels', array() );
75
+ if( !empty( $labels ) ) {
76
+ foreach( $fields as $key => $field ) {
77
+ if( isset( $labels[$field['name']] ) )
78
+ $fields[$key]['label'] = $labels[$field['name']];
79
+ }
80
+ }
81
+ return $fields;
82
+
83
+ }
84
+ add_filter( 'woo_ce_product_vendor_fields', 'woo_ce_override_product_vendor_field_labels', 11 );
85
+ ?>
includes/products.php ADDED
@@ -0,0 +1,1380 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if( is_admin() ) {
3
+
4
+ /* Start of: WordPress Administration */
5
+
6
+ // HTML template for Filter Products by Product Category widget on Store Exporter screen
7
+ function woo_ce_products_filter_by_product_category() {
8
+
9
+ $args = array(
10
+ 'hide_empty' => 1
11
+ );
12
+ $product_categories = woo_ce_get_product_categories( $args );
13
+
14
+ ob_start(); ?>
15
+ <p><label><input type="checkbox" id="products-filters-categories" /> <?php _e( 'Filter Products by Product Categories', 'woo_ce' ); ?></label></p>
16
+ <div id="export-products-filters-categories" class="separator">
17
+ <?php if( $product_categories ) { ?>
18
+ <ul>
19
+ <?php foreach( $product_categories as $product_category ) { ?>
20
+ <li>
21
+ <label><input type="checkbox" name="product_filter_category[<?php echo $product_category->term_id; ?>]" value="<?php echo $product_category->term_id; ?>" title="<?php printf( __( 'Term ID: %d', 'woo_ce' ), $product_category->term_id ); ?>"<?php disabled( $product_category->count, 0 ); ?> /> <?php echo woo_ce_format_product_category_label( $product_category->name, $product_category->parent_name ); ?></label>
22
+ <span class="description">(<?php echo $product_category->count; ?>)</span>
23
+ </li>
24
+ <?php } ?>
25
+ </ul>
26
+ <p class="description"><?php _e( 'Select the Product Categories you want to filter exported Products by. Default is to include all Product Categories.', 'woo_ce' ); ?></p>
27
+ <?php } else { ?>
28
+ <p><?php _e( 'No Product Categories were found.', 'woo_ce' ); ?></p>
29
+ <?php } ?>
30
+ </div>
31
+ <!-- #export-products-filters-categories -->
32
+ <?php
33
+ ob_end_flush();
34
+
35
+ }
36
+
37
+ // HTML template for Filter Products by Product Tag widget on Store Exporter screen
38
+ function woo_ce_products_filter_by_product_tag() {
39
+
40
+ $args = array(
41
+ 'hide_empty' => 1
42
+ );
43
+ $product_tags = woo_ce_get_product_tags( $args );
44
+
45
+ ob_start(); ?>
46
+ <p><label><input type="checkbox" id="products-filters-tags" /> <?php _e( 'Filter Products by Product Tags', 'woo_ce' ); ?></label></p>
47
+ <div id="export-products-filters-tags" class="separator">
48
+ <?php if( $product_tags ) { ?>
49
+ <ul>
50
+ <?php foreach( $product_tags as $product_tag ) { ?>
51
+ <li>
52
+ <label><input type="checkbox" name="product_filter_tag[<?php echo $product_tag->term_id; ?>]" value="<?php echo $product_tag->term_id; ?>" title="<?php printf( __( 'Term ID: %d', 'woo_ce' ), $product_tag->term_id ); ?>"<?php disabled( $product_tag->count, 0 ); ?> /> <?php echo $product_tag->name; ?></label>
53
+ <span class="description">(<?php echo $product_tag->count; ?>)</span>
54
+ </li>
55
+ <?php } ?>
56
+ </ul>
57
+ <p class="description"><?php _e( 'Select the Product Tags you want to filter exported Products by. Default is to include all Product Tags.', 'woo_ce' ); ?></p>
58
+ <?php } else { ?>
59
+ <p><?php _e( 'No Product Tags were found.', 'woo_ce' ); ?></p>
60
+ <?php } ?>
61
+ </div>
62
+ <!-- #export-products-filters-tags -->
63
+ <?php
64
+ ob_end_flush();
65
+
66
+ }
67
+
68
+ // HTML template for Filter Products by Product Status widget on Store Exporter screen
69
+ function woo_ce_products_filter_by_product_status() {
70
+
71
+ $product_statuses = get_post_statuses();
72
+ if( !isset( $product_statuses['trash'] ) )
73
+ $product_statuses['trash'] = __( 'Trash', 'woo_ce' );
74
+
75
+ ob_start(); ?>
76
+ <p><label><input type="checkbox" id="products-filters-status" /> <?php _e( 'Filter Products by Product Status', 'woo_ce' ); ?></label></p>
77
+ <div id="export-products-filters-status" class="separator">
78
+ <ul>
79
+ <?php foreach( $product_statuses as $key => $product_status ) { ?>
80
+ <li><label><input type="checkbox" name="product_filter_status[<?php echo $key; ?>]" value="<?php echo $key; ?>" /> <?php echo $product_status; ?></label></li>
81
+ <?php } ?>
82
+ </ul>
83
+ <p class="description"><?php _e( 'Select the Product Status options you want to filter exported Products by. Default is to include all Product Status options.', 'woo_ce' ); ?></p>
84
+ </div>
85
+ <!-- #export-products-filters-status -->
86
+ <?php
87
+ ob_end_flush();
88
+
89
+ }
90
+
91
+ // HTML template for Filter Products by Product Type widget on Store Exporter screen
92
+ function woo_ce_products_filter_by_product_type() {
93
+
94
+ $product_types = woo_ce_get_product_types();
95
+
96
+ ob_start(); ?>
97
+ <p><label><input type="checkbox" id="products-filters-type" /> <?php _e( 'Filter Products by Product Type', 'woo_ce' ); ?></label></p>
98
+ <div id="export-products-filters-type" class="separator">
99
+ <ul>
100
+ <?php if( $product_types ) { ?>
101
+ <?php foreach( $product_types as $key => $product_type ) { ?>
102
+ <li><label><input type="checkbox" name="product_filter_type[<?php echo $key; ?>]" value="<?php echo $key; ?>" /> <?php echo woo_ce_format_product_type( $product_type['name'] ); ?> (<?php echo $product_type['count']; ?>)</label></li>
103
+ <?php } ?>
104
+ <?php } ?>
105
+ </ul>
106
+ <p class="description"><?php _e( 'Select the Product Type\'s you want to filter exported Products by. Default is to include all Product Types and Variations.', 'woo_ce' ); ?></p>
107
+ </div>
108
+ <!-- #export-products-filters-type -->
109
+ <?php
110
+ ob_end_flush();
111
+
112
+ }
113
+
114
+ // HTML template for Filter Products by Product Type widget on Store Exporter screen
115
+ function woo_ce_products_filter_by_stock_status() {
116
+
117
+ // Store Exporter Deluxe
118
+ $woo_cd_url = 'http://www.visser.com.au/woocommerce/plugins/exporter-deluxe/';
119
+ $woo_cd_link = sprintf( '<a href="%s" target="_blank">' . __( 'Store Exporter Deluxe', 'woo_ce' ) . '</a>', $woo_cd_url );
120
+
121
+ ob_start(); ?>
122
+ <p><label><input type="checkbox" id="products-filters-stock" /> <?php _e( 'Filter Products by Stock Status', 'woo_ce' ); ?></label></p>
123
+ <div id="export-products-filters-stock" class="separator">
124
+ <ul>
125
+ <li value=""><label><input type="radio" name="product_filter_stock" value="" checked="checked" /><?php _e( 'Include both', 'woo_ce' ); ?></label></li>
126
+ <li value="instock"><label><input type="radio" name="product_filter_stock" value="instock" disabled="disabled" /><?php _e( 'In stock', 'woo_ce' ); ?><span class="description"> - <?php printf( __( 'available in %s', 'woo_ce' ), $woo_cd_link ); ?></span></label></li>
127
+ <li value="outofstock"><label><input type="radio" name="product_filter_stock" value="outofstock" disabled="disabled" /><?php _e( 'Out of stock', 'woo_ce' ); ?><span class="description"> - <?php printf( __( 'available in %s', 'woo_ce' ), $woo_cd_link ); ?></span></label></li>
128
+ </ul>
129
+ </div>
130
+ <!-- #export-products-filters-stock -->
131
+ <?php
132
+ ob_end_flush();
133
+
134
+ }
135
+
136
+ // HTML template for Product Sorting widget on Store Exporter screen
137
+ function woo_ce_products_product_sorting() {
138
+
139
+ $product_orderby = woo_ce_get_option( 'product_orderby', 'ID' );
140
+ $product_order = woo_ce_get_option( 'product_order', 'DESC' );
141
+
142
+ ob_start(); ?>
143
+ <p><label><?php _e( 'Product Sorting', 'woo_ce' ); ?></label></p>
144
+ <div>
145
+ <select name="product_orderby">
146
+ <option value="ID"<?php selected( 'ID', $product_orderby ); ?>><?php _e( 'Product ID', 'woo_ce' ); ?></option>
147
+ <option value="title"<?php selected( 'title', $product_orderby ); ?>><?php _e( 'Product Name', 'woo_ce' ); ?></option>
148
+ <option value="date"<?php selected( 'date', $product_orderby ); ?>><?php _e( 'Date Created', 'woo_ce' ); ?></option>
149
+ <option value="modified"<?php selected( 'modified', $product_orderby ); ?>><?php _e( 'Date Modified', 'woo_ce' ); ?></option>
150
+ <option value="rand"<?php selected( 'rand', $product_orderby ); ?>><?php _e( 'Random', 'woo_ce' ); ?></option>
151
+ <option value="menu_order"<?php selected( 'menu_order', $product_orderby ); ?>><?php _e( 'Sort Order', 'woo_ce' ); ?></option>
152
+ </select>
153
+ <select name="product_order">
154
+ <option value="ASC"<?php selected( 'ASC', $product_order ); ?>><?php _e( 'Ascending', 'woo_ce' ); ?></option>
155
+ <option value="DESC"<?php selected( 'DESC', $product_order ); ?>><?php _e( 'Descending', 'woo_ce' ); ?></option>
156
+ </select>
157
+ <p class="description"><?php _e( 'Select the sorting of Products within the exported file. By default this is set to export Products by Product ID in Desending order.', 'woo_ce' ); ?></p>
158
+ </div>
159
+ <?php
160
+ ob_end_flush();
161
+
162
+ }
163
+
164
+ // HTML template for Up-sells formatting on Store Exporter screen
165
+ function woo_ce_products_upsells_formatting() {
166
+
167
+ $upsell_formatting = woo_ce_get_option( 'upsell_formatting', 1 );
168
+
169
+ ob_start(); ?>
170
+ <tr class="export-options product-options">
171
+ <th><label for=""><?php _e( 'Up-sells formatting', 'woo_ce' ); ?></label></th>
172
+ <td>
173
+ <label><input type="radio" name="product_upsell_formatting" value="0"<?php checked( $upsell_formatting, 0 ); ?> />&nbsp;<?php _e( 'Export Up-Sells as Product ID', 'woo_ce' ); ?></label><br />
174
+ <label><input type="radio" name="product_upsell_formatting" value="1"<?php checked( $upsell_formatting, 1 ); ?> />&nbsp;<?php _e( 'Export Up-Sells as Product SKU', 'woo_ce' ); ?></label>
175
+ <p class="description"><?php _e( 'Choose the up-sell formatting that is accepted by your WooCommerce import Plugin (e.g. Product Importer Deluxe, Product Import Suite, etc.).', 'woo_ce' ); ?></p>
176
+ </td>
177
+ </tr>
178
+
179
+ <?php
180
+ ob_end_flush();
181
+
182
+ }
183
+
184
+ // HTML template for Cross-sells formatting on Store Exporter screen
185
+ function woo_ce_products_crosssells_formatting() {
186
+
187
+ $crosssell_formatting = woo_ce_get_option( 'crosssell_formatting', 1 );
188
+
189
+ ob_start(); ?>
190
+ <tr class="export-options product-options">
191
+ <th><label for=""><?php _e( 'Cross-sells formatting', 'woo_ce' ); ?></label></th>
192
+ <td>
193
+ <label><input type="radio" name="product_crosssell_formatting" value="0"<?php checked( $crosssell_formatting, 0 ); ?> />&nbsp;<?php _e( 'Export Cross-Sells as Product ID', 'woo_ce' ); ?></label><br />
194
+ <label><input type="radio" name="product_crosssell_formatting" value="1"<?php checked( $crosssell_formatting, 1 ); ?> />&nbsp;<?php _e( 'Export Cross-Sells as Product SKU', 'woo_ce' ); ?></label>
195
+ <p class="description"><?php _e( 'Choose the cross-sell formatting that is accepted by your WooCommerce import Plugin (e.g. Product Importer Deluxe, Product Import Suite, etc.).', 'woo_ce' ); ?></p>
196
+ </td>
197
+ </tr>
198
+
199
+ <?php
200
+ ob_end_flush();
201
+
202
+ }
203
+
204
+ // HTML template for Custom Products widget on Store Exporter screen
205
+ function woo_ce_products_custom_fields() {
206
+
207
+ if( $custom_products = woo_ce_get_option( 'custom_products', '' ) )
208
+ $custom_products = implode( "\n", $custom_products );
209
+
210
+ $troubleshooting_url = 'http://www.visser.com.au/documentation/store-exporter-deluxe/usage/';
211
+
212
+ ob_start(); ?>
213
+ <form method="post" id="export-products-custom-fields" class="export-options product-options">
214
+ <div id="poststuff">
215
+
216
+ <div class="postbox" id="export-options product-options">
217
+ <h3 class="hndle"><?php _e( 'Custom Product Fields', 'woo_ce' ); ?></h3>
218
+ <div class="inside">
219
+ <p class="description"><?php _e( 'To include additional custom Product meta in the Export Products table above fill the Products text box then click Save Custom Fields.', 'woo_ce' ); ?></p>
220
+ <table class="form-table">
221
+
222
+ <tr>
223
+ <th>
224
+ <label><?php _e( 'Product meta', 'woo_ce' ); ?></label>
225
+ </th>
226
+ <td>
227
+ <textarea name="custom_products" rows="5" cols="70"><?php echo esc_textarea( $custom_products ); ?></textarea>
228
+ <p class="description"><?php _e( 'Include additional custom Product meta in your export file by adding each custom Product meta name to a new line above.<br />For example: <code>Customer UA, Customer IP Address</code>', 'woo_ce' ); ?></p>
229
+ </td>
230
+ </tr>
231
+
232
+ </table>
233
+ <p class="submit">
234
+ <input type="submit" value="<?php _e( 'Save Custom Fields', 'woo_ce' ); ?>" class="button-primary" />
235
+ </p>
236
+ <p class="description"><?php printf( __( 'For more information on custom Product meta consult our <a href="%s" target="_blank">online documentation</a>.', 'woo_ce' ), $troubleshooting_url ); ?></p>
237
+ </div>
238
+ <!-- .inside -->
239
+ </div>
240
+ <!-- .postbox -->
241
+
242
+ </div>
243
+ <!-- #poststuff -->
244
+ <input type="hidden" name="action" value="update" />
245
+ </form>
246
+ <!-- #export-products-custom-fields -->
247
+ <?php
248
+ ob_end_flush();
249
+
250
+ }
251
+
252
+ /* End of: WordPress Administration */
253
+
254
+ }
255
+
256
+ // Returns a list of WooCommerce Product IDs to export process
257
+ function woo_ce_get_products( $args = array() ) {
258
+
259
+ $limit_volume = -1;
260
+ $offset = 0;
261
+ $product_categories = false;
262
+ $product_tags = false;
263
+ $product_status = false;
264
+ $product_type = false;
265
+ $orderby = 'ID';
266
+ $order = 'ASC';
267
+ if( $args ) {
268
+ $limit_volume = $args['limit_volume'];
269
+ $offset = $args['offset'];
270
+ if( !empty( $args['product_categories'] ) )
271
+ $product_categories = $args['product_categories'];
272
+ if( !empty( $args['product_tags'] ) )
273
+ $product_tags = $args['product_tags'];
274
+ if( !empty( $args['product_status'] ) )
275
+ $product_status = $args['product_status'];
276
+ if( !empty( $args['product_type'] ) )
277
+ $product_type = $args['product_type'];
278
+ if( isset( $args['product_orderby'] ) )
279
+ $orderby = $args['product_orderby'];
280
+ if( isset( $args['product_order'] ) )
281
+ $order = $args['product_order'];
282
+ }
283
+ $post_type = array( 'product', 'product_variation' );
284
+ $args = array(
285
+ 'post_type' => $post_type,
286
+ 'orderby' => $orderby,
287
+ 'order' => $order,
288
+ 'offset' => $offset,
289
+ 'posts_per_page' => $limit_volume,
290
+ 'post_status' => woo_ce_post_statuses(),
291
+ 'fields' => 'ids'
292
+ );
293
+ if( $product_categories ) {
294
+ $term_taxonomy = 'product_cat';
295
+ $args['tax_query'] = array(
296
+ array(
297
+ 'taxonomy' => $term_taxonomy,
298
+ 'field' => 'id',
299
+ 'terms' => $product_categories
300
+ )
301
+ );
302
+ }
303
+ if( $product_tags ) {
304
+ $term_taxonomy = 'product_tag';
305
+ $args['tax_query'] = array(
306
+ array(
307
+ 'taxonomy' => $term_taxonomy,
308
+ 'field' => 'id',
309
+ 'terms' => $product_tags
310
+ )
311
+ );
312
+ }
313
+ if( $product_status )
314
+ $args['post_status'] = woo_ce_post_statuses( $product_status, true );
315
+ if( $product_type ) {
316
+ if( in_array( 'variation', $product_type ) ) {
317
+ $args['post_type'] = 'product_variation';
318
+ } else {
319
+ $args['tax_query'] = array(
320
+ array(
321
+ 'taxonomy' => 'product_type',
322
+ 'field' => 'slug',
323
+ 'terms' => $product_type
324
+ )
325
+ );
326
+ }
327
+ }
328
+ $products = array();
329
+ $product_ids = new WP_Query( $args );
330
+ if( $product_ids->posts ) {
331
+ foreach( $product_ids->posts as $product_id ) {
332
+ $product = get_post( $product_id );
333
+ // Filter out variations that don't have a Parent Product that exists
334
+ if( $product->post_type == 'product_variation' ) {
335
+ // Check if Parent exists
336
+ if( $product->post_parent ) {
337
+ if( !get_post( $product->post_parent ) ) {
338
+ unset( $product_id, $product );
339
+ continue;
340
+ }
341
+ }
342
+ }
343
+ if( isset( $product_id ) )
344
+ $products[] = $product_id;
345
+ }
346
+ unset( $product_ids, $product_id );
347
+ }
348
+ return $products;
349
+
350
+ }
351
+
352
+ function woo_ce_get_product_data( $product_id = 0, $args = array() ) {
353
+
354
+ // Get Product defaults
355
+ $weight_unit = get_option( 'woocommerce_weight_unit' );
356
+ $dimension_unit = get_option( 'woocommerce_dimension_unit' );
357
+ $height_unit = $dimension_unit;
358
+ $width_unit = $dimension_unit;
359
+ $length_unit = $dimension_unit;
360
+
361
+ $product = get_post( $product_id );
362
+ $product->parent_id = '';
363
+ $product->parent_sku = '';
364
+ if( $product->post_type == 'product_variation' ) {
365
+ // Assign Parent ID for Variants then check if Parent exists
366
+ if( $product->parent_id = $product->post_parent )
367
+ $product->parent_sku = get_post_meta( $product->post_parent, '_sku', true );
368
+ else
369
+ $product->parent_id = '';
370
+ }
371
+ $product->product_id = $product->ID;
372
+ $product->sku = get_post_meta( $product->ID, '_sku', true );
373
+ $product->name = get_the_title( $product->ID );
374
+ $product->permalink = get_permalink( $product->ID );
375
+ $product->slug = $product->post_name;
376
+ $product->description = $product->post_content;
377
+ $product->excerpt = $product->post_excerpt;
378
+ $product->regular_price = get_post_meta( $product->ID, '_regular_price', true );
379
+ // Check that a valid price has been provided and that wc_format_localized_price() exists
380
+ if( isset( $product->regular_price ) && $product->regular_price != '' && function_exists( 'wc_format_localized_price' ) )
381
+ $product->regular_price = wc_format_localized_price( $product->regular_price );
382
+ $product->price = get_post_meta( $product->ID, '_price', true );
383
+ if( $product->regular_price != '' && ( $product->regular_price <> $product->price ) )
384
+ $product->price = $product->regular_price;
385
+ // Check that a valid price has been provided and that wc_format_localized_price() exists
386
+ if( isset( $product->price ) && $product->price != '' && function_exists( 'wc_format_localized_price' ) )
387
+ $product->price = wc_format_localized_price( $product->price );
388
+ $product->sale_price = get_post_meta( $product->ID, '_sale_price', true );
389
+ // Check that a valid price has been provided and that wc_format_localized_price() exists
390
+ if( isset( $product->sale_price ) && $product->sale_price != '' && function_exists( 'wc_format_localized_price' ) )
391
+ $product->sale_price = wc_format_localized_price( $product->sale_price );
392
+ $product->sale_price_dates_from = woo_ce_format_sale_price_dates( get_post_meta( $product->ID, '_sale_price_dates_from', true ) );
393
+ $product->sale_price_dates_to = woo_ce_format_sale_price_dates( get_post_meta( $product->ID, '_sale_price_dates_to', true ) );
394
+ $product->post_date = woo_ce_format_date( $product->post_date );
395
+ $product->post_modified = woo_ce_format_date( $product->post_modified );
396
+ $product->type = woo_ce_get_product_assoc_type( $product->ID );
397
+ if( $product->post_type == 'product_variation' )
398
+ $product->type = __( 'Variation', 'woo_ce' );
399
+ $product->visibility = woo_ce_format_visibility( get_post_meta( $product->ID, '_visibility', true ) );
400
+ $product->featured = woo_ce_format_switch( get_post_meta( $product->ID, '_featured', true ) );
401
+ $product->virtual = woo_ce_format_switch( get_post_meta( $product->ID, '_virtual', true ) );
402
+ $product->downloadable = woo_ce_format_switch( get_post_meta( $product->ID, '_downloadable', true ) );
403
+ $product->weight = get_post_meta( $product->ID, '_weight', true );
404
+ $product->weight_unit = ( $product->weight != '' ? $weight_unit : '' );
405
+ $product->height = get_post_meta( $product->ID, '_height', true );
406
+ $product->height_unit = ( $product->height != '' ? $height_unit : '' );
407
+ $product->width = get_post_meta( $product->ID, '_width', true );
408
+ $product->width_unit = ( $product->width != '' ? $width_unit : '' );
409
+ $product->length = get_post_meta( $product->ID, '_length', true );
410
+ $product->length_unit = ( $product->length != '' ? $length_unit : '' );
411
+ $product->category = woo_ce_get_product_assoc_categories( $product->ID, $product->parent_id );
412
+ $product->tag = woo_ce_get_product_assoc_tags( $product->ID );
413
+ $product->manage_stock = woo_ce_format_switch( get_post_meta( $product->ID, '_manage_stock', true ) );
414
+ $product->allow_backorders = woo_ce_format_switch( get_post_meta( $product->ID, '_backorders', true ) );
415
+ $product->sold_individually = woo_ce_format_switch( get_post_meta( $product->ID, '_sold_individually', true ) );
416
+ $product->upsell_ids = woo_ce_get_product_assoc_upsell_ids( $product->ID );
417
+ $product->crosssell_ids = woo_ce_get_product_assoc_crosssell_ids( $product->ID );
418
+ $product->quantity = get_post_meta( $product->ID, '_stock', true );
419
+ $product->stock_status = woo_ce_format_stock_status( get_post_meta( $product->ID, '_stock_status', true ), $product->quantity );
420
+ $product->image = woo_ce_get_product_assoc_featured_image( $product->ID );
421
+ $product->tax_status = woo_ce_format_tax_status( get_post_meta( $product->ID, '_tax_status', true ) );
422
+ $product->tax_class = woo_ce_format_tax_class( get_post_meta( $product->ID, '_tax_class', true ) );
423
+ $product->product_url = get_post_meta( $product->ID, '_product_url', true );
424
+ $product->button_text = get_post_meta( $product->ID, '_button_text', true );
425
+ $product->file_download = woo_ce_get_product_assoc_file_downloads( $product->ID );
426
+ $product->download_limit = get_post_meta( $product->ID, '_download_limit', true );
427
+ $product->download_expiry = get_post_meta( $product->ID, '_download_expiry', true );
428
+ $product->download_type = woo_ce_format_download_type( get_post_meta( $product->ID, '_download_type', true ) );
429
+ $product->purchase_note = get_post_meta( $product->ID, '_purchase_note', true );
430
+ $product->product_status = woo_ce_format_product_status( $product->post_status );
431
+ $product->enable_reviews = woo_ce_format_comment_status( $product->comment_status );
432
+ $product->menu_order = $product->menu_order;
433
+
434
+ // Attributes
435
+ if( $attributes = woo_ce_get_product_attributes() ) {
436
+ if( $product->post_type == 'product_variation' ) {
437
+ foreach( $attributes as $attribute ) {
438
+ $attribute_value = get_post_meta( $product->ID, sprintf( 'attribute_pa_%s', $attribute->attribute_name ), true );
439
+ if( !empty( $attribute_value ) ) {
440
+ $term_id = term_exists( $attribute_value, sprintf( 'pa_%s', $attribute->attribute_name ) );
441
+ if( $term_id !== 0 && $term_id !== null && !is_wp_error( $term_id ) ) {
442
+ $term = get_term( $term_id['term_id'], sprintf( 'pa_%s', $attribute->attribute_name ) );
443
+ $attribute_value = $term->name;
444
+ unset( $term );
445
+ }
446
+ unset( $term_id );
447
+ }
448
+ $product->{'attribute_' . $attribute->attribute_name} = $attribute_value;
449
+ unset( $attribute_value );
450
+ }
451
+ } else {
452
+ $product->attributes = maybe_unserialize( get_post_meta( $product->ID, '_product_attributes', true ) );
453
+ if( !empty( $product->attributes ) ) {
454
+ // Check for taxonomy-based attributes
455
+ foreach( $attributes as $attribute ) {
456
+ if( isset( $product->attributes['pa_' . $attribute->attribute_name] ) )
457
+ $product->{'attribute_' . $attribute->attribute_name} = woo_ce_get_product_assoc_attributes( $product->ID, $product->attributes['pa_' . $attribute->attribute_name], 'product' );
458
+ else
459
+ $product->{'attribute_' . $attribute->attribute_name} = woo_ce_get_product_assoc_attributes( $product->ID, $attribute, 'global' );
460
+ }
461
+ // Check for per-Product attributes (custom)
462
+ foreach( $product->attributes as $key => $attribute ) {
463
+ if( $attribute['is_taxonomy'] == 0 ) {
464
+ if( !isset( $product->{'attribute_' . $key} ) )
465
+ $product->{'attribute_' . $key} = $attribute['value'];
466
+ }
467
+ }
468
+ }
469
+ }
470
+ }
471
+
472
+ // Advanced Google Product Feed - http://plugins.leewillis.co.uk/downloads/wp-e-commerce-product-feeds/
473
+ if( function_exists( 'woocommerce_gpf_install' ) ) {
474
+ $product->gpf_data = get_post_meta( $product->ID, '_wpec_gpf_data', true );
475
+ $product->gpf_availability = ( isset( $product->gpf_data['availability'] ) ? woo_ce_format_gpf_availability( $product->gpf_data['availability'] ) : '' );
476
+ $product->gpf_condition = ( isset( $product->gpf_data['condition'] ) ? woo_ce_format_gpf_condition( $product->gpf_data['condition'] ) : '' );
477
+ $product->gpf_brand = ( isset( $product->gpf_data['brand'] ) ? $product->gpf_data['brand'] : '' );
478
+ $product->gpf_product_type = ( isset( $product->gpf_data['product_type'] ) ? $product->gpf_data['product_type'] : '' );
479
+ $product->gpf_google_product_category = ( isset( $product->gpf_data['google_product_category'] ) ? $product->gpf_data['google_product_category'] : '' );
480
+ $product->gpf_gtin = ( isset( $product->gpf_data['gtin'] ) ? $product->gpf_data['gtin'] : '' );
481
+ $product->gpf_mpn = ( isset( $product->gpf_data['mpn'] ) ? $product->gpf_data['mpn'] : '' );
482
+ $product->gpf_gender = ( isset( $product->gpf_data['gender'] ) ? $product->gpf_data['gender'] : '' );
483
+ $product->gpf_age_group = ( isset( $product->gpf_data['age_group'] ) ? $product->gpf_data['age_group'] : '' );
484
+ $product->gpf_color = ( isset( $product->gpf_data['color'] ) ? $product->gpf_data['color'] : '' );
485
+ $product->gpf_size = ( isset( $product->gpf_data['size'] ) ? $product->gpf_data['size'] : '' );
486
+ }
487
+
488
+ // All in One SEO Pack - http://wordpress.org/extend/plugins/all-in-one-seo-pack/
489
+ if( function_exists( 'aioseop_activate' ) ) {
490
+ $product->aioseop_keywords = get_post_meta( $product->ID, '_aioseop_keywords', true );
491
+ $product->aioseop_description = get_post_meta( $product->ID, '_aioseop_description', true );
492
+ $product->aioseop_title = get_post_meta( $product->ID, '_aioseop_title', true );
493
+ $product->aioseop_titleatr = get_post_meta( $product->ID, '_aioseop_titleatr', true );
494
+ $product->aioseop_menulabel = get_post_meta( $product->ID, '_aioseop_menulabel', true );
495
+ }
496
+
497
+ // WordPress SEO - http://wordpress.org/plugins/wordpress-seo/
498
+ if( function_exists( 'wpseo_admin_init' ) ) {
499
+ $product->wpseo_focuskw = get_post_meta( $product->ID, '_yoast_wpseo_focuskw', true );
500
+ $product->wpseo_metadesc = get_post_meta( $product->ID, '_yoast_wpseo_metadesc', true );
501
+ $product->wpseo_title = get_post_meta( $product->ID, '_yoast_wpseo_title', true );
502
+ $product->wpseo_googleplus_description = get_post_meta( $product->ID, '_yoast_wpseo_google-plus-description', true );
503
+ $product->wpseo_opengraph_description = get_post_meta( $product->ID, '_yoast_wpseo_opengraph-description', true );
504
+ }
505
+
506
+ // Ultimate SEO - http://wordpress.org/plugins/seo-ultimate/
507
+ if( function_exists( 'su_wp_incompat_notice' ) ) {
508
+ $product->useo_meta_title = get_post_meta( $product->ID, '_su_title', true );
509
+ $product->useo_meta_description = get_post_meta( $product->ID, '_su_description', true );
510
+ $product->useo_meta_keywords = get_post_meta( $product->ID, '_su_keywords', true );
511
+ $product->useo_social_title = get_post_meta( $product->ID, '_su_og_title', true );
512
+ $product->useo_social_description = get_post_meta( $product->ID, '_su_og_description', true );
513
+ $product->useo_meta_noindex = get_post_meta( $product->ID, '_su_meta_robots_noindex', true );
514
+ $product->useo_meta_noautolinks = get_post_meta( $product->ID, '_su_disable_autolinks', true );
515
+ }
516
+
517
+ // WooCommerce MSRP Pricing - http://woothemes.com/woocommerce/
518
+ if( function_exists( 'woocommerce_msrp_activate' ) ) {
519
+ $product->msrp = get_post_meta( $product->ID, '_msrp_price', true );
520
+ if( $product->msrp == false && $product->post_type == 'product_variation' )
521
+ $product->msrp = get_post_meta( $product->ID, '_msrp', true );
522
+ // Check that a valid price has been provided and that wc_format_localized_price() exists
523
+ if( isset( $product->msrp ) && $product->msrp != '' && function_exists( 'wc_format_localized_price' ) )
524
+ $product->msrp = wc_format_localized_price( $product->msrp );
525
+ }
526
+
527
+ // Allow Plugin/Theme authors to add support for additional Product columns
528
+ return apply_filters( 'woo_ce_product_item', $product, $product->ID );
529
+
530
+ }
531
+
532
+ // Returns Product Categories associated to a specific Product
533
+ function woo_ce_get_product_assoc_categories( $product_id = 0, $parent_id = 0 ) {
534
+
535
+ global $export;
536
+
537
+ $output = '';
538
+ $term_taxonomy = 'product_cat';
539
+ // Return Product Categories of Parent if this is a Variation
540
+ if( $parent_id )
541
+ $product_id = $parent_id;
542
+ if( $product_id )
543
+ $categories = wp_get_object_terms( $product_id, $term_taxonomy );
544
+ if( !empty( $categories ) && is_wp_error( $categories ) == false ) {
545
+ $size = count( $categories );
546
+ for( $i = 0; $i < $size; $i++ ) {
547
+ if( $categories[$i]->parent == '0' ) {
548
+ $output .= $categories[$i]->name . $export->category_separator;
549
+ } else {
550
+ // Check if Parent -> Child
551
+ $parent_category = get_term( $categories[$i]->parent, $term_taxonomy );
552
+ // Check if Parent -> Child -> Subchild
553
+ if( $parent_category->parent == '0' ) {
554
+ $output .= $parent_category->name . '>' . $categories[$i]->name . $export->category_separator;
555
+ $output = str_replace( $parent_category->name . $export->category_separator, '', $output );
556
+ } else {
557
+ $root_category = get_term( $parent_category->parent, $term_taxonomy );
558
+ $output .= $root_category->name . '>' . $parent_category->name . '>' . $categories[$i]->name . $export->category_separator;
559
+ $output = str_replace( array(
560
+ $root_category->name . '>' . $parent_category->name . $export->category_separator,
561
+ $parent_category->name . $export->category_separator
562
+ ), '', $output );
563
+ }
564
+ unset( $root_category, $parent_category );
565
+ }
566
+ }
567
+ $output = substr( $output, 0, -1 );
568
+ } else {
569
+ $output .= __( 'Uncategorized', 'woo_ce' );
570
+ }
571
+ return $output;
572
+
573
+ }
574
+
575
+ // Returns Product Tags associated to a specific Product
576
+ function woo_ce_get_product_assoc_tags( $product_id = 0 ) {
577
+
578
+ global $export;
579
+
580
+ $output = '';
581
+ $term_taxonomy = 'product_tag';
582
+ $tags = wp_get_object_terms( $product_id, $term_taxonomy );
583
+ if( !empty( $tags ) && is_wp_error( $tags ) == false ) {
584
+ $size = count( $tags );
585
+ for( $i = 0; $i < $size; $i++ ) {
586
+ if( $tag = get_term( $tags[$i]->term_id, $term_taxonomy ) )
587
+ $output .= $tag->name . $export->category_separator;
588
+ }
589
+ $output = substr( $output, 0, -1 );
590
+ }
591
+ return $output;
592
+
593
+ }
594
+
595
+ // Returns the Featured Image associated to a specific Product
596
+ function woo_ce_get_product_assoc_featured_image( $product_id = 0 ) {
597
+
598
+ $output = '';
599
+ if( $product_id ) {
600
+ if( $thumbnail_id = get_post_meta( $product_id, '_thumbnail_id', true ) )
601
+ $output = wp_get_attachment_url( $thumbnail_id );
602
+ }
603
+ return $output;
604
+
605
+ }
606
+
607
+ // Returns the Product Type of a specific Product
608
+ function woo_ce_get_product_assoc_type( $product_id = 0 ) {
609
+
610
+ global $export;
611
+
612
+ $output = '';
613
+ $term_taxonomy = 'product_type';
614
+ $types = wp_get_object_terms( $product_id, $term_taxonomy );
615
+ if( empty( $types ) )
616
+ $types = array( get_term_by( 'name', 'simple', $term_taxonomy ) );
617
+ if( $types ) {
618
+ $size = count( $types );
619
+ for( $i = 0; $i < $size; $i++ ) {
620
+ $type = get_term( $types[$i]->term_id, $term_taxonomy );
621
+ $output .= woo_ce_format_product_type( $type->name ) . $export->category_separator;
622
+ }
623
+ $output = substr( $output, 0, -1 );
624
+ }
625
+ return $output;
626
+
627
+ }
628
+
629
+ // Returns the Up-Sell associated to a specific Product
630
+ function woo_ce_get_product_assoc_upsell_ids( $product_id = 0 ) {
631
+
632
+ global $export;
633
+
634
+ $output = '';
635
+ if( $product_id ) {
636
+ $upsell_ids = get_post_meta( $product_id, '_upsell_ids', true );
637
+ // Convert Product ID to Product SKU as per Up-Sells Formatting
638
+ if( $export->upsell_formatting == 1 && !empty( $upsell_ids ) ) {
639
+ $size = count( $upsell_ids );
640
+ for( $i = 0; $i < $size; $i++ ) {
641
+ $upsell_ids[$i] = get_post_meta( $upsell_ids[$i], '_sku', true );
642
+ if( empty( $upsell_ids[$i] ) )
643
+ unset( $upsell_ids[$i] );
644
+ }
645
+ // 'reindex' array
646
+ $upsell_ids = array_values( $upsell_ids );
647
+ }
648
+ $output = woo_ce_convert_product_ids( $upsell_ids );
649
+ }
650
+ return $output;
651
+
652
+ }
653
+
654
+ // Returns the Cross-Sell associated to a specific Product
655
+ function woo_ce_get_product_assoc_crosssell_ids( $product_id = 0 ) {
656
+
657
+ global $export;
658
+
659
+ $output = '';
660
+ if( $product_id ) {
661
+ $crosssell_ids = get_post_meta( $product_id, '_crosssell_ids', true );
662
+ // Convert Product ID to Product SKU as per Cross-Sells Formatting
663
+ if( $export->crosssell_formatting == 1 && !empty( $crosssell_ids ) ) {
664
+ $size = count( $crosssell_ids );
665
+ for( $i = 0; $i < $size; $i++ ) {
666
+ $crosssell_ids[$i] = get_post_meta( $crosssell_ids[$i], '_sku', true );
667
+ // Remove Cross-Sell if SKU is empty
668
+ if( empty( $crosssell_ids[$i] ) )
669
+ unset( $crosssell_ids[$i] );
670
+ }
671
+ // 'reindex' array
672
+ $crosssell_ids = array_values( $crosssell_ids );
673
+ }
674
+ $output = woo_ce_convert_product_ids( $crosssell_ids );
675
+ }
676
+ return $output;
677
+
678
+ }
679
+
680
+ // Returns Product Attributes associated to a specific Product
681
+ function woo_ce_get_product_assoc_attributes( $product_id = 0, $attribute = array(), $type = 'product' ) {
682
+
683
+ global $export;
684
+
685
+ $output = '';
686
+ if( $product_id ) {
687
+ $terms = array();
688
+ if( $type == 'product' ) {
689
+ if( $attribute['is_taxonomy'] == 1 )
690
+ $term_taxonomy = $attribute['name'];
691
+ } else if( $type == 'global' ) {
692
+ $term_taxonomy = 'pa_' . $attribute->attribute_name;
693
+ }
694
+ $terms = wp_get_object_terms( $product_id, $term_taxonomy );
695
+ if( !empty( $terms ) && is_wp_error( $terms ) == false ) {
696
+ $size = count( $terms );
697
+ for( $i = 0; $i < $size; $i++ )
698
+ $output .= $terms[$i]->name . $export->category_separator;
699
+ unset( $terms );
700
+ }
701
+ $output = substr( $output, 0, -1 );
702
+ }
703
+ return $output;
704
+
705
+ }
706
+
707
+ // Returns File Downloads associated to a specific Product
708
+ function woo_ce_get_product_assoc_file_downloads( $product_id = 0 ) {
709
+
710
+ global $export;
711
+
712
+ $output = '';
713
+ if( $product_id ) {
714
+ if( version_compare( WOOCOMMERCE_VERSION, '2.0', '>=' ) ) {
715
+ // If WooCommerce 2.0+ is installed then use new _downloadable_files Post meta key
716
+ if( $file_downloads = maybe_unserialize( get_post_meta( $product_id, '_downloadable_files', true ) ) ) {
717
+ foreach( $file_downloads as $file_download )
718
+ $output .= $file_download['file'] . $export->category_separator;
719
+ unset( $file_download, $file_downloads );
720
+ }
721
+ $output = substr( $output, 0, -1 );
722
+ } else {
723
+ // If WooCommerce -2.0 is installed then use legacy _file_paths Post meta key
724
+ if( $file_downloads = maybe_unserialize( get_post_meta( $product_id, '_file_paths', true ) ) ) {
725
+ foreach( $file_downloads as $file_download )
726
+ $output .= $file_download . $export->category_separator;
727
+ unset( $file_download, $file_downloads );
728
+ }
729
+ $output = substr( $output, 0, -1 );
730
+ }
731
+ }
732
+ return $output;
733
+
734
+ }
735
+
736
+ // Returns a list of Product export columns
737
+ function woo_ce_get_product_fields( $format = 'full' ) {
738
+
739
+ $export_type = 'product';
740
+
741
+ $fields = array();
742
+ $fields[] = array(
743
+ 'name' => 'parent_id',
744
+ 'label' => __( 'Parent ID', 'woo_ce' )
745
+ );
746
+ $fields[] = array(
747
+ 'name' => 'parent_sku',
748
+ 'label' => __( 'Parent SKU', 'woo_ce' )
749
+ );
750
+ $fields[] = array(
751
+ 'name' => 'product_id',
752
+ 'label' => __( 'Product ID', 'woo_ce' )
753
+ );
754
+ $fields[] = array(
755
+ 'name' => 'sku',
756
+ 'label' => __( 'Product SKU', 'woo_ce' )
757
+ );
758
+ $fields[] = array(
759
+ 'name' => 'name',
760
+ 'label' => __( 'Product Name', 'woo_ce' )
761
+ );
762
+ $fields[] = array(
763
+ 'name' => 'slug',
764
+ 'label' => __( 'Slug', 'woo_ce' )
765
+ );
766
+ $fields[] = array(
767
+ 'name' => 'permalink',
768
+ 'label' => __( 'Permalink', 'woo_ce' )
769
+ );
770
+ $fields[] = array(
771
+ 'name' => 'description',
772
+ 'label' => __( 'Description', 'woo_ce' )
773
+ );
774
+ $fields[] = array(
775
+ 'name' => 'excerpt',
776
+ 'label' => __( 'Excerpt', 'woo_ce' )
777
+ );
778
+ $fields[] = array(
779
+ 'name' => 'post_date',
780
+ 'label' => __( 'Product Published', 'woo_ce' )
781
+ );
782
+ $fields[] = array(
783
+ 'name' => 'post_modified',
784
+ 'label' => __( 'Product Modified', 'woo_ce' )
785
+ );
786
+ $fields[] = array(
787
+ 'name' => 'type',
788
+ 'label' => __( 'Type', 'woo_ce' )
789
+ );
790
+ $fields[] = array(
791
+ 'name' => 'visibility',
792
+ 'label' => __( 'Visibility', 'woo_ce' )
793
+ );
794
+ $fields[] = array(
795
+ 'name' => 'featured',
796
+ 'label' => __( 'Featured', 'woo_ce' )
797
+ );
798
+ $fields[] = array(
799
+ 'name' => 'virtual',
800
+ 'label' => __( 'Virtual', 'woo_ce' )
801
+ );
802
+ $fields[] = array(
803
+ 'name' => 'downloadable',
804
+ 'label' => __( 'Downloadable', 'woo_ce' )
805
+ );
806
+ $fields[] = array(
807
+ 'name' => 'price',
808
+ 'label' => __( 'Price', 'woo_ce' )
809
+ );
810
+ $fields[] = array(
811
+ 'name' => 'sale_price',
812
+ 'label' => __( 'Sale Price', 'woo_ce' )
813
+ );
814
+ $fields[] = array(
815
+ 'name' => 'sale_price_dates_from',
816
+ 'label' => __( 'Sale Price Dates From', 'woo_ce' )
817
+ );
818
+ $fields[] = array(
819
+ 'name' => 'sale_price_dates_to',
820
+ 'label' => __( 'Sale Price Dates To', 'woo_ce' )
821
+ );
822
+ $fields[] = array(
823
+ 'name' => 'weight',
824
+ 'label' => __( 'Weight', 'woo_ce' )
825
+ );
826
+ $fields[] = array(
827
+ 'name' => 'weight_unit',
828
+ 'label' => __( 'Weight Unit', 'woo_ce' )
829
+ );
830
+ $fields[] = array(
831
+ 'name' => 'height',
832
+ 'label' => __( 'Height', 'woo_ce' )
833
+ );
834
+ $fields[] = array(
835
+ 'name' => 'height_unit',
836
+ 'label' => __( 'Height Unit', 'woo_ce' )
837
+ );
838
+ $fields[] = array(
839
+ 'name' => 'width',
840
+ 'label' => __( 'Width', 'woo_ce' )
841
+ );
842
+ $fields[] = array(
843
+ 'name' => 'width_unit',
844
+ 'label' => __( 'Width Unit', 'woo_ce' )
845
+ );
846
+ $fields[] = array(
847
+ 'name' => 'length',
848
+ 'label' => __( 'Length', 'woo_ce' )
849
+ );
850
+ $fields[] = array(
851
+ 'name' => 'length_unit',
852
+ 'label' => __( 'Length Unit', 'woo_ce' )
853
+ );
854
+ $fields[] = array(
855
+ 'name' => 'category',
856
+ 'label' => __( 'Category', 'woo_ce' )
857
+ );
858
+ $fields[] = array(
859
+ 'name' => 'tag',
860
+ 'label' => __( 'Tag', 'woo_ce' )
861
+ );
862
+ $fields[] = array(
863
+ 'name' => 'image',
864
+ 'label' => __( 'Featured Image', 'woo_ce' )
865
+ );
866
+ $fields[] = array(
867
+ 'name' => 'product_gallery',
868
+ 'label' => __( 'Product Gallery', 'woo_ce' ),
869
+ 'disabled' => 1
870
+ );
871
+ $fields[] = array(
872
+ 'name' => 'tax_status',
873
+ 'label' => __( 'Tax Status', 'woo_ce' )
874
+ );
875
+ $fields[] = array(
876
+ 'name' => 'tax_class',
877
+ 'label' => __( 'Tax Class', 'woo_ce' )
878
+ );
879
+ $fields[] = array(
880
+ 'name' => 'file_download',
881
+ 'label' => __( 'File Download', 'woo_ce' )
882
+ );
883
+ $fields[] = array(
884
+ 'name' => 'download_limit',
885
+ 'label' => __( 'Download Limit', 'woo_ce' )
886
+ );
887
+ $fields[] = array(
888
+ 'name' => 'download_expiry',
889
+ 'label' => __( 'Download Expiry', 'woo_ce' )
890
+ );
891
+ $fields[] = array(
892
+ 'name' => 'download_type',
893
+ 'label' => __( 'Download Type', 'woo_ce' )
894
+ );
895
+ $fields[] = array(
896
+ 'name' => 'manage_stock',
897
+ 'label' => __( 'Manage Stock', 'woo_ce' )
898
+ );
899
+ $fields[] = array(
900
+ 'name' => 'quantity',
901
+ 'label' => __( 'Quantity', 'woo_ce' )
902
+ );
903
+ $fields[] = array(
904
+ 'name' => 'stock_status',
905
+ 'label' => __( 'Stock Status', 'woo_ce' )
906
+ );
907
+ $fields[] = array(
908
+ 'name' => 'allow_backorders',
909
+ 'label' => __( 'Allow Backorders', 'woo_ce' )
910
+ );
911
+ $fields[] = array(
912
+ 'name' => 'sold_individually',
913
+ 'label' => __( 'Sold Individually', 'woo_ce' )
914
+ );
915
+ $fields[] = array(
916
+ 'name' => 'upsell_ids',
917
+ 'label' => __( 'Up-Sells', 'woo_ce' )
918
+ );
919
+ $fields[] = array(
920
+ 'name' => 'crosssell_ids',
921
+ 'label' => __( 'Cross-Sells', 'woo_ce' )
922
+ );
923
+ $fields[] = array(
924
+ 'name' => 'product_url',
925
+ 'label' => __( 'Product URL', 'woo_ce' )
926
+ );
927
+ $fields[] = array(
928
+ 'name' => 'button_text',
929
+ 'label' => __( 'Button Text', 'woo_ce' )
930
+ );
931
+ $fields[] = array(
932
+ 'name' => 'purchase_note',
933
+ 'label' => __( 'Purchase Note', 'woo_ce' )
934
+ );
935
+ $fields[] = array(
936
+ 'name' => 'product_status',
937
+ 'label' => __( 'Product Status', 'woo_ce' )
938
+ );
939
+ $fields[] = array(
940
+ 'name' => 'enable_reviews',
941
+ 'label' => __( 'Enable Reviews', 'woo_ce' )
942
+ );
943
+ $fields[] = array(
944
+ 'name' => 'menu_order',
945
+ 'label' => __( 'Sort Order', 'woo_ce' )
946
+ );
947
+
948
+ /*
949
+ $fields[] = array(
950
+ 'name' => '',
951
+ 'label' => __( '', 'woo_ce' )
952
+ );
953
+ */
954
+
955
+ // Allow Plugin/Theme authors to add support for additional columns
956
+ $fields = apply_filters( 'woo_ce_' . $export_type . '_fields', $fields, $export_type );
957
+
958
+ if( $remember = woo_ce_get_option( $export_type . '_fields', array() ) ) {
959
+ $remember = maybe_unserialize( $remember );
960
+ $size = count( $fields );
961
+ for( $i = 0; $i < $size; $i++ ) {
962
+ $fields[$i]['disabled'] = ( isset( $fields[$i]['disabled'] ) ? $fields[$i]['disabled'] : 0 );
963
+ $fields[$i]['default'] = 1;
964
+ if( !array_key_exists( $fields[$i]['name'], $remember ) )
965
+ $fields[$i]['default'] = 0;
966
+ }
967
+ }
968
+
969
+ switch( $format ) {
970
+
971
+ case 'summary':
972
+ $output = array();
973
+ $size = count( $fields );
974
+ for( $i = 0; $i < $size; $i++ ) {
975
+ if( isset( $fields[$i] ) )
976
+ $output[$fields[$i]['name']] = 'on';
977
+ }
978
+ return $output;
979
+ break;
980
+
981
+ case 'full':
982
+ default:
983
+ $sorting = woo_ce_get_option( $export_type . '_sorting', array() );
984
+ $size = count( $fields );
985
+ for( $i = 0; $i < $size; $i++ )
986
+ $fields[$i]['order'] = ( isset( $sorting[$fields[$i]['name']] ) ? $sorting[$fields[$i]['name']] : $i );
987
+ usort( $fields, woo_ce_sort_fields( 'order' ) );
988
+ return $fields;
989
+ break;
990
+
991
+ }
992
+
993
+ }
994
+
995
+ function woo_ce_override_product_field_labels( $fields = array() ) {
996
+
997
+ $labels = woo_ce_get_option( 'product_labels', array() );
998
+ if( !empty( $labels ) ) {
999
+ foreach( $fields as $key => $field ) {
1000
+ if( isset( $labels[$field['name']] ) )
1001
+ $fields[$key]['label'] = $labels[$field['name']];
1002
+ }
1003
+ }
1004
+ return $fields;
1005
+
1006
+ }
1007
+ add_filter( 'woo_ce_product_fields', 'woo_ce_override_product_field_labels', 11 );
1008
+
1009
+ function woo_ce_extend_product_fields( $fields ) {
1010
+
1011
+ // Attributes
1012
+ if( $attributes = woo_ce_get_product_attributes() ) {
1013
+ foreach( $attributes as $attribute ) {
1014
+ if( empty( $attribute->attribute_label ) )
1015
+ $attribute->attribute_label = $attribute->attribute_name;
1016
+ $fields[] = array(
1017
+ 'name' => sprintf( 'attribute_%s', $attribute->attribute_name ),
1018
+ 'label' => sprintf( __( 'Attribute: %s', 'woo_ce' ), ucwords( $attribute->attribute_label ) )
1019
+ );
1020
+ }
1021
+ }
1022
+
1023
+ // Advanced Google Product Feed - http://www.leewillis.co.uk/wordpress-plugins/
1024
+ if( function_exists( 'woocommerce_gpf_install' ) ) {
1025
+ $fields[] = array(
1026
+ 'name' => 'gpf_availability',
1027
+ 'label' => __( 'Advanced Google Product Feed - Availability', 'woo_ce' )
1028
+ );
1029
+ $fields[] = array(
1030
+ 'name' => 'gpf_condition',
1031
+ 'label' => __( 'Advanced Google Product Feed - Condition', 'woo_ce' )
1032
+ );
1033
+ $fields[] = array(
1034
+ 'name' => 'gpf_brand',
1035
+ 'label' => __( 'Advanced Google Product Feed - Brand', 'woo_ce' )
1036
+ );
1037
+ $fields[] = array(
1038
+ 'name' => 'gpf_productype',
1039
+ 'label' => __( 'Advanced Google Product Feed - Product Type', 'woo_ce' )
1040
+ );
1041
+ $fields[] = array(
1042
+ 'name' => 'gpf_google_product_category',
1043
+ 'label' => __( 'Advanced Google Product Feed - Google Product Category', 'woo_ce' )
1044
+ );
1045
+ $fields[] = array(
1046
+ 'name' => 'gpf_gtin',
1047
+ 'label' => __( 'Advanced Google Product Feed - Global Trade Item Number (GTIN)', 'woo_ce' )
1048
+ );
1049
+ $fields[] = array(
1050
+ 'name' => 'gpf_mpn',
1051
+ 'label' => __( 'Advanced Google Product Feed - Manufacturer Part Number (MPN)', 'woo_ce' )
1052
+ );
1053
+ $fields[] = array(
1054
+ 'name' => 'gpf_gender',
1055
+ 'label' => __( 'Advanced Google Product Feed - Gender', 'woo_ce' )
1056
+ );
1057
+ $fields[] = array(
1058
+ 'name' => 'gpf_agegroup',
1059
+ 'label' => __( 'Advanced Google Product Feed - Age Group', 'woo_ce' )
1060
+ );
1061
+ $fields[] = array(
1062
+ 'name' => 'gpf_colour',
1063
+ 'label' => __( 'Advanced Google Product Feed - Colour', 'woo_ce' )
1064
+ );
1065
+ $fields[] = array(
1066
+ 'name' => 'gpf_size',
1067
+ 'label' => __( 'Advanced Google Product Feed - Size', 'woo_ce' )
1068
+ );
1069
+ }
1070
+
1071
+ // All in One SEO Pack - http://wordpress.org/extend/plugins/all-in-one-seo-pack/
1072
+ if( function_exists( 'aioseop_activate' ) ) {
1073
+ $fields[] = array(
1074
+ 'name' => 'aioseop_keywords',
1075
+ 'label' => __( 'All in One SEO - Keywords', 'woo_ce' )
1076
+ );
1077
+ $fields[] = array(
1078
+ 'name' => 'aioseop_description',
1079
+ 'label' => __( 'All in One SEO - Description', 'woo_ce' )
1080
+ );
1081
+ $fields[] = array(
1082
+ 'name' => 'aioseop_title',
1083
+ 'label' => __( 'All in One SEO - Title', 'woo_ce' )
1084
+ );
1085
+ $fields[] = array(
1086
+ 'name' => 'aioseop_title_attributes',
1087
+ 'label' => __( 'All in One SEO - Title Attributes', 'woo_ce' )
1088
+ );
1089
+ $fields[] = array(
1090
+ 'name' => 'aioseop_menu_label',
1091
+ 'label' => __( 'All in One SEO - Menu Label', 'woo_ce' )
1092
+ );
1093
+ }
1094
+
1095
+ // WordPress SEO - http://wordpress.org/plugins/wordpress-seo/
1096
+ if( function_exists( 'wpseo_admin_init' ) ) {
1097
+ $fields[] = array(
1098
+ 'name' => 'wpseo_focuskw',
1099
+ 'label' => __( 'WordPress SEO - Focus Keyword', 'woo_ce' )
1100
+ );
1101
+ $fields[] = array(
1102
+ 'name' => 'wpseo_metadesc',
1103
+ 'label' => __( 'WordPress SEO - Meta Description', 'woo_ce' )
1104
+ );
1105
+ $fields[] = array(
1106
+ 'name' => 'wpseo_title',
1107
+ 'label' => __( 'WordPress SEO - SEO Title', 'woo_ce' )
1108
+ );
1109
+ $fields[] = array(
1110
+ 'name' => 'wpseo_googleplus_description',
1111
+ 'label' => __( 'WordPress SEO - Google+ Description', 'woo_ce' )
1112
+ );
1113
+ $fields[] = array(
1114
+ 'name' => 'wpseo_opengraph_description',
1115
+ 'label' => __( 'WordPress SEO - Facebook Description', 'woo_ce' )
1116
+ );
1117
+ }
1118
+
1119
+ // Ultimate SEO - http://wordpress.org/plugins/seo-ultimate/
1120
+ if( function_exists( 'su_wp_incompat_notice' ) ) {
1121
+ $fields[] = array(
1122
+ 'name' => 'useo_meta_title',
1123
+ 'label' => __( 'Ultimate SEO - Title Tag', 'woo_ce' )
1124
+ );
1125
+ $fields[] = array(
1126
+ 'name' => 'useo_meta_description',
1127
+ 'label' => __( 'Ultimate SEO - Meta Description', 'woo_ce' )
1128
+ );
1129
+ $fields[] = array(
1130
+ 'name' => 'useo_meta_keywords',
1131
+ 'label' => __( 'Ultimate SEO - Meta Keywords', 'woo_ce' )
1132
+ );
1133
+ $fields[] = array(
1134
+ 'name' => 'useo_social_title',
1135
+ 'label' => __( 'Ultimate SEO - Social Title', 'woo_ce' )
1136
+ );
1137
+ $fields[] = array(
1138
+ 'name' => 'useo_social_description',
1139
+ 'label' => __( 'Ultimate SEO - Social Description', 'woo_ce' )
1140
+ );
1141
+ $fields[] = array(
1142
+ 'name' => 'useo_meta_noindex',
1143
+ 'label' => __( 'Ultimate SEO - NoIndex', 'woo_ce' )
1144
+ );
1145
+ $fields[] = array(
1146
+ 'name' => 'useo_meta_noautolinks',
1147
+ 'label' => __( 'Ultimate SEO - Disable Autolinks', 'woo_ce' )
1148
+ );
1149
+ }
1150
+
1151
+ // WooCommerce MSRP Pricing - http://woothemes.com/woocommerce/
1152
+ if( function_exists( 'woocommerce_msrp_activate' ) ) {
1153
+ $fields[] = array(
1154
+ 'name' => 'msrp',
1155
+ 'label' => __( 'Manufacturer Suggested Retail Price (MSRP)', 'woo_ce' ),
1156
+ 'disabled' => 1
1157
+ );
1158
+ }
1159
+
1160
+ // WooCommerce Brands Addon - http://woothemes.com/woocommerce/
1161
+ if( class_exists( 'WC_Brands' ) ) {
1162
+ $fields[] = array(
1163
+ 'name' => 'brands',
1164
+ 'label' => __( 'Brands', 'woo_ce' ),
1165
+ 'disabled' => 1
1166
+ );
1167
+ }
1168
+
1169
+ // Cost of Goods - http://www.skyverge.com/product/woocommerce-cost-of-goods-tracking/
1170
+ if( class_exists( 'WC_COG' ) ) {
1171
+ $fields[] = array(
1172
+ 'name' => 'cost_of_goods',
1173
+ 'label' => __( 'Cost of Goods', 'woo_ce' ),
1174
+ 'disabled' => 1
1175
+ );
1176
+ }
1177
+
1178
+ // Per-Product Shipping - http://www.woothemes.com/products/per-product-shipping/
1179
+ if( function_exists( 'woocommerce_per_product_shipping_init' ) ) {
1180
+ $fields[] = array(
1181
+ 'name' => 'per_product_shipping',
1182
+ 'label' => __( 'Per-Product Shipping', 'woo_ce' ),
1183
+ 'disabled' => 1
1184
+ );
1185
+ }
1186
+
1187
+ // Product Vendors - http://www.woothemes.com/products/product-vendors/
1188
+ if( class_exists( 'WooCommerce_Product_Vendors' ) ) {
1189
+ $fields[] = array(
1190
+ 'name' => 'vendors',
1191
+ 'label' => __( 'Product Vendors', 'woo_ce' ),
1192
+ 'disabled' => 1
1193
+ );
1194
+ $fields[] = array(
1195
+ 'name' => 'vendor_ids',
1196
+ 'label' => __( 'Product Vendor ID\'s', 'woo_ce' ),
1197
+ 'disabled' => 1
1198
+ );
1199
+ $fields[] = array(
1200
+ 'name' => 'vendor_commission',
1201
+ 'label' => __( 'Vendor Commission', 'woo_ce' ),
1202
+ 'disabled' => 1
1203
+ );
1204
+ }
1205
+
1206
+ // Advanced Custom Fields - http://www.advancedcustomfields.com
1207
+ if( class_exists( 'acf' ) ) {
1208
+ if( $custom_fields = woo_ce_get_acf_product_fields() ) {
1209
+ foreach( $custom_fields as $custom_field ) {
1210
+ $fields[] = array(
1211
+ 'name' => $custom_field['name'],
1212
+ 'label' => $custom_field['label'],
1213
+ 'disabled' => 1
1214
+ );
1215
+ }
1216
+ unset( $custom_fields, $custom_field );
1217
+ }
1218
+ }
1219
+
1220
+ // Custom Product meta
1221
+ $custom_products = woo_ce_get_option( 'custom_products', '' );
1222
+ if( !empty( $custom_products ) ) {
1223
+ foreach( $custom_products as $custom_product ) {
1224
+ if( !empty( $custom_product ) ) {
1225
+ $fields[] = array(
1226
+ 'name' => $custom_product,
1227
+ 'label' => $custom_product
1228
+ );
1229
+ }
1230
+ }
1231
+ unset( $custom_products, $custom_product );
1232
+ }
1233
+
1234
+ return $fields;
1235
+
1236
+ }
1237
+ add_filter( 'woo_ce_product_fields', 'woo_ce_extend_product_fields' );
1238
+
1239
+ // Returns the export column header label based on an export column slug
1240
+ function woo_ce_get_product_field( $name = null, $format = 'name' ) {
1241
+
1242
+ $output = '';
1243
+ if( $name ) {
1244
+ $fields = woo_ce_get_product_fields();
1245
+ $size = count( $fields );
1246
+ for( $i = 0; $i < $size; $i++ ) {
1247
+ if( $fields[$i]['name'] == $name ) {
1248
+ switch( $format ) {
1249
+
1250
+ case 'name':
1251
+ $output = $fields[$i]['label'];
1252
+ break;
1253
+
1254
+ case 'full':
1255
+ $output = $fields[$i];
1256
+ break;
1257
+
1258
+ }
1259
+ $i = $size;
1260
+ }
1261
+ }
1262
+ }
1263
+ return $output;
1264
+
1265
+ }
1266
+
1267
+ // Returns a list of WooCommerce Product Types to export process
1268
+ function woo_ce_get_product_types() {
1269
+
1270
+ $term_taxonomy = 'product_type';
1271
+ $args = array(
1272
+ 'hide_empty' => 0
1273
+ );
1274
+ $types = get_terms( $term_taxonomy, $args );
1275
+ if( !empty( $types ) && is_wp_error( $types ) == false ) {
1276
+ $size = count( $types );
1277
+ for( $i = 0; $i < $size; $i++ ) {
1278
+ $output[$types[$i]->slug] = array(
1279
+ 'name' => $types[$i]->name,
1280
+ 'count' => $types[$i]->count
1281
+ );
1282
+ }
1283
+ $output['variation'] = array(
1284
+ 'name' => __( 'variation', 'woo_ce' ),
1285
+ 'count' => woo_ce_get_product_type_variation_count()
1286
+ );
1287
+ asort( $output );
1288
+ return $output;
1289
+ }
1290
+
1291
+ }
1292
+
1293
+ function woo_ce_get_product_type_variation_count() {
1294
+
1295
+ $post_type = 'product_variation';
1296
+ $args = array(
1297
+ 'post_type' => $post_type,
1298
+ 'posts_per_page' => 1
1299
+ );
1300
+ $query = new WP_Query( $args );
1301
+ $size = $query->found_posts;
1302
+ return $size;
1303
+
1304
+ }
1305
+
1306
+ // Returns a list of WooCommerce Product Attributes to export process
1307
+ function woo_ce_get_product_attributes() {
1308
+
1309
+ global $wpdb;
1310
+
1311
+ $output = array();
1312
+ $attributes_sql = "SELECT * FROM " . $wpdb->prefix . "woocommerce_attribute_taxonomies";
1313
+ $attributes = $wpdb->get_results( $attributes_sql );
1314
+ $wpdb->flush();
1315
+ if( !empty( $attributes ) )
1316
+ $output = $attributes;
1317
+ unset( $attributes );
1318
+ return $output;
1319
+
1320
+ }
1321
+
1322
+ function woo_ce_get_acf_product_fields() {
1323
+
1324
+ global $wpdb;
1325
+
1326
+ $post_type = 'acf';
1327
+ $args = array(
1328
+ 'post_type' => $post_type,
1329
+ 'numberposts' => -1
1330
+ );
1331
+ if( $field_groups = get_posts( $args ) ) {
1332
+ $fields = array();
1333
+ $post_types = array( 'product', 'product_variation' );
1334
+ foreach( $field_groups as $field_group ) {
1335
+ $has_fields = false;
1336
+ if( $rules = get_post_meta( $field_group->ID, 'rule' ) ) {
1337
+ $size = count( $rules );
1338
+ for( $i = 0; $i < $size; $i++ ) {
1339
+ if( ( $rules[$i]['param'] == 'post_type' ) && ( $rules[$i]['operator'] == '==' ) && ( in_array( $rules[$i]['value'], $post_types ) ) ) {
1340
+ $has_fields = true;
1341
+ $i = $size;
1342
+ }
1343
+ }
1344
+ }
1345
+ unset( $rules );
1346
+ if( $has_fields ) {
1347
+ $custom_fields_sql = "SELECT `meta_value` FROM `" . $wpdb->postmeta . "` WHERE `post_id` = " . (int)$field_group->ID . " AND `meta_key` LIKE 'field_%'";
1348
+ if( $custom_fields = $wpdb->get_col( $custom_fields_sql ) ) {
1349
+ foreach( $custom_fields as $custom_field ) {
1350
+ $custom_field = maybe_unserialize( $custom_field );
1351
+ $fields[] = array(
1352
+ 'name' => $custom_field['name'],
1353
+ 'label' => $custom_field['label']
1354
+ );
1355
+ }
1356
+ }
1357
+ unset( $custom_fields, $custom_field );
1358
+ }
1359
+ }
1360
+ return $fields;
1361
+ }
1362
+
1363
+ }
1364
+
1365
+ function woo_ce_extend_product_item( $product, $product_id ) {
1366
+
1367
+ $custom_products = woo_ce_get_option( 'custom_products', '' );
1368
+ if( !empty( $custom_products ) ) {
1369
+ foreach( $custom_products as $custom_product ) {
1370
+ // Check that the custom Product name is filled and it hasn't previously been set
1371
+ if( !empty( $custom_product ) && !isset( $product->{$custom_product} ) )
1372
+ $product->{$custom_product} = get_post_meta( $product->ID, $custom_product, true );
1373
+ }
1374
+ }
1375
+
1376
+ return $product;
1377
+
1378
+ }
1379
+ add_filter( 'woo_ce_product_item', 'woo_ce_extend_product_item', 10, 2 );
1380
+ ?>
includes/settings.php ADDED
@@ -0,0 +1,278 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ function woo_ce_export_settings_quicklinks() {
3
+
4
+ ob_start(); ?>
5
+ <li>| <a href="#xml-settings"><?php _e( 'XML Settings', 'woo_ce' ); ?></a> |</li>
6
+ <li><a href="#scheduled-exports"><?php _e( 'Scheduled Exports', 'woo_ce' ); ?></a> |</li>
7
+ <li><a href="#cron-exports"><?php _e( 'CRON Exports', 'woo_ce' ); ?></a></li>
8
+ <?php
9
+ ob_end_flush();
10
+
11
+ }
12
+
13
+ function woo_ce_export_settings_additional() {
14
+
15
+ $woo_cd_url = 'http://www.visser.com.au/woocommerce/plugins/exporter-deluxe/';
16
+ $woo_cd_link = sprintf( '<a href="%s" target="_blank">' . __( 'Store Exporter Deluxe', 'woo_ce' ) . '</a>', $woo_cd_url );
17
+
18
+ $email_to = '-';
19
+ $email_subject = __( '[%store_name%] Export: %export_type% (%export_filename%)', 'woo_ce' );
20
+ $post_to = '-';
21
+ ob_start(); ?>
22
+ <tr>
23
+ <th>
24
+ <label for="email_to"><?php _e( 'Default e-mail recipient', 'woo_ce' ); ?></label>
25
+ </th>
26
+ <td>
27
+ <input name="email_to" type="text" id="email_to" value="<?php echo esc_attr( $email_to ); ?>" class="regular-text code" disabled="disabled" /><span class="description"> - <?php printf( __( 'available in %s', 'woo_ce' ), $woo_cd_link ); ?></span>
28
+ <p class="description"><?php _e( 'Set the default recipient of scheduled export e-mails, can be overriden via CRON using the <code>to</code> argument. Default is the WordPress Blog administrator e-mail address.', 'woo_ce' ); ?></p>
29
+ </td>
30
+ </tr>
31
+ <tr>
32
+ <th>
33
+ <label for="email_to"><?php _e( 'Default e-mail subject', 'woo_ce' ); ?></label>
34
+ </th>
35
+ <td>
36
+ <input name="email_to" type="text" id="email_subject" value="<?php echo esc_attr( $email_subject ); ?>" class="large-text code" disabled="disabled" /><span class="description"> - <?php printf( __( 'available in %s', 'woo_ce' ), $woo_cd_link ); ?></span>
37
+ <p class="description"><?php _e( 'Set the default subject of scheduled export e-mails, can be overriden via CRON using the <code>subject</code> argument. Tags can be used: <code>%store_name%</code>, <code>%export_type%</code>, <code>%export_filename%</code>.', 'woo_ce' ); ?></p>
38
+ </td>
39
+ </tr>
40
+ <tr>
41
+ <th>
42
+ <label for="post_to"><?php _e( 'Default remote POST URL', 'woo_ce' ); ?></label>
43
+ </th>
44
+ <td>
45
+ <input name="post_to" type="text" id="post_to" value="<?php echo esc_url( $post_to ); ?>" class="full-text code" disabled="disabled" /><span class="description"> - <?php printf( __( 'available in %s', 'woo_ce' ), $woo_cd_link ); ?></span>
46
+ <p class="description"><?php _e( 'Set the default remote POST address for scheduled exports, can be overriden via CRON using the <code>to</code> argument. Default is empty.', 'woo_ce' ); ?></p>
47
+ </td>
48
+ </tr>
49
+ <?php
50
+ ob_end_flush();
51
+
52
+ }
53
+
54
+ // Returns the disabled HTML template for the Enable CRON and Secret Export Key options for the Settings screen
55
+ function woo_ce_export_settings_cron() {
56
+
57
+ $woo_cd_url = 'http://www.visser.com.au/woocommerce/plugins/exporter-deluxe/';
58
+ $woo_cd_link = sprintf( '<a href="%s" target="_blank">' . __( 'Store Exporter Deluxe', 'woo_ce' ) . '</a>', $woo_cd_url );
59
+
60
+ // Scheduled exports
61
+ $export_types = woo_ce_return_export_types();
62
+ $order_statuses = woo_ce_get_order_statuses();
63
+ $product_types = woo_ce_get_product_types();
64
+ $auto_interval = 1440;
65
+ $auto_format = 'csv';
66
+ $ftp_method_host = 'ftp.domain.com';
67
+ $ftp_method_user = 'export';
68
+ $ftp_method_pass = '';
69
+ $ftp_method_port = '';
70
+ $ftp_method_path = 'wp-content/uploads/export/';
71
+ $ftp_method_passive = 'auto';
72
+ $ftp_method_timeout = '';
73
+
74
+ // CRON exports
75
+ $secret_key = '-';
76
+
77
+ $troubleshooting_url = 'http://www.visser.com.au/documentation/store-exporter-deluxe/usage/';
78
+ ob_start(); ?>
79
+ <tr id="xml-settings">
80
+ <td colspan="2" style="padding:0;">
81
+ <hr />
82
+ <h3><?php _e( 'XML Settings', 'woo_ce' ); ?></h3>
83
+ </td>
84
+ </tr>
85
+ <tr>
86
+ <th>
87
+ <label><?php _e( 'Attribute display', 'woo_ce' ); ?></label>
88
+ </th>
89
+ <td>
90
+ <ul>
91
+ <li><label><input type="checkbox" name="xml_attribute_url" value="1" disabled="disabled" /> <?php _e( 'Site Address', 'woo_ce' ); ?><span class="description"> - <?php printf( __( 'available in %s', 'woo_ce' ), $woo_cd_link ); ?></span></label></li>
92
+ <li><label><input type="checkbox" name="xml_attribute_title" value="1" disabled="disabled" /> <?php _e( 'Site Title', 'woo_ce' ); ?><span class="description"> - <?php printf( __( 'available in %s', 'woo_ce' ), $woo_cd_link ); ?></span></label></li>
93
+ <li><label><input type="checkbox" name="xml_attribute_date" value="1" disabled="disabled" /> <?php _e( 'Export Date', 'woo_ce' ); ?><span class="description"> - <?php printf( __( 'available in %s', 'woo_ce' ), $woo_cd_link ); ?></span></label></li>
94
+ <li><label><input type="checkbox" name="xml_attribute_time" value="1" disabled="disabled" /> <?php _e( 'Export Time', 'woo_ce' ); ?><span class="description"> - <?php printf( __( 'available in %s', 'woo_ce' ), $woo_cd_link ); ?></span></label></li>
95
+ <li><label><input type="checkbox" name="xml_attribute_export" value="1" disabled="disabled" /> <?php _e( 'Export Type', 'woo_ce' ); ?><span class="description"> - <?php printf( __( 'available in %s', 'woo_ce' ), $woo_cd_link ); ?></span></label></li>
96
+ <li><label><input type="checkbox" name="xml_attribute_orderby" value="1" disabled="disabled" /> <?php _e( 'Export Order By', 'woo_ce' ); ?><span class="description"> - <?php printf( __( 'available in %s', 'woo_ce' ), $woo_cd_link ); ?></span></label></li>
97
+ <li><label><input type="checkbox" name="xml_attribute_order" value="1" disabled="disabled" /> <?php _e( 'Export Order', 'woo_ce' ); ?><span class="description"> - <?php printf( __( 'available in %s', 'woo_ce' ), $woo_cd_link ); ?></span></label></li>
98
+ <li><label><input type="checkbox" name="xml_attribute_limit" value="1" disabled="disabled" /> <?php _e( 'Limit Volume', 'woo_ce' ); ?><span class="description"> - <?php printf( __( 'available in %s', 'woo_ce' ), $woo_cd_link ); ?></span></label></li>
99
+ <li><label><input type="checkbox" name="xml_attribute_offset" value="1" disabled="disabled" /> <?php _e( 'Volume Offset', 'woo_ce' ); ?><span class="description"> - <?php printf( __( 'available in %s', 'woo_ce' ), $woo_cd_link ); ?></span></label></li>
100
+ </ul>
101
+ <p class="description"><?php _e( 'Control the visibility of different attributes in the XML export.', 'woo_ce' ); ?></p>
102
+ </td>
103
+ </tr>
104
+
105
+ <tr id="scheduled-exports">
106
+ <td colspan="2" style="padding:0;">
107
+ <hr />
108
+ <h3><div class="dashicons dashicons-calendar"></div>&nbsp;<?php _e( 'Scheduled Exports', 'woo_ce' ); ?></h3>
109
+ <p class="description"><?php _e( 'Configure Store Exporter Deluxe to automatically generate exports.', 'woo_ce' ); ?></p>
110
+ </td>
111
+ </tr>
112
+ <tr>
113
+ <th>
114
+ <label for="enable_auto"><?php _e( 'Enable scheduled exports', 'woo_ce' ); ?></label>
115
+ </th>
116
+ <td>
117
+ <select id="enable_auto" name="enable_auto">
118
+ <option value="1" disabled="disabled"><?php _e( 'Yes', 'woo_ce' ); ?></option>
119
+ <option value="0" selected="selected"><?php _e( 'No', 'woo_ce' ); ?></option>
120
+ </select>
121
+ <p class="description"><?php _e( 'Enabling Scheduled Exports will trigger automated exports at the interval specified under Once every (minutes).', 'woo_ce' ); ?></p>
122
+ </td>
123
+ </tr>
124
+ <tr>
125
+ <th>
126
+ <label for="auto_type"><?php _e( 'Export type', 'woo_ce' ); ?></label>
127
+ </th>
128
+ <td>
129
+ <select id="auto_type" name="auto_type">
130
+ <?php if( $export_types ) { ?>
131
+ <?php foreach( $export_types as $key => $export_type ) { ?>
132
+ <option value="<?php echo $key; ?>"><?php echo $export_type; ?></option>
133
+ <?php } ?>
134
+ <?php } else { ?>
135
+ <option value=""><?php _e( 'No export types were found.', 'woo_ce' ); ?></option>
136
+ <?php } ?>
137
+ </select>
138
+ <span class="description"> - <?php printf( __( 'available in %s', 'woo_ce' ), $woo_cd_link ); ?></span>
139
+ <p class="description"><?php _e( 'Select the data type you want to export.', 'woo_ce' ); ?></p>
140
+ </td>
141
+ </tr>
142
+ <tr class="auto_type_options">
143
+ <th>
144
+ <label><?php _e( 'Export filters', 'woo_ce' ); ?></label>
145
+ </th>
146
+ <td>
147
+ <ul>
148
+ <li class="export-options product-options">
149
+ <label><?php _e( 'Product Type', 'woo_ce' ); ?></label>
150
+ <?php if( $product_types ) { ?>
151
+ <ul style="margin-top:0.2em;">
152
+ <?php foreach( $product_types as $key => $product_type ) { ?>
153
+ <li><label><input type="checkbox" name="product_filter_type[<?php echo $key; ?>]" value="<?php echo $key; ?>" disabled="disabled" /> <?php echo woo_ce_format_product_type( $product_type['name'] ); ?> (<?php echo $product_type['count']; ?>)<span class="description"> - <?php printf( __( 'available in %s', 'woo_ce' ), $woo_cd_link ); ?></span></label></li>
154
+ <?php } ?>
155
+ </ul>
156
+ <?php } ?>
157
+ <p class="description"><?php _e( 'Select the Product Type\'s you want to filter exported Products by. Default is to include all Product Types and Variations.', 'woo_ce' ); ?></p>
158
+ </li>
159
+ <li class="export-options category-options tag-options brand-options customer-options user-options coupon-options subscription-options product_vendor-options">
160
+ <p><?php _e( 'No export filter options are available for this export type.', 'woo_ce' ); ?></p>
161
+ </li>
162
+ <li class="export-options order-options">
163
+ <label><?php _e( 'Order Status', 'woo_ce' ); ?></label>
164
+ <select name="order_filter_status">
165
+ <option value="" selected="selected"><?php _e( 'All', 'woo_ce' ); ?></option>
166
+ <?php if( $order_statuses ) { ?>
167
+ <?php foreach( $order_statuses as $order_status ) { ?>
168
+ <option value="<?php echo $order_status->name; ?>" disabled="disabled"><?php echo ucfirst( $order_status->name ); ?></option>
169
+ <?php } ?>
170
+ <?php } ?>
171
+ </select>
172
+ <span class="description"> - <?php printf( __( 'available in %s', 'woo_ce' ), $woo_cd_link ); ?></span>
173
+ <p class="description"><?php _e( 'Select the Order Status you want to filter exported Orders by. Default is to include all Order Status options.', 'woo_ce' ); ?></p>
174
+ </li>
175
+ <li class="export-options order-options">
176
+ <label><?php _e( 'Order Date', 'woo_ce' ); ?></label>
177
+ <input type="text" size="10" maxlength="10" class="text" disabled="disabled"> to <input type="text" size="10" maxlength="10" class="text" disabled="disabled"><span class="description"> - <?php printf( __( 'available in %s', 'woo_ce' ), $woo_cd_link ); ?></span>
178
+ <p class="description"><?php _e( 'Filter the dates of Orders to be included in the export. Default is empty.', 'woo_ce' ); ?></p>
179
+ </li>
180
+ </ul>
181
+ </td>
182
+ </tr>
183
+ <tr>
184
+ <th>
185
+ <label for="auto_interval"><?php _e( 'Once every (minutes)', 'woo_ce' ); ?></label>
186
+ </th>
187
+ <td>
188
+ <input name="auto_interval" type="text" id="auto_interval" value="<?php echo esc_attr( $auto_interval ); ?>" size="4" maxlength="4" class="text" disabled="disabled" /><span class="description"> - <?php printf( __( 'available in %s', 'woo_ce' ), $woo_cd_link ); ?></span>
189
+ <p class="description"><?php _e( 'Choose how often Store Exporter Deluxe generates new exports. Default is every 1440 minutes (once every 24 hours).', 'woo_ce' ); ?></p>
190
+ </td>
191
+ </tr>
192
+ <tr>
193
+ <th>
194
+ <label><?php _e( 'Export format', 'woo_ce' ); ?></label>
195
+ </th>
196
+ <td>
197
+ <label><input type="radio" name="auto_format" value="csv"<?php checked( $auto_format, 'csv' ); ?> disabled="disabled" /> <?php _e( 'CSV', 'woo_ce' ); ?> <span class="description"><?php _e( '(Comma separated values)', 'woo_ce' ); ?></span><span class="description"> - <?php printf( __( 'available in %s', 'woo_ce' ), $woo_cd_link ); ?></span></label><br />
198
+ <label><input type="radio" name="auto_format" value="xml"<?php checked( $auto_format, 'xml' ); ?> disabled="disabled" /> <?php _e( 'XML', 'woo_ce' ); ?> <span class="description"><?php _e( '(EXtensible Markup Language)', 'woo_ce' ); ?></span><span class="description"> - <?php printf( __( 'available in %s', 'woo_ce' ), $woo_cd_link ); ?></span></label><br />
199
+ <label><input type="radio" name="auto_format" value="xls"<?php checked( $auto_format, 'xls' ); ?> disabled="disabled" /> <?php _e( 'Excel (XLS)', 'woo_ce' ); ?> <span class="description"><?php _e( '(Microsoft Excel 2007)', 'woo_ce' ); ?></span><span class="description"> - <?php printf( __( 'available in %s', 'woo_ce' ), $woo_cd_link ); ?></span></label>
200
+ <p class="description"><?php _e( 'Adjust the export format to generate different export file formats. Default is CSV.', 'woo_ce' ); ?></p>
201
+ </td>
202
+ </tr>
203
+ <tr>
204
+ <th>
205
+ <label for="auto_method"><?php _e( 'Export method', 'woo_ce' ); ?></label>
206
+ </th>
207
+ <td>
208
+ <select id="auto_method" name="auto_method">
209
+ <option value="archive"><?php _e( 'Archive to WordPress Media', 'woo_ce' ); ?></option>
210
+ <option value="email"><?php _e( 'Send as e-mail', 'woo_ce' ); ?></option>
211
+ <option value="post"><?php _e( 'POST to remote URL', 'woo_ce' ); ?></option>
212
+ <option value="ftp"><?php _e( 'Upload to remote FTP', 'woo_ce' ); ?></option>
213
+ </select>
214
+ <span class="description"> - <?php printf( __( 'available in %s', 'woo_ce' ), $woo_cd_link ); ?></span>
215
+ <p class="description"><?php _e( 'Choose what Store Exporter Deluxe does with the generated export. Default is to archive the export to the WordPress Media for archival purposes.', 'woo_ce' ); ?></p>
216
+ </td>
217
+ </tr>
218
+ <tr class="auto_method_options">
219
+ <th>
220
+ <label><?php _e( 'Export method options', 'woo_ce' ); ?></label>
221
+ </th>
222
+ <td>
223
+ <ul>
224
+ <li class="export-options ftp-options">
225
+ <label for="ftp_method_host"><?php _e( 'Host', 'woo_ce' ); ?>:</label> <input type="text" id="ftp_method_host" name="ftp_method_host" size="15" class="regular-text code" value="<?php echo sanitize_text_field( $ftp_method_host ); ?>" disabled="disabled" /><br />
226
+ <label for="ftp_method_user"><?php _e( 'Username', 'woo_ce' ); ?>:</label> <input type="text" id="ftp_method_user" name="ftp_method_user" size="15" class="regular-text code" value="<?php echo sanitize_text_field( $ftp_method_user ); ?>" disabled="disabled" /><br />
227
+ <label for="ftp_method_pass"><?php _e( 'Password', 'woo_ce' ); ?>:</label> <input type="password" id="ftp_method_pass" name="ftp_method_pass" size="15" class="regular-text code" value="" disabled="disabled" /><?php if( !empty( $ftp_method_pass ) ) { echo ' ' . __( '(password is saved)', 'woo_ce' ); } ?><br />
228
+ <label for="ftp_method_port"><?php _e( 'Port', 'woo_ce' ); ?>:</label> <input type="text" id="ftp_method_port" name="ftp_method_port" size="5" class="short-text code" value="<?php echo sanitize_text_field( $ftp_method_port ); ?>" maxlength="5" disabled="disabled" /><br />
229
+ <label for="ftp_method_file_path"><?php _e( 'File path', 'woo_ce' ); ?>:</label> <input type="text" id="ftp_method_file_path" name="ftp_method_path" size="25" class="regular-text code" value="<?php echo sanitize_text_field( $ftp_method_path ); ?>" disabled="disabled" /><br />
230
+ <label for="ftp_method_passive"><?php _e( 'Transfer mode', 'woo_ce' ); ?>:</label>
231
+ <select id="ftp_method_passive" name="ftp_method_passive">
232
+ <option value="auto" selected="selected"><?php _e( 'Auto', 'woo_ce' ); ?></option>
233
+ <option value="active" disabled="disabled"><?php _e( 'Active', 'woo_ce' ); ?></option>
234
+ <option value="passive" disabled="disabled"><?php _e( 'Passive', 'woo_ce' ); ?></option>
235
+ </select><br />
236
+ <label for="ftp_method_timeout"><?php _e( 'Timeout', 'woo_ce' ); ?>:</label> <input type="text" id="ftp_method_timeout" name="ftp_method_timeout" size="5" class="short-text code" value="<?php echo sanitize_text_field( $ftp_method_timeout ); ?>" /><br />
237
+ <p class="description"><?php _e( 'Enter the FTP host, login details and path of where to save the export file, do not provide the filename, the export filename can be set on General Settings above. For file path example: <code>wp-content/uploads/exports/</code>', 'woo_ce' ); ?></p>
238
+ </li>
239
+ <li class="export-options archive-options email-options post-options">
240
+ <p><?php _e( 'No export method options are available for this export method.', 'woo_ce' ); ?></p>
241
+ </li>
242
+ </ul>
243
+ </td>
244
+ </tr>
245
+
246
+ <tr id="cron-exports">
247
+ <td colspan="2" style="padding:0;">
248
+ <hr />
249
+ <h3><div class="dashicons dashicons-clock"></div>&nbsp;<?php _e( 'CRON Exports', 'woo_ce' ); ?></h3>
250
+ <p class="description"><?php printf( __( 'Store Exporter Deluxe supports exporting via a command line request. For sample CRON requests and supported arguments consult our <a href="%s" target="_blank">online documentation</a>.', 'woo_ce' ), $troubleshooting_url ); ?></p>
251
+ </td>
252
+ </tr>
253
+ <tr>
254
+ <th>
255
+ <label for="enable_cron"><?php _e( 'Enable CRON', 'woo_ce' ); ?></label>
256
+ </th>
257
+ <td>
258
+ <select id="enable_cron" name="enable_cron">
259
+ <option value="1" disabled="disabled"><?php _e( 'Yes', 'woo_ce' ); ?></option>
260
+ <option value="0" selected="selected"><?php _e( 'No', 'woo_ce' ); ?></option>
261
+ </select>
262
+ <p class="description"><?php _e( 'Enabling CRON allows developers to schedule automated exports and connect with Store Exporter Deluxe remotely.', 'woo_ce' ); ?></p>
263
+ </td>
264
+ </tr>
265
+ <tr>
266
+ <th>
267
+ <label for="secret_key"><?php _e( 'Export secret key', 'woo_ce' ); ?></label>
268
+ </th>
269
+ <td>
270
+ <input name="secret_key" type="text" id="secret_key" value="<?php echo esc_attr( $secret_key ); ?>" class="large-text code" disabled="disabled" /><span class="description"> - <?php printf( __( 'available in %s', 'woo_ce' ), $woo_cd_link ); ?></span>
271
+ <p class="description"><?php _e( 'This secret key (can be left empty to allow unrestricted access) limits access to authorised developers who provide a matching key when working with Store Exporter Deluxe.', 'woo_ce' ); ?></p>
272
+ </td>
273
+ </tr>
274
+ <?php
275
+ ob_end_flush();
276
+
277
+ }
278
+ ?>
includes/subscriptions.php ADDED
@@ -0,0 +1,108 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ function woo_ce_get_subscription_fields( $format = 'full' ) {
3
+
4
+ $fields = array();
5
+ $fields[] = array(
6
+ 'name' => 'key',
7
+ 'label' => __( 'Subscription Key', 'woo_ce' )
8
+ );
9
+ $fields[] = array(
10
+ 'name' => 'status',
11
+ 'label' => __( 'Subscription Status', 'woo_ce' )
12
+ );
13
+ $fields[] = array(
14
+ 'name' => 'name',
15
+ 'label' => __( 'Subscription Name', 'woo_ce' )
16
+ );
17
+ $fields[] = array(
18
+ 'name' => 'user',
19
+ 'label' => __( 'User', 'woo_ce' )
20
+ );
21
+ $fields[] = array(
22
+ 'name' => 'user_id',
23
+ 'label' => __( 'User ID', 'woo_ce' )
24
+ );
25
+ $fields[] = array(
26
+ 'name' => 'order_id',
27
+ 'label' => __( 'Order ID', 'woo_ce' )
28
+ );
29
+ $fields[] = array(
30
+ 'name' => 'order_status',
31
+ 'label' => __( 'Order Status', 'woo_ce' )
32
+ );
33
+ $fields[] = array(
34
+ 'name' => 'post_status',
35
+ 'label' => __( 'Post Status', 'woo_ce' )
36
+ );
37
+ $fields[] = array(
38
+ 'name' => 'start_date',
39
+ 'label' => __( 'Start Date', 'woo_ce' )
40
+ );
41
+ $fields[] = array(
42
+ 'name' => 'expiration',
43
+ 'label' => __( 'Expiration', 'woo_ce' )
44
+ );
45
+ $fields[] = array(
46
+ 'name' => 'end_date',
47
+ 'label' => __( 'End Date', 'woo_ce' )
48
+ );
49
+ $fields[] = array(
50
+ 'name' => 'trial_end_date',
51
+ 'label' => __( 'Trial End Date', 'woo_ce' )
52
+ );
53
+ $fields[] = array(
54
+ 'name' => 'last_payment',
55
+ 'label' => __( 'Last Payment', 'woo_ce' )
56
+ );
57
+ $fields[] = array(
58
+ 'name' => 'next_payment',
59
+ 'label' => __( 'Next Payment', 'woo_ce' )
60
+ );
61
+ $fields[] = array(
62
+ 'name' => 'renewals',
63
+ 'label' => __( 'Renewals', 'woo_ce' )
64
+ );
65
+ $fields[] = array(
66
+ 'name' => 'product_id',
67
+ 'label' => __( 'Product ID', 'woo_ce' )
68
+ );
69
+ $fields[] = array(
70
+ 'name' => 'product_sku',
71
+ 'label' => __( 'Product SKU', 'woo_ce' )
72
+ );
73
+ $fields[] = array(
74
+ 'name' => 'variation_id',
75
+ 'label' => __( 'Variation ID', 'woo_ce' )
76
+ );
77
+ $fields[] = array(
78
+ 'name' => 'coupon',
79
+ 'label' => __( 'Coupon Code', 'woo_ce' )
80
+ );
81
+ /*
82
+ $fields[] = array(
83
+ 'name' => '',
84
+ 'label' => __( '', 'woo_ce' )
85
+ );
86
+ */
87
+
88
+ // Allow Plugin/Theme authors to add support for additional Subscription columns
89
+ $fields = apply_filters( 'woo_ce_subscription_fields', $fields );
90
+
91
+ switch( $format ) {
92
+
93
+ case 'summary':
94
+ $output = array();
95
+ $size = count( $fields );
96
+ for( $i = 0; $i < $size; $i++ )
97
+ $output[$fields[$i]['name']] = 'on';
98
+ return $output;
99
+ break;
100
+
101
+ case 'full':
102
+ default:
103
+ return $fields;
104
+ break;
105
+
106
+ }
107
+
108
+ }
includes/tags.php ADDED
@@ -0,0 +1,164 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if( is_admin() ) {
3
+
4
+ /* Start of: WordPress Administration */
5
+
6
+ // HTML template for Tag Sorting widget on Store Exporter screen
7
+ function woo_ce_tag_order_sorting() {
8
+
9
+ $tag_orderby = woo_ce_get_option( 'tag_orderby', 'ID' );
10
+ $tag_order = woo_ce_get_option( 'tag_order', 'DESC' );
11
+
12
+ ob_start(); ?>
13
+ <p><label><?php _e( 'Product Tag Sorting', 'woo_ce' ); ?></label></p>
14
+ <div>
15
+ <select name="tag_orderby">
16
+ <option value="id"<?php selected( 'id', $tag_orderby ); ?>><?php _e( 'Term ID', 'woo_ce' ); ?></option>
17
+ <option value="name"<?php selected( 'name', $tag_orderby ); ?>><?php _e( 'Tag Name', 'woo_ce' ); ?></option>
18
+ </select>
19
+ <select name="tag_order">
20
+ <option value="ASC"<?php selected( 'ASC', $tag_order ); ?>><?php _e( 'Ascending', 'woo_ce' ); ?></option>
21
+ <option value="DESC"<?php selected( 'DESC', $tag_order ); ?>><?php _e( 'Descending', 'woo_ce' ); ?></option>
22
+ </select>
23
+ <p class="description"><?php _e( 'Select the sorting of Product Tags within the exported file. By default this is set to export Product Tags by Term ID in Desending order.', 'woo_ce' ); ?></p>
24
+ </div>
25
+ <?php
26
+ ob_end_flush();
27
+
28
+ }
29
+
30
+ /* End of: WordPress Administration */
31
+
32
+ }
33
+
34
+ // Returns a list of WooCommerce Product Tags to export process
35
+ function woo_ce_get_product_tags( $args = array() ) {
36
+
37
+ $term_taxonomy = 'product_tag';
38
+ $defaults = array(
39
+ 'orderby' => 'name',
40
+ 'order' => 'ASC',
41
+ 'hide_empty' => 0
42
+ );
43
+ $args = wp_parse_args( $args, $defaults );
44
+ $tags = get_terms( $term_taxonomy, $args );
45
+ if( !empty( $tags ) && is_wp_error( $tags ) == false ) {
46
+ $size = count( $tags );
47
+ for( $i = 0; $i < $size; $i++ ) {
48
+ $tags[$i]->disabled = 0;
49
+ if( $tags[$i]->count == 0 )
50
+ $tags[$i]->disabled = 1;
51
+ }
52
+ return $tags;
53
+ }
54
+
55
+ }
56
+
57
+ // Returns a list of Product Tag export columns
58
+ function woo_ce_get_tag_fields( $format = 'full' ) {
59
+
60
+ $export_type = 'tag';
61
+
62
+ $fields = array();
63
+ $fields[] = array(
64
+ 'name' => 'term_id',
65
+ 'label' => __( 'Term ID', 'woo_ce' )
66
+ );
67
+ $fields[] = array(
68
+ 'name' => 'name',
69
+ 'label' => __( 'Tag Name', 'woo_ce' )
70
+ );
71
+ $fields[] = array(
72
+ 'name' => 'slug',
73
+ 'label' => __( 'Tag Slug', 'woo_ce' )
74
+ );
75
+
76
+ /*
77
+ $fields[] = array(
78
+ 'name' => '',
79
+ 'label' => __( '', 'woo_ce' )
80
+ );
81
+ */
82
+
83
+ // Allow Plugin/Theme authors to add support for additional columns
84
+ $fields = apply_filters( 'woo_ce_' . $export_type . '_fields', $fields, $export_type );
85
+
86
+ if( $remember = woo_ce_get_option( $export_type . '_fields', array() ) ) {
87
+ $remember = maybe_unserialize( $remember );
88
+ $size = count( $fields );
89
+ for( $i = 0; $i < $size; $i++ ) {
90
+ $fields[$i]['disabled'] = ( isset( $fields[$i]['disabled'] ) ? $fields[$i]['disabled'] : 0 );
91
+ $fields[$i]['default'] = 1;
92
+ if( !array_key_exists( $fields[$i]['name'], $remember ) )
93
+ $fields[$i]['default'] = 0;
94
+ }
95
+ }
96
+
97
+ switch( $format ) {
98
+
99
+ case 'summary':
100
+ $output = array();
101
+ $size = count( $fields );
102
+ for( $i = 0; $i < $size; $i++ ) {
103
+ if( isset( $fields[$i] ) )
104
+ $output[$fields[$i]['name']] = 'on';
105
+ }
106
+ return $output;
107
+ break;
108
+
109
+ case 'full':
110
+ default:
111
+ $sorting = woo_ce_get_option( $export_type . '_sorting', array() );
112
+ $size = count( $fields );
113
+ for( $i = 0; $i < $size; $i++ )
114
+ $fields[$i]['order'] = ( isset( $sorting[$fields[$i]['name']] ) ? $sorting[$fields[$i]['name']] : $i );
115
+ usort( $fields, woo_ce_sort_fields( 'order' ) );
116
+ return $fields;
117
+ break;
118
+
119
+ }
120
+
121
+ }
122
+
123
+ function woo_ce_override_tag_field_labels( $fields = array() ) {
124
+
125
+ $labels = woo_ce_get_option( 'tag_labels', array() );
126
+ if( !empty( $labels ) ) {
127
+ foreach( $fields as $key => $field ) {
128
+ if( isset( $labels[$field['name']] ) )
129
+ $fields[$key]['label'] = $labels[$field['name']];
130
+ }
131
+ }
132
+ return $fields;
133
+
134
+ }
135
+ add_filter( 'woo_ce_tag_fields', 'woo_ce_override_tag_field_labels', 11 );
136
+
137
+ // Returns the export column header label based on an export column slug
138
+ function woo_ce_get_tag_field( $name = null, $format = 'name' ) {
139
+
140
+ $output = '';
141
+ if( $name ) {
142
+ $fields = woo_ce_get_tag_fields();
143
+ $size = count( $fields );
144
+ for( $i = 0; $i < $size; $i++ ) {
145
+ if( $fields[$i]['name'] == $name ) {
146
+ switch( $format ) {
147
+
148
+ case 'name':
149
+ $output = $fields[$i]['label'];
150
+ break;
151
+
152
+ case 'full':
153
+ $output = $fields[$i];
154
+ break;
155
+
156
+ }
157
+ $i = $size;
158
+ }
159
+ }
160
+ }
161
+ return $output;
162
+
163
+ }
164
+ ?>
includes/users.php ADDED
@@ -0,0 +1,270 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if( is_admin() ) {
3
+
4
+ /* Start of: WordPress Administration */
5
+
6
+ // HTML template for User Sorting widget on Store Exporter screen
7
+ function woo_ce_users_user_sorting() {
8
+
9
+ $orderby = woo_ce_get_option( 'user_orderby', 'ID' );
10
+ $order = woo_ce_get_option( 'user_order', 'ASC' );
11
+
12
+ ob_start(); ?>
13
+ <p><label><?php _e( 'User Sorting', 'woo_ce' ); ?></label></p>
14
+ <div>
15
+ <select name="user_orderby">
16
+ <option value="ID"<?php selected( 'ID', $orderby ); ?>><?php _e( 'User ID', 'woo_ce' ); ?></option>
17
+ <option value="display_name"<?php selected( 'display_name', $orderby ); ?>><?php _e( 'Display Name', 'woo_ce' ); ?></option>
18
+ <option value="user_name"<?php selected( 'user_name', $orderby ); ?>><?php _e( 'Name', 'woo_ce' ); ?></option>
19
+ <option value="user_login"<?php selected( 'user_login', $orderby ); ?>><?php _e( 'Username', 'woo_ce' ); ?></option>
20
+ <option value="nicename"<?php selected( 'nicename', $orderby ); ?>><?php _e( 'Nickname', 'woo_ce' ); ?></option>
21
+ <option value="email"<?php selected( 'email', $orderby ); ?>><?php _e( 'E-mail', 'woo_ce' ); ?></option>
22
+ <option value="url"<?php selected( 'url', $orderby ); ?>><?php _e( 'Website', 'woo_ce' ); ?></option>
23
+ <option value="registered"<?php selected( 'registered', $orderby ); ?>><?php _e( 'Date Registered', 'woo_ce' ); ?></option>
24
+ <option value="rand"<?php selected( 'rand', $orderby ); ?>><?php _e( 'Random', 'woo_ce' ); ?></option>
25
+ </select>
26
+ <select name="user_order">
27
+ <option value="ASC"<?php selected( 'ASC', $order ); ?>><?php _e( 'Ascending', 'woo_ce' ); ?></option>
28
+ <option value="DESC"<?php selected( 'DESC', $order ); ?>><?php _e( 'Descending', 'woo_ce' ); ?></option>
29
+ </select>
30
+ <p class="description"><?php _e( 'Select the sorting of Users within the exported file. By default this is set to export User by User ID in Desending order.', 'woo_ce' ); ?></p>
31
+ </div>
32
+ <?php
33
+ ob_end_flush();
34
+
35
+ }
36
+
37
+ /* End of: WordPress Administration */
38
+
39
+ }
40
+
41
+ // Returns a list of User export columns
42
+ function woo_ce_get_user_fields( $format = 'full' ) {
43
+
44
+ $export_type = 'user';
45
+
46
+ $fields = array();
47
+ $fields[] = array(
48
+ 'name' => 'user_id',
49
+ 'label' => __( 'User ID', 'woo_ce' )
50
+ );
51
+ $fields[] = array(
52
+ 'name' => 'user_name',
53
+ 'label' => __( 'Username', 'woo_ce' )
54
+ );
55
+ $fields[] = array(
56
+ 'name' => 'user_role',
57
+ 'label' => __( 'User Role', 'woo_ce' )
58
+ );
59
+ $fields[] = array(
60
+ 'name' => 'first_name',
61
+ 'label' => __( 'First Name', 'woo_ce' )
62
+ );
63
+ $fields[] = array(
64
+ 'name' => 'last_name',
65
+ 'label' => __( 'Last Name', 'woo_ce' )
66
+ );
67
+ $fields[] = array(
68
+ 'name' => 'full_name',
69
+ 'label' => __( 'Full Name', 'woo_ce' )
70
+ );
71
+ $fields[] = array(
72
+ 'name' => 'nick_name',
73
+ 'label' => __( 'Nickname', 'woo_ce' )
74
+ );
75
+ $fields[] = array(
76
+ 'name' => 'email',
77
+ 'label' => __( 'E-mail', 'woo_ce' )
78
+ );
79
+ $fields[] = array(
80
+ 'name' => 'url',
81
+ 'label' => __( 'Website', 'woo_ce' )
82
+ );
83
+ $fields[] = array(
84
+ 'name' => 'date_registered',
85
+ 'label' => __( 'Date Registered', 'woo_ce' )
86
+ );
87
+
88
+ /*
89
+ $fields[] = array(
90
+ 'name' => '',
91
+ 'label' => __( '', 'woo_ce' )
92
+ );
93
+ */
94
+
95
+ // Allow Plugin/Theme authors to add support for additional columns
96
+ $fields = apply_filters( 'woo_ce_' . $export_type . '_fields', $fields, $export_type );
97
+
98
+ if( $remember = woo_ce_get_option( $export_type . '_fields', array() ) ) {
99
+ $remember = maybe_unserialize( $remember );
100
+ $size = count( $fields );
101
+ for( $i = 0; $i < $size; $i++ ) {
102
+ $fields[$i]['disabled'] = ( isset( $fields[$i]['disabled'] ) ? $fields[$i]['disabled'] : 0 );
103
+ $fields[$i]['default'] = 1;
104
+ if( !array_key_exists( $fields[$i]['name'], $remember ) )
105
+ $fields[$i]['default'] = 0;
106
+ }
107
+ }
108
+
109
+ switch( $format ) {
110
+
111
+ case 'summary':
112
+ $output = array();
113
+ $size = count( $fields );
114
+ for( $i = 0; $i < $size; $i++ ) {
115
+ if( isset( $fields[$i] ) )
116
+ $output[$fields[$i]['name']] = 'on';
117
+ }
118
+ return $output;
119
+ break;
120
+
121
+ case 'full':
122
+ default:
123
+ $sorting = woo_ce_get_option( $export_type . '_sorting', array() );
124
+ $size = count( $fields );
125
+ for( $i = 0; $i < $size; $i++ )
126
+ $fields[$i]['order'] = ( isset( $sorting[$fields[$i]['name']] ) ? $sorting[$fields[$i]['name']] : $i );
127
+ usort( $fields, woo_ce_sort_fields( 'order' ) );
128
+ return $fields;
129
+ break;
130
+
131
+ }
132
+
133
+ }
134
+
135
+ function woo_ce_override_user_field_labels( $fields = array() ) {
136
+
137
+ $labels = woo_ce_get_option( 'user_labels', array() );
138
+ if( !empty( $labels ) ) {
139
+ foreach( $fields as $key => $field ) {
140
+ if( isset( $labels[$field['name']] ) )
141
+ $fields[$key]['label'] = $labels[$field['name']];
142
+ }
143
+ }
144
+ return $fields;
145
+
146
+ }
147
+ add_filter( 'woo_ce_user_fields', 'woo_ce_override_user_field_labels', 11 );
148
+
149
+ // Returns the export column header label based on an export column slug
150
+ function woo_ce_get_user_field( $name = null, $format = 'name' ) {
151
+
152
+ $output = '';
153
+ if( $name ) {
154
+ $fields = woo_ce_get_user_fields();
155
+ $size = count( $fields );
156
+ for( $i = 0; $i < $size; $i++ ) {
157
+ if( $fields[$i]['name'] == $name ) {
158
+ switch( $format ) {
159
+
160
+ case 'name':
161
+ $output = $fields[$i]['label'];
162
+ break;
163
+
164
+ case 'full':
165
+ $output = $fields[$i];
166
+ break;
167
+
168
+ }
169
+ $i = $size;
170
+ }
171
+ }
172
+ }
173
+ return $output;
174
+
175
+ }
176
+
177
+ // Adds custom User columns to the User fields list
178
+ function woo_ce_extend_user_fields( $fields = array() ) {
179
+
180
+ if( class_exists( 'WC_Admin_Profile' ) ) {
181
+ $admin_profile = new WC_Admin_Profile();
182
+ $show_fields = $admin_profile->get_customer_meta_fields();
183
+ foreach( $show_fields as $fieldset ) {
184
+ foreach( $fieldset['fields'] as $key => $field ) {
185
+ $fields[] = array(
186
+ 'name' => $key,
187
+ 'label' => sprintf( '%s: %s', $fieldset['title'], esc_html( $field['label'] ) ),
188
+ 'disabled' => 1
189
+ );
190
+ }
191
+ }
192
+ unset( $show_fields, $fieldset, $field );
193
+ }
194
+ return $fields;
195
+
196
+ }
197
+ add_filter( 'woo_ce_user_fields', 'woo_ce_extend_user_fields' );
198
+
199
+ // Returns a list of User IDs
200
+ function woo_ce_get_users( $args = array() ) {
201
+
202
+ global $export;
203
+
204
+ $limit_volume = 0;
205
+ $offset = 0;
206
+ $orderby = 'login';
207
+ $order = 'ASC';
208
+
209
+ if( $args ) {
210
+ $limit_volume = ( isset( $args['limit_volume'] ) ? $args['limit_volume'] : 0 );
211
+ if( $limit_volume == -1 )
212
+ $limit_volume = 0;
213
+ $offset = ( isset( $args['offset'] ) ? $args['offset'] : 0 );
214
+ $orderby = ( isset( $args['user_orderby'] ) ? $args['user_orderby'] : 'login' );
215
+ $order = ( isset( $args['user_order'] ) ? $args['user_order'] : 'ASC' );
216
+ }
217
+ $args = array(
218
+ 'offset' => $offset,
219
+ 'number' => $limit_volume,
220
+ 'order' => $order,
221
+ 'offset' => $offset,
222
+ 'fields' => 'ids'
223
+ );
224
+ if( $user_ids = new WP_User_Query( $args ) ) {
225
+ $users = array();
226
+ $export->total_rows = $user_ids->total_users;
227
+ foreach( $user_ids->results as $user_id )
228
+ $users[] = $user_id;
229
+ return $users;
230
+ }
231
+
232
+ }
233
+
234
+ function woo_ce_get_user_data( $user_id = 0, $args = array() ) {
235
+
236
+ $defaults = array();
237
+ $args = wp_parse_args( $args, $defaults );
238
+
239
+ // Get User details
240
+ $user_data = get_userdata( $user_id );
241
+
242
+ $user = new stdClass;
243
+ if( $user_data !== false ) {
244
+ $user->ID = $user_data->ID;
245
+ $user->user_id = $user_data->ID;
246
+ $user->user_name = $user_data->user_login;
247
+ $user->user_role = $user_data->roles[0];
248
+ $user->first_name = $user_data->first_name;
249
+ $user->last_name = $user_data->last_name;
250
+ $user->full_name = sprintf( '%s %s', $user->first_name, $user->last_name );
251
+ $user->nick_name = $user_data->user_nicename;
252
+ $user->email = $user_data->user_email;
253
+ $user->url = $user_data->user_url;
254
+ $user->date_registered = $user_data->user_registered;
255
+ }
256
+ return apply_filters( 'woo_ce_user', $user );
257
+
258
+ }
259
+
260
+ // Returns a list of WordPress User Roles
261
+ function woo_ce_get_user_roles() {
262
+
263
+ global $wp_roles;
264
+
265
+ $user_roles = $wp_roles->roles;
266
+ return $user_roles;
267
+
268
+ }
269
+
270
+ ?>
js/jquery-ui.js ADDED
@@ -0,0 +1,48 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*!
2
+ * jQuery UI 1.8.16
3
+ */
4
+ (function(c,j){function k(a,b){var d=a.nodeName.toLowerCase();if("area"===d){b=a.parentNode;d=b.name;if(!a.href||!d||b.nodeName.toLowerCase()!=="map")return false;a=c("img[usemap=#"+d+"]")[0];return!!a&&l(a)}return(/input|select|textarea|button|object/.test(d)?!a.disabled:"a"==d?a.href||b:b)&&l(a)}function l(a){return!c(a).parents().andSelf().filter(function(){return c.curCSS(this,"visibility")==="hidden"||c.expr.filters.hidden(this)}).length}c.ui=c.ui||{};if(!c.ui.version){c.extend(c.ui,{version:"1.8.16",
5
+ keyCode:{ALT:18,BACKSPACE:8,CAPS_LOCK:20,COMMA:188,COMMAND:91,COMMAND_LEFT:91,COMMAND_RIGHT:93,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,MENU:93,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38,WINDOWS:91}});c.fn.extend({propAttr:c.fn.prop||c.fn.attr,_focus:c.fn.focus,focus:function(a,b){return typeof a==="number"?this.each(function(){var d=
6
+ this;setTimeout(function(){c(d).focus();b&&b.call(d)},a)}):this._focus.apply(this,arguments)},scrollParent:function(){var a;a=c.browser.msie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position"))?this.parents().filter(function(){return/(relative|absolute|fixed)/.test(c.curCSS(this,"position",1))&&/(auto|scroll)/.test(c.curCSS(this,"overflow",1)+c.curCSS(this,"overflow-y",1)+c.curCSS(this,"overflow-x",1))}).eq(0):this.parents().filter(function(){return/(auto|scroll)/.test(c.curCSS(this,
7
+ "overflow",1)+c.curCSS(this,"overflow-y",1)+c.curCSS(this,"overflow-x",1))}).eq(0);return/fixed/.test(this.css("position"))||!a.length?c(document):a},zIndex:function(a){if(a!==j)return this.css("zIndex",a);if(this.length){a=c(this[0]);for(var b;a.length&&a[0]!==document;){b=a.css("position");if(b==="absolute"||b==="relative"||b==="fixed"){b=parseInt(a.css("zIndex"),10);if(!isNaN(b)&&b!==0)return b}a=a.parent()}}return 0},disableSelection:function(){return this.bind((c.support.selectstart?"selectstart":
8
+ "mousedown")+".ui-disableSelection",function(a){a.preventDefault()})},enableSelection:function(){return this.unbind(".ui-disableSelection")}});c.each(["Width","Height"],function(a,b){function d(f,g,m,n){c.each(e,function(){g-=parseFloat(c.curCSS(f,"padding"+this,true))||0;if(m)g-=parseFloat(c.curCSS(f,"border"+this+"Width",true))||0;if(n)g-=parseFloat(c.curCSS(f,"margin"+this,true))||0});return g}var e=b==="Width"?["Left","Right"]:["Top","Bottom"],h=b.toLowerCase(),i={innerWidth:c.fn.innerWidth,innerHeight:c.fn.innerHeight,
9
+ outerWidth:c.fn.outerWidth,outerHeight:c.fn.outerHeight};c.fn["inner"+b]=function(f){if(f===j)return i["inner"+b].call(this);return this.each(function(){c(this).css(h,d(this,f)+"px")})};c.fn["outer"+b]=function(f,g){if(typeof f!=="number")return i["outer"+b].call(this,f);return this.each(function(){c(this).css(h,d(this,f,true,g)+"px")})}});c.extend(c.expr[":"],{data:function(a,b,d){return!!c.data(a,d[3])},focusable:function(a){return k(a,!isNaN(c.attr(a,"tabindex")))},tabbable:function(a){var b=c.attr(a,
10
+ "tabindex"),d=isNaN(b);return(d||b>=0)&&k(a,!d)}});c(function(){var a=document.body,b=a.appendChild(b=document.createElement("div"));c.extend(b.style,{minHeight:"100px",height:"auto",padding:0,borderWidth:0});c.support.minHeight=b.offsetHeight===100;c.support.selectstart="onselectstart"in b;a.removeChild(b).style.display="none"});c.extend(c.ui,{plugin:{add:function(a,b,d){a=c.ui[a].prototype;for(var e in d){a.plugins[e]=a.plugins[e]||[];a.plugins[e].push([b,d[e]])}},call:function(a,b,d){if((b=a.plugins[b])&&
11
+ a.element[0].parentNode)for(var e=0;e<b.length;e++)a.options[b[e][0]]&&b[e][1].apply(a.element,d)}},contains:function(a,b){return document.compareDocumentPosition?a.compareDocumentPosition(b)&16:a!==b&&a.contains(b)},hasScroll:function(a,b){if(c(a).css("overflow")==="hidden")return false;b=b&&b==="left"?"scrollLeft":"scrollTop";var d=false;if(a[b]>0)return true;a[b]=1;d=a[b]>0;a[b]=0;return d},isOverAxis:function(a,b,d){return a>b&&a<b+d},isOver:function(a,b,d,e,h,i){return c.ui.isOverAxis(a,d,h)&&
12
+ c.ui.isOverAxis(b,e,i)}})}})(jQuery);
13
+ ;
14
+
15
+ (function(b,j){if(b.cleanData){var k=b.cleanData;b.cleanData=function(a){for(var c=0,d;(d=a[c])!=null;c++)try{b(d).triggerHandler("remove")}catch(e){}k(a)}}else{var l=b.fn.remove;b.fn.remove=function(a,c){return this.each(function(){if(!c)if(!a||b.filter(a,[this]).length)b("*",this).add([this]).each(function(){try{b(this).triggerHandler("remove")}catch(d){}});return l.call(b(this),a,c)})}}b.widget=function(a,c,d){var e=a.split(".")[0],f;a=a.split(".")[1];f=e+"-"+a;if(!d){d=c;c=b.Widget}b.expr[":"][f]=
16
+ function(h){return!!b.data(h,a)};b[e]=b[e]||{};b[e][a]=function(h,g){arguments.length&&this._createWidget(h,g)};c=new c;c.options=b.extend(true,{},c.options);b[e][a].prototype=b.extend(true,c,{namespace:e,widgetName:a,widgetEventPrefix:b[e][a].prototype.widgetEventPrefix||a,widgetBaseClass:f},d);b.widget.bridge(a,b[e][a])};b.widget.bridge=function(a,c){b.fn[a]=function(d){var e=typeof d==="string",f=Array.prototype.slice.call(arguments,1),h=this;d=!e&&f.length?b.extend.apply(null,[true,d].concat(f)):
17
+ d;if(e&&d.charAt(0)==="_")return h;e?this.each(function(){var g=b.data(this,a),i=g&&b.isFunction(g[d])?g[d].apply(g,f):g;if(i!==g&&i!==j){h=i;return false}}):this.each(function(){var g=b.data(this,a);g?g.option(d||{})._init():b.data(this,a,new c(d,this))});return h}};b.Widget=function(a,c){arguments.length&&this._createWidget(a,c)};b.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",options:{disabled:false},_createWidget:function(a,c){b.data(c,this.widgetName,this);this.element=b(c);this.options=
18
+ b.extend(true,{},this.options,this._getCreateOptions(),a);var d=this;this.element.bind("remove."+this.widgetName,function(){d.destroy()});this._create();this._trigger("create");this._init()},_getCreateOptions:function(){return b.metadata&&b.metadata.get(this.element[0])[this.widgetName]},_create:function(){},_init:function(){},destroy:function(){this.element.unbind("."+this.widgetName).removeData(this.widgetName);this.widget().unbind("."+this.widgetName).removeAttr("aria-disabled").removeClass(this.widgetBaseClass+
19
+ "-disabled ui-state-disabled")},widget:function(){return this.element},option:function(a,c){var d=a;if(arguments.length===0)return b.extend({},this.options);if(typeof a==="string"){if(c===j)return this.options[a];d={};d[a]=c}this._setOptions(d);return this},_setOptions:function(a){var c=this;b.each(a,function(d,e){c._setOption(d,e)});return this},_setOption:function(a,c){this.options[a]=c;if(a==="disabled")this.widget()[c?"addClass":"removeClass"](this.widgetBaseClass+"-disabled ui-state-disabled").attr("aria-disabled",
20
+ c);return this},enable:function(){return this._setOption("disabled",false)},disable:function(){return this._setOption("disabled",true)},_trigger:function(a,c,d){var e=this.options[a];c=b.Event(c);c.type=(a===this.widgetEventPrefix?a:this.widgetEventPrefix+a).toLowerCase();d=d||{};if(c.originalEvent){a=b.event.props.length;for(var f;a;){f=b.event.props[--a];c[f]=c.originalEvent[f]}}this.element.trigger(c,d);return!(b.isFunction(e)&&e.call(this.element[0],c,d)===false||c.isDefaultPrevented())}}})(jQuery);
21
+ ;
22
+
23
+ (function(b){var d=false;b(document).mouseup(function(){d=false});b.widget("ui.mouse",{options:{cancel:":input,option",distance:1,delay:0},_mouseInit:function(){var a=this;this.element.bind("mousedown."+this.widgetName,function(c){return a._mouseDown(c)}).bind("click."+this.widgetName,function(c){if(true===b.data(c.target,a.widgetName+".preventClickEvent")){b.removeData(c.target,a.widgetName+".preventClickEvent");c.stopImmediatePropagation();return false}});this.started=false},_mouseDestroy:function(){this.element.unbind("."+
24
+ this.widgetName)},_mouseDown:function(a){if(!d){this._mouseStarted&&this._mouseUp(a);this._mouseDownEvent=a;var c=this,f=a.which==1,g=typeof this.options.cancel=="string"&&a.target.nodeName?b(a.target).closest(this.options.cancel).length:false;if(!f||g||!this._mouseCapture(a))return true;this.mouseDelayMet=!this.options.delay;if(!this.mouseDelayMet)this._mouseDelayTimer=setTimeout(function(){c.mouseDelayMet=true},this.options.delay);if(this._mouseDistanceMet(a)&&this._mouseDelayMet(a)){this._mouseStarted=
25
+ this._mouseStart(a)!==false;if(!this._mouseStarted){a.preventDefault();return true}}true===b.data(a.target,this.widgetName+".preventClickEvent")&&b.removeData(a.target,this.widgetName+".preventClickEvent");this._mouseMoveDelegate=function(e){return c._mouseMove(e)};this._mouseUpDelegate=function(e){return c._mouseUp(e)};b(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate);a.preventDefault();return d=true}},_mouseMove:function(a){if(b.browser.msie&&
26
+ !(document.documentMode>=9)&&!a.button)return this._mouseUp(a);if(this._mouseStarted){this._mouseDrag(a);return a.preventDefault()}if(this._mouseDistanceMet(a)&&this._mouseDelayMet(a))(this._mouseStarted=this._mouseStart(this._mouseDownEvent,a)!==false)?this._mouseDrag(a):this._mouseUp(a);return!this._mouseStarted},_mouseUp:function(a){b(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate);if(this._mouseStarted){this._mouseStarted=
27
+ false;a.target==this._mouseDownEvent.target&&b.data(a.target,this.widgetName+".preventClickEvent",true);this._mouseStop(a)}return false},_mouseDistanceMet:function(a){return Math.max(Math.abs(this._mouseDownEvent.pageX-a.pageX),Math.abs(this._mouseDownEvent.pageY-a.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return true}})})(jQuery);
28
+ ;
29
+
30
+ (function(d){d.widget("ui.slider",d.ui.mouse,{widgetEventPrefix:"slide",options:{animate:false,distance:0,max:100,min:0,orientation:"horizontal",range:false,step:1,value:0,values:null},_create:function(){var a=this,b=this.options,c=this.element.find(".ui-slider-handle").addClass("ui-state-default ui-corner-all"),f=b.values&&b.values.length||1,e=[];this._mouseSliding=this._keySliding=false;this._animateOff=true;this._handleIndex=null;this._detectOrientation();this._mouseInit();this.element.addClass("ui-slider ui-slider-"+
31
+ this.orientation+" ui-widget ui-widget-content ui-corner-all"+(b.disabled?" ui-slider-disabled ui-disabled":""));this.range=d([]);if(b.range){if(b.range===true){if(!b.values)b.values=[this._valueMin(),this._valueMin()];if(b.values.length&&b.values.length!==2)b.values=[b.values[0],b.values[0]]}this.range=d("<div></div>").appendTo(this.element).addClass("ui-slider-range ui-widget-header"+(b.range==="min"||b.range==="max"?" ui-slider-range-"+b.range:""))}for(var j=c.length;j<f;j+=1)e.push("<a class='ui-slider-handle ui-state-default ui-corner-all' href='#'></a>");
32
+ this.handles=c.add(d(e.join("")).appendTo(a.element));this.handle=this.handles.eq(0);this.handles.add(this.range).filter("a").click(function(g){g.preventDefault()}).hover(function(){b.disabled||d(this).addClass("ui-state-hover")},function(){d(this).removeClass("ui-state-hover")}).focus(function(){if(b.disabled)d(this).blur();else{d(".ui-slider .ui-state-focus").removeClass("ui-state-focus");d(this).addClass("ui-state-focus")}}).blur(function(){d(this).removeClass("ui-state-focus")});this.handles.each(function(g){d(this).data("index.ui-slider-handle",
33
+ g)});this.handles.keydown(function(g){var k=true,l=d(this).data("index.ui-slider-handle"),i,h,m;if(!a.options.disabled){switch(g.keyCode){case d.ui.keyCode.HOME:case d.ui.keyCode.END:case d.ui.keyCode.PAGE_UP:case d.ui.keyCode.PAGE_DOWN:case d.ui.keyCode.UP:case d.ui.keyCode.RIGHT:case d.ui.keyCode.DOWN:case d.ui.keyCode.LEFT:k=false;if(!a._keySliding){a._keySliding=true;d(this).addClass("ui-state-active");i=a._start(g,l);if(i===false)return}break}m=a.options.step;i=a.options.values&&a.options.values.length?
34
+ (h=a.values(l)):(h=a.value());switch(g.keyCode){case d.ui.keyCode.HOME:h=a._valueMin();break;case d.ui.keyCode.END:h=a._valueMax();break;case d.ui.keyCode.PAGE_UP:h=a._trimAlignValue(i+(a._valueMax()-a._valueMin())/5);break;case d.ui.keyCode.PAGE_DOWN:h=a._trimAlignValue(i-(a._valueMax()-a._valueMin())/5);break;case d.ui.keyCode.UP:case d.ui.keyCode.RIGHT:if(i===a._valueMax())return;h=a._trimAlignValue(i+m);break;case d.ui.keyCode.DOWN:case d.ui.keyCode.LEFT:if(i===a._valueMin())return;h=a._trimAlignValue(i-
35
+ m);break}a._slide(g,l,h);return k}}).keyup(function(g){var k=d(this).data("index.ui-slider-handle");if(a._keySliding){a._keySliding=false;a._stop(g,k);a._change(g,k);d(this).removeClass("ui-state-active")}});this._refreshValue();this._animateOff=false},destroy:function(){this.handles.remove();this.range.remove();this.element.removeClass("ui-slider ui-slider-horizontal ui-slider-vertical ui-slider-disabled ui-widget ui-widget-content ui-corner-all").removeData("slider").unbind(".slider");this._mouseDestroy();
36
+ return this},_mouseCapture:function(a){var b=this.options,c,f,e,j,g;if(b.disabled)return false;this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()};this.elementOffset=this.element.offset();c=this._normValueFromMouse({x:a.pageX,y:a.pageY});f=this._valueMax()-this._valueMin()+1;j=this;this.handles.each(function(k){var l=Math.abs(c-j.values(k));if(f>l){f=l;e=d(this);g=k}});if(b.range===true&&this.values(1)===b.min){g+=1;e=d(this.handles[g])}if(this._start(a,g)===false)return false;
37
+ this._mouseSliding=true;j._handleIndex=g;e.addClass("ui-state-active").focus();b=e.offset();this._clickOffset=!d(a.target).parents().andSelf().is(".ui-slider-handle")?{left:0,top:0}:{left:a.pageX-b.left-e.width()/2,top:a.pageY-b.top-e.height()/2-(parseInt(e.css("borderTopWidth"),10)||0)-(parseInt(e.css("borderBottomWidth"),10)||0)+(parseInt(e.css("marginTop"),10)||0)};this.handles.hasClass("ui-state-hover")||this._slide(a,g,c);return this._animateOff=true},_mouseStart:function(){return true},_mouseDrag:function(a){var b=
38
+ this._normValueFromMouse({x:a.pageX,y:a.pageY});this._slide(a,this._handleIndex,b);return false},_mouseStop:function(a){this.handles.removeClass("ui-state-active");this._mouseSliding=false;this._stop(a,this._handleIndex);this._change(a,this._handleIndex);this._clickOffset=this._handleIndex=null;return this._animateOff=false},_detectOrientation:function(){this.orientation=this.options.orientation==="vertical"?"vertical":"horizontal"},_normValueFromMouse:function(a){var b;if(this.orientation==="horizontal"){b=
39
+ this.elementSize.width;a=a.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)}else{b=this.elementSize.height;a=a.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)}b=a/b;if(b>1)b=1;if(b<0)b=0;if(this.orientation==="vertical")b=1-b;a=this._valueMax()-this._valueMin();return this._trimAlignValue(this._valueMin()+b*a)},_start:function(a,b){var c={handle:this.handles[b],value:this.value()};if(this.options.values&&this.options.values.length){c.value=this.values(b);
40
+ c.values=this.values()}return this._trigger("start",a,c)},_slide:function(a,b,c){var f;if(this.options.values&&this.options.values.length){f=this.values(b?0:1);if(this.options.values.length===2&&this.options.range===true&&(b===0&&c>f||b===1&&c<f))c=f;if(c!==this.values(b)){f=this.values();f[b]=c;a=this._trigger("slide",a,{handle:this.handles[b],value:c,values:f});this.values(b?0:1);a!==false&&this.values(b,c,true)}}else if(c!==this.value()){a=this._trigger("slide",a,{handle:this.handles[b],value:c});
41
+ a!==false&&this.value(c)}},_stop:function(a,b){var c={handle:this.handles[b],value:this.value()};if(this.options.values&&this.options.values.length){c.value=this.values(b);c.values=this.values()}this._trigger("stop",a,c)},_change:function(a,b){if(!this._keySliding&&!this._mouseSliding){var c={handle:this.handles[b],value:this.value()};if(this.options.values&&this.options.values.length){c.value=this.values(b);c.values=this.values()}this._trigger("change",a,c)}},value:function(a){if(arguments.length){this.options.value=
42
+ this._trimAlignValue(a);this._refreshValue();this._change(null,0)}else return this._value()},values:function(a,b){var c,f,e;if(arguments.length>1){this.options.values[a]=this._trimAlignValue(b);this._refreshValue();this._change(null,a)}else if(arguments.length)if(d.isArray(arguments[0])){c=this.options.values;f=arguments[0];for(e=0;e<c.length;e+=1){c[e]=this._trimAlignValue(f[e]);this._change(null,e)}this._refreshValue()}else return this.options.values&&this.options.values.length?this._values(a):
43
+ this.value();else return this._values()},_setOption:function(a,b){var c,f=0;if(d.isArray(this.options.values))f=this.options.values.length;d.Widget.prototype._setOption.apply(this,arguments);switch(a){case "disabled":if(b){this.handles.filter(".ui-state-focus").blur();this.handles.removeClass("ui-state-hover");this.handles.propAttr("disabled",true);this.element.addClass("ui-disabled")}else{this.handles.propAttr("disabled",false);this.element.removeClass("ui-disabled")}break;case "orientation":this._detectOrientation();
44
+ this.element.removeClass("ui-slider-horizontal ui-slider-vertical").addClass("ui-slider-"+this.orientation);this._refreshValue();break;case "value":this._animateOff=true;this._refreshValue();this._change(null,0);this._animateOff=false;break;case "values":this._animateOff=true;this._refreshValue();for(c=0;c<f;c+=1)this._change(null,c);this._animateOff=false;break}},_value:function(){var a=this.options.value;return a=this._trimAlignValue(a)},_values:function(a){var b,c;if(arguments.length){b=this.options.values[a];
45
+ return b=this._trimAlignValue(b)}else{b=this.options.values.slice();for(c=0;c<b.length;c+=1)b[c]=this._trimAlignValue(b[c]);return b}},_trimAlignValue:function(a){if(a<=this._valueMin())return this._valueMin();if(a>=this._valueMax())return this._valueMax();var b=this.options.step>0?this.options.step:1,c=(a-this._valueMin())%b;a=a-c;if(Math.abs(c)*2>=b)a+=c>0?b:-b;return parseFloat(a.toFixed(5))},_valueMin:function(){return this.options.min},_valueMax:function(){return this.options.max},_refreshValue:function(){var a=
46
+ this.options.range,b=this.options,c=this,f=!this._animateOff?b.animate:false,e,j={},g,k,l,i;if(this.options.values&&this.options.values.length)this.handles.each(function(h){e=(c.values(h)-c._valueMin())/(c._valueMax()-c._valueMin())*100;j[c.orientation==="horizontal"?"left":"bottom"]=e+"%";d(this).stop(1,1)[f?"animate":"css"](j,b.animate);if(c.options.range===true)if(c.orientation==="horizontal"){if(h===0)c.range.stop(1,1)[f?"animate":"css"]({left:e+"%"},b.animate);if(h===1)c.range[f?"animate":"css"]({width:e-
47
+ g+"%"},{queue:false,duration:b.animate})}else{if(h===0)c.range.stop(1,1)[f?"animate":"css"]({bottom:e+"%"},b.animate);if(h===1)c.range[f?"animate":"css"]({height:e-g+"%"},{queue:false,duration:b.animate})}g=e});else{k=this.value();l=this._valueMin();i=this._valueMax();e=i!==l?(k-l)/(i-l)*100:0;j[c.orientation==="horizontal"?"left":"bottom"]=e+"%";this.handle.stop(1,1)[f?"animate":"css"](j,b.animate);if(a==="min"&&this.orientation==="horizontal")this.range.stop(1,1)[f?"animate":"css"]({width:e+"%"},
48
+ b.animate);if(a==="max"&&this.orientation==="horizontal")this.range[f?"animate":"css"]({width:100-e+"%"},{queue:false,duration:b.animate});if(a==="min"&&this.orientation==="vertical")this.range.stop(1,1)[f?"animate":"css"]({height:e+"%"},b.animate);if(a==="max"&&this.orientation==="vertical")this.range[f?"animate":"css"]({height:100-e+"%"},{queue:false,duration:b.animate})}}});d.extend(d.ui.slider,{version:"1.8.16"})})(jQuery);
js/jquery.chosen.js ADDED
@@ -0,0 +1,988 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // Chosen, a Select Box Enhancer for jQuery and Protoype
2
+ // by Patrick Filler for Harvest, http://getharvest.com
3
+ //
4
+ // Version 0.9.8
5
+ // Full source at https://github.com/harvesthq/chosen
6
+ // Copyright (c) 2011 Harvest http://getharvest.com
7
+
8
+ // MIT License, https://github.com/harvesthq/chosen/blob/master/LICENSE.md
9
+ // This file is generated by `cake build`, do not edit it by hand.
10
+ (function() {
11
+ var SelectParser;
12
+
13
+ SelectParser = (function() {
14
+
15
+ function SelectParser() {
16
+ this.options_index = 0;
17
+ this.parsed = [];
18
+ }
19
+
20
+ SelectParser.prototype.add_node = function(child) {
21
+ if (child.nodeName === "OPTGROUP") {
22
+ return this.add_group(child);
23
+ } else {
24
+ return this.add_option(child);
25
+ }
26
+ };
27
+
28
+ SelectParser.prototype.add_group = function(group) {
29
+ var group_position, option, _i, _len, _ref, _results;
30
+ group_position = this.parsed.length;
31
+ this.parsed.push({
32
+ array_index: group_position,
33
+ group: true,
34
+ label: group.label,
35
+ children: 0,
36
+ disabled: group.disabled
37
+ });
38
+ _ref = group.childNodes;
39
+ _results = [];
40
+ for (_i = 0, _len = _ref.length; _i < _len; _i++) {
41
+ option = _ref[_i];
42
+ _results.push(this.add_option(option, group_position, group.disabled));
43
+ }
44
+ return _results;
45
+ };
46
+
47
+ SelectParser.prototype.add_option = function(option, group_position, group_disabled) {
48
+ if (option.nodeName === "OPTION") {
49
+ if (option.text !== "") {
50
+ if (group_position != null) this.parsed[group_position].children += 1;
51
+ this.parsed.push({
52
+ array_index: this.parsed.length,
53
+ options_index: this.options_index,
54
+ value: option.value,
55
+ text: option.text,
56
+ html: option.innerHTML,
57
+ selected: option.selected,
58
+ disabled: group_disabled === true ? group_disabled : option.disabled,
59
+ group_array_index: group_position,
60
+ classes: option.className,
61
+ style: option.style.cssText
62
+ });
63
+ } else {
64
+ this.parsed.push({
65
+ array_index: this.parsed.length,
66
+ options_index: this.options_index,
67
+ empty: true
68
+ });
69
+ }
70
+ return this.options_index += 1;
71
+ }
72
+ };
73
+
74
+ return SelectParser;
75
+
76
+ })();
77
+
78
+ SelectParser.select_to_array = function(select) {
79
+ var child, parser, _i, _len, _ref;
80
+ parser = new SelectParser();
81
+ _ref = select.childNodes;
82
+ for (_i = 0, _len = _ref.length; _i < _len; _i++) {
83
+ child = _ref[_i];
84
+ parser.add_node(child);
85
+ }
86
+ return parser.parsed;
87
+ };
88
+
89
+ this.SelectParser = SelectParser;
90
+
91
+ }).call(this);
92
+
93
+ /*
94
+ Chosen source: generate output using 'cake build'
95
+ Copyright (c) 2011 by Harvest
96
+ */
97
+
98
+ (function() {
99
+ var AbstractChosen, root;
100
+
101
+ root = this;
102
+
103
+ AbstractChosen = (function() {
104
+
105
+ function AbstractChosen(form_field, options) {
106
+ this.form_field = form_field;
107
+ this.options = options != null ? options : {};
108
+ this.set_default_values();
109
+ this.is_multiple = this.form_field.multiple;
110
+ this.set_default_text();
111
+ this.setup();
112
+ this.set_up_html();
113
+ this.register_observers();
114
+ this.finish_setup();
115
+ }
116
+
117
+ AbstractChosen.prototype.set_default_values = function() {
118
+ var _this = this;
119
+ this.click_test_action = function(evt) {
120
+ return _this.test_active_click(evt);
121
+ };
122
+ this.activate_action = function(evt) {
123
+ return _this.activate_field(evt);
124
+ };
125
+ this.active_field = false;
126
+ this.mouse_on_container = false;
127
+ this.results_showing = false;
128
+ this.result_highlighted = null;
129
+ this.result_single_selected = null;
130
+ this.allow_single_deselect = (this.options.allow_single_deselect != null) && (this.form_field.options[0] != null) && this.form_field.options[0].text === "" ? this.options.allow_single_deselect : false;
131
+ this.disable_search_threshold = this.options.disable_search_threshold || 0;
132
+ this.search_contains = this.options.search_contains || false;
133
+ this.choices = 0;
134
+ return this.max_selected_options = this.options.max_selected_options || Infinity;
135
+ };
136
+
137
+ AbstractChosen.prototype.set_default_text = function() {
138
+ if (this.form_field.getAttribute("data-placeholder")) {
139
+ this.default_text = this.form_field.getAttribute("data-placeholder");
140
+ } else if (this.is_multiple) {
141
+ this.default_text = this.options.placeholder_text_multiple || this.options.placeholder_text || "Select Some Options";
142
+ } else {
143
+ this.default_text = this.options.placeholder_text_single || this.options.placeholder_text || "Select an Option";
144
+ }
145
+ return this.results_none_found = this.form_field.getAttribute("data-no_results_text") || this.options.no_results_text || "No results match";
146
+ };
147
+
148
+ AbstractChosen.prototype.mouse_enter = function() {
149
+ return this.mouse_on_container = true;
150
+ };
151
+
152
+ AbstractChosen.prototype.mouse_leave = function() {
153
+ return this.mouse_on_container = false;
154
+ };
155
+
156
+ AbstractChosen.prototype.input_focus = function(evt) {
157
+ var _this = this;
158
+ if (!this.active_field) {
159
+ return setTimeout((function() {
160
+ return _this.container_mousedown();
161
+ }), 50);
162
+ }
163
+ };
164
+
165
+ AbstractChosen.prototype.input_blur = function(evt) {
166
+ var _this = this;
167
+ if (!this.mouse_on_container) {
168
+ this.active_field = false;
169
+ return setTimeout((function() {
170
+ return _this.blur_test();
171
+ }), 100);
172
+ }
173
+ };
174
+
175
+ AbstractChosen.prototype.result_add_option = function(option) {
176
+ var classes, style;
177
+ if (!option.disabled) {
178
+ option.dom_id = this.container_id + "_o_" + option.array_index;
179
+ classes = option.selected && this.is_multiple ? [] : ["active-result"];
180
+ if (option.selected) classes.push("result-selected");
181
+ if (option.group_array_index != null) classes.push("group-option");
182
+ if (option.classes !== "") classes.push(option.classes);
183
+ style = option.style.cssText !== "" ? " style=\"" + option.style + "\"" : "";
184
+ return '<li id="' + option.dom_id + '" class="' + classes.join(' ') + '"' + style + '>' + option.html + '</li>';
185
+ } else {
186
+ return "";
187
+ }
188
+ };
189
+
190
+ AbstractChosen.prototype.results_update_field = function() {
191
+ this.results_reset();
192
+ this.result_clear_highlight();
193
+ this.result_single_selected = null;
194
+ return this.results_build();
195
+ };
196
+
197
+ AbstractChosen.prototype.results_toggle = function() {
198
+ if (this.results_showing) {
199
+ return this.results_hide();
200
+ } else {
201
+ return this.results_show();
202
+ }
203
+ };
204
+
205
+ AbstractChosen.prototype.results_search = function(evt) {
206
+ if (this.results_showing) {
207
+ return this.winnow_results();
208
+ } else {
209
+ return this.results_show();
210
+ }
211
+ };
212
+
213
+ AbstractChosen.prototype.keyup_checker = function(evt) {
214
+ var stroke, _ref;
215
+ stroke = (_ref = evt.which) != null ? _ref : evt.keyCode;
216
+ this.search_field_scale();
217
+ switch (stroke) {
218
+ case 8:
219
+ if (this.is_multiple && this.backstroke_length < 1 && this.choices > 0) {
220
+ return this.keydown_backstroke();
221
+ } else if (!this.pending_backstroke) {
222
+ this.result_clear_highlight();
223
+ return this.results_search();
224
+ }
225
+ break;
226
+ case 13:
227
+ evt.preventDefault();
228
+ if (this.results_showing) return this.result_select(evt);
229
+ break;
230
+ case 27:
231
+ if (this.results_showing) this.results_hide();
232
+ return true;
233
+ case 9:
234
+ case 38:
235
+ case 40:
236
+ case 16:
237
+ case 91:
238
+ case 17:
239
+ break;
240
+ default:
241
+ return this.results_search();
242
+ }
243
+ };
244
+
245
+ AbstractChosen.prototype.generate_field_id = function() {
246
+ var new_id;
247
+ new_id = this.generate_random_id();
248
+ this.form_field.id = new_id;
249
+ return new_id;
250
+ };
251
+
252
+ AbstractChosen.prototype.generate_random_char = function() {
253
+ var chars, newchar, rand;
254
+ chars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
255
+ rand = Math.floor(Math.random() * chars.length);
256
+ return newchar = chars.substring(rand, rand + 1);
257
+ };
258
+
259
+ return AbstractChosen;
260
+
261
+ })();
262
+
263
+ root.AbstractChosen = AbstractChosen;
264
+
265
+ }).call(this);
266
+
267
+ /*
268
+ Chosen source: generate output using 'cake build'
269
+ Copyright (c) 2011 by Harvest
270
+ */
271
+
272
+ (function() {
273
+ var $, Chosen, get_side_border_padding, root,
274
+ __hasProp = Object.prototype.hasOwnProperty,
275
+ __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor; child.__super__ = parent.prototype; return child; };
276
+
277
+ root = this;
278
+
279
+ $ = jQuery;
280
+
281
+ $.fn.extend({
282
+ chosen: function(options) {
283
+ if ($.browser.msie && ($.browser.version === "6.0" || $.browser.version === "7.0")) {
284
+ return this;
285
+ }
286
+ return this.each(function(input_field) {
287
+ var $this;
288
+ $this = $(this);
289
+ if (!$this.hasClass("chzn-done")) {
290
+ return $this.data('chosen', new Chosen(this, options));
291
+ }
292
+ });
293
+ }
294
+ });
295
+
296
+ Chosen = (function(_super) {
297
+
298
+ __extends(Chosen, _super);
299
+
300
+ function Chosen() {
301
+ Chosen.__super__.constructor.apply(this, arguments);
302
+ }
303
+
304
+ Chosen.prototype.setup = function() {
305
+ this.form_field_jq = $(this.form_field);
306
+ return this.is_rtl = this.form_field_jq.hasClass("chzn-rtl");
307
+ };
308
+
309
+ Chosen.prototype.finish_setup = function() {
310
+ return this.form_field_jq.addClass("chzn-done");
311
+ };
312
+
313
+ Chosen.prototype.set_up_html = function() {
314
+ var container_div, dd_top, dd_width, sf_width;
315
+ this.container_id = this.form_field.id.length ? this.form_field.id.replace(/[^\w]/g, '_') : this.generate_field_id();
316
+ this.container_id += "_chzn";
317
+ this.f_width = this.form_field_jq.outerWidth();
318
+ container_div = $("<div />", {
319
+ id: this.container_id,
320
+ "class": "chzn-container" + (this.is_rtl ? ' chzn-rtl' : ''),
321
+ style: 'width: ' + this.f_width + 'px;'
322
+ });
323
+ if (this.is_multiple) {
324
+ container_div.html('<ul class="chzn-choices"><li class="search-field"><input type="text" value="' + this.default_text + '" class="default" autocomplete="off" style="width:25px;" /></li></ul><div class="chzn-drop" style="left:-9000px;"><ul class="chzn-results"></ul></div>');
325
+ } else {
326
+ container_div.html('<a href="javascript:void(0)" class="chzn-single chzn-default"><span>' + this.default_text + '</span><div><b></b></div></a><div class="chzn-drop" style="left:-9000px;"><div class="chzn-search"><input type="text" autocomplete="off" /></div><ul class="chzn-results"></ul></div>');
327
+ }
328
+ this.form_field_jq.hide().after(container_div);
329
+ this.container = $('#' + this.container_id);
330
+ this.container.addClass("chzn-container-" + (this.is_multiple ? "multi" : "single"));
331
+ this.dropdown = this.container.find('div.chzn-drop').first();
332
+ dd_top = this.container.height();
333
+ dd_width = this.f_width - get_side_border_padding(this.dropdown);
334
+ this.dropdown.css({
335
+ "width": dd_width + "px",
336
+ "top": dd_top + "px"
337
+ });
338
+ this.search_field = this.container.find('input').first();
339
+ this.search_results = this.container.find('ul.chzn-results').first();
340
+ this.search_field_scale();
341
+ this.search_no_results = this.container.find('li.no-results').first();
342
+ if (this.is_multiple) {
343
+ this.search_choices = this.container.find('ul.chzn-choices').first();
344
+ this.search_container = this.container.find('li.search-field').first();
345
+ } else {
346
+ this.search_container = this.container.find('div.chzn-search').first();
347
+ this.selected_item = this.container.find('.chzn-single').first();
348
+ sf_width = dd_width - get_side_border_padding(this.search_container) - get_side_border_padding(this.search_field);
349
+ this.search_field.css({
350
+ "width": sf_width + "px"
351
+ });
352
+ }
353
+ this.results_build();
354
+ this.set_tab_index();
355
+ return this.form_field_jq.trigger("liszt:ready", {
356
+ chosen: this
357
+ });
358
+ };
359
+
360
+ Chosen.prototype.register_observers = function() {
361
+ var _this = this;
362
+ this.container.mousedown(function(evt) {
363
+ return _this.container_mousedown(evt);
364
+ });
365
+ this.container.mouseup(function(evt) {
366
+ return _this.container_mouseup(evt);
367
+ });
368
+ this.container.mouseenter(function(evt) {
369
+ return _this.mouse_enter(evt);
370
+ });
371
+ this.container.mouseleave(function(evt) {
372
+ return _this.mouse_leave(evt);
373
+ });
374
+ this.search_results.mouseup(function(evt) {
375
+ return _this.search_results_mouseup(evt);
376
+ });
377
+ this.search_results.mouseover(function(evt) {
378
+ return _this.search_results_mouseover(evt);
379
+ });
380
+ this.search_results.mouseout(function(evt) {
381
+ return _this.search_results_mouseout(evt);
382
+ });
383
+ this.form_field_jq.bind("liszt:updated", function(evt) {
384
+ return _this.results_update_field(evt);
385
+ });
386
+ this.search_field.blur(function(evt) {
387
+ return _this.input_blur(evt);
388
+ });
389
+ this.search_field.keyup(function(evt) {
390
+ return _this.keyup_checker(evt);
391
+ });
392
+ this.search_field.keydown(function(evt) {
393
+ return _this.keydown_checker(evt);
394
+ });
395
+ if (this.is_multiple) {
396
+ this.search_choices.click(function(evt) {
397
+ return _this.choices_click(evt);
398
+ });
399
+ return this.search_field.focus(function(evt) {
400
+ return _this.input_focus(evt);
401
+ });
402
+ } else {
403
+ return this.container.click(function(evt) {
404
+ return evt.preventDefault();
405
+ });
406
+ }
407
+ };
408
+
409
+ Chosen.prototype.search_field_disabled = function() {
410
+ this.is_disabled = this.form_field_jq[0].disabled;
411
+ if (this.is_disabled) {
412
+ this.container.addClass('chzn-disabled');
413
+ this.search_field[0].disabled = true;
414
+ if (!this.is_multiple) {
415
+ this.selected_item.unbind("focus", this.activate_action);
416
+ }
417
+ return this.close_field();
418
+ } else {
419
+ this.container.removeClass('chzn-disabled');
420
+ this.search_field[0].disabled = false;
421
+ if (!this.is_multiple) {
422
+ return this.selected_item.bind("focus", this.activate_action);
423
+ }
424
+ }
425
+ };
426
+
427
+ Chosen.prototype.container_mousedown = function(evt) {
428
+ var target_closelink;
429
+ if (!this.is_disabled) {
430
+ target_closelink = evt != null ? ($(evt.target)).hasClass("search-choice-close") : false;
431
+ if (evt && evt.type === "mousedown" && !this.results_showing) {
432
+ evt.stopPropagation();
433
+ }
434
+ if (!this.pending_destroy_click && !target_closelink) {
435
+ if (!this.active_field) {
436
+ if (this.is_multiple) this.search_field.val("");
437
+ $(document).click(this.click_test_action);
438
+ this.results_show();
439
+ } else if (!this.is_multiple && evt && (($(evt.target)[0] === this.selected_item[0]) || $(evt.target).parents("a.chzn-single").length)) {
440
+ evt.preventDefault();
441
+ this.results_toggle();
442
+ }
443
+ return this.activate_field();
444
+ } else {
445
+ return this.pending_destroy_click = false;
446
+ }
447
+ }
448
+ };
449
+
450
+ Chosen.prototype.container_mouseup = function(evt) {
451
+ if (evt.target.nodeName === "ABBR") return this.results_reset(evt);
452
+ };
453
+
454
+ Chosen.prototype.blur_test = function(evt) {
455
+ if (!this.active_field && this.container.hasClass("chzn-container-active")) {
456
+ return this.close_field();
457
+ }
458
+ };
459
+
460
+ Chosen.prototype.close_field = function() {
461
+ $(document).unbind("click", this.click_test_action);
462
+ if (!this.is_multiple) {
463
+ this.selected_item.attr("tabindex", this.search_field.attr("tabindex"));
464
+ this.search_field.attr("tabindex", -1);
465
+ }
466
+ this.active_field = false;
467
+ this.results_hide();
468
+ this.container.removeClass("chzn-container-active");
469
+ this.winnow_results_clear();
470
+ this.clear_backstroke();
471
+ this.show_search_field_default();
472
+ return this.search_field_scale();
473
+ };
474
+
475
+ Chosen.prototype.activate_field = function() {
476
+ if (!this.is_multiple && !this.active_field) {
477
+ this.search_field.attr("tabindex", this.selected_item.attr("tabindex"));
478
+ this.selected_item.attr("tabindex", -1);
479
+ }
480
+ this.container.addClass("chzn-container-active");
481
+ this.active_field = true;
482
+ this.search_field.val(this.search_field.val());
483
+ return this.search_field.focus();
484
+ };
485
+
486
+ Chosen.prototype.test_active_click = function(evt) {
487
+ if ($(evt.target).parents('#' + this.container_id).length) {
488
+ return this.active_field = true;
489
+ } else {
490
+ return this.close_field();
491
+ }
492
+ };
493
+
494
+ Chosen.prototype.results_build = function() {
495
+ var content, data, _i, _len, _ref;
496
+ this.parsing = true;
497
+ this.results_data = root.SelectParser.select_to_array(this.form_field);
498
+ if (this.is_multiple && this.choices > 0) {
499
+ this.search_choices.find("li.search-choice").remove();
500
+ this.choices = 0;
501
+ } else if (!this.is_multiple) {
502
+ this.selected_item.find("span").text(this.default_text);
503
+ if (this.form_field.options.length <= this.disable_search_threshold) {
504
+ this.container.addClass("chzn-container-single-nosearch");
505
+ } else {
506
+ this.container.removeClass("chzn-container-single-nosearch");
507
+ }
508
+ }
509
+ content = '';
510
+ _ref = this.results_data;
511
+ for (_i = 0, _len = _ref.length; _i < _len; _i++) {
512
+ data = _ref[_i];
513
+ if (data.group) {
514
+ content += this.result_add_group(data);
515
+ } else if (!data.empty) {
516
+ content += this.result_add_option(data);
517
+ if (data.selected && this.is_multiple) {
518
+ this.choice_build(data);
519
+ } else if (data.selected && !this.is_multiple) {
520
+ this.selected_item.removeClass("chzn-default").find("span").text(data.text);
521
+ if (this.allow_single_deselect) this.single_deselect_control_build();
522
+ }
523
+ }
524
+ }
525
+ this.search_field_disabled();
526
+ this.show_search_field_default();
527
+ this.search_field_scale();
528
+ this.search_results.html(content);
529
+ return this.parsing = false;
530
+ };
531
+
532
+ Chosen.prototype.result_add_group = function(group) {
533
+ if (!group.disabled) {
534
+ group.dom_id = this.container_id + "_g_" + group.array_index;
535
+ return '<li id="' + group.dom_id + '" class="group-result">' + $("<div />").text(group.label).html() + '</li>';
536
+ } else {
537
+ return "";
538
+ }
539
+ };
540
+
541
+ Chosen.prototype.result_do_highlight = function(el) {
542
+ var high_bottom, high_top, maxHeight, visible_bottom, visible_top;
543
+ if (el.length) {
544
+ this.result_clear_highlight();
545
+ this.result_highlight = el;
546
+ this.result_highlight.addClass("highlighted");
547
+ maxHeight = parseInt(this.search_results.css("maxHeight"), 10);
548
+ visible_top = this.search_results.scrollTop();
549
+ visible_bottom = maxHeight + visible_top;
550
+ high_top = this.result_highlight.position().top + this.search_results.scrollTop();
551
+ high_bottom = high_top + this.result_highlight.outerHeight();
552
+ if (high_bottom >= visible_bottom) {
553
+ return this.search_results.scrollTop((high_bottom - maxHeight) > 0 ? high_bottom - maxHeight : 0);
554
+ } else if (high_top < visible_top) {
555
+ return this.search_results.scrollTop(high_top);
556
+ }
557
+ }
558
+ };
559
+
560
+ Chosen.prototype.result_clear_highlight = function() {
561
+ if (this.result_highlight) this.result_highlight.removeClass("highlighted");
562
+ return this.result_highlight = null;
563
+ };
564
+
565
+ Chosen.prototype.results_show = function() {
566
+ var dd_top;
567
+ if (!this.is_multiple) {
568
+ this.selected_item.addClass("chzn-single-with-drop");
569
+ if (this.result_single_selected) {
570
+ this.result_do_highlight(this.result_single_selected);
571
+ }
572
+ } else if (this.max_selected_options <= this.choices) {
573
+ this.form_field_jq.trigger("liszt:maxselected", {
574
+ chosen: this
575
+ });
576
+ return false;
577
+ }
578
+ dd_top = this.is_multiple ? this.container.height() : this.container.height() - 1;
579
+ this.form_field_jq.trigger("liszt:showing_dropdown", {
580
+ chosen: this
581
+ });
582
+ this.dropdown.css({
583
+ "top": dd_top + "px",
584
+ "left": 0
585
+ });
586
+ this.results_showing = true;
587
+ this.search_field.focus();
588
+ this.search_field.val(this.search_field.val());
589
+ return this.winnow_results();
590
+ };
591
+
592
+ Chosen.prototype.results_hide = function() {
593
+ if (!this.is_multiple) {
594
+ this.selected_item.removeClass("chzn-single-with-drop");
595
+ }
596
+ this.result_clear_highlight();
597
+ this.form_field_jq.trigger("liszt:hiding_dropdown", {
598
+ chosen: this
599
+ });
600
+ this.dropdown.css({
601
+ "left": "-9000px"
602
+ });
603
+ return this.results_showing = false;
604
+ };
605
+
606
+ Chosen.prototype.set_tab_index = function(el) {
607
+ var ti;
608
+ if (this.form_field_jq.attr("tabindex")) {
609
+ ti = this.form_field_jq.attr("tabindex");
610
+ this.form_field_jq.attr("tabindex", -1);
611
+ if (this.is_multiple) {
612
+ return this.search_field.attr("tabindex", ti);
613
+ } else {
614
+ this.selected_item.attr("tabindex", ti);
615
+ return this.search_field.attr("tabindex", -1);
616
+ }
617
+ }
618
+ };
619
+
620
+ Chosen.prototype.show_search_field_default = function() {
621
+ if (this.is_multiple && this.choices < 1 && !this.active_field) {
622
+ this.search_field.val(this.default_text);
623
+ return this.search_field.addClass("default");
624
+ } else {
625
+ this.search_field.val("");
626
+ return this.search_field.removeClass("default");
627
+ }
628
+ };
629
+
630
+ Chosen.prototype.search_results_mouseup = function(evt) {
631
+ var target;
632
+ target = $(evt.target).hasClass("active-result") ? $(evt.target) : $(evt.target).parents(".active-result").first();
633
+ if (target.length) {
634
+ this.result_highlight = target;
635
+ return this.result_select(evt);
636
+ }
637
+ };
638
+
639
+ Chosen.prototype.search_results_mouseover = function(evt) {
640
+ var target;
641
+ target = $(evt.target).hasClass("active-result") ? $(evt.target) : $(evt.target).parents(".active-result").first();
642
+ if (target) return this.result_do_highlight(target);
643
+ };
644
+
645
+ Chosen.prototype.search_results_mouseout = function(evt) {
646
+ if ($(evt.target).hasClass("active-result" || $(evt.target).parents('.active-result').first())) {
647
+ return this.result_clear_highlight();
648
+ }
649
+ };
650
+
651
+ Chosen.prototype.choices_click = function(evt) {
652
+ evt.preventDefault();
653
+ if (this.active_field && !($(evt.target).hasClass("search-choice" || $(evt.target).parents('.search-choice').first)) && !this.results_showing) {
654
+ return this.results_show();
655
+ }
656
+ };
657
+
658
+ Chosen.prototype.choice_build = function(item) {
659
+ var choice_id, link,
660
+ _this = this;
661
+ if (this.is_multiple && this.max_selected_options <= this.choices) {
662
+ this.form_field_jq.trigger("liszt:maxselected", {
663
+ chosen: this
664
+ });
665
+ return false;
666
+ }
667
+ choice_id = this.container_id + "_c_" + item.array_index;
668
+ this.choices += 1;
669
+ this.search_container.before('<li class="search-choice" id="' + choice_id + '"><span>' + item.html + '</span><a href="javascript:void(0)" class="search-choice-close" rel="' + item.array_index + '"></a></li>');
670
+ link = $('#' + choice_id).find("a").first();
671
+ return link.click(function(evt) {
672
+ return _this.choice_destroy_link_click(evt);
673
+ });
674
+ };
675
+
676
+ Chosen.prototype.choice_destroy_link_click = function(evt) {
677
+ evt.preventDefault();
678
+ if (!this.is_disabled) {
679
+ this.pending_destroy_click = true;
680
+ return this.choice_destroy($(evt.target));
681
+ } else {
682
+ return evt.stopPropagation;
683
+ }
684
+ };
685
+
686
+ Chosen.prototype.choice_destroy = function(link) {
687
+ this.choices -= 1;
688
+ this.show_search_field_default();
689
+ if (this.is_multiple && this.choices > 0 && this.search_field.val().length < 1) {
690
+ this.results_hide();
691
+ }
692
+ this.result_deselect(link.attr("rel"));
693
+ return link.parents('li').first().remove();
694
+ };
695
+
696
+ Chosen.prototype.results_reset = function() {
697
+ this.form_field.options[0].selected = true;
698
+ this.selected_item.find("span").text(this.default_text);
699
+ if (!this.is_multiple) this.selected_item.addClass("chzn-default");
700
+ this.show_search_field_default();
701
+ this.selected_item.find("abbr").remove();
702
+ this.form_field_jq.trigger("change");
703
+ if (this.active_field) return this.results_hide();
704
+ };
705
+
706
+ Chosen.prototype.result_select = function(evt) {
707
+ var high, high_id, item, position;
708
+ if (this.result_highlight) {
709
+ high = this.result_highlight;
710
+ high_id = high.attr("id");
711
+ this.result_clear_highlight();
712
+ if (this.is_multiple) {
713
+ this.result_deactivate(high);
714
+ } else {
715
+ this.search_results.find(".result-selected").removeClass("result-selected");
716
+ this.result_single_selected = high;
717
+ this.selected_item.removeClass("chzn-default");
718
+ }
719
+ high.addClass("result-selected");
720
+ position = high_id.substr(high_id.lastIndexOf("_") + 1);
721
+ item = this.results_data[position];
722
+ item.selected = true;
723
+ this.form_field.options[item.options_index].selected = true;
724
+ if (this.is_multiple) {
725
+ this.choice_build(item);
726
+ } else {
727
+ this.selected_item.find("span").first().text(item.text);
728
+ if (this.allow_single_deselect) this.single_deselect_control_build();
729
+ }
730
+ if (!(evt.metaKey && this.is_multiple)) this.results_hide();
731
+ this.search_field.val("");
732
+ this.form_field_jq.trigger("change", {
733
+ 'selected': this.form_field.options[item.options_index].value
734
+ });
735
+ return this.search_field_scale();
736
+ }
737
+ };
738
+
739
+ Chosen.prototype.result_activate = function(el) {
740
+ return el.addClass("active-result");
741
+ };
742
+
743
+ Chosen.prototype.result_deactivate = function(el) {
744
+ return el.removeClass("active-result");
745
+ };
746
+
747
+ Chosen.prototype.result_deselect = function(pos) {
748
+ var result, result_data;
749
+ result_data = this.results_data[pos];
750
+ result_data.selected = false;
751
+ this.form_field.options[result_data.options_index].selected = false;
752
+ result = $("#" + this.container_id + "_o_" + pos);
753
+ result.removeClass("result-selected").addClass("active-result").show();
754
+ this.result_clear_highlight();
755
+ this.winnow_results();
756
+ this.form_field_jq.trigger("change", {
757
+ deselected: this.form_field.options[result_data.options_index].value
758
+ });
759
+ return this.search_field_scale();
760
+ };
761
+
762
+ Chosen.prototype.single_deselect_control_build = function() {
763
+ if (this.allow_single_deselect && this.selected_item.find("abbr").length < 1) {
764
+ return this.selected_item.find("span").first().after("<abbr class=\"search-choice-close\"></abbr>");
765
+ }
766
+ };
767
+
768
+ Chosen.prototype.winnow_results = function() {
769
+ var found, option, part, parts, regex, regexAnchor, result, result_id, results, searchText, startpos, text, zregex, _i, _j, _len, _len2, _ref;
770
+ this.no_results_clear();
771
+ results = 0;
772
+ searchText = this.search_field.val() === this.default_text ? "" : $('<div/>').text($.trim(this.search_field.val())).html();
773
+ regexAnchor = this.search_contains ? "" : "^";
774
+ regex = new RegExp(regexAnchor + searchText.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"), 'i');
775
+ zregex = new RegExp(searchText.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"), 'i');
776
+ _ref = this.results_data;
777
+ for (_i = 0, _len = _ref.length; _i < _len; _i++) {
778
+ option = _ref[_i];
779
+ if (!option.disabled && !option.empty) {
780
+ if (option.group) {
781
+ $('#' + option.dom_id).css('display', 'none');
782
+ } else if (!(this.is_multiple && option.selected)) {
783
+ found = false;
784
+ result_id = option.dom_id;
785
+ result = $("#" + result_id);
786
+ if (regex.test(option.html)) {
787
+ found = true;
788
+ results += 1;
789
+ } else if (option.html.indexOf(" ") >= 0 || option.html.indexOf("[") === 0) {
790
+ parts = option.html.replace(/\[|\]/g, "").split(" ");
791
+ if (parts.length) {
792
+ for (_j = 0, _len2 = parts.length; _j < _len2; _j++) {
793
+ part = parts[_j];
794
+ if (regex.test(part)) {
795
+ found = true;
796
+ results += 1;
797
+ }
798
+ }
799
+ }
800
+ }
801
+ if (found) {
802
+ if (searchText.length) {
803
+ startpos = option.html.search(zregex);
804
+ text = option.html.substr(0, startpos + searchText.length) + '</em>' + option.html.substr(startpos + searchText.length);
805
+ text = text.substr(0, startpos) + '<em>' + text.substr(startpos);
806
+ } else {
807
+ text = option.html;
808
+ }
809
+ result.html(text);
810
+ this.result_activate(result);
811
+ if (option.group_array_index != null) {
812
+ $("#" + this.results_data[option.group_array_index].dom_id).css('display', 'list-item');
813
+ }
814
+ } else {
815
+ if (this.result_highlight && result_id === this.result_highlight.attr('id')) {
816
+ this.result_clear_highlight();
817
+ }
818
+ this.result_deactivate(result);
819
+ }
820
+ }
821
+ }
822
+ }
823
+ if (results < 1 && searchText.length) {
824
+ return this.no_results(searchText);
825
+ } else {
826
+ return this.winnow_results_set_highlight();
827
+ }
828
+ };
829
+
830
+ Chosen.prototype.winnow_results_clear = function() {
831
+ var li, lis, _i, _len, _results;
832
+ this.search_field.val("");
833
+ lis = this.search_results.find("li");
834
+ _results = [];
835
+ for (_i = 0, _len = lis.length; _i < _len; _i++) {
836
+ li = lis[_i];
837
+ li = $(li);
838
+ if (li.hasClass("group-result")) {
839
+ _results.push(li.css('display', 'auto'));
840
+ } else if (!this.is_multiple || !li.hasClass("result-selected")) {
841
+ _results.push(this.result_activate(li));
842
+ } else {
843
+ _results.push(void 0);
844
+ }
845
+ }
846
+ return _results;
847
+ };
848
+
849
+ Chosen.prototype.winnow_results_set_highlight = function() {
850
+ var do_high, selected_results;
851
+ if (!this.result_highlight) {
852
+ selected_results = !this.is_multiple ? this.search_results.find(".result-selected.active-result") : [];
853
+ do_high = selected_results.length ? selected_results.first() : this.search_results.find(".active-result").first();
854
+ if (do_high != null) return this.result_do_highlight(do_high);
855
+ }
856
+ };
857
+
858
+ Chosen.prototype.no_results = function(terms) {
859
+ var no_results_html;
860
+ no_results_html = $('<li class="no-results">' + this.results_none_found + ' "<span></span>"</li>');
861
+ no_results_html.find("span").first().html(terms);
862
+ return this.search_results.append(no_results_html);
863
+ };
864
+
865
+ Chosen.prototype.no_results_clear = function() {
866
+ return this.search_results.find(".no-results").remove();
867
+ };
868
+
869
+ Chosen.prototype.keydown_arrow = function() {
870
+ var first_active, next_sib;
871
+ if (!this.result_highlight) {
872
+ first_active = this.search_results.find("li.active-result").first();
873
+ if (first_active) this.result_do_highlight($(first_active));
874
+ } else if (this.results_showing) {
875
+ next_sib = this.result_highlight.nextAll("li.active-result").first();
876
+ if (next_sib) this.result_do_highlight(next_sib);
877
+ }
878
+ if (!this.results_showing) return this.results_show();
879
+ };
880
+
881
+ Chosen.prototype.keyup_arrow = function() {
882
+ var prev_sibs;
883
+ if (!this.results_showing && !this.is_multiple) {
884
+ return this.results_show();
885
+ } else if (this.result_highlight) {
886
+ prev_sibs = this.result_highlight.prevAll("li.active-result");
887
+ if (prev_sibs.length) {
888
+ return this.result_do_highlight(prev_sibs.first());
889
+ } else {
890
+ if (this.choices > 0) this.results_hide();
891
+ return this.result_clear_highlight();
892
+ }
893
+ }
894
+ };
895
+
896
+ Chosen.prototype.keydown_backstroke = function() {
897
+ if (this.pending_backstroke) {
898
+ this.choice_destroy(this.pending_backstroke.find("a").first());
899
+ return this.clear_backstroke();
900
+ } else {
901
+ this.pending_backstroke = this.search_container.siblings("li.search-choice").last();
902
+ return this.pending_backstroke.addClass("search-choice-focus");
903
+ }
904
+ };
905
+
906
+ Chosen.prototype.clear_backstroke = function() {
907
+ if (this.pending_backstroke) {
908
+ this.pending_backstroke.removeClass("search-choice-focus");
909
+ }
910
+ return this.pending_backstroke = null;
911
+ };
912
+
913
+ Chosen.prototype.keydown_checker = function(evt) {
914
+ var stroke, _ref;
915
+ stroke = (_ref = evt.which) != null ? _ref : evt.keyCode;
916
+ this.search_field_scale();
917
+ if (stroke !== 8 && this.pending_backstroke) this.clear_backstroke();
918
+ switch (stroke) {
919
+ case 8:
920
+ this.backstroke_length = this.search_field.val().length;
921
+ break;
922
+ case 9:
923
+ if (this.results_showing && !this.is_multiple) this.result_select(evt);
924
+ this.mouse_on_container = false;
925
+ break;
926
+ case 13:
927
+ evt.preventDefault();
928
+ break;
929
+ case 38:
930
+ evt.preventDefault();
931
+ this.keyup_arrow();
932
+ break;
933
+ case 40:
934
+ this.keydown_arrow();
935
+ break;
936
+ }
937
+ };
938
+
939
+ Chosen.prototype.search_field_scale = function() {
940
+ var dd_top, div, h, style, style_block, styles, w, _i, _len;
941
+ if (this.is_multiple) {
942
+ h = 0;
943
+ w = 0;
944
+ style_block = "position:absolute; left: -1000px; top: -1000px; display:none;";
945
+ styles = ['font-size', 'font-style', 'font-weight', 'font-family', 'line-height', 'text-transform', 'letter-spacing'];
946
+ for (_i = 0, _len = styles.length; _i < _len; _i++) {
947
+ style = styles[_i];
948
+ style_block += style + ":" + this.search_field.css(style) + ";";
949
+ }
950
+ div = $('<div />', {
951
+ 'style': style_block
952
+ });
953
+ div.text(this.search_field.val());
954
+ $('body').append(div);
955
+ w = div.width() + 25;
956
+ div.remove();
957
+ if (w > this.f_width - 10) w = this.f_width - 10;
958
+ this.search_field.css({
959
+ 'width': w + 'px'
960
+ });
961
+ dd_top = this.container.height();
962
+ return this.dropdown.css({
963
+ "top": dd_top + "px"
964
+ });
965
+ }
966
+ };
967
+
968
+ Chosen.prototype.generate_random_id = function() {
969
+ var string;
970
+ string = "sel" + this.generate_random_char() + this.generate_random_char() + this.generate_random_char();
971
+ while ($("#" + string).length > 0) {
972
+ string += this.generate_random_char();
973
+ }
974
+ return string;
975
+ };
976
+
977
+ return Chosen;
978
+
979
+ })(AbstractChosen);
980
+
981
+ get_side_border_padding = function(elmt) {
982
+ var side_border_padding;
983
+ return side_border_padding = elmt.outerWidth() - elmt.width();
984
+ };
985
+
986
+ root.get_side_border_padding = get_side_border_padding;
987
+
988
+ }).call(this);
js/jquery.csvToTable.js ADDED
@@ -0,0 +1,154 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * CSV to Table plugin
3
+ * http://code.google.com/p/jquerycsvtotable/
4
+ *
5
+ * Copyright (c) 2010 Steve Sobel
6
+ * http://honestbleeps.com/
7
+ *
8
+ * v0.9 - 2010-06-22 - First release.
9
+ *
10
+ * Example implementation:
11
+ * $('#divID').CSVToTable('test.csv');
12
+ *
13
+ * The above line would load 'test.csv' via AJAX and render a table. If
14
+ * headers are not specified, the plugin assumes the first line of the CSV
15
+ * file contains the header names.
16
+ *
17
+ * Configurable options:
18
+ * separator - separator to use when parsing CSV/TSV data
19
+ * - value will almost always be "," or "\t" (comma or tab)
20
+ * - if not specified, default value is ","
21
+ * headers - an array of headers for the CSV data
22
+ * - if not specified, plugin assumes that the first line of the CSV
23
+ * file contains the header names.
24
+ * - Example: headers: ['Album Title', 'Artist Name', 'Price ($USD)']
25
+ * tableClass - class name to apply to the <table> tag rendered by the plugin.
26
+ * theadClass - class name to apply to the <thead> tag rendered by the plugin.
27
+ * thClass - class name to apply to the <th> tag rendered by the plugin.
28
+ * tbodyClass - class name to apply to the <tbody> tag rendered by the plugin.
29
+ * trClass - class name to apply to the <tr> tag rendered by the plugin.
30
+ * tdClass - class name to apply to the <td> tag rendered by the plugin.
31
+ * loadingImage - path to an image to display while CSV/TSV data is loading
32
+ * loadingText - text to display while CSV/TSV is loading
33
+ * - if not specified, default value is "Loading CSV data..."
34
+ *
35
+ *
36
+ * Upon completion, the plugin triggers a "loadComplete" event so that you
37
+ * may perform other manipulation on the table after it has loaded. A
38
+ * common use of this would be to use the jQuery tablesorter plugin, found
39
+ * at http://tablesorter.com/
40
+ *
41
+ * An example of such a call would be as follows, assuming you have loaded
42
+ * the tablesorter plugin.
43
+ *
44
+ * $('#CSVTable').CSVToTable('test.csv',
45
+ * {
46
+ * loadingImage: 'images/loading.gif',
47
+ * startLine: 1,
48
+ * headers: ['Album Title', 'Artist Name', 'Price ($USD)']
49
+ * }
50
+ * ).bind("loadComplete",function() {
51
+ * $('#CSVTable').find('TABLE').tablesorter();
52
+ * });;
53
+
54
+ *
55
+ */
56
+
57
+
58
+ (function($){
59
+
60
+ /**
61
+ *
62
+ * CSV Parser credit goes to Brian Huisman, from his blog entry entitled "CSV String to Array in JavaScript":
63
+ * http://www.greywyvern.com/?post=258
64
+ *
65
+ */
66
+ String.prototype.splitCSV = function(sep) {
67
+ for (var thisCSV = this.split(sep = sep || ","), x = thisCSV.length - 1, tl; x >= 0; x--) {
68
+ if (thisCSV[x].replace(/"\s+$/, '"').charAt(thisCSV[x].length - 1) == '"') {
69
+ if ((tl = thisCSV[x].replace(/^\s+"/, '"')).length > 1 && tl.charAt(0) == '"') {
70
+ thisCSV[x] = thisCSV[x].replace(/^\s*"|"\s*$/g, '').replace(/""/g, '"');
71
+ } else if (x) {
72
+ thisCSV.splice(x - 1, 2, [thisCSV[x - 1], thisCSV[x]].join(sep));
73
+ } else thisCSV = thisCSV.shift().split(sep).concat(thisCSV);
74
+ } else thisCSV[x].replace(/""/g, '"');
75
+ } return thisCSV;
76
+ };
77
+
78
+ $.fn.CSVToTable = function(csvFile, options) {
79
+ var defaults = {
80
+ tableClass: "CSVTable",
81
+ theadClass: "",
82
+ thClass: "",
83
+ tbodyClass: "",
84
+ trClass: "",
85
+ tdClass: "",
86
+ loadingImage: "",
87
+ loadingText: "Loading CSV data...",
88
+ separator: ",",
89
+ startLine: 0
90
+ };
91
+ var options = $.extend(defaults, options);
92
+ return this.each(function() {
93
+ var obj = $(this);
94
+ var error = '';
95
+ var csv = obj.html(); // this is the string containing the CSV data
96
+ var data = csv;
97
+ (options.loadingImage) ? loading = '<div style="text-align: center"><img alt="' + options.loadingText + '" src="' + options.loadingImage + '" /><br>' + options.loadingText + '</div>' : loading = options.loadingText;
98
+ obj.html(loading);
99
+ var tableHTML = '<table class="' + options.tableClass + '">';
100
+ var lines = data.replace('\r','').split('\n');
101
+ var printedLines = 0;
102
+ var headerCount = 0;
103
+ var headers = new Array();
104
+ $.each(lines, function(lineCount, line) {
105
+ if ((lineCount == 0) && (typeof(options.headers) != 'undefined')) {
106
+ headers = options.headers;
107
+ headerCount = headers.length;
108
+ tableHTML += '<thead class="' + options.theadClass + '"><tr class="' + options.trClass + '">';
109
+ $.each(headers, function(headerCount, header) {
110
+ tableHTML += '<th class="' + options.thClass + '">' + header + '</th>';
111
+ });
112
+ tableHTML += '</tr></thead><tbody class="' + options.tbodyClass + '">';
113
+ }
114
+ if ((lineCount == options.startLine) && (typeof(options.headers) == 'undefined')) {
115
+ headers = line.splitCSV(options.separator);
116
+ headerCount = headers.length;
117
+ tableHTML += '<thead class="' + options.theadClass + '"><tr class="' + options.trClass + '">';
118
+ $.each(headers, function(headerCount, header) {
119
+ tableHTML += '<th class="' + options.thClass + '">' + header + '</th>';
120
+ });
121
+ tableHTML += '</tr></thead><tbody class="' + options.tbodyClass + '">';
122
+ } else if (lineCount >= options.startLine) {
123
+ var items = line.splitCSV(options.separator);
124
+ if (items.length > 1) {
125
+ printedLines++;
126
+ if (items.length != headerCount) {
127
+ error += 'error on line ' + lineCount + ': Item count (' + items.length + ') does not match header count (' + headerCount + ') \n';
128
+ }
129
+ (printedLines % 2) ? oddOrEven = 'odd' : oddOrEven = 'even';
130
+ tableHTML += '<tr class="' + options.trClass + ' ' + oddOrEven + '">';
131
+ $.each(items, function(itemCount, item) {
132
+ tableHTML += '<td class="' + options.tdClass + '">' + item + '</td>';
133
+ });
134
+ tableHTML += '</tr>';
135
+ }
136
+ }
137
+ });
138
+ tableHTML += '</tbody></table>';
139
+ if (error) {
140
+ obj.html(error);
141
+ } else {
142
+ obj.fadeOut(500, function() {
143
+ obj.html(tableHTML)
144
+ }).fadeIn(function() {
145
+ // trigger loadComplete
146
+ setTimeout(function() {
147
+ obj.trigger("loadComplete");
148
+ },0);
149
+ });
150
+ }
151
+ });
152
+ };
153
+
154
+ })(jQuery);
js/ui-datepicker.js ADDED
@@ -0,0 +1,84 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * jQuery UI Datepicker 1.8.16
3
+ *
4
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
5
+ * Dual licensed under the MIT or GPL Version 2 licenses.
6
+ * http://jquery.org/license
7
+ *
8
+ * http://docs.jquery.com/UI/Datepicker
9
+ *
10
+ * Depends:
11
+ * jquery.ui.core.js
12
+ */
13
+ (function(d,C){function M(){this.debug=false;this._curInst=null;this._keyEvent=false;this._disabledInputs=[];this._inDialog=this._datepickerShowing=false;this._mainDivId="ui-datepicker-div";this._inlineClass="ui-datepicker-inline";this._appendClass="ui-datepicker-append";this._triggerClass="ui-datepicker-trigger";this._dialogClass="ui-datepicker-dialog";this._disableClass="ui-datepicker-disabled";this._unselectableClass="ui-datepicker-unselectable";this._currentClass="ui-datepicker-current-day";this._dayOverClass=
14
+ "ui-datepicker-days-cell-over";this.regional=[];this.regional[""]={closeText:"Done",prevText:"Prev",nextText:"Next",currentText:"Today",monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su",
15
+ "Mo","Tu","We","Th","Fr","Sa"],weekHeader:"Wk",dateFormat:"mm/dd/yy",firstDay:0,isRTL:false,showMonthAfterYear:false,yearSuffix:""};this._defaults={showOn:"focus",showAnim:"fadeIn",showOptions:{},defaultDate:null,appendText:"",buttonText:"...",buttonImage:"",buttonImageOnly:false,hideIfNoPrevNext:false,navigationAsDateFormat:false,gotoCurrent:false,changeMonth:false,changeYear:false,yearRange:"c-10:c+10",showOtherMonths:false,selectOtherMonths:false,showWeek:false,calculateWeek:this.iso8601Week,shortYearCutoff:"+10",
16
+ minDate:null,maxDate:null,duration:"fast",beforeShowDay:null,beforeShow:null,onSelect:null,onChangeMonthYear:null,onClose:null,numberOfMonths:1,showCurrentAtPos:0,stepMonths:1,stepBigMonths:12,altField:"",altFormat:"",constrainInput:true,showButtonPanel:false,autoSize:false,disabled:false};d.extend(this._defaults,this.regional[""]);this.dpDiv=N(d('<div id="'+this._mainDivId+'" class="ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all"></div>'))}function N(a){return a.bind("mouseout",
17
+ function(b){b=d(b.target).closest("button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a");b.length&&b.removeClass("ui-state-hover ui-datepicker-prev-hover ui-datepicker-next-hover")}).bind("mouseover",function(b){b=d(b.target).closest("button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a");if(!(d.datepicker._isDisabledDatepicker(J.inline?a.parent()[0]:J.input[0])||!b.length)){b.parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover");
18
+ b.addClass("ui-state-hover");b.hasClass("ui-datepicker-prev")&&b.addClass("ui-datepicker-prev-hover");b.hasClass("ui-datepicker-next")&&b.addClass("ui-datepicker-next-hover")}})}function H(a,b){d.extend(a,b);for(var c in b)if(b[c]==null||b[c]==C)a[c]=b[c];return a}d.extend(d.ui,{datepicker:{version:"1.8.16"}});var B=(new Date).getTime(),J;d.extend(M.prototype,{markerClassName:"hasDatepicker",maxRows:4,log:function(){this.debug&&console.log.apply("",arguments)},_widgetDatepicker:function(){return this.dpDiv},
19
+ setDefaults:function(a){H(this._defaults,a||{});return this},_attachDatepicker:function(a,b){var c=null;for(var e in this._defaults){var f=a.getAttribute("date:"+e);if(f){c=c||{};try{c[e]=eval(f)}catch(h){c[e]=f}}}e=a.nodeName.toLowerCase();f=e=="div"||e=="span";if(!a.id){this.uuid+=1;a.id="dp"+this.uuid}var i=this._newInst(d(a),f);i.settings=d.extend({},b||{},c||{});if(e=="input")this._connectDatepicker(a,i);else f&&this._inlineDatepicker(a,i)},_newInst:function(a,b){return{id:a[0].id.replace(/([^A-Za-z0-9_-])/g,
20
+ "\\\\$1"),input:a,selectedDay:0,selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:b,dpDiv:!b?this.dpDiv:N(d('<div class="'+this._inlineClass+' ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all"></div>'))}},_connectDatepicker:function(a,b){var c=d(a);b.append=d([]);b.trigger=d([]);if(!c.hasClass(this.markerClassName)){this._attachments(c,b);c.addClass(this.markerClassName).keydown(this._doKeyDown).keypress(this._doKeyPress).keyup(this._doKeyUp).bind("setData.datepicker",
21
+ function(e,f,h){b.settings[f]=h}).bind("getData.datepicker",function(e,f){return this._get(b,f)});this._autoSize(b);d.data(a,"datepicker",b);b.settings.disabled&&this._disableDatepicker(a)}},_attachments:function(a,b){var c=this._get(b,"appendText"),e=this._get(b,"isRTL");b.append&&b.append.remove();if(c){b.append=d('<span class="'+this._appendClass+'">'+c+"</span>");a[e?"before":"after"](b.append)}a.unbind("focus",this._showDatepicker);b.trigger&&b.trigger.remove();c=this._get(b,"showOn");if(c==
22
+ "focus"||c=="both")a.focus(this._showDatepicker);if(c=="button"||c=="both"){c=this._get(b,"buttonText");var f=this._get(b,"buttonImage");b.trigger=d(this._get(b,"buttonImageOnly")?d("<img/>").addClass(this._triggerClass).attr({src:f,alt:c,title:c}):d('<button type="button"></button>').addClass(this._triggerClass).html(f==""?c:d("<img/>").attr({src:f,alt:c,title:c})));a[e?"before":"after"](b.trigger);b.trigger.click(function(){d.datepicker._datepickerShowing&&d.datepicker._lastInput==a[0]?d.datepicker._hideDatepicker():
23
+ d.datepicker._showDatepicker(a[0]);return false})}},_autoSize:function(a){if(this._get(a,"autoSize")&&!a.inline){var b=new Date(2009,11,20),c=this._get(a,"dateFormat");if(c.match(/[DM]/)){var e=function(f){for(var h=0,i=0,g=0;g<f.length;g++)if(f[g].length>h){h=f[g].length;i=g}return i};b.setMonth(e(this._get(a,c.match(/MM/)?"monthNames":"monthNamesShort")));b.setDate(e(this._get(a,c.match(/DD/)?"dayNames":"dayNamesShort"))+20-b.getDay())}a.input.attr("size",this._formatDate(a,b).length)}},_inlineDatepicker:function(a,
24
+ b){var c=d(a);if(!c.hasClass(this.markerClassName)){c.addClass(this.markerClassName).append(b.dpDiv).bind("setData.datepicker",function(e,f,h){b.settings[f]=h}).bind("getData.datepicker",function(e,f){return this._get(b,f)});d.data(a,"datepicker",b);this._setDate(b,this._getDefaultDate(b),true);this._updateDatepicker(b);this._updateAlternate(b);b.settings.disabled&&this._disableDatepicker(a);b.dpDiv.css("display","block")}},_dialogDatepicker:function(a,b,c,e,f){a=this._dialogInst;if(!a){this.uuid+=
25
+ 1;this._dialogInput=d('<input type="text" id="'+("dp"+this.uuid)+'" style="position: absolute; top: -100px; width: 0px; z-index: -10;"/>');this._dialogInput.keydown(this._doKeyDown);d("body").append(this._dialogInput);a=this._dialogInst=this._newInst(this._dialogInput,false);a.settings={};d.data(this._dialogInput[0],"datepicker",a)}H(a.settings,e||{});b=b&&b.constructor==Date?this._formatDate(a,b):b;this._dialogInput.val(b);this._pos=f?f.length?f:[f.pageX,f.pageY]:null;if(!this._pos)this._pos=[document.documentElement.clientWidth/
26
+ 2-100+(document.documentElement.scrollLeft||document.body.scrollLeft),document.documentElement.clientHeight/2-150+(document.documentElement.scrollTop||document.body.scrollTop)];this._dialogInput.css("left",this._pos[0]+20+"px").css("top",this._pos[1]+"px");a.settings.onSelect=c;this._inDialog=true;this.dpDiv.addClass(this._dialogClass);this._showDatepicker(this._dialogInput[0]);d.blockUI&&d.blockUI(this.dpDiv);d.data(this._dialogInput[0],"datepicker",a);return this},_destroyDatepicker:function(a){var b=
27
+ d(a),c=d.data(a,"datepicker");if(b.hasClass(this.markerClassName)){var e=a.nodeName.toLowerCase();d.removeData(a,"datepicker");if(e=="input"){c.append.remove();c.trigger.remove();b.removeClass(this.markerClassName).unbind("focus",this._showDatepicker).unbind("keydown",this._doKeyDown).unbind("keypress",this._doKeyPress).unbind("keyup",this._doKeyUp)}else if(e=="div"||e=="span")b.removeClass(this.markerClassName).empty()}},_enableDatepicker:function(a){var b=d(a),c=d.data(a,"datepicker");if(b.hasClass(this.markerClassName)){var e=
28
+ a.nodeName.toLowerCase();if(e=="input"){a.disabled=false;c.trigger.filter("button").each(function(){this.disabled=false}).end().filter("img").css({opacity:"1.0",cursor:""})}else if(e=="div"||e=="span"){b=b.children("."+this._inlineClass);b.children().removeClass("ui-state-disabled");b.find("select.ui-datepicker-month, select.ui-datepicker-year").removeAttr("disabled")}this._disabledInputs=d.map(this._disabledInputs,function(f){return f==a?null:f})}},_disableDatepicker:function(a){var b=d(a),c=d.data(a,
29
+ "datepicker");if(b.hasClass(this.markerClassName)){var e=a.nodeName.toLowerCase();if(e=="input"){a.disabled=true;c.trigger.filter("button").each(function(){this.disabled=true}).end().filter("img").css({opacity:"0.5",cursor:"default"})}else if(e=="div"||e=="span"){b=b.children("."+this._inlineClass);b.children().addClass("ui-state-disabled");b.find("select.ui-datepicker-month, select.ui-datepicker-year").attr("disabled","disabled")}this._disabledInputs=d.map(this._disabledInputs,function(f){return f==
30
+ a?null:f});this._disabledInputs[this._disabledInputs.length]=a}},_isDisabledDatepicker:function(a){if(!a)return false;for(var b=0;b<this._disabledInputs.length;b++)if(this._disabledInputs[b]==a)return true;return false},_getInst:function(a){try{return d.data(a,"datepicker")}catch(b){throw"Missing instance data for this datepicker";}},_optionDatepicker:function(a,b,c){var e=this._getInst(a);if(arguments.length==2&&typeof b=="string")return b=="defaults"?d.extend({},d.datepicker._defaults):e?b=="all"?
31
+ d.extend({},e.settings):this._get(e,b):null;var f=b||{};if(typeof b=="string"){f={};f[b]=c}if(e){this._curInst==e&&this._hideDatepicker();var h=this._getDateDatepicker(a,true),i=this._getMinMaxDate(e,"min"),g=this._getMinMaxDate(e,"max");H(e.settings,f);if(i!==null&&f.dateFormat!==C&&f.minDate===C)e.settings.minDate=this._formatDate(e,i);if(g!==null&&f.dateFormat!==C&&f.maxDate===C)e.settings.maxDate=this._formatDate(e,g);this._attachments(d(a),e);this._autoSize(e);this._setDate(e,h);this._updateAlternate(e);
32
+ this._updateDatepicker(e)}},_changeDatepicker:function(a,b,c){this._optionDatepicker(a,b,c)},_refreshDatepicker:function(a){(a=this._getInst(a))&&this._updateDatepicker(a)},_setDateDatepicker:function(a,b){if(a=this._getInst(a)){this._setDate(a,b);this._updateDatepicker(a);this._updateAlternate(a)}},_getDateDatepicker:function(a,b){(a=this._getInst(a))&&!a.inline&&this._setDateFromField(a,b);return a?this._getDate(a):null},_doKeyDown:function(a){var b=d.datepicker._getInst(a.target),c=true,e=b.dpDiv.is(".ui-datepicker-rtl");
33
+ b._keyEvent=true;if(d.datepicker._datepickerShowing)switch(a.keyCode){case 9:d.datepicker._hideDatepicker();c=false;break;case 13:c=d("td."+d.datepicker._dayOverClass+":not(."+d.datepicker._currentClass+")",b.dpDiv);c[0]&&d.datepicker._selectDay(a.target,b.selectedMonth,b.selectedYear,c[0]);if(a=d.datepicker._get(b,"onSelect")){c=d.datepicker._formatDate(b);a.apply(b.input?b.input[0]:null,[c,b])}else d.datepicker._hideDatepicker();return false;case 27:d.datepicker._hideDatepicker();break;case 33:d.datepicker._adjustDate(a.target,
34
+ a.ctrlKey?-d.datepicker._get(b,"stepBigMonths"):-d.datepicker._get(b,"stepMonths"),"M");break;case 34:d.datepicker._adjustDate(a.target,a.ctrlKey?+d.datepicker._get(b,"stepBigMonths"):+d.datepicker._get(b,"stepMonths"),"M");break;case 35:if(a.ctrlKey||a.metaKey)d.datepicker._clearDate(a.target);c=a.ctrlKey||a.metaKey;break;case 36:if(a.ctrlKey||a.metaKey)d.datepicker._gotoToday(a.target);c=a.ctrlKey||a.metaKey;break;case 37:if(a.ctrlKey||a.metaKey)d.datepicker._adjustDate(a.target,e?+1:-1,"D");c=
35
+ a.ctrlKey||a.metaKey;if(a.originalEvent.altKey)d.datepicker._adjustDate(a.target,a.ctrlKey?-d.datepicker._get(b,"stepBigMonths"):-d.datepicker._get(b,"stepMonths"),"M");break;case 38:if(a.ctrlKey||a.metaKey)d.datepicker._adjustDate(a.target,-7,"D");c=a.ctrlKey||a.metaKey;break;case 39:if(a.ctrlKey||a.metaKey)d.datepicker._adjustDate(a.target,e?-1:+1,"D");c=a.ctrlKey||a.metaKey;if(a.originalEvent.altKey)d.datepicker._adjustDate(a.target,a.ctrlKey?+d.datepicker._get(b,"stepBigMonths"):+d.datepicker._get(b,
36
+ "stepMonths"),"M");break;case 40:if(a.ctrlKey||a.metaKey)d.datepicker._adjustDate(a.target,+7,"D");c=a.ctrlKey||a.metaKey;break;default:c=false}else if(a.keyCode==36&&a.ctrlKey)d.datepicker._showDatepicker(this);else c=false;if(c){a.preventDefault();a.stopPropagation()}},_doKeyPress:function(a){var b=d.datepicker._getInst(a.target);if(d.datepicker._get(b,"constrainInput")){b=d.datepicker._possibleChars(d.datepicker._get(b,"dateFormat"));var c=String.fromCharCode(a.charCode==C?a.keyCode:a.charCode);
37
+ return a.ctrlKey||a.metaKey||c<" "||!b||b.indexOf(c)>-1}},_doKeyUp:function(a){a=d.datepicker._getInst(a.target);if(a.input.val()!=a.lastVal)try{if(d.datepicker.parseDate(d.datepicker._get(a,"dateFormat"),a.input?a.input.val():null,d.datepicker._getFormatConfig(a))){d.datepicker._setDateFromField(a);d.datepicker._updateAlternate(a);d.datepicker._updateDatepicker(a)}}catch(b){d.datepicker.log(b)}return true},_showDatepicker:function(a){a=a.target||a;if(a.nodeName.toLowerCase()!="input")a=d("input",
38
+ a.parentNode)[0];if(!(d.datepicker._isDisabledDatepicker(a)||d.datepicker._lastInput==a)){var b=d.datepicker._getInst(a);if(d.datepicker._curInst&&d.datepicker._curInst!=b){d.datepicker._datepickerShowing&&d.datepicker._triggerOnClose(d.datepicker._curInst);d.datepicker._curInst.dpDiv.stop(true,true)}var c=d.datepicker._get(b,"beforeShow");c=c?c.apply(a,[a,b]):{};if(c!==false){H(b.settings,c);b.lastVal=null;d.datepicker._lastInput=a;d.datepicker._setDateFromField(b);if(d.datepicker._inDialog)a.value=
39
+ "";if(!d.datepicker._pos){d.datepicker._pos=d.datepicker._findPos(a);d.datepicker._pos[1]+=a.offsetHeight}var e=false;d(a).parents().each(function(){e|=d(this).css("position")=="fixed";return!e});if(e&&d.browser.opera){d.datepicker._pos[0]-=document.documentElement.scrollLeft;d.datepicker._pos[1]-=document.documentElement.scrollTop}c={left:d.datepicker._pos[0],top:d.datepicker._pos[1]};d.datepicker._pos=null;b.dpDiv.empty();b.dpDiv.css({position:"absolute",display:"block",top:"-1000px"});d.datepicker._updateDatepicker(b);
40
+ c=d.datepicker._checkOffset(b,c,e);b.dpDiv.css({position:d.datepicker._inDialog&&d.blockUI?"static":e?"fixed":"absolute",display:"none",left:c.left+"px",top:c.top+"px"});if(!b.inline){c=d.datepicker._get(b,"showAnim");var f=d.datepicker._get(b,"duration"),h=function(){var i=b.dpDiv.find("iframe.ui-datepicker-cover");if(i.length){var g=d.datepicker._getBorders(b.dpDiv);i.css({left:-g[0],top:-g[1],width:b.dpDiv.outerWidth(),height:b.dpDiv.outerHeight()})}};b.dpDiv.zIndex(d(a).zIndex()+1);d.datepicker._datepickerShowing=
41
+ true;d.effects&&d.effects[c]?b.dpDiv.show(c,d.datepicker._get(b,"showOptions"),f,h):b.dpDiv[c||"show"](c?f:null,h);if(!c||!f)h();b.input.is(":visible")&&!b.input.is(":disabled")&&b.input.focus();d.datepicker._curInst=b}}}},_updateDatepicker:function(a){this.maxRows=4;var b=d.datepicker._getBorders(a.dpDiv);J=a;a.dpDiv.empty().append(this._generateHTML(a));var c=a.dpDiv.find("iframe.ui-datepicker-cover");c.length&&c.css({left:-b[0],top:-b[1],width:a.dpDiv.outerWidth(),height:a.dpDiv.outerHeight()});
42
+ a.dpDiv.find("."+this._dayOverClass+" a").mouseover();b=this._getNumberOfMonths(a);c=b[1];a.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width("");c>1&&a.dpDiv.addClass("ui-datepicker-multi-"+c).css("width",17*c+"em");a.dpDiv[(b[0]!=1||b[1]!=1?"add":"remove")+"Class"]("ui-datepicker-multi");a.dpDiv[(this._get(a,"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl");a==d.datepicker._curInst&&d.datepicker._datepickerShowing&&a.input&&a.input.is(":visible")&&
43
+ !a.input.is(":disabled")&&a.input[0]!=document.activeElement&&a.input.focus();if(a.yearshtml){var e=a.yearshtml;setTimeout(function(){e===a.yearshtml&&a.yearshtml&&a.dpDiv.find("select.ui-datepicker-year:first").replaceWith(a.yearshtml);e=a.yearshtml=null},0)}},_getBorders:function(a){var b=function(c){return{thin:1,medium:2,thick:3}[c]||c};return[parseFloat(b(a.css("border-left-width"))),parseFloat(b(a.css("border-top-width")))]},_checkOffset:function(a,b,c){var e=a.dpDiv.outerWidth(),f=a.dpDiv.outerHeight(),
44
+ h=a.input?a.input.outerWidth():0,i=a.input?a.input.outerHeight():0,g=document.documentElement.clientWidth+d(document).scrollLeft(),j=document.documentElement.clientHeight+d(document).scrollTop();b.left-=this._get(a,"isRTL")?e-h:0;b.left-=c&&b.left==a.input.offset().left?d(document).scrollLeft():0;b.top-=c&&b.top==a.input.offset().top+i?d(document).scrollTop():0;b.left-=Math.min(b.left,b.left+e>g&&g>e?Math.abs(b.left+e-g):0);b.top-=Math.min(b.top,b.top+f>j&&j>f?Math.abs(f+i):0);return b},_findPos:function(a){for(var b=
45
+ this._get(this._getInst(a),"isRTL");a&&(a.type=="hidden"||a.nodeType!=1||d.expr.filters.hidden(a));)a=a[b?"previousSibling":"nextSibling"];a=d(a).offset();return[a.left,a.top]},_triggerOnClose:function(a){var b=this._get(a,"onClose");if(b)b.apply(a.input?a.input[0]:null,[a.input?a.input.val():"",a])},_hideDatepicker:function(a){var b=this._curInst;if(!(!b||a&&b!=d.data(a,"datepicker")))if(this._datepickerShowing){a=this._get(b,"showAnim");var c=this._get(b,"duration"),e=function(){d.datepicker._tidyDialog(b);
46
+ this._curInst=null};d.effects&&d.effects[a]?b.dpDiv.hide(a,d.datepicker._get(b,"showOptions"),c,e):b.dpDiv[a=="slideDown"?"slideUp":a=="fadeIn"?"fadeOut":"hide"](a?c:null,e);a||e();d.datepicker._triggerOnClose(b);this._datepickerShowing=false;this._lastInput=null;if(this._inDialog){this._dialogInput.css({position:"absolute",left:"0",top:"-100px"});if(d.blockUI){d.unblockUI();d("body").append(this.dpDiv)}}this._inDialog=false}},_tidyDialog:function(a){a.dpDiv.removeClass(this._dialogClass).unbind(".ui-datepicker-calendar")},
47
+ _checkExternalClick:function(a){if(d.datepicker._curInst){a=d(a.target);a[0].id!=d.datepicker._mainDivId&&a.parents("#"+d.datepicker._mainDivId).length==0&&!a.hasClass(d.datepicker.markerClassName)&&!a.hasClass(d.datepicker._triggerClass)&&d.datepicker._datepickerShowing&&!(d.datepicker._inDialog&&d.blockUI)&&d.datepicker._hideDatepicker()}},_adjustDate:function(a,b,c){a=d(a);var e=this._getInst(a[0]);if(!this._isDisabledDatepicker(a[0])){this._adjustInstDate(e,b+(c=="M"?this._get(e,"showCurrentAtPos"):
48
+ 0),c);this._updateDatepicker(e)}},_gotoToday:function(a){a=d(a);var b=this._getInst(a[0]);if(this._get(b,"gotoCurrent")&&b.currentDay){b.selectedDay=b.currentDay;b.drawMonth=b.selectedMonth=b.currentMonth;b.drawYear=b.selectedYear=b.currentYear}else{var c=new Date;b.selectedDay=c.getDate();b.drawMonth=b.selectedMonth=c.getMonth();b.drawYear=b.selectedYear=c.getFullYear()}this._notifyChange(b);this._adjustDate(a)},_selectMonthYear:function(a,b,c){a=d(a);var e=this._getInst(a[0]);e["selected"+(c=="M"?
49
+ "Month":"Year")]=e["draw"+(c=="M"?"Month":"Year")]=parseInt(b.options[b.selectedIndex].value,10);this._notifyChange(e);this._adjustDate(a)},_selectDay:function(a,b,c,e){var f=d(a);if(!(d(e).hasClass(this._unselectableClass)||this._isDisabledDatepicker(f[0]))){f=this._getInst(f[0]);f.selectedDay=f.currentDay=d("a",e).html();f.selectedMonth=f.currentMonth=b;f.selectedYear=f.currentYear=c;this._selectDate(a,this._formatDate(f,f.currentDay,f.currentMonth,f.currentYear))}},_clearDate:function(a){a=d(a);
50
+ this._getInst(a[0]);this._selectDate(a,"")},_selectDate:function(a,b){a=this._getInst(d(a)[0]);b=b!=null?b:this._formatDate(a);a.input&&a.input.val(b);this._updateAlternate(a);var c=this._get(a,"onSelect");if(c)c.apply(a.input?a.input[0]:null,[b,a]);else a.input&&a.input.trigger("change");if(a.inline)this._updateDatepicker(a);else{this._hideDatepicker();this._lastInput=a.input[0];typeof a.input[0]!="object"&&a.input.focus();this._lastInput=null}},_updateAlternate:function(a){var b=this._get(a,"altField");
51
+ if(b){var c=this._get(a,"altFormat")||this._get(a,"dateFormat"),e=this._getDate(a),f=this.formatDate(c,e,this._getFormatConfig(a));d(b).each(function(){d(this).val(f)})}},noWeekends:function(a){a=a.getDay();return[a>0&&a<6,""]},iso8601Week:function(a){a=new Date(a.getTime());a.setDate(a.getDate()+4-(a.getDay()||7));var b=a.getTime();a.setMonth(0);a.setDate(1);return Math.floor(Math.round((b-a)/864E5)/7)+1},parseDate:function(a,b,c){if(a==null||b==null)throw"Invalid arguments";b=typeof b=="object"?
52
+ b.toString():b+"";if(b=="")return null;var e=(c?c.shortYearCutoff:null)||this._defaults.shortYearCutoff;e=typeof e!="string"?e:(new Date).getFullYear()%100+parseInt(e,10);for(var f=(c?c.dayNamesShort:null)||this._defaults.dayNamesShort,h=(c?c.dayNames:null)||this._defaults.dayNames,i=(c?c.monthNamesShort:null)||this._defaults.monthNamesShort,g=(c?c.monthNames:null)||this._defaults.monthNames,j=c=-1,l=-1,u=-1,k=false,o=function(p){(p=A+1<a.length&&a.charAt(A+1)==p)&&A++;return p},m=function(p){var D=
53
+ o(p);p=new RegExp("^\\d{1,"+(p=="@"?14:p=="!"?20:p=="y"&&D?4:p=="o"?3:2)+"}");p=b.substring(q).match(p);if(!p)throw"Missing number at position "+q;q+=p[0].length;return parseInt(p[0],10)},n=function(p,D,K){p=d.map(o(p)?K:D,function(w,x){return[[x,w]]}).sort(function(w,x){return-(w[1].length-x[1].length)});var E=-1;d.each(p,function(w,x){w=x[1];if(b.substr(q,w.length).toLowerCase()==w.toLowerCase()){E=x[0];q+=w.length;return false}});if(E!=-1)return E+1;else throw"Unknown name at position "+q;},s=
54
+ function(){if(b.charAt(q)!=a.charAt(A))throw"Unexpected literal at position "+q;q++},q=0,A=0;A<a.length;A++)if(k)if(a.charAt(A)=="'"&&!o("'"))k=false;else s();else switch(a.charAt(A)){case "d":l=m("d");break;case "D":n("D",f,h);break;case "o":u=m("o");break;case "m":j=m("m");break;case "M":j=n("M",i,g);break;case "y":c=m("y");break;case "@":var v=new Date(m("@"));c=v.getFullYear();j=v.getMonth()+1;l=v.getDate();break;case "!":v=new Date((m("!")-this._ticksTo1970)/1E4);c=v.getFullYear();j=v.getMonth()+
55
+ 1;l=v.getDate();break;case "'":if(o("'"))s();else k=true;break;default:s()}if(q<b.length)throw"Extra/unparsed characters found in date: "+b.substring(q);if(c==-1)c=(new Date).getFullYear();else if(c<100)c+=(new Date).getFullYear()-(new Date).getFullYear()%100+(c<=e?0:-100);if(u>-1){j=1;l=u;do{e=this._getDaysInMonth(c,j-1);if(l<=e)break;j++;l-=e}while(1)}v=this._daylightSavingAdjust(new Date(c,j-1,l));if(v.getFullYear()!=c||v.getMonth()+1!=j||v.getDate()!=l)throw"Invalid date";return v},ATOM:"yy-mm-dd",
56
+ COOKIE:"D, dd M yy",ISO_8601:"yy-mm-dd",RFC_822:"D, d M y",RFC_850:"DD, dd-M-y",RFC_1036:"D, d M y",RFC_1123:"D, d M yy",RFC_2822:"D, d M yy",RSS:"D, d M y",TICKS:"!",TIMESTAMP:"@",W3C:"yy-mm-dd",_ticksTo1970:(718685+Math.floor(492.5)-Math.floor(19.7)+Math.floor(4.925))*24*60*60*1E7,formatDate:function(a,b,c){if(!b)return"";var e=(c?c.dayNamesShort:null)||this._defaults.dayNamesShort,f=(c?c.dayNames:null)||this._defaults.dayNames,h=(c?c.monthNamesShort:null)||this._defaults.monthNamesShort;c=(c?c.monthNames:
57
+ null)||this._defaults.monthNames;var i=function(o){(o=k+1<a.length&&a.charAt(k+1)==o)&&k++;return o},g=function(o,m,n){m=""+m;if(i(o))for(;m.length<n;)m="0"+m;return m},j=function(o,m,n,s){return i(o)?s[m]:n[m]},l="",u=false;if(b)for(var k=0;k<a.length;k++)if(u)if(a.charAt(k)=="'"&&!i("'"))u=false;else l+=a.charAt(k);else switch(a.charAt(k)){case "d":l+=g("d",b.getDate(),2);break;case "D":l+=j("D",b.getDay(),e,f);break;case "o":l+=g("o",Math.round(((new Date(b.getFullYear(),b.getMonth(),b.getDate())).getTime()-
58
+ (new Date(b.getFullYear(),0,0)).getTime())/864E5),3);break;case "m":l+=g("m",b.getMonth()+1,2);break;case "M":l+=j("M",b.getMonth(),h,c);break;case "y":l+=i("y")?b.getFullYear():(b.getYear()%100<10?"0":"")+b.getYear()%100;break;case "@":l+=b.getTime();break;case "!":l+=b.getTime()*1E4+this._ticksTo1970;break;case "'":if(i("'"))l+="'";else u=true;break;default:l+=a.charAt(k)}return l},_possibleChars:function(a){for(var b="",c=false,e=function(h){(h=f+1<a.length&&a.charAt(f+1)==h)&&f++;return h},f=
59
+ 0;f<a.length;f++)if(c)if(a.charAt(f)=="'"&&!e("'"))c=false;else b+=a.charAt(f);else switch(a.charAt(f)){case "d":case "m":case "y":case "@":b+="0123456789";break;case "D":case "M":return null;case "'":if(e("'"))b+="'";else c=true;break;default:b+=a.charAt(f)}return b},_get:function(a,b){return a.settings[b]!==C?a.settings[b]:this._defaults[b]},_setDateFromField:function(a,b){if(a.input.val()!=a.lastVal){var c=this._get(a,"dateFormat"),e=a.lastVal=a.input?a.input.val():null,f,h;f=h=this._getDefaultDate(a);
60
+ var i=this._getFormatConfig(a);try{f=this.parseDate(c,e,i)||h}catch(g){this.log(g);e=b?"":e}a.selectedDay=f.getDate();a.drawMonth=a.selectedMonth=f.getMonth();a.drawYear=a.selectedYear=f.getFullYear();a.currentDay=e?f.getDate():0;a.currentMonth=e?f.getMonth():0;a.currentYear=e?f.getFullYear():0;this._adjustInstDate(a)}},_getDefaultDate:function(a){return this._restrictMinMax(a,this._determineDate(a,this._get(a,"defaultDate"),new Date))},_determineDate:function(a,b,c){var e=function(h){var i=new Date;
61
+ i.setDate(i.getDate()+h);return i},f=function(h){try{return d.datepicker.parseDate(d.datepicker._get(a,"dateFormat"),h,d.datepicker._getFormatConfig(a))}catch(i){}var g=(h.toLowerCase().match(/^c/)?d.datepicker._getDate(a):null)||new Date,j=g.getFullYear(),l=g.getMonth();g=g.getDate();for(var u=/([+-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g,k=u.exec(h);k;){switch(k[2]||"d"){case "d":case "D":g+=parseInt(k[1],10);break;case "w":case "W":g+=parseInt(k[1],10)*7;break;case "m":case "M":l+=parseInt(k[1],10);g=
62
+ Math.min(g,d.datepicker._getDaysInMonth(j,l));break;case "y":case "Y":j+=parseInt(k[1],10);g=Math.min(g,d.datepicker._getDaysInMonth(j,l));break}k=u.exec(h)}return new Date(j,l,g)};if(b=(b=b==null||b===""?c:typeof b=="string"?f(b):typeof b=="number"?isNaN(b)?c:e(b):new Date(b.getTime()))&&b.toString()=="Invalid Date"?c:b){b.setHours(0);b.setMinutes(0);b.setSeconds(0);b.setMilliseconds(0)}return this._daylightSavingAdjust(b)},_daylightSavingAdjust:function(a){if(!a)return null;a.setHours(a.getHours()>
63
+ 12?a.getHours()+2:0);return a},_setDate:function(a,b,c){var e=!b,f=a.selectedMonth,h=a.selectedYear;b=this._restrictMinMax(a,this._determineDate(a,b,new Date));a.selectedDay=a.currentDay=b.getDate();a.drawMonth=a.selectedMonth=a.currentMonth=b.getMonth();a.drawYear=a.selectedYear=a.currentYear=b.getFullYear();if((f!=a.selectedMonth||h!=a.selectedYear)&&!c)this._notifyChange(a);this._adjustInstDate(a);if(a.input)a.input.val(e?"":this._formatDate(a))},_getDate:function(a){return!a.currentYear||a.input&&
64
+ a.input.val()==""?null:this._daylightSavingAdjust(new Date(a.currentYear,a.currentMonth,a.currentDay))},_generateHTML:function(a){var b=new Date;b=this._daylightSavingAdjust(new Date(b.getFullYear(),b.getMonth(),b.getDate()));var c=this._get(a,"isRTL"),e=this._get(a,"showButtonPanel"),f=this._get(a,"hideIfNoPrevNext"),h=this._get(a,"navigationAsDateFormat"),i=this._getNumberOfMonths(a),g=this._get(a,"showCurrentAtPos"),j=this._get(a,"stepMonths"),l=i[0]!=1||i[1]!=1,u=this._daylightSavingAdjust(!a.currentDay?
65
+ new Date(9999,9,9):new Date(a.currentYear,a.currentMonth,a.currentDay)),k=this._getMinMaxDate(a,"min"),o=this._getMinMaxDate(a,"max");g=a.drawMonth-g;var m=a.drawYear;if(g<0){g+=12;m--}if(o){var n=this._daylightSavingAdjust(new Date(o.getFullYear(),o.getMonth()-i[0]*i[1]+1,o.getDate()));for(n=k&&n<k?k:n;this._daylightSavingAdjust(new Date(m,g,1))>n;){g--;if(g<0){g=11;m--}}}a.drawMonth=g;a.drawYear=m;n=this._get(a,"prevText");n=!h?n:this.formatDate(n,this._daylightSavingAdjust(new Date(m,g-j,1)),this._getFormatConfig(a));
66
+ n=this._canAdjustMonth(a,-1,m,g)?'<a class="ui-datepicker-prev ui-corner-all" onclick="DP_jQuery_'+B+".datepicker._adjustDate('#"+a.id+"', -"+j+", 'M');\" title=\""+n+'"><span class="ui-icon ui-icon-circle-triangle-'+(c?"e":"w")+'">'+n+"</span></a>":f?"":'<a class="ui-datepicker-prev ui-corner-all ui-state-disabled" title="'+n+'"><span class="ui-icon ui-icon-circle-triangle-'+(c?"e":"w")+'">'+n+"</span></a>";var s=this._get(a,"nextText");s=!h?s:this.formatDate(s,this._daylightSavingAdjust(new Date(m,
67
+ g+j,1)),this._getFormatConfig(a));f=this._canAdjustMonth(a,+1,m,g)?'<a class="ui-datepicker-next ui-corner-all" onclick="DP_jQuery_'+B+".datepicker._adjustDate('#"+a.id+"', +"+j+", 'M');\" title=\""+s+'"><span class="ui-icon ui-icon-circle-triangle-'+(c?"w":"e")+'">'+s+"</span></a>":f?"":'<a class="ui-datepicker-next ui-corner-all ui-state-disabled" title="'+s+'"><span class="ui-icon ui-icon-circle-triangle-'+(c?"w":"e")+'">'+s+"</span></a>";j=this._get(a,"currentText");s=this._get(a,"gotoCurrent")&&
68
+ a.currentDay?u:b;j=!h?j:this.formatDate(j,s,this._getFormatConfig(a));h=!a.inline?'<button type="button" class="ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all" onclick="DP_jQuery_'+B+'.datepicker._hideDatepicker();">'+this._get(a,"closeText")+"</button>":"";e=e?'<div class="ui-datepicker-buttonpane ui-widget-content">'+(c?h:"")+(this._isInRange(a,s)?'<button type="button" class="ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all" onclick="DP_jQuery_'+
69
+ B+".datepicker._gotoToday('#"+a.id+"');\">"+j+"</button>":"")+(c?"":h)+"</div>":"";h=parseInt(this._get(a,"firstDay"),10);h=isNaN(h)?0:h;j=this._get(a,"showWeek");s=this._get(a,"dayNames");this._get(a,"dayNamesShort");var q=this._get(a,"dayNamesMin"),A=this._get(a,"monthNames"),v=this._get(a,"monthNamesShort"),p=this._get(a,"beforeShowDay"),D=this._get(a,"showOtherMonths"),K=this._get(a,"selectOtherMonths");this._get(a,"calculateWeek");for(var E=this._getDefaultDate(a),w="",x=0;x<i[0];x++){var O=
70
+ "";this.maxRows=4;for(var G=0;G<i[1];G++){var P=this._daylightSavingAdjust(new Date(m,g,a.selectedDay)),t=" ui-corner-all",y="";if(l){y+='<div class="ui-datepicker-group';if(i[1]>1)switch(G){case 0:y+=" ui-datepicker-group-first";t=" ui-corner-"+(c?"right":"left");break;case i[1]-1:y+=" ui-datepicker-group-last";t=" ui-corner-"+(c?"left":"right");break;default:y+=" ui-datepicker-group-middle";t="";break}y+='">'}y+='<div class="ui-datepicker-header ui-widget-header ui-helper-clearfix'+t+'">'+(/all|left/.test(t)&&
71
+ x==0?c?f:n:"")+(/all|right/.test(t)&&x==0?c?n:f:"")+this._generateMonthYearHeader(a,g,m,k,o,x>0||G>0,A,v)+'</div><table class="ui-datepicker-calendar"><thead><tr>';var z=j?'<th class="ui-datepicker-week-col">'+this._get(a,"weekHeader")+"</th>":"";for(t=0;t<7;t++){var r=(t+h)%7;z+="<th"+((t+h+6)%7>=5?' class="ui-datepicker-week-end"':"")+'><span title="'+s[r]+'">'+q[r]+"</span></th>"}y+=z+"</tr></thead><tbody>";z=this._getDaysInMonth(m,g);if(m==a.selectedYear&&g==a.selectedMonth)a.selectedDay=Math.min(a.selectedDay,
72
+ z);t=(this._getFirstDayOfMonth(m,g)-h+7)%7;z=Math.ceil((t+z)/7);this.maxRows=z=l?this.maxRows>z?this.maxRows:z:z;r=this._daylightSavingAdjust(new Date(m,g,1-t));for(var Q=0;Q<z;Q++){y+="<tr>";var R=!j?"":'<td class="ui-datepicker-week-col">'+this._get(a,"calculateWeek")(r)+"</td>";for(t=0;t<7;t++){var I=p?p.apply(a.input?a.input[0]:null,[r]):[true,""],F=r.getMonth()!=g,L=F&&!K||!I[0]||k&&r<k||o&&r>o;R+='<td class="'+((t+h+6)%7>=5?" ui-datepicker-week-end":"")+(F?" ui-datepicker-other-month":"")+(r.getTime()==
73
+ P.getTime()&&g==a.selectedMonth&&a._keyEvent||E.getTime()==r.getTime()&&E.getTime()==P.getTime()?" "+this._dayOverClass:"")+(L?" "+this._unselectableClass+" ui-state-disabled":"")+(F&&!D?"":" "+I[1]+(r.getTime()==u.getTime()?" "+this._currentClass:"")+(r.getTime()==b.getTime()?" ui-datepicker-today":""))+'"'+((!F||D)&&I[2]?' title="'+I[2]+'"':"")+(L?"":' onclick="DP_jQuery_'+B+".datepicker._selectDay('#"+a.id+"',"+r.getMonth()+","+r.getFullYear()+', this);return false;"')+">"+(F&&!D?"&#xa0;":L?'<span class="ui-state-default">'+
74
+ r.getDate()+"</span>":'<a class="ui-state-default'+(r.getTime()==b.getTime()?" ui-state-highlight":"")+(r.getTime()==u.getTime()?" ui-state-active":"")+(F?" ui-priority-secondary":"")+'" href="#">'+r.getDate()+"</a>")+"</td>";r.setDate(r.getDate()+1);r=this._daylightSavingAdjust(r)}y+=R+"</tr>"}g++;if(g>11){g=0;m++}y+="</tbody></table>"+(l?"</div>"+(i[0]>0&&G==i[1]-1?'<div class="ui-datepicker-row-break"></div>':""):"");O+=y}w+=O}w+=e+(d.browser.msie&&parseInt(d.browser.version,10)<7&&!a.inline?'<iframe src="javascript:false;" class="ui-datepicker-cover" frameborder="0"></iframe>':
75
+ "");a._keyEvent=false;return w},_generateMonthYearHeader:function(a,b,c,e,f,h,i,g){var j=this._get(a,"changeMonth"),l=this._get(a,"changeYear"),u=this._get(a,"showMonthAfterYear"),k='<div class="ui-datepicker-title">',o="";if(h||!j)o+='<span class="ui-datepicker-month">'+i[b]+"</span>";else{i=e&&e.getFullYear()==c;var m=f&&f.getFullYear()==c;o+='<select class="ui-datepicker-month" onchange="DP_jQuery_'+B+".datepicker._selectMonthYear('#"+a.id+"', this, 'M');\" >";for(var n=0;n<12;n++)if((!i||n>=e.getMonth())&&
76
+ (!m||n<=f.getMonth()))o+='<option value="'+n+'"'+(n==b?' selected="selected"':"")+">"+g[n]+"</option>";o+="</select>"}u||(k+=o+(h||!(j&&l)?"&#xa0;":""));if(!a.yearshtml){a.yearshtml="";if(h||!l)k+='<span class="ui-datepicker-year">'+c+"</span>";else{g=this._get(a,"yearRange").split(":");var s=(new Date).getFullYear();i=function(q){q=q.match(/c[+-].*/)?c+parseInt(q.substring(1),10):q.match(/[+-].*/)?s+parseInt(q,10):parseInt(q,10);return isNaN(q)?s:q};b=i(g[0]);g=Math.max(b,i(g[1]||""));b=e?Math.max(b,
77
+ e.getFullYear()):b;g=f?Math.min(g,f.getFullYear()):g;for(a.yearshtml+='<select class="ui-datepicker-year" onchange="DP_jQuery_'+B+".datepicker._selectMonthYear('#"+a.id+"', this, 'Y');\" >";b<=g;b++)a.yearshtml+='<option value="'+b+'"'+(b==c?' selected="selected"':"")+">"+b+"</option>";a.yearshtml+="</select>";k+=a.yearshtml;a.yearshtml=null}}k+=this._get(a,"yearSuffix");if(u)k+=(h||!(j&&l)?"&#xa0;":"")+o;k+="</div>";return k},_adjustInstDate:function(a,b,c){var e=a.drawYear+(c=="Y"?b:0),f=a.drawMonth+
78
+ (c=="M"?b:0);b=Math.min(a.selectedDay,this._getDaysInMonth(e,f))+(c=="D"?b:0);e=this._restrictMinMax(a,this._daylightSavingAdjust(new Date(e,f,b)));a.selectedDay=e.getDate();a.drawMonth=a.selectedMonth=e.getMonth();a.drawYear=a.selectedYear=e.getFullYear();if(c=="M"||c=="Y")this._notifyChange(a)},_restrictMinMax:function(a,b){var c=this._getMinMaxDate(a,"min");a=this._getMinMaxDate(a,"max");b=c&&b<c?c:b;return b=a&&b>a?a:b},_notifyChange:function(a){var b=this._get(a,"onChangeMonthYear");if(b)b.apply(a.input?
79
+ a.input[0]:null,[a.selectedYear,a.selectedMonth+1,a])},_getNumberOfMonths:function(a){a=this._get(a,"numberOfMonths");return a==null?[1,1]:typeof a=="number"?[1,a]:a},_getMinMaxDate:function(a,b){return this._determineDate(a,this._get(a,b+"Date"),null)},_getDaysInMonth:function(a,b){return 32-this._daylightSavingAdjust(new Date(a,b,32)).getDate()},_getFirstDayOfMonth:function(a,b){return(new Date(a,b,1)).getDay()},_canAdjustMonth:function(a,b,c,e){var f=this._getNumberOfMonths(a);c=this._daylightSavingAdjust(new Date(c,
80
+ e+(b<0?b:f[0]*f[1]),1));b<0&&c.setDate(this._getDaysInMonth(c.getFullYear(),c.getMonth()));return this._isInRange(a,c)},_isInRange:function(a,b){var c=this._getMinMaxDate(a,"min");a=this._getMinMaxDate(a,"max");return(!c||b.getTime()>=c.getTime())&&(!a||b.getTime()<=a.getTime())},_getFormatConfig:function(a){var b=this._get(a,"shortYearCutoff");b=typeof b!="string"?b:(new Date).getFullYear()%100+parseInt(b,10);return{shortYearCutoff:b,dayNamesShort:this._get(a,"dayNamesShort"),dayNames:this._get(a,
81
+ "dayNames"),monthNamesShort:this._get(a,"monthNamesShort"),monthNames:this._get(a,"monthNames")}},_formatDate:function(a,b,c,e){if(!b){a.currentDay=a.selectedDay;a.currentMonth=a.selectedMonth;a.currentYear=a.selectedYear}b=b?typeof b=="object"?b:this._daylightSavingAdjust(new Date(e,c,b)):this._daylightSavingAdjust(new Date(a.currentYear,a.currentMonth,a.currentDay));return this.formatDate(this._get(a,"dateFormat"),b,this._getFormatConfig(a))}});d.fn.datepicker=function(a){if(!this.length)return this;
82
+ if(!d.datepicker.initialized){d(document).mousedown(d.datepicker._checkExternalClick).find("body").append(d.datepicker.dpDiv);d.datepicker.initialized=true}var b=Array.prototype.slice.call(arguments,1);if(typeof a=="string"&&(a=="isDisabled"||a=="getDate"||a=="widget"))return d.datepicker["_"+a+"Datepicker"].apply(d.datepicker,[this[0]].concat(b));if(a=="option"&&arguments.length==2&&typeof arguments[1]=="string")return d.datepicker["_"+a+"Datepicker"].apply(d.datepicker,[this[0]].concat(b));return this.each(function(){typeof a==
83
+ "string"?d.datepicker["_"+a+"Datepicker"].apply(d.datepicker,[this].concat(b)):d.datepicker._attachDatepicker(this,a)})};d.datepicker=new M;d.datepicker.initialized=false;d.datepicker.uuid=(new Date).getTime();d.datepicker.version="1.8.16";window["DP_jQuery_"+B]=d})(jQuery);
84
+ ;
languages/woo_ce-en_GB.mo ADDED
Binary file
languages/woo_ce-en_GB.po ADDED
@@ -0,0 +1,97 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ msgid ""
2
+ msgstr ""
3
+ "Project-Id-Version: woocommerce-exporter\n"
4
+ "Report-Msgid-Bugs-To: \n"
5
+ "POT-Creation-Date: 2012-01-29 18:32+1000\n"
6
+ "PO-Revision-Date: 2012-01-29 18:32+1000\n"
7
+ "Last-Translator: \n"
8
+ "Language-Team: Visser Labs\n"
9
+ "MIME-Version: 1.0\n"
10
+ "Content-Type: text/plain; charset=UTF-8\n"
11
+ "Content-Transfer-Encoding: 8bit\n"
12
+ "X-Poedit-KeywordsList: __;_e\n"
13
+ "X-Poedit-Basepath: .\n"
14
+ "X-Poedit-SearchPath-0: ..\n"
15
+
16
+ #: ../exporter.php:26
17
+ msgid "WooCommerce Exporter"
18
+ msgstr ""
19
+
20
+ #: ../exporter.php:27
21
+ #: ../includes/functions.php:9
22
+ msgid "Store Export"
23
+ msgstr ""
24
+
25
+ #: ../exporter.php:69
26
+ msgid "Chosen WooCommerce details have been exported from your store."
27
+ msgstr ""
28
+
29
+ #: ../exporter.php:99
30
+ msgid "Export to CSV"
31
+ msgstr ""
32
+
33
+ #: ../exporter.php:103
34
+ msgid "Export WooCommerce Details"
35
+ msgstr ""
36
+
37
+ #: ../exporter.php:109
38
+ msgid "Products"
39
+ msgstr ""
40
+
41
+ #: ../exporter.php:122
42
+ msgid "Import Options"
43
+ msgstr ""
44
+
45
+ #: ../exporter.php:129
46
+ msgid "Script timeout"
47
+ msgstr ""
48
+
49
+ #: ../exporter.php:131
50
+ #: ../exporter.php:132
51
+ msgid "minutes"
52
+ msgstr ""
53
+
54
+ #: ../exporter.php:133
55
+ msgid "hour"
56
+ msgstr ""
57
+
58
+ #: ../exporter.php:134
59
+ msgid "Unlimited"
60
+ msgstr ""
61
+
62
+ #: ../exporter.php:136
63
+ msgid "Script timeout defines how long WooCommerce Exporter is 'allowed' to process your CSV file, once the time limit is reached the export process halts."
64
+ msgstr ""
65
+
66
+ #: ../exporter.php:146
67
+ msgid "Export"
68
+ msgstr ""
69
+
70
+ #: ../exporter.php:152
71
+ msgid "Chosen WooCommerce details are being exported, this process can take awhile. Time for a beer?"
72
+ msgstr ""
73
+
74
+ #: ../exporter.php:154
75
+ msgid "Return to <a href=\""
76
+ msgstr ""
77
+
78
+ #: ../includes/common-dashboard_widgets.php:8
79
+ msgid "Plugin News - by Visser Labs"
80
+ msgstr ""
81
+
82
+ #: ../includes/common-dashboard_widgets.php:32
83
+ msgid "Connection failed. Please check your network settings."
84
+ msgstr ""
85
+
86
+ #: ../includes/common-update.php:49
87
+ msgid "An Unexpected HTTP Error occurred during the API request.</p> <p><a href=\"?\" onclick=\"document.location.reload(); return false;\">Try again</a>"
88
+ msgstr ""
89
+
90
+ #: ../includes/common-update.php:53
91
+ msgid "An unknown error occurred"
92
+ msgstr ""
93
+
94
+ #: ../includes/functions.php:9
95
+ msgid "WP e-Commerce Exporter"
96
+ msgstr ""
97
+
license.txt ADDED
@@ -0,0 +1,281 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ GNU GENERAL PUBLIC LICENSE
2
+ Version 2, June 1991
3
+
4
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.
5
+ 51 Franklin St, Fifth Floor, Boston, MA 02110, USA
6
+
7
+ Everyone is permitted to copy and distribute verbatim copies
8
+ of this license document, but changing it is not allowed.
9
+
10
+ Preamble
11
+
12
+ The licenses for most software are designed to take away your
13
+ freedom to share and change it. By contrast, the GNU General Public
14
+ License is intended to guarantee your freedom to share and change free
15
+ software--to make sure the software is free for all its users. This
16
+ General Public License applies to most of the Free Software
17
+ Foundation's software and to any other program whose authors commit to
18
+ using it. (Some other Free Software Foundation software is covered by
19
+ the GNU Library General Public License instead.) You can apply it to
20
+ your programs, too.
21
+
22
+ When we speak of free software, we are referring to freedom, not
23
+ price. Our General Public Licenses are designed to make sure that you
24
+ have the freedom to distribute copies of free software (and charge for
25
+ this service if you wish), that you receive source code or can get it
26
+ if you want it, that you can change the software or use pieces of it
27
+ in new free programs; and that you know you can do these things.
28
+
29
+ To protect your rights, we need to make restrictions that forbid
30
+ anyone to deny you these rights or to ask you to surrender the rights.
31
+ These restrictions translate to certain responsibilities for you if you
32
+ distribute copies of the software, or if you modify it.
33
+
34
+ For example, if you distribute copies of such a program, whether
35
+ gratis or for a fee, you must give the recipients all the rights that
36
+ you have. You must make sure that they, too, receive or can get the
37
+ source code. And you must show them these terms so they know their
38
+ rights.
39
+
40
+ We protect your rights with two steps: (1) copyright the software, and
41
+ (2) offer you this license which gives you legal permission to copy,
42
+ distribute and/or modify the software.
43
+
44
+ Also, for each author's protection and ours, we want to make certain
45
+ that everyone understands that there is no warranty for this free
46
+ software. If the software is modified by someone else and passed on, we
47
+ want its recipients to know that what they have is not the original, so
48
+ that any problems introduced by others will not reflect on the original
49
+ authors' reputations.
50
+
51
+ Finally, any free program is threatened constantly by software
52
+ patents. We wish to avoid the danger that redistributors of a free
53
+ program will individually obtain patent licenses, in effect making the
54
+ program proprietary. To prevent this, we have made it clear that any
55
+ patent must be licensed for everyone's free use or not licensed at all.
56
+
57
+ The precise terms and conditions for copying, distribution and
58
+ modification follow.
59
+
60
+ GNU GENERAL PUBLIC LICENSE
61
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
62
+
63
+ 0. This License applies to any program or other work which contains
64
+ a notice placed by the copyright holder saying it may be distributed
65
+ under the terms of this General Public License. The "Program", below,
66
+ refers to any such program or work, and a "work based on the Program"
67
+ means either the Program or any derivative work under copyright law:
68
+ that is to say, a work containing the Program or a portion of it,
69
+ either verbatim or with modifications and/or translated into another
70
+ language. (Hereinafter, translation is included without limitation in
71
+ the term "modification".) Each licensee is addressed as "you".
72
+
73
+ Activities other than copying, distribution and modification are not
74
+ covered by this License; they are outside its scope. The act of
75
+ running the Program is not restricted, and the output from the Program
76
+ is covered only if its contents constitute a work based on the
77
+ Program (independent of having been made by running the Program).
78
+ Whether that is true depends on what the Program does.
79
+
80
+ 1. You may copy and distribute verbatim copies of the Program's
81
+ source code as you receive it, in any medium, provided that you
82
+ conspicuously and appropriately publish on each copy an appropriate
83
+ copyright notice and disclaimer of warranty; keep intact all the
84
+ notices that refer to this License and to the absence of any warranty;
85
+ and give any other recipients of the Program a copy of this License
86
+ along with the Program.
87
+
88
+ You may charge a fee for the physical act of transferring a copy, and
89
+ you may at your option offer warranty protection in exchange for a fee.
90
+
91
+ 2. You may modify your copy or copies of the Program or any portion
92
+ of it, thus forming a work based on the Program, and copy and
93
+ distribute such modifications or work under the terms of Section 1
94
+ above, provided that you also meet all of these conditions:
95
+
96
+ a) You must cause the modified files to carry prominent notices
97
+ stating that you changed the files and the date of any change.
98
+
99
+ b) You must cause any work that you distribute or publish, that in
100
+ whole or in part contains or is derived from the Program or any
101
+ part thereof, to be licensed as a whole at no charge to all third
102
+ parties under the terms of this License.
103
+
104
+ c) If the modified program normally reads commands interactively
105
+ when run, you must cause it, when started running for such
106
+ interactive use in the most ordinary way, to print or display an
107
+ announcement including an appropriate copyright notice and a
108
+ notice that there is no warranty (or else, saying that you provide
109
+ a warranty) and that users may redistribute the program under
110
+ these conditions, and telling the user how to view a copy of this
111
+ License. (Exception: if the Program itself is interactive but
112
+ does not normally print such an announcement, your work based on
113
+ the Program is not required to print an announcement.)
114
+
115
+ These requirements apply to the modified work as a whole. If
116
+ identifiable sections of that work are not derived from the Program,
117
+ and can be reasonably considered independent and separate works in
118
+ themselves, then this License, and its terms, do not apply to those
119
+ sections when you distribute them as separate works. But when you
120
+ distribute the same sections as part of a whole which is a work based
121
+ on the Program, the distribution of the whole must be on the terms of
122
+ this License, whose permissions for other licensees extend to the
123
+ entire whole, and thus to each and every part regardless of who wrote it.
124
+ Thus, it is not the intent of this section to claim rights or contest
125
+ your rights to work written entirely by you; rather, the intent is to
126
+ exercise the right to control the distribution of derivative or
127
+ collective works based on the Program.
128
+
129
+ In addition, mere aggregation of another work not based on the Program
130
+ with the Program (or with a work based on the Program) on a volume of
131
+ a storage or distribution medium does not bring the other work under
132
+ the scope of this License.
133
+
134
+ 3. You may copy and distribute the Program (or a work based on it,
135
+ under Section 2) in object code or executable form under the terms of
136
+ Sections 1 and 2 above provided that you also do one of the following:
137
+
138
+ a) Accompany it with the complete corresponding machine-readable
139
+ source code, which must be distributed under the terms of Sections
140
+ 1 and 2 above on a medium customarily used for software interchange; or,
141
+
142
+ b) Accompany it with a written offer, valid for at least three
143
+ years, to give any third party, for a charge no more than your
144
+ cost of physically performing source distribution, a complete
145
+ machine-readable copy of the corresponding source code, to be
146
+ distributed under the terms of Sections 1 and 2 above on a medium
147
+ customarily used for software interchange; or,
148
+
149
+ c) Accompany it with the information you received as to the offer
150
+ to distribute corresponding source code. (This alternative is
151
+ allowed only for noncommercial distribution and only if you
152
+ received the program in object code or executable form with such
153
+ an offer, in accord with Subsection b above.)
154
+
155
+ The source code for a work means the preferred form of the work for
156
+ making modifications to it. For an executable work, complete source
157
+ code means all the source code for all modules it contains, plus any
158
+ associated interface definition files, plus the scripts used to
159
+ control compilation and installation of the executable. However, as a
160
+ special exception, the source code distributed need not include
161
+ anything that is normally distributed (in either source or binary
162
+ form) with the major components (compiler, kernel, and so on) of the
163
+ operating system on which the executable runs, unless that component
164
+ itself accompanies the executable.
165
+
166
+ If distribution of executable or object code is made by offering
167
+ access to copy from a designated place, then offering equivalent
168
+ access to copy the source code from the same place counts as
169
+ distribution of the source code, even though third parties are not
170
+ compelled to copy the source along with the object code.
171
+
172
+ 4. You may not copy, modify, sublicense, or distribute the Program
173
+ except as expressly provided under this License. Any attempt
174
+ otherwise to copy, modify, sublicense or distribute the Program is
175
+ void, and will automatically terminate your rights under this License.
176
+ However, parties who have received copies, or rights, from you under
177
+ this License will not have their licenses terminated so long as such
178
+ parties remain in full compliance.
179
+
180
+ 5. You are not required to accept this License, since you have not
181
+ signed it. However, nothing else grants you permission to modify or
182
+ distribute the Program or its derivative works. These actions are
183
+ prohibited by law if you do not accept this License. Therefore, by
184
+ modifying or distributing the Program (or any work based on the
185
+ Program), you indicate your acceptance of this License to do so, and
186
+ all its terms and conditions for copying, distributing or modifying
187
+ the Program or works based on it.
188
+
189
+ 6. Each time you redistribute the Program (or any work based on the
190
+ Program), the recipient automatically receives a license from the
191
+ original licensor to copy, distribute or modify the Program subject to
192
+ these terms and conditions. You may not impose any further
193
+ restrictions on the recipients' exercise of the rights granted herein.
194
+ You are not responsible for enforcing compliance by third parties to
195
+ this License.
196
+
197
+ 7. If, as a consequence of a court judgment or allegation of patent
198
+ infringement or for any other reason (not limited to patent issues),
199
+ conditions are imposed on you (whether by court order, agreement or
200
+ otherwise) that contradict the conditions of this License, they do not
201
+ excuse you from the conditions of this License. If you cannot
202
+ distribute so as to satisfy simultaneously your obligations under this
203
+ License and any other pertinent obligations, then as a consequence you
204
+ may not distribute the Program at all. For example, if a patent
205
+ license would not permit royalty-free redistribution of the Program by
206
+ all those who receive copies directly or indirectly through you, then
207
+ the only way you could satisfy both it and this License would be to
208
+ refrain entirely from distribution of the Program.
209
+
210
+ If any portion of this section is held invalid or unenforceable under
211
+ any particular circumstance, the balance of the section is intended to
212
+ apply and the section as a whole is intended to apply in other
213
+ circumstances.
214
+
215
+ It is not the purpose of this section to induce you to infringe any
216
+ patents or other property right claims or to contest validity of any
217
+ such claims; this section has the sole purpose of protecting the
218
+ integrity of the free software distribution system, which is
219
+ implemented by public license practices. Many people have made
220
+ generous contributions to the wide range of software distributed
221
+ through that system in reliance on consistent application of that
222
+ system; it is up to the author/donor to decide if he or she is willing
223
+ to distribute software through any other system and a licensee cannot
224
+ impose that choice.
225
+
226
+ This section is intended to make thoroughly clear what is believed to
227
+ be a consequence of the rest of this License.
228
+
229
+ 8. If the distribution and/or use of the Program is restricted in
230
+ certain countries either by patents or by copyrighted interfaces, the
231
+ original copyright holder who places the Program under this License
232
+ may add an explicit geographical distribution limitation excluding
233
+ those countries, so that distribution is permitted only in or among
234
+ countries not thus excluded. In such case, this License incorporates
235
+ the limitation as if written in the body of this License.
236
+
237
+ 9. The Free Software Foundation may publish revised and/or new versions
238
+ of the General Public License from time to time. Such new versions will
239
+ be similar in spirit to the present version, but may differ in detail to
240
+ address new problems or concerns.
241
+
242
+ Each version is given a distinguishing version number. If the Program
243
+ specifies a version number of this License which applies to it and "any
244
+ later version", you have the option of following the terms and conditions
245
+ either of that version or of any later version published by the Free
246
+ Software Foundation. If the Program does not specify a version number of
247
+ this License, you may choose any version ever published by the Free Software
248
+ Foundation.
249
+
250
+ 10. If you wish to incorporate parts of the Program into other free
251
+ programs whose distribution conditions are different, write to the author
252
+ to ask for permission. For software which is copyrighted by the Free
253
+ Software Foundation, write to the Free Software Foundation; we sometimes
254
+ make exceptions for this. Our decision will be guided by the two goals
255
+ of preserving the free status of all derivatives of our free software and
256
+ of promoting the sharing and reuse of software generally.
257
+
258
+ NO WARRANTY
259
+
260
+ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
261
+ FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
262
+ OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
263
+ PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
264
+ OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
265
+ MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
266
+ TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
267
+ PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
268
+ REPAIR OR CORRECTION.
269
+
270
+ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
271
+ WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
272
+ REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
273
+ INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
274
+ OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
275
+ TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
276
+ YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
277
+ PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
278
+ POSSIBILITY OF SUCH DAMAGES.
279
+
280
+ END OF TERMS AND CONDITIONS
281
+
readme.txt ADDED
@@ -0,0 +1,562 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ === WooCommerce - Store Exporter ===
2
+
3
+ Contributors: visser
4
+ Donate link: http://www.visser.com.au/#donations
5
+ Tags: e-commerce, woocommerce, shop, cart, ecommerce, export, csv, xml, xls, excel, customers, products, sales, orders, coupons, users, attributes, subscriptions
6
+ Requires at least: 2.9.2
7
+ Tested up to: 4.0
8
+ Stable tag: 1.8.1
9
+
10
+ == Description ==
11
+
12
+ Export store details out of WooCommerce into simple formatted files (e.g. CSV, XML, Excel 2007 XLS, etc.).
13
+
14
+ Features include:
15
+
16
+ * Export Products (*)
17
+ * Export Products by Product Category
18
+ * Export Products by Product Status
19
+ * Export Products by Type including Variations
20
+ * Export Categories
21
+ * Export Tags
22
+ * Export Brands (*)
23
+ * Export Orders (*)
24
+ * Export Orders by Order Status (*)
25
+ * Export Orders by Order Date (*)
26
+ * Export Orders by Customers (*)
27
+ * Export Orders by Coupon Code (*)
28
+ * Export Customers (*)
29
+ * Export Customers by Order Status (*)
30
+ * Export Users
31
+ * Export Coupons (*)
32
+ * Export Subscriptions (*)
33
+ * Export Product Vendors (*)
34
+ * Export Attributes (*)
35
+ * Toggle and save export fields
36
+ * Field label editor (*)
37
+ * Works with WordPress Multisite
38
+ * Export to CSV file
39
+ * Export to XML file (*)
40
+ * Export to Excel 2007 (XLS) file (*)
41
+ * Export to WordPress Media
42
+ * Export to e-mail addresses (*)
43
+ * Export to remote POST (*)
44
+ * Export to remote FTP (*)
45
+ * Supports external CRON commands (*)
46
+ * Supports scheduled exports (*)
47
+
48
+ (*) Requires the Pro upgrade to enable additional store export functionality.
49
+
50
+ Just a few of the features unlocked in the Pro upgrade of Product Importer include:
51
+
52
+ - Compatibility with Product Importer Deluxe
53
+ - Export All in One SEO Pack
54
+ - Export Advanced Google Product Feed
55
+ - Export Product Addons
56
+ - Export Sequential Order Number Pro
57
+ - Export Checkout Manager
58
+ - Export Checkout Manager Pro
59
+ - Export Checkout Field Editor
60
+ - Export Cost of Goods
61
+ - Export Per-Product Shipping
62
+ - Export Print Invoice & Delivery Note
63
+ - Export Local Pickups Plus
64
+ - Export WooCommerce Subscriptions
65
+ - Export Checkout Field Manager
66
+ - Export Currency Switcher
67
+ - Export WooCommerce PDF Invoices & Packing Slips
68
+ - Export WooCommerce Checkout Add-ons
69
+ - Export Product Vendors
70
+
71
+ ... and more free and Premium extensions for WooCommerce.
72
+
73
+ For more information visit: http://www.visser.com.au/woocommerce/
74
+
75
+ == Installation ==
76
+
77
+ 1. Upload the folder 'woocommerce-exporter' to the '/wp-content/plugins/' directory
78
+ 2. Activate 'WooCommerce - Store Exporter' through the 'Plugins' menu in WordPress
79
+
80
+ See Usage section before for instructions on how to generate export files.
81
+
82
+ == Usage ==
83
+
84
+ 1. Open WooCommerce > Store Export from the WordPress Administration
85
+ 2. Select the Export tab on the Store Exporter screen
86
+ 3. Select which export type and WooCommerce details you would like to export
87
+ 4. Click Export
88
+ 5. Download archived copies of previous exports from the Archives tab
89
+
90
+ Done!
91
+
92
+ == Support ==
93
+
94
+ If you have any problems, questions or suggestions please join the members discussion on our WooCommerce dedicated forum.
95
+
96
+ http://www.visser.com.au/woocommerce/forums/
97
+
98
+ == Screenshots ==
99
+
100
+ 1. The overview screen for Store Exporter.
101
+ 2. Select the data fields to be included in the export, selections are remembered for next export.
102
+ 3. Each dataset (e.g. Products, Orders, etc.) include filter options to filter by date, status, type, customer and more.
103
+ 4. A range of export options can be adjusted to suit different languages and file formatting requirements.
104
+ 5. Export a list of WooCommerce Product Categories into a CSV file.
105
+ 6. Export a list of WooCommerce Product Tags into a CSV file.
106
+ 7. Download archived copies of previous exports
107
+ 8. Use the Field Editor to relabel export fields to your preferred names
108
+ 9. Drag-and-drop export fields to your preferred ordering, sorting is saved between screen refreshes.
109
+
110
+ == Changelog ==
111
+
112
+ = 1.8.1 =
113
+ * Adeded: Export modules to the Export screen
114
+
115
+ = 1.8 =
116
+ * Fixed: Up-sells formatting not saving between screen refreshes
117
+ * Fixed: Cross-sells formatting not saving between screen refreshes
118
+ * Fixed: PHP 5.2 compatibility for anonymous functions
119
+ * Added: Admin notice for PHP 5.2 users to update to supported releases of PHP
120
+
121
+ = 1.7.9 =
122
+ * Changed: Moved Up-sells formatting option to products.php
123
+ * Changed: Moved Cross-sells formatting option to products.php
124
+
125
+ = 1.7.8 =
126
+ * Added: Gravity Form ID to Orders export
127
+ * Added: Gravity Form Name to Orders export
128
+ * Added: Support for changing the export format of scheduled exports
129
+ * Fixed: Display of multiple queued Admin notices
130
+ * Fixed: PHP warning on Subscriptions export
131
+ * Fixed: Attributes showing Term Slug in Products export
132
+ * Fixed: Attributes not including Taxonomy based Terms in Products export
133
+ * Fixed: Empty export rows under certain environments in Products export
134
+ * Added: Support for filtering Orders by Order Dates for scheduled exports
135
+ * Fixed: Compatibility with WooCommerce 2.2+
136
+ * Changed: Moved Brands sorting to brands.php
137
+
138
+ = 1.7.7 =
139
+ * Added: Support for WooCommerce Checkout Add-ons in Orders export
140
+ * Fixed: Saving Export filename option over-sanitized
141
+
142
+ = 1.7.6 =
143
+ * Fixed: Limit volume for Users export
144
+ * Fixed: Offset for Users export
145
+ * Fixed: Sanitize form fields
146
+ * Fixed: Data validation on outputs
147
+ * Fixed: Saving of Order in Users export
148
+ * Fixed: Saving of Order By in Users export
149
+ * Fixed: Count of Customers for large store catalogues
150
+
151
+ = 1.7.5 =
152
+ * Fixed: Custom Product meta not working
153
+ * Changed: Moved Product Gallery support to Pro
154
+ * Changed: Moved Default e-mail recipient to General Settings
155
+ * Changed: Moved Default remote URL POST to General Settings
156
+ * Added: Export Users type in basic Store Exporter
157
+ * Fixed: Add missing WordPress options for Plugin if not present on activation
158
+
159
+ = 1.7.4 =
160
+ * Added: Subscriptions export type
161
+ * Added: Support for Subscription Key in Subscriptions export
162
+ * Added: Support for Subscription Status in Subscriptions export
163
+ * Added: Support for Subscription Name in Subscriptions export
164
+ * Added: Support for User in Subscriptions export
165
+ * Added: Support for User ID in Subscriptions export
166
+ * Added: Support for Order ID in Subscriptions export
167
+ * Added: Support for Order Status in Subscriptions export
168
+ * Added: Support for Post Status in Subscriptions export
169
+ * Added: Support for Start Date in Subscriptions export
170
+ * Added: Support for Expiration in Subscriptions export
171
+ * Added: Support for End Date in Subscriptions export
172
+ * Added: Support for Trial End Date in Subscriptions export
173
+ * Added: Support for Last Payment in Subscriptions export
174
+ * Added: Support for Next Payment in Subscriptions export
175
+ * Added: Support for Renewals in Subscriptions export
176
+ * Added: Support for Product ID in Subscriptions export
177
+ * Added: Support for Product SKU in Subscriptions export
178
+ * Added: Support for Variation ID in Subscriptions export
179
+ * Added: Support for Coupon Code in Subscription export
180
+ * Added: Support for Limit Volume in Subscription export
181
+
182
+ = 1.7.3 =
183
+ * Added: Export type is remembered between screen refreshes
184
+ * Changed: Moved Product Sorting widget to products.php
185
+ * Changed: Moved Filter Products by Product Category widget to products.php
186
+ * Changed: Moved Filter Products by Product Tag widget to products.php
187
+ * Changed: Moved Filter Products by Product Status widget to products.php
188
+
189
+ = 1.7.2 =
190
+ * Fixed: Check for wc_format_localized_price() in older releases of WooCommerce
191
+ * Added: Brands export type
192
+ * Added: Support for Brand Name in Brands export
193
+ * Added: Support for Brand Description in Brands export
194
+ * Added: Support for Brand Slug in Brands export
195
+ * Added: Support for Parent ID in Brands export
196
+ * Added: Support for Brand Image in Brands export
197
+ * Added: Support for sorting options in Brands export
198
+ * Fixed: Added checks for 3rd party classes and legacy WooCommerce functions for 2.0.20
199
+ * Added: Support for Category Description in Categories export
200
+ * Added: Support for Category Image in Categories export
201
+ * Added: Support for Display Type in Categories export
202
+
203
+ = 1.7.1 =
204
+ * Added: Brands support to Orders export
205
+ * Added: Brands support for Order Items in Orders export
206
+ * Fixed: PHP warning notice in Orders export
207
+ * Added: Option to filter different Order Items types from Orders export
208
+
209
+ = 1.7 =
210
+ * Added: Rename of export files across Plugin
211
+ * Added: Coupon Code to Orders export
212
+ * Added: Export Users
213
+ * Added: Support for User ID in Users export
214
+ * Added: Support for Username in Users export
215
+ * Added: Support for User Role in Users export
216
+ * Added: Support for First Name in Users export
217
+ * Added: Support for Last Name in Users export
218
+ * Added: Support for Full Name in Users export
219
+ * Added: Support for Nickname in Users export
220
+ * Added: Support for E-mail in Users export
221
+ * Added: Support for Website in Users export
222
+ * Added: Support for Date Registered in Users export
223
+ * Added: Support for WooCommerce User Profile fields in Users export
224
+ * Added: Product Gallery formatting support includes Media URL
225
+ * Added: Sorting support for Users export
226
+ * Added: Sorting options for Coupons
227
+ * Added: Filter Orders by Coupon Codes
228
+
229
+ = 1.6.2 =
230
+ * Added: MSRP Pricing support for Products
231
+ * Added: WooCommerce Print Invoice & Delivery Note Invoice Number support for Orders
232
+ * Added: WooCommerce Sequential Order Numbers (free) support for Orders
233
+ * Changed: Get 3rd Party Plugin support from woo_ce_product_fields filter
234
+ * Changed: Preparations for sortable export column
235
+ * Fixed: URL to Add New export button after empty export
236
+ * Added: jQuery checks for functions before running
237
+ * Fixed: Conflicts with other WooCommerce Plugins due to shared 'save' form action
238
+ * Fixed: Support for WooCommerce Checkout Manager (Free!)
239
+ * Added: Support for WooCommerce Checkout Manager Pro
240
+ * Added: Support for Currency Switcher in Orders export
241
+ * Added: Support for Checkout Field Editor
242
+
243
+ = 1.6.1 =
244
+ * Fixed: Empty exports
245
+ * Changed: Better detection of empty exports
246
+ * Changed: Better detection of empty data types
247
+ * Added: Customer Filter to Export screen
248
+ * Added: Filter Customers by Order Status option
249
+ * Added: Using is_wp_error() throughout CPT and Term requests
250
+
251
+ = 1.6 =
252
+ * Fixed: Coupon export as XML
253
+ * Fixed: Order export as XML
254
+ * Fixed: Customer export as XML
255
+ * Fixed: Compatibility with WordPress 3.9.1
256
+ * Added: Product export support for Advanced Google Product Feed
257
+ * Added: Product export support for All in One SEO Pack
258
+ * Added: Product export support for WordPress SEO
259
+ * Added: Product export support for Ultimate SEO
260
+ * Fixed: Fatal error affecting CRON export for XML export
261
+ * Fixed: Remember column options after exporting Orders
262
+
263
+ = 1.5.9 =
264
+ * Fixed: Clearing the Limit Volume or Offset values would not be saved
265
+ * Fixed: Force file extension if removed from the Filename option on Settings screen
266
+ * Changed: Reduced memory load by storing $args in $export global
267
+
268
+ = 1.5.8 =
269
+ * Fixed: Fatal error if Store Exporter is not activated
270
+
271
+ = 1.5.7 =
272
+ * Changed: Replaced woo_ce_save_csv_file_attachment() with generic woo_ce_save_file_attachment()
273
+ * Changed: Replaced woo_ce_save_csv_file_guid() with generic woo_ce_save_file_guid()
274
+ * Changed: Replaced woo_ce_save_csv_file_details() with generic woo_ce_save_file_details()
275
+ * Changed: Replaced woo_ce_update_csv_file_detail() with generic woo_ce_update_file_detail()
276
+ * Changed: Moved woo_ce_save_file_details() into common Plugin space
277
+ * Changed: Added third allow_empty property to custom get_option()
278
+
279
+ = 1.5.6 =
280
+ * Added: Disabled support for XML Export Format under Export Option
281
+ * Changed: Created new functions-csv.php file
282
+ * Changed: Moved woo_ce_generate_csv_filename() to functions-csv.php
283
+ * Changed: Moved woo_ce_generate_csv_header() to functions-csv.php
284
+
285
+ = 1.5.5 =
286
+ * Fixed: Export error prompt displaying due to WordPress transient
287
+
288
+ = 1.5.4 =
289
+ * Changed: Removed WooCommere Plugins dashboard widget
290
+ * Added: CSS class to Custom Product Fields
291
+ * Fixed: Broken export checks that may affect export options
292
+
293
+ = 1.5.3 =
294
+ * Added: Support for exporting Local Pickup Plus fields in Orders
295
+ * Fixed: Memory leak in woo_ce_expand_state_name
296
+ * Fixed: Memory leak in woo_ce_expand_country_name
297
+ * Changed: Removed duplicate Order Items: Type field
298
+ * Added: Disabled Custom Order Fields widget to Export screen
299
+ * Changed: Using WP_Query instead of get_posts for bulk export
300
+ * Changed: Cross-Sells and Up-Sells get their own formatting functions
301
+ * Changed: Moved export function into common space for CRON and scheduled exports
302
+ * Added: Toggle visibility of each export types fields within Export Options
303
+
304
+ = 1.5.2 =
305
+ * Added: Option for Up-Sells to export Product SKU instead of Product ID
306
+ * Added: Option for Cross-Sells to export Product SKU instead of Product ID
307
+ * Changed: Toggle visibility of dataset relevant export options
308
+ * Changed: Moved Field delimiter option to Settings tab
309
+ * Changed: Moved Category separator option to Settings tab
310
+ * Changed: Moved Add BOM character option to Settings tab
311
+ * Changed: Moved Character encoding option to Settings tab
312
+ * Changed: Moved Field escape formatting option to Settings tab
313
+ * Changed: Moved Order Item Formatting option to Export Options widget
314
+ * Changed: Combined Volume offset and Limit volume
315
+ * Added: Skip Overview screen option to Overview screen
316
+
317
+ = 1.5.1 =
318
+ * Fixed: CSV File not being displayed on Media screen
319
+ * Added: Download Type support to Products export
320
+ * Fixed: File Download support for WooCommerce 2.0+
321
+ * Changed: Legacy support for File Download export support in pre-WooCommerce 2.0
322
+ * Changed: An empty weight/height/width/length will make the dimension unit empty
323
+ * Added: Setttings tab for managing global export settings
324
+ * Added: Custom export filename support with variables: %store_name%, %dataset%, %date%, %time%
325
+ * Changed: Moved Date Format option to Settings tab
326
+ * Changed: Moved Max unique Order items option to Settings tab
327
+ * Changed: Moved Enable Archives options to Settings tab
328
+ * Changed: Removed Manage Custom Product Fields link from Export Options
329
+ * Changed: Moved Script Timeout option to Settings tab
330
+
331
+ = 1.5 =
332
+ * Added: Menu Order to Products export
333
+ * Changed: Comment Status to Enable Reviews in Products export
334
+
335
+ = 1.4.9 =
336
+ * Added: Order Items: Category and Order Items: Tag to Orders export
337
+ * Added: Clicking an export type from the opening screen will open that export tab
338
+
339
+ = 1.4.8 =
340
+ * Changed: Dropped $woo_ce global
341
+ * Added: Using Plugin constants
342
+ * Changed: Moved debug log to WordPress transient
343
+ * Added: Disabled Custom Product Fields dialog
344
+ * Changed: Removed duplicate Sale Price from Product export
345
+ * Fixed: Empty Parent SKU and Product SKU for Product Variations
346
+ * Fixed: Fill default Stock Status for Products
347
+ * Fixed: Set Product Type to Simple Product by default
348
+ * Added: Error notice after blank screen on export
349
+ * Fixed: Product Categories empty for Variations in Product export
350
+
351
+ = 1.4.7 =
352
+ * Fixed: Multi-site support resolved
353
+ * Changed: Permanently delete failed exports
354
+
355
+ = 1.4.6 =
356
+ * Fixed: Blank screen on export in some instances
357
+ * Changed: Removed legacy progress bar
358
+ * Changed: Removed legacy Javascript in export screen
359
+ * Added: Admin notice confirming deleted archive file
360
+ * Changed: Removed bold headings from admin notices
361
+ * Added: Error notice to explain blank CSV
362
+ * Changed: Renamed "Delete temporary CSV after download" to "Enable Archives"
363
+ * Changed: Removed woo_ce_unload_export_global()
364
+ * Fixed: Delete WordPress Media on failed export
365
+ * Added: Link to Usage document when an error is encountered "Need help?"
366
+ * Changed: Using 'export' capability check for Store Export menu
367
+ * Changed: Using 'update_plugins' capability check for Jigoshop Plugins Dashboard widget (thanks Marcus!)
368
+
369
+ = 1.4.5 =
370
+ * Added: Custom Product fields
371
+ * Added: Memory optimisations for get_posts()
372
+ * Changed: Standard admin notices
373
+
374
+ = 1.4.4 =
375
+ * Changed: Default Date Format to d/m/Y
376
+
377
+ = 1.4.3 =
378
+ * Fixed: Export Orders by User Role
379
+ * Added: Formatting of User Role
380
+
381
+ = 1.4.2 =
382
+ * Added: Product Published and Product Modified dates to Products export
383
+ * Added: Date formatting independant of WordPress > Settings > General
384
+
385
+ = 1.4.1 =
386
+ * Fixed: Default file encoding can trigger PHP warning
387
+ * Added: File encoding support for Categories and Tags
388
+ * Added: Product Tags sorting export support
389
+ * Added: Category sorting export support
390
+ * Added: Separate files for each dataset
391
+
392
+ = 1.4 =
393
+ * Added: File encoding for datasets
394
+ * Changed: Default file encoding to UTF-8
395
+ * Added: Product sorting and ordering
396
+ * Changed: Ordering of Export Options
397
+
398
+ = 1.3.9 =
399
+ * Added: Payment Gateway ID to Orders export
400
+ * Added: Shipping Method ID to Orders export
401
+ * Added: Shipping Cost to Orders export
402
+ * Added: Checkout IP Address to Orders export
403
+ * Added: User Role to Orders export
404
+ * Changed: Removed encoding changes to Description and Excerpt
405
+
406
+ = 1.3.8 =
407
+ * Fixed: PHP 4 notices for File Encoding dropdown
408
+ * Fixed: Translation string on Export screen
409
+ * Added: WordPress get_posts() optimisation
410
+ * Fixed: Ignore Variant Products without Base Products (ala 'phantom Posts')
411
+
412
+ = 1.3.7 =
413
+ * Added: Additional Category column support
414
+ * Added: Additional Tag column support
415
+ * Fixed: HTML entities now print in plain-text
416
+
417
+ = 1.3.6 =
418
+ * Fixed: PHP error for missing function within Store Exporter Deluxe
419
+
420
+ = 1.3.5 =
421
+ * Fixed: Admin icon on Store Exporter screen
422
+ * Fixed: PHP error on Store Exporter screen without Products
423
+ * Changed: Moved CSV File dialog on Media screen to template file
424
+
425
+ = 1.3.4 =
426
+ * Added: Total incl. GST
427
+ * Added: Total excl. GST
428
+ * Added: Purchase Time
429
+ * Changed: Moved woo_ce_count_object() to formatting.php
430
+ * Added: Commenting to each function
431
+ * Fixed: PHP 4 support for missing mb_list_encodings()
432
+
433
+ = 1.3.3 =
434
+ * Added: New Product filter 'woo_ce_product_item'
435
+
436
+ = 1.3.2 =
437
+ * Fixed: Order Notes on Orders export
438
+
439
+ = 1.3.1 =
440
+ * Added: Link to submit additional fields
441
+
442
+ = 1.3 =
443
+ * Changed: Using manage_woocommerce instead of manage_options for permission check
444
+ * Changed: Removed woo_is_admin_valid_icon
445
+ * Changed: Using default WooCommerce icons
446
+
447
+ = 1.2.9 =
448
+ * Fixed: Urgent fix for duplicate formatting function
449
+
450
+ = 1.2.8 =
451
+ * Added: Product ID support
452
+ * Added: Post Parent ID support
453
+ * Added: Export Product variation support
454
+ * Added: Product Attribute support
455
+ * Added: Filter Products export by Type
456
+ * Added: Sale Price Dates From/To support
457
+ * Added: Virtual and Downloadable Product support
458
+ * Added: Remove archived export
459
+ * Added: Count and filter of archived exports
460
+ * Fixed: Hide User ID 0 (guest) from Orders
461
+
462
+ = 1.2.7 =
463
+ * Added: jQuery Chosen support to Orders Customer dropdown
464
+ * Fixed: Incorrect counts on some Export types
465
+
466
+ = 1.2.6 =
467
+ * Added: Product Type support
468
+ * Added: Native jQuery UI support
469
+ * Fixed: Various small bugs
470
+
471
+ = 1.2.5 =
472
+ * Added: Featured Image support
473
+
474
+ = 1.2.3 =
475
+ * Fixed: Tags export
476
+ * Added: Export Products by Product Tag filter
477
+ * Added: Notice for empty export files
478
+ * Changed: UI changes to Filter dialogs
479
+
480
+ = 1.2.2 =
481
+ * Changed: Free version can see Order, Coupon and Customer export options
482
+ * Added: Plugin screenshots
483
+
484
+ = 1.2.1 =
485
+ * Added: Support for BOM
486
+ * Added: Escape field formatting option
487
+ * Added: New line support
488
+ * Added: Payment Status (number) option
489
+
490
+ = 1.2 =
491
+ * Fixed: Surplus cell separator at end of lines
492
+ * Added: Remember field selections
493
+
494
+ = 1.1.1 =
495
+ * Added: Expiry Date support to Coupons
496
+ * Added: Individual Use to Coupons
497
+ * Added: Apply before tax to Coupons
498
+ * Added: Exclude sale items to Coupons
499
+ * Added: Expiry Date to Coupons
500
+ * Added: Minimum Amount to Coupons
501
+ * Added: Exclude Product ID's to Coupons
502
+ * Added: Product Categories to Coupons
503
+ * Added: Exclude Product Categories to Coupons
504
+ * Added: Usage Limit to Coupons
505
+ * Fixed: Customers count causing memory error
506
+ * Added: Formatting of 'on' and 'off' values
507
+ * Changed: Memory overrides
508
+
509
+ = 1.1.0 =
510
+ * Added: Save option for delimiter
511
+ * Added: Save option for category separator
512
+ * Added: Save options for limit volume
513
+ * Added: Save options for offset
514
+ * Added: Save options for timeout
515
+
516
+ = 1.0.9 =
517
+ * Fixed: Export buttons not adjusting Export Dataset
518
+ * Added: Select All options to Export
519
+ * Added: Partial export support
520
+ * Changed: Integration with Exporter Deluxe
521
+
522
+ = 1.0.8 =
523
+ * Added: Integration with Exporter Deluxe
524
+
525
+ = 1.0.7 =
526
+ * Fixed: Excerpt/Product Short description
527
+
528
+ = 1.0.6 =
529
+ * Changed: Options engine
530
+ * Changed: Moved styles to admin_enqueue_scripts
531
+ * Added: Coupons support
532
+
533
+ = 1.0.5 =
534
+ * Fixed: Template header bug
535
+ * Added: Tabbed viewing on the Exporter screen
536
+ * Added: Export Orders
537
+ * Added: Product columns
538
+ * Added: Order columns
539
+ * Added: Category heirachy support (up to 3 levels deep)
540
+ * Fixed: Foreign character support
541
+ * Changed: More efficient Tag generation
542
+ * Fixed: Link error on Export within Plugin screen
543
+
544
+ = 1.0.4 =
545
+ * Added: Duplicate e-mail address filtering
546
+ * Changed: Updated readme.txt
547
+
548
+ = 1.0.3 =
549
+ * Added: Support for Customers
550
+
551
+ = 1.0.2 =
552
+ * Changed: Migrated to WordPress Extend
553
+
554
+ = 1.0.1 =
555
+ * Fixed: Dashboard widget not loading
556
+
557
+ = 1.0 =
558
+ * Added: First working release of the Plugin
559
+
560
+ == Disclaimer ==
561
+
562
+ It is not responsible for any harm or wrong doing this Plugin may cause. Users are fully responsible for their own use. This Plugin is to be used WITHOUT warranty.
templates/admin/chosen-sprite.png ADDED
Binary file
templates/admin/chosen.css ADDED
@@ -0,0 +1,397 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* @group Base */
2
+ .chzn-container {
3
+ font-size: 12px;
4
+ position: relative;
5
+ display: inline-block;
6
+ zoom: 1;
7
+ *display: inline;
8
+ }
9
+ .chzn-container .chzn-drop {
10
+ background: #fff;
11
+ border: 1px solid #aaa;
12
+ border-top: 0;
13
+ position: absolute;
14
+ top: 29px;
15
+ left: 0;
16
+ -webkit-box-shadow: 0 4px 5px rgba(0,0,0,.15);
17
+ -moz-box-shadow : 0 4px 5px rgba(0,0,0,.15);
18
+ box-shadow : 0 4px 5px rgba(0,0,0,.15);
19
+ z-index: 1010;
20
+ }
21
+ /* @end */
22
+
23
+ /* @group Single Chosen */
24
+ .chzn-container-single .chzn-single {
25
+ background-color: #ffffff;
26
+ filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffffff', endColorstr='#eeeeee', GradientType=0 );
27
+ background-image: -webkit-gradient(linear, 0 0, 0 100%, color-stop(20%, #ffffff), color-stop(50%, #f6f6f6), color-stop(52%, #eeeeee), color-stop(100%, #f4f4f4));
28
+ background-image: -webkit-linear-gradient(top, #ffffff 20%, #f6f6f6 50%, #eeeeee 52%, #f4f4f4 100%);
29
+ background-image: -moz-linear-gradient(top, #ffffff 20%, #f6f6f6 50%, #eeeeee 52%, #f4f4f4 100%);
30
+ background-image: -o-linear-gradient(top, #ffffff 20%, #f6f6f6 50%, #eeeeee 52%, #f4f4f4 100%);
31
+ background-image: linear-gradient(#ffffff 20%, #f6f6f6 50%, #eeeeee 52%, #f4f4f4 100%);
32
+ -webkit-border-radius: 5px;
33
+ -moz-border-radius : 5px;
34
+ border-radius : 5px;
35
+ -moz-background-clip : padding;
36
+ -webkit-background-clip: padding-box;
37
+ background-clip : padding-box;
38
+ border: 1px solid #aaaaaa;
39
+ -webkit-box-shadow: 0 0 3px #ffffff inset, 0 1px 1px rgba(0,0,0,0.1);
40
+ -moz-box-shadow : 0 0 3px #ffffff inset, 0 1px 1px rgba(0,0,0,0.1);
41
+ box-shadow : 0 0 3px #ffffff inset, 0 1px 1px rgba(0,0,0,0.1);
42
+ display: block;
43
+ overflow: hidden;
44
+ white-space: nowrap;
45
+ position: relative;
46
+ height: 23px;
47
+ line-height: 24px;
48
+ padding: 0 0 0 8px;
49
+ color: #444444;
50
+ text-decoration: none;
51
+ }
52
+ .chzn-container-single .chzn-default {
53
+ color: #999;
54
+ }
55
+ .chzn-container-single .chzn-single span {
56
+ margin-right: 26px;
57
+ display: block;
58
+ overflow: hidden;
59
+ white-space: nowrap;
60
+ -o-text-overflow: ellipsis;
61
+ -ms-text-overflow: ellipsis;
62
+ text-overflow: ellipsis;
63
+ }
64
+ .chzn-container-single .chzn-single abbr {
65
+ display: block;
66
+ position: absolute;
67
+ right: 26px;
68
+ top: 6px;
69
+ width: 12px;
70
+ height: 13px;
71
+ font-size: 1px;
72
+ background: url('chosen-sprite.png') right top no-repeat;
73
+ }
74
+ .chzn-container-single .chzn-single abbr:hover {
75
+ background-position: right -11px;
76
+ }
77
+ .chzn-container-single.chzn-disabled .chzn-single abbr:hover {
78
+ background-position: right top;
79
+ }
80
+ .chzn-container-single .chzn-single div {
81
+ position: absolute;
82
+ right: 0;
83
+ top: 0;
84
+ display: block;
85
+ height: 100%;
86
+ width: 18px;
87
+ }
88
+ .chzn-container-single .chzn-single div b {
89
+ background: url('chosen-sprite.png') no-repeat 0 0;
90
+ display: block;
91
+ width: 100%;
92
+ height: 100%;
93
+ }
94
+ .chzn-container-single .chzn-search {
95
+ padding: 3px 4px;
96
+ position: relative;
97
+ margin: 0;
98
+ white-space: nowrap;
99
+ z-index: 1010;
100
+ }
101
+ .chzn-container-single .chzn-search input {
102
+ background: #fff url('chosen-sprite.png') no-repeat 100% -22px;
103
+ background: url('chosen-sprite.png') no-repeat 100% -22px, -webkit-gradient(linear, 0 0, 0 100%, color-stop(1%, #eeeeee), color-stop(15%, #ffffff));
104
+ background: url('chosen-sprite.png') no-repeat 100% -22px, -webkit-linear-gradient(top, #eeeeee 1%, #ffffff 15%);
105
+ background: url('chosen-sprite.png') no-repeat 100% -22px, -moz-linear-gradient(top, #eeeeee 1%, #ffffff 15%);
106
+ background: url('chosen-sprite.png') no-repeat 100% -22px, -o-linear-gradient(top, #eeeeee 1%, #ffffff 15%);
107
+ background: url('chosen-sprite.png') no-repeat 100% -22px, linear-gradient(#eeeeee 1%, #ffffff 15%);
108
+ margin: 1px 0;
109
+ padding: 4px 20px 4px 5px;
110
+ outline: 0;
111
+ border: 1px solid #aaa;
112
+ font-family: sans-serif;
113
+ font-size: 1em;
114
+ }
115
+ .chzn-container-single .chzn-drop {
116
+ -webkit-border-radius: 0 0 4px 4px;
117
+ -moz-border-radius : 0 0 4px 4px;
118
+ border-radius : 0 0 4px 4px;
119
+ -moz-background-clip : padding;
120
+ -webkit-background-clip: padding-box;
121
+ background-clip : padding-box;
122
+ }
123
+ /* @end */
124
+
125
+ .chzn-container-single-nosearch .chzn-search input {
126
+ position: absolute;
127
+ left: -9000px;
128
+ }
129
+
130
+ /* @group Multi Chosen */
131
+ .chzn-container-multi .chzn-choices {
132
+ background-color: #fff;
133
+ background-image: -webkit-gradient(linear, 0 0, 0 100%, color-stop(1%, #eeeeee), color-stop(15%, #ffffff));
134
+ background-image: -webkit-linear-gradient(top, #eeeeee 1%, #ffffff 15%);
135
+ background-image: -moz-linear-gradient(top, #eeeeee 1%, #ffffff 15%);
136
+ background-image: -o-linear-gradient(top, #eeeeee 1%, #ffffff 15%);
137
+ background-image: linear-gradient(#eeeeee 1%, #ffffff 15%);
138
+ border: 1px solid #aaa;
139
+ margin: 0;
140
+ padding: 0;
141
+ cursor: text;
142
+ overflow: hidden;
143
+ height: auto !important;
144
+ height: 1%;
145
+ position: relative;
146
+ }
147
+ .chzn-container-multi .chzn-choices li {
148
+ float: left;
149
+ list-style: none;
150
+ }
151
+ .chzn-container-multi .chzn-choices .search-field {
152
+ white-space: nowrap;
153
+ margin: 0;
154
+ padding: 0;
155
+ }
156
+ .chzn-container-multi .chzn-choices .search-field input {
157
+ color: #666;
158
+ background: transparent !important;
159
+ border: 0 !important;
160
+ font-family: sans-serif;
161
+ font-size: 100%;
162
+ height: 15px;
163
+ padding: 5px;
164
+ margin: 1px 0;
165
+ outline: 0;
166
+ -webkit-box-shadow: none;
167
+ -moz-box-shadow : none;
168
+ box-shadow : none;
169
+ }
170
+ .chzn-container-multi .chzn-choices .search-field .default {
171
+ color: #999;
172
+ }
173
+ .chzn-container-multi .chzn-choices .search-choice {
174
+ -webkit-border-radius: 3px;
175
+ -moz-border-radius : 3px;
176
+ border-radius : 3px;
177
+ -moz-background-clip : padding;
178
+ -webkit-background-clip: padding-box;
179
+ background-clip : padding-box;
180
+ background-color: #e4e4e4;
181
+ filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f4f4f4', endColorstr='#eeeeee', GradientType=0 );
182
+ background-image: -webkit-gradient(linear, 0 0, 0 100%, color-stop(20%, #f4f4f4), color-stop(50%, #f0f0f0), color-stop(52%, #e8e8e8), color-stop(100%, #eeeeee));
183
+ background-image: -webkit-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
184
+ background-image: -moz-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
185
+ background-image: -o-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
186
+ background-image: linear-gradient(#f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
187
+ -webkit-box-shadow: 0 0 2px #ffffff inset, 0 1px 0 rgba(0,0,0,0.05);
188
+ -moz-box-shadow : 0 0 2px #ffffff inset, 0 1px 0 rgba(0,0,0,0.05);
189
+ box-shadow : 0 0 2px #ffffff inset, 0 1px 0 rgba(0,0,0,0.05);
190
+ color: #333;
191
+ border: 1px solid #aaaaaa;
192
+ line-height: 13px;
193
+ padding: 3px 20px 3px 5px;
194
+ margin: 3px 0 3px 5px;
195
+ position: relative;
196
+ cursor: default;
197
+ }
198
+ .chzn-container-multi .chzn-choices .search-choice.search-choice-disabled {
199
+ background-color: #e4e4e4;
200
+ filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f4f4f4', endColorstr='#eeeeee', GradientType=0 );
201
+ background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, color-stop(20%, #f4f4f4), color-stop(50%, #f0f0f0), color-stop(52%, #e8e8e8), color-stop(100%, #eeeeee));
202
+ background-image: -webkit-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
203
+ background-image: -moz-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
204
+ background-image: -o-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
205
+ background-image: -ms-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
206
+ background-image: linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
207
+ color: #666;
208
+ border: 1px solid #cccccc;
209
+ padding-right: 5px;
210
+ }
211
+ .chzn-container-multi .chzn-choices .search-choice-focus {
212
+ background: #d4d4d4;
213
+ }
214
+ .chzn-container-multi .chzn-choices .search-choice .search-choice-close {
215
+ display: block;
216
+ position: absolute;
217
+ right: 3px;
218
+ top: 4px;
219
+ width: 12px;
220
+ height: 13px;
221
+ font-size: 1px;
222
+ background: url('chosen-sprite.png') right top no-repeat;
223
+ }
224
+ .chzn-container-multi .chzn-choices .search-choice .search-choice-close:hover {
225
+ background-position: right -11px;
226
+ }
227
+ .chzn-container-multi .chzn-choices .search-choice-focus .search-choice-close {
228
+ background-position: right -11px;
229
+ }
230
+ /* @end */
231
+
232
+ /* @group Results */
233
+ .chzn-container .chzn-results {
234
+ margin: 0 4px 4px 0;
235
+ max-height: 240px;
236
+ padding: 0 0 0 4px;
237
+ position: relative;
238
+ overflow-x: hidden;
239
+ overflow-y: auto;
240
+ -webkit-overflow-scrolling: touch;
241
+ }
242
+ .chzn-container-multi .chzn-results {
243
+ margin: -1px 0 0;
244
+ padding: 0;
245
+ }
246
+ .chzn-container .chzn-results li {
247
+ display: none;
248
+ line-height: 15px;
249
+ padding: 5px 6px;
250
+ margin: 0;
251
+ list-style: none;
252
+ }
253
+ .chzn-container .chzn-results .active-result {
254
+ cursor: pointer;
255
+ display: list-item;
256
+ }
257
+ .chzn-container .chzn-results .highlighted {
258
+ background-color: #3875d7;
259
+ filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#3875d7', endColorstr='#2a62bc', GradientType=0 );
260
+ background-image: -webkit-gradient(linear, 0 0, 0 100%, color-stop(20%, #3875d7), color-stop(90%, #2a62bc));
261
+ background-image: -webkit-linear-gradient(top, #3875d7 20%, #2a62bc 90%);
262
+ background-image: -moz-linear-gradient(top, #3875d7 20%, #2a62bc 90%);
263
+ background-image: -o-linear-gradient(top, #3875d7 20%, #2a62bc 90%);
264
+ background-image: linear-gradient(#3875d7 20%, #2a62bc 90%);
265
+ color: #fff;
266
+ }
267
+ .chzn-container .chzn-results li em {
268
+ background: #feffde;
269
+ font-style: normal;
270
+ }
271
+ .chzn-container .chzn-results .highlighted em {
272
+ background: transparent;
273
+ }
274
+ .chzn-container .chzn-results .no-results {
275
+ background: #f4f4f4;
276
+ display: list-item;
277
+ }
278
+ .chzn-container .chzn-results .group-result {
279
+ cursor: default;
280
+ color: #999;
281
+ font-weight: bold;
282
+ }
283
+ .chzn-container .chzn-results .group-option {
284
+ padding-left: 15px;
285
+ }
286
+ .chzn-container-multi .chzn-drop .result-selected {
287
+ display: none;
288
+ }
289
+ .chzn-container .chzn-results-scroll {
290
+ background: white;
291
+ margin: 0 4px;
292
+ position: absolute;
293
+ text-align: center;
294
+ width: 321px; /* This should by dynamic with js */
295
+ z-index: 1;
296
+ }
297
+ .chzn-container .chzn-results-scroll span {
298
+ display: inline-block;
299
+ height: 17px;
300
+ text-indent: -5000px;
301
+ width: 9px;
302
+ }
303
+ .chzn-container .chzn-results-scroll-down {
304
+ bottom: 0;
305
+ }
306
+ .chzn-container .chzn-results-scroll-down span {
307
+ background: url('chosen-sprite.png') no-repeat -4px -3px;
308
+ }
309
+ .chzn-container .chzn-results-scroll-up span {
310
+ background: url('chosen-sprite.png') no-repeat -22px -3px;
311
+ }
312
+ /* @end */
313
+
314
+ /* @group Active */
315
+ .chzn-container-active .chzn-single {
316
+ -webkit-box-shadow: 0 0 5px rgba(0,0,0,.3);
317
+ -moz-box-shadow : 0 0 5px rgba(0,0,0,.3);
318
+ box-shadow : 0 0 5px rgba(0,0,0,.3);
319
+ border: 1px solid #5897fb;
320
+ }
321
+ .chzn-container-active .chzn-single-with-drop {
322
+ border: 1px solid #aaa;
323
+ -webkit-box-shadow: 0 1px 0 #fff inset;
324
+ -moz-box-shadow : 0 1px 0 #fff inset;
325
+ box-shadow : 0 1px 0 #fff inset;
326
+ background-color: #eee;
327
+ filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#eeeeee', endColorstr='#ffffff', GradientType=0 );
328
+ background-image: -webkit-gradient(linear, 0 0, 0 100%, color-stop(20%, #eeeeee), color-stop(80%, #ffffff));
329
+ background-image: -webkit-linear-gradient(top, #eeeeee 20%, #ffffff 80%);
330
+ background-image: -moz-linear-gradient(top, #eeeeee 20%, #ffffff 80%);
331
+ background-image: -o-linear-gradient(top, #eeeeee 20%, #ffffff 80%);
332
+ background-image: linear-gradient(#eeeeee 20%, #ffffff 80%);
333
+ -webkit-border-bottom-left-radius : 0;
334
+ -webkit-border-bottom-right-radius: 0;
335
+ -moz-border-radius-bottomleft : 0;
336
+ -moz-border-radius-bottomright: 0;
337
+ border-bottom-left-radius : 0;
338
+ border-bottom-right-radius: 0;
339
+ }
340
+ .chzn-container-active .chzn-single-with-drop div {
341
+ background: transparent;
342
+ border-left: none;
343
+ }
344
+ .chzn-container-active .chzn-single-with-drop div b {
345
+ background-position: -18px 1px;
346
+ }
347
+ .chzn-container-active .chzn-choices {
348
+ -webkit-box-shadow: 0 0 5px rgba(0,0,0,.3);
349
+ -moz-box-shadow : 0 0 5px rgba(0,0,0,.3);
350
+ box-shadow : 0 0 5px rgba(0,0,0,.3);
351
+ border: 1px solid #5897fb;
352
+ }
353
+ .chzn-container-active .chzn-choices .search-field input {
354
+ color: #111 !important;
355
+ }
356
+ /* @end */
357
+
358
+ /* @group Disabled Support */
359
+ .chzn-disabled {
360
+ cursor: default;
361
+ opacity:0.5 !important;
362
+ }
363
+ .chzn-disabled .chzn-single {
364
+ cursor: default;
365
+ }
366
+ .chzn-disabled .chzn-choices .search-choice .search-choice-close {
367
+ cursor: default;
368
+ }
369
+
370
+ /* @group Right to Left */
371
+ .chzn-rtl { text-align: right; }
372
+ .chzn-rtl .chzn-single { padding: 0 8px 0 0; overflow: visible; }
373
+ .chzn-rtl .chzn-single span { margin-left: 26px; margin-right: 0; direction: rtl; }
374
+
375
+ .chzn-rtl .chzn-single div { left: 3px; right: auto; }
376
+ .chzn-rtl .chzn-single abbr {
377
+ left: 26px;
378
+ right: auto;
379
+ }
380
+ .chzn-rtl .chzn-choices .search-field input { direction: rtl; }
381
+ .chzn-rtl .chzn-choices li { float: right; }
382
+ .chzn-rtl .chzn-choices .search-choice { padding: 3px 5px 3px 19px; margin: 3px 5px 3px 0; }
383
+ .chzn-rtl .chzn-choices .search-choice .search-choice-close { left: 4px; right: auto; background-position: right top;}
384
+ .chzn-rtl.chzn-container-single .chzn-results { margin: 0 0 4px 4px; padding: 0 4px 0 0; }
385
+ .chzn-rtl .chzn-results .group-option { padding-left: 0; padding-right: 15px; }
386
+ .chzn-rtl.chzn-container-active .chzn-single-with-drop div { border-right: none; }
387
+ .chzn-rtl .chzn-search input {
388
+ background: #fff url('chosen-sprite.png') no-repeat -38px -22px;
389
+ background: url('chosen-sprite.png') no-repeat -38px -22px, -webkit-gradient(linear, 0 0, 0 100%, color-stop(1%, #eeeeee), color-stop(15%, #ffffff));
390
+ background: url('chosen-sprite.png') no-repeat -38px -22px, -webkit-linear-gradient(top, #eeeeee 1%, #ffffff 15%);
391
+ background: url('chosen-sprite.png') no-repeat -38px -22px, -moz-linear-gradient(top, #eeeeee 1%, #ffffff 15%);
392
+ background: url('chosen-sprite.png') no-repeat -38px -22px, -o-linear-gradient(top, #eeeeee 1%, #ffffff 15%);
393
+ background: url('chosen-sprite.png') no-repeat -38px -22px, linear-gradient(#eeeeee 1%, #ffffff 15%);
394
+ padding: 4px 5px 4px 20px;
395
+ direction: rtl;
396
+ }
397
+ /* @end */
templates/admin/export.css ADDED
@@ -0,0 +1,103 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* Tabbed navigation */
2
+
3
+ #woo-ce h2 .nav-tab {
4
+ font-size: 16px;
5
+ margin-right:0;
6
+ }
7
+ #woo-ce h2.nav-tab-wrapper {
8
+ padding-left:7px;
9
+ }
10
+
11
+ /* Overview */
12
+
13
+ #woo-ce .overview-left {
14
+ float:left;
15
+ width:73%;
16
+ }
17
+ #woo-ce .overview-right {
18
+ float:left;
19
+ width:24%;
20
+ }
21
+ #woo-ce .overview-right h3 {
22
+ font-size:16px;
23
+ }
24
+ #woo-ce .overview-right h3 span {
25
+ float:right;
26
+ font-size:11px;
27
+ font-weight:normal;
28
+ }
29
+ #woo-ce .overview-right p {
30
+ font-size:12px;
31
+ color:#333;
32
+ line-height:1.6em;
33
+ }
34
+ #woo-ce .overview-right ul {
35
+ font-size:12px;
36
+ line-height:1.2em;
37
+ }
38
+
39
+ /* Export */
40
+
41
+ #woo-ce #export-type th {
42
+ padding:0;
43
+ }
44
+ #woo-ce #export-type td {
45
+ padding:0;
46
+ }
47
+ #woo-ce .postbox .submit {
48
+ padding:0.3em 0;
49
+ }
50
+ #woo-ce textarea#export_log {
51
+ font:12px Consolas, Monaco, Courier, monospace;
52
+ width:100%;
53
+ height:200px;
54
+ }
55
+ #woo-ce #export_sheet {
56
+ overflow: scroll;
57
+ margin-bottom:1em;
58
+ }
59
+ #woo-ce #export_sheet table {
60
+ width:100%;
61
+ }
62
+
63
+ #woo-ce .separator {
64
+ border-bottom:1px solid #dfdfdf;
65
+ }
66
+ #woo-ce .woo_vm_version_table .export_module {
67
+ background-color:#fff;
68
+ padding:0.2em 0 0 0.5em;
69
+ }
70
+ #woo-ce .woo_vm_version_table .dashicons {
71
+ color:#666;
72
+ }
73
+ #woo-ce .woo_vm_version_table .status {
74
+ width:80px;
75
+ }
76
+
77
+
78
+ /* Settings */
79
+
80
+ #woo-ce .auto_method_options li.ftp-options label {
81
+ display:inline-block;
82
+ width:120px;
83
+ }
84
+
85
+ /* Support - Donate / Rate */
86
+
87
+ #woo-ce .support-donate_rate {
88
+ display:block;
89
+ float:right;
90
+ }
91
+ #woo-ce .support-donate_rate p {
92
+ margin-top:16px;
93
+ }
94
+ #woo-ce .support-donate_rate .star {
95
+ vertical-align:bottom;
96
+ display:inline-block;
97
+ width:17px;
98
+ height:17px;
99
+ background:url('images/star.png') no-repeat;
100
+ }
101
+ #woo-ce .support-donate_rate span {
102
+ display:none;
103
+ }
templates/admin/export.js ADDED
@@ -0,0 +1,336 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ var $j = jQuery.noConflict();
2
+ $j(function() {
3
+
4
+ // This controls the Skip Overview link on the Overview screen
5
+ $j('#skip_overview').click(function(){
6
+ $j('#skip_overview_form').submit();
7
+ });
8
+
9
+ // Date Picker
10
+ if( $j.isFunction($j.fn.datepicker) ) {
11
+ $j('.datepicker').datepicker({
12
+ dateFormat: 'dd/mm/yy'
13
+ });
14
+ }
15
+
16
+ // Chosen
17
+ if( $j.isFunction($j.fn.chosen) ) {
18
+ $j(".chzn-select").chosen({
19
+ search_contains: true
20
+ });
21
+ }
22
+
23
+ // Sortable export columns
24
+ if( $j.isFunction($j.fn.sortable) ) {
25
+ $j('table.ui-sortable').sortable({
26
+ items:'tr',
27
+ cursor:'move',
28
+ axis:'y',
29
+ handle: 'td',
30
+ scrollSensitivity:40,
31
+ helper:function(e,ui){
32
+ ui.children().each(function(){
33
+ jQuery(this).width(jQuery(this).width());
34
+ });
35
+ ui.css('left', '0');
36
+ return ui;
37
+ },
38
+ start:function(event,ui){
39
+ ui.item.css('background-color','#f6f6f6');
40
+ },
41
+ stop:function(event,ui){
42
+ ui.item.removeAttr('style');
43
+ field_row_indexes(this);
44
+ }
45
+ });
46
+
47
+ function field_row_indexes(obj) {
48
+ rows = $j(obj).find('tr');
49
+ $j(rows).each(function(index, el){
50
+ $j('input.field_order', el).val( parseInt( $j(el).index() ) );
51
+ });
52
+ };
53
+ }
54
+
55
+ // Select all field options for this export type
56
+ $j('.checkall').click(function () {
57
+ $j(this).closest('.postbox').find(':checkbox').attr('checked', true);
58
+ });
59
+ // Unselect all field options for this export type
60
+ $j('.uncheckall').click(function () {
61
+ $j(this).closest('.postbox').find(':checkbox').attr('checked', false);
62
+ });
63
+
64
+ $j('.export-types').hide();
65
+ $j('.export-options').hide();
66
+
67
+ // Categories
68
+ $j('#export-products-filters-categories').hide();
69
+ if( $j('#products-filters-categories').attr('checked') ) {
70
+ $j('#export-products-filters-categories').show();
71
+ }
72
+ // Tags
73
+ $j('#export-products-filters-tags').hide();
74
+ if( $j('#products-filters-tags').attr('checked') ) {
75
+ $j('#export-products-filters-tags').show();
76
+ }
77
+ // Brands
78
+ $j('#export-products-filters-brands').hide();
79
+ if( $j('#products-filters-brands').attr('checked') ) {
80
+ $j('#export-products-filters-brands').show();
81
+ }
82
+ // Product Status
83
+ $j('#export-products-filters-status').hide();
84
+ if( $j('#products-filters-status').attr('checked') ) {
85
+ $j('#export-products-filters-status').show();
86
+ }
87
+ $j('#export-products-filters-type').hide();
88
+ if( $j('#products-filters-type').attr('checked') ) {
89
+ $j('#export-products-filters-type').show();
90
+ }
91
+ $j('#export-products-filters-stock').hide();
92
+ if( $j('#products-filters-stock').attr('checked') ) {
93
+ $j('#export-products-filters-stock').show();
94
+ }
95
+
96
+ $j('#export-category').hide();
97
+
98
+ $j('#export-tag').hide();
99
+
100
+ $j('#export-brand').hide();
101
+
102
+ $j('#export-order').hide();
103
+ $j('#export-orders-filters-status').hide();
104
+ if( $j('#orders-filters-status').attr('checked') ) {
105
+ $j('#export-orders-filters-status').show();
106
+ }
107
+ $j('#export-orders-filters-date').hide();
108
+ if( $j('#orders-filters-date').attr('checked') ) {
109
+ $j('#export-orders-filters-date').show();
110
+ }
111
+ $j('#export-orders-filters-customer').hide();
112
+ if( $j('#orders-filters-customer').attr('checked') ) {
113
+ $j('#export-orders-filters-customer').show();
114
+ }
115
+ $j('#export-orders-filters-user_role').hide();
116
+ if( $j('#orders-filters-user_role').attr('checked') ) {
117
+ $j('#export-orders-filters-user_role').show();
118
+ }
119
+ $j('#export-orders-filters-coupon').hide();
120
+ if( $j('#orders-filters-coupon').attr('checked') ) {
121
+ $j('#export-orders-filters-coupon').show();
122
+ }
123
+ $j('#export-orders-filters-category').hide();
124
+ if( $j('#orders-filters-category').attr('checked') ) {
125
+ $j('#export-orders-filters-category').show();
126
+ }
127
+ $j('#export-orders-filters-tag').hide();
128
+ if( $j('#orders-filters-tag').attr('checked') ) {
129
+ $j('#export-orders-filters-tag').show();
130
+ }
131
+
132
+ $j('#export-customers-filters-status').hide();
133
+ if( $j('#customers-filters-status').attr('checked') ) {
134
+ $j('#export-customers-filters-status').show();
135
+ }
136
+ $j('#export-customer').hide();
137
+ $j('#export-user').hide();
138
+ $j('#export-coupon').hide();
139
+ $j('#export-subscription').hide();
140
+ $j('#export-product_vendor').hide();
141
+ $j('#export-attribute').hide();
142
+
143
+ $j('#products-filters-categories').click(function(){
144
+ $j('#export-products-filters-categories').toggle();
145
+ });
146
+ $j('#products-filters-tags').click(function(){
147
+ $j('#export-products-filters-tags').toggle();
148
+ });
149
+ $j('#products-filters-status').click(function(){
150
+ $j('#export-products-filters-status').toggle();
151
+ });
152
+ $j('#products-filters-type').click(function(){
153
+ $j('#export-products-filters-type').toggle();
154
+ });
155
+ $j('#products-filters-stock').click(function(){
156
+ $j('#export-products-filters-stock').toggle();
157
+ });
158
+
159
+ $j('#orders-filters-date').click(function(){
160
+ $j('#export-orders-filters-date').toggle();
161
+ });
162
+ $j('#orders-filters-status').click(function(){
163
+ $j('#export-orders-filters-status').toggle();
164
+ });
165
+ $j('#orders-filters-customer').click(function(){
166
+ $j('#export-orders-filters-customer').toggle();
167
+ });
168
+ $j('#orders-filters-user_role').click(function(){
169
+ $j('#export-orders-filters-user_role').toggle();
170
+ });
171
+ $j('#orders-filters-coupon').click(function(){
172
+ $j('#export-orders-filters-coupon').toggle();
173
+ });
174
+ $j('#orders-filters-category').click(function(){
175
+ $j('#export-orders-filters-category').toggle();
176
+ });
177
+ $j('#orders-filters-tag').click(function(){
178
+ $j('#export-orders-filters-tag').toggle();
179
+ });
180
+
181
+ $j('#customers-filters-status').click(function(){
182
+ $j('#export-customers-filters-status').toggle();
183
+ });
184
+
185
+ // Export types
186
+ $j('#product').click(function(){
187
+ $j('.export-types').hide();
188
+ $j('#export-product').show();
189
+
190
+ $j('.export-options').hide();
191
+ $j('.product-options').show();
192
+ });
193
+ $j('#category').click(function(){
194
+ $j('.export-types').hide();
195
+ $j('#export-category').show();
196
+
197
+ $j('.export-options').hide();
198
+ $j('.category-options').show();
199
+ });
200
+ $j('#tag').click(function(){
201
+ $j('.export-types').hide();
202
+ $j('#export-tag').show();
203
+
204
+ $j('.export-options').hide();
205
+ $j('.tag-options').show();
206
+ });
207
+ $j('#brand').click(function(){
208
+ $j('.export-types').hide();
209
+ $j('#export-brand').show();
210
+
211
+ $j('.export-options').hide();
212
+ $j('.brand-options').show();
213
+ });
214
+ $j('#order').click(function(){
215
+ $j('.export-types').hide();
216
+ $j('#export-order').show();
217
+
218
+ $j('.export-options').hide();
219
+ $j('.order-options').show();
220
+ });
221
+ $j('#customer').click(function(){
222
+ $j('.export-types').hide();
223
+ $j('#export-customer').show();
224
+
225
+ $j('.export-options').hide();
226
+ $j('.customer-options').show();
227
+ });
228
+ $j('#user').click(function(){
229
+ $j('.export-types').hide();
230
+ $j('#export-user').show();
231
+
232
+ $j('.export-options').hide();
233
+ $j('.user-options').show();
234
+ });
235
+ $j('#coupon').click(function(){
236
+ $j('.export-types').hide();
237
+ $j('#export-coupon').show();
238
+
239
+ $j('.export-options').hide();
240
+ $j('.coupon-options').show();
241
+ });
242
+ $j('#subscription').click(function(){
243
+ $j('.export-types').hide();
244
+ $j('#export-subscription').show();
245
+
246
+ $j('.export-options').hide();
247
+ $j('.subscription-options').show();
248
+ });
249
+ $j('#product_vendor').click(function(){
250
+ $j('.export-types').hide();
251
+ $j('#export-product_vendor').show();
252
+
253
+ $j('.export-options').hide();
254
+ $j('.product_vendor-options').show();
255
+ });
256
+ $j('#attribute').click(function(){
257
+ $j('.export-types').hide();
258
+ $j('#export-attribute').show();
259
+
260
+ $j('.export-options').hide();
261
+ $j('.attribute-options').show();
262
+ });
263
+
264
+ // Export button
265
+ $j('#export_product').click(function(){
266
+ $j('input:radio[name=dataset]:nth(0)').attr('checked',true);
267
+ });
268
+ $j('#export_category').click(function(){
269
+ $j('input:radio[name=dataset]:nth(1)').attr('checked',true);
270
+ });
271
+ $j('#export_tag').click(function(){
272
+ $j('input:radio[name=dataset]:nth(2)').attr('checked',true);
273
+ });
274
+ $j('#export_brand').click(function(){
275
+ $j('input:radio[name=dataset]:nth(3)').attr('checked',true);
276
+ });
277
+ $j('#export_order').click(function(){
278
+ $j('input:radio[name=dataset]:nth(4)').attr('checked',true);
279
+ });
280
+ $j('#export_customer').click(function(){
281
+ $j('input:radio[name=dataset]:nth(5)').attr('checked',true);
282
+ });
283
+ $j('#export_user').click(function(){
284
+ $j('input:radio[name=dataset]:nth(6)').attr('checked',true);
285
+ });
286
+ $j('#export_coupon').click(function(){
287
+ $j('input:radio[name=dataset]:nth(7)').attr('checked',true);
288
+ });
289
+ $j('#export_subscription').click(function(){
290
+ $j('input:radio[name=dataset]:nth(8)').attr('checked',true);
291
+ });
292
+ $j('#export_product_vendor').click(function(){
293
+ $j('input:radio[name=dataset]:nth(9)').attr('checked',true);
294
+ });
295
+ $j('#export_attribute').click(function(){
296
+ $j('input:radio[name=dataset]:nth(10)').attr('checked',true);
297
+ });
298
+
299
+ $j("#auto_type").change(function () {
300
+ var type = $j('select[name=auto_type]').val();
301
+ $j('.auto_type_options .export-options').hide();
302
+ $j('.auto_type_options .'+type+'-options').show();
303
+ });
304
+
305
+ $j("#auto_method").change(function () {
306
+ var type = $j('select[name=auto_method]').val();
307
+ $j('.auto_method_options .export-options').hide();
308
+ $j('.auto_method_options .'+type+'-options').show();
309
+ });
310
+
311
+ $j(document).ready(function() {
312
+ // This auto-selects the export type based on the link from the Overview screen
313
+ var href = jQuery(location).attr('href');
314
+ // If this is the Export tab
315
+ if (href.toLowerCase().indexOf('tab=export') >= 0) {
316
+ // If the URL includes an in-line link
317
+ if (href.toLowerCase().indexOf('#') >= 0 ) {
318
+ var type = href.substr(href.indexOf("#") + 1);
319
+ var type = type.replace('export-','');
320
+ $j('#'+type).trigger('click');
321
+ } else {
322
+ // This auto-selects the last known export type based on stored WordPress option, defaults to Products
323
+ var type = $j('input:radio[name=dataset]:checked').val();
324
+ $j('#'+type).trigger('click');
325
+ }
326
+ } else if (href.toLowerCase().indexOf('tab=settings') >= 0) {
327
+ $j("#auto_type").trigger("change");
328
+ $j("#auto_method").trigger("change");
329
+ } else {
330
+ // This auto-selects the last known export type based on stored WordPress option, defaults to Products
331
+ var type = $j('input:radio[name=dataset]:checked').val();
332
+ $j('#'+type).trigger('click');
333
+ }
334
+ });
335
+
336
+ });
templates/admin/images/animated-overlay.gif ADDED
Binary file
templates/admin/images/progress.gif ADDED
Binary file
templates/admin/images/ui-bg_flat_0_aaaaaa_40x100.png ADDED
Binary file
templates/admin/images/ui-bg_flat_75_ffffff_40x100.png ADDED
Binary file
templates/admin/images/ui-bg_glass_55_fbf9ee_1x400.png ADDED
Binary file
templates/admin/images/ui-bg_glass_65_ffffff_1x400.png ADDED
Binary file
templates/admin/images/ui-bg_glass_75_dadada_1x400.png ADDED
Binary file
templates/admin/images/ui-bg_glass_75_e6e6e6_1x400.png ADDED
Binary file
templates/admin/images/ui-bg_glass_95_fef1ec_1x400.png ADDED
Binary file
templates/admin/images/ui-bg_highlight-soft_75_cccccc_1x100.png ADDED
Binary file
templates/admin/images/ui-icons_222222_256x240.png ADDED
Binary file
templates/admin/images/ui-icons_2e83ff_256x240.png ADDED
Binary file
templates/admin/images/ui-icons_454545_256x240.png ADDED
Binary file
templates/admin/images/ui-icons_888888_256x240.png ADDED
Binary file
templates/admin/images/ui-icons_cd0a0a_256x240.png ADDED
Binary file
templates/admin/jquery-csvtable.css ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* CSV Table Classes */
2
+ TABLE.CSVTable {
3
+ font: 0.8em Verdana,Arial,Geneva,Helvetica,sans-serif;
4
+ border-collapse: collapse;
5
+ width: 450px;
6
+ }
7
+
8
+ /* Header */
9
+ TABLE.CSVTable THEAD TR {
10
+ background: #E8EDFF;
11
+ }
12
+ TABLE.CSVTable TH {
13
+ font-family: "Lucida Sans Unicode","Lucida Grande",Sans-Serif;
14
+ font-size: 1.2em;
15
+ }
16
+
17
+ /* Table Cells */
18
+ TABLE.CSVTable TD, TABLE.CSVTable TH {
19
+ padding: 8px;
20
+ text-align: left;
21
+ border-bottom: 1px solid #FFFFFF;
22
+ border-top: 1px solid transparent;
23
+ }
24
+ /* Default background color for rows */
25
+ TABLE.CSVTable TR {
26
+ background: #F0F0F0;
27
+ }
28
+ /* Background color for odd rows */
29
+ TABLE.CSVTable TR.odd {
30
+ background: #F9F9F9;
31
+ }
32
+ /* Hover color for all rows */
33
+ TABLE.CSVTable TR:hover {
34
+ background: #E8EDFF;
35
+ }
36
+
37
+ /* Source code */
38
+ .source {
39
+ background-color: #FAFAFA; border: 1px solid #999999
40
+ }
templates/admin/jquery-ui-datepicker.css ADDED
@@ -0,0 +1,347 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * jQuery UI CSS Framework
3
+ * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
4
+ * Dual licensed under the MIT (MIT-LICENSE.txt) and GPL (GPL-LICENSE.txt) licenses.
5
+ */
6
+
7
+ /* Layout helpers
8
+ ----------------------------------*/
9
+ .ui-helper-hidden { display: none; }
10
+ .ui-helper-hidden-accessible { position: absolute; left: -99999999px; }
11
+ .ui-helper-reset { margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none; }
12
+ .ui-helper-clearfix:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; }
13
+ .ui-helper-clearfix { display: inline-block; }
14
+ /* required comment for clearfix to work in Opera \*/
15
+ * html .ui-helper-clearfix { height:1%; }
16
+ .ui-helper-clearfix { display:block; }
17
+ /* end clearfix */
18
+ .ui-helper-zfix { width: 100%; height: 100%; top: 0; left: 0; position: absolute; opacity: 0; filter:Alpha(Opacity=0); }
19
+
20
+
21
+ /* Interaction Cues
22
+ ----------------------------------*/
23
+ .ui-state-disabled { cursor: default !important; }
24
+
25
+
26
+ /* Icons
27
+ ----------------------------------*/
28
+
29
+ /* states and images */
30
+ .ui-icon { display: block; text-indent: -99999px; overflow: hidden; background-repeat: no-repeat; }
31
+
32
+
33
+ /* Misc visuals
34
+ ----------------------------------*/
35
+
36
+ /* Overlays */
37
+ .ui-widget-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
38
+
39
+
40
+
41
+ /*
42
+ * jQuery UI CSS Framework
43
+ * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
44
+ * Dual licensed under the MIT (MIT-LICENSE.txt) and GPL (GPL-LICENSE.txt) licenses.
45
+ * To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=Verdana,Arial,sans-serif&fwDefault=normal&fsDefault=1.1em&cornerRadius=4px&bgColorHeader=cccccc&bgTextureHeader=03_highlight_soft.png&bgImgOpacityHeader=75&borderColorHeader=aaaaaa&fcHeader=222222&iconColorHeader=222222&bgColorContent=ffffff&bgTextureContent=01_flat.png&bgImgOpacityContent=75&borderColorContent=aaaaaa&fcContent=222222&iconColorContent=222222&bgColorDefault=e6e6e6&bgTextureDefault=02_glass.png&bgImgOpacityDefault=75&borderColorDefault=d3d3d3&fcDefault=555555&iconColorDefault=888888&bgColorHover=dadada&bgTextureHover=02_glass.png&bgImgOpacityHover=75&borderColorHover=999999&fcHover=212121&iconColorHover=454545&bgColorActive=ffffff&bgTextureActive=02_glass.png&bgImgOpacityActive=65&borderColorActive=aaaaaa&fcActive=212121&iconColorActive=454545&bgColorHighlight=fbf9ee&bgTextureHighlight=02_glass.png&bgImgOpacityHighlight=55&borderColorHighlight=fcefa1&fcHighlight=363636&iconColorHighlight=2e83ff&bgColorError=fef1ec&bgTextureError=02_glass.png&bgImgOpacityError=95&borderColorError=cd0a0a&fcError=cd0a0a&iconColorError=cd0a0a&bgColorOverlay=aaaaaa&bgTextureOverlay=01_flat.png&bgImgOpacityOverlay=0&opacityOverlay=30&bgColorShadow=aaaaaa&bgTextureShadow=01_flat.png&bgImgOpacityShadow=0&opacityShadow=30&thicknessShadow=8px&offsetTopShadow=-8px&offsetLeftShadow=-8px&cornerRadiusShadow=8px
46
+ */
47
+
48
+
49
+ /* Component containers
50
+ ----------------------------------*/
51
+ .ui-widget { font-family: Verdana,Arial,sans-serif; font-size: 1.1em; }
52
+ .ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget button { font-family: Verdana,Arial,sans-serif; font-size: 1em; }
53
+ .ui-widget-content { border: 1px solid #aaaaaa; background: #ffffff url(images/ui-bg_flat_75_ffffff_40x100.png) 50% 50% repeat-x; color: #222222; }
54
+ .ui-widget-content a { color: #222222; }
55
+ .ui-widget-header { border: 1px solid #aaaaaa; background: #cccccc url(images/ui-bg_highlight-soft_75_cccccc_1x100.png) 50% 50% repeat-x; color: #222222; font-weight: bold; }
56
+ .ui-widget-header a { color: #222222; }
57
+
58
+ /* Interaction states
59
+ ----------------------------------*/
60
+ .ui-state-default, .ui-widget-content .ui-state-default { border: 1px solid #d3d3d3; background: #e6e6e6 url(images/ui-bg_glass_75_e6e6e6_1x400.png) 50% 50% repeat-x; font-weight: normal; color: #555555; outline: none; }
61
+ .ui-state-default a, .ui-state-default a:link, .ui-state-default a:visited { color: #555555; text-decoration: none; outline: none; }
62
+ .ui-state-hover, .ui-widget-content .ui-state-hover, .ui-state-focus, .ui-widget-content .ui-state-focus { border: 1px solid #999999; background: #dadada url(images/ui-bg_glass_75_dadada_1x400.png) 50% 50% repeat-x; font-weight: normal; color: #212121; outline: none; }
63
+ .ui-state-hover a, .ui-state-hover a:hover { color: #212121; text-decoration: none; outline: none; }
64
+ .ui-state-active, .ui-widget-content .ui-state-active { border: 1px solid #aaaaaa; background: #ffffff url(images/ui-bg_glass_65_ffffff_1x400.png) 50% 50% repeat-x; font-weight: normal; color: #212121; outline: none; }
65
+ .ui-state-active a, .ui-state-active a:link, .ui-state-active a:visited { color: #212121; outline: none; text-decoration: none; }
66
+
67
+ /* Interaction Cues
68
+ ----------------------------------*/
69
+ .ui-state-highlight, .ui-widget-content .ui-state-highlight {border: 1px solid #fcefa1; background: #fbf9ee url(images/ui-bg_glass_55_fbf9ee_1x400.png) 50% 50% repeat-x; color: #363636; }
70
+ .ui-state-highlight a, .ui-widget-content .ui-state-highlight a { color: #363636; }
71
+ .ui-state-error, .ui-widget-content .ui-state-error {border: 1px solid #cd0a0a; background: #fef1ec url(images/ui-bg_glass_95_fef1ec_1x400.png) 50% 50% repeat-x; color: #cd0a0a; }
72
+ .ui-state-error a, .ui-widget-content .ui-state-error a { color: #cd0a0a; }
73
+ .ui-state-error-text, .ui-widget-content .ui-state-error-text { color: #cd0a0a; }
74
+ .ui-state-disabled, .ui-widget-content .ui-state-disabled { opacity: .35; filter:Alpha(Opacity=35); background-image: none; }
75
+ .ui-priority-primary, .ui-widget-content .ui-priority-primary { font-weight: bold; }
76
+ .ui-priority-secondary, .ui-widget-content .ui-priority-secondary { opacity: .7; filter:Alpha(Opacity=70); font-weight: normal; }
77
+
78
+ /* Icons
79
+ ----------------------------------*/
80
+
81
+ /* states and images */
82
+ .ui-icon { width: 16px; height: 16px; background-image: url(images/ui-icons_222222_256x240.png); }
83
+ .ui-widget-content .ui-icon {background-image: url(images/ui-icons_222222_256x240.png); }
84
+ .ui-widget-header .ui-icon {background-image: url(images/ui-icons_222222_256x240.png); }
85
+ .ui-state-default .ui-icon { background-image: url(images/ui-icons_888888_256x240.png); }
86
+ .ui-state-hover .ui-icon, .ui-state-focus .ui-icon {background-image: url(images/ui-icons_454545_256x240.png); }
87
+ .ui-state-active .ui-icon {background-image: url(images/ui-icons_454545_256x240.png); }
88
+ .ui-state-highlight .ui-icon {background-image: url(images/ui-icons_2e83ff_256x240.png); }
89
+ .ui-state-error .ui-icon, .ui-state-error-text .ui-icon {background-image: url(images/ui-icons_cd0a0a_256x240.png); }
90
+
91
+ /* positioning */
92
+ .ui-icon-carat-1-n { background-position: 0 0; }
93
+ .ui-icon-carat-1-ne { background-position: -16px 0; }
94
+ .ui-icon-carat-1-e { background-position: -32px 0; }
95
+ .ui-icon-carat-1-se { background-position: -48px 0; }
96
+ .ui-icon-carat-1-s { background-position: -64px 0; }
97
+ .ui-icon-carat-1-sw { background-position: -80px 0; }
98
+ .ui-icon-carat-1-w { background-position: -96px 0; }
99
+ .ui-icon-carat-1-nw { background-position: -112px 0; }
100
+ .ui-icon-carat-2-n-s { background-position: -128px 0; }
101
+ .ui-icon-carat-2-e-w { background-position: -144px 0; }
102
+ .ui-icon-triangle-1-n { background-position: 0 -16px; }
103
+ .ui-icon-triangle-1-ne { background-position: -16px -16px; }
104
+ .ui-icon-triangle-1-e { background-position: -32px -16px; }
105
+ .ui-icon-triangle-1-se { background-position: -48px -16px; }
106
+ .ui-icon-triangle-1-s { background-position: -64px -16px; }
107
+ .ui-icon-triangle-1-sw { background-position: -80px -16px; }
108
+ .ui-icon-triangle-1-w { background-position: -96px -16px; }
109
+ .ui-icon-triangle-1-nw { background-position: -112px -16px; }
110
+ .ui-icon-triangle-2-n-s { background-position: -128px -16px; }
111
+ .ui-icon-triangle-2-e-w { background-position: -144px -16px; }
112
+ .ui-icon-arrow-1-n { background-position: 0 -32px; }
113
+ .ui-icon-arrow-1-ne { background-position: -16px -32px; }
114
+ .ui-icon-arrow-1-e { background-position: -32px -32px; }
115
+ .ui-icon-arrow-1-se { background-position: -48px -32px; }
116
+ .ui-icon-arrow-1-s { background-position: -64px -32px; }
117
+ .ui-icon-arrow-1-sw { background-position: -80px -32px; }
118
+ .ui-icon-arrow-1-w { background-position: -96px -32px; }
119
+ .ui-icon-arrow-1-nw { background-position: -112px -32px; }
120
+ .ui-icon-arrow-2-n-s { background-position: -128px -32px; }
121
+ .ui-icon-arrow-2-ne-sw { background-position: -144px -32px; }
122
+ .ui-icon-arrow-2-e-w { background-position: -160px -32px; }
123
+ .ui-icon-arrow-2-se-nw { background-position: -176px -32px; }
124
+ .ui-icon-arrowstop-1-n { background-position: -192px -32px; }
125
+ .ui-icon-arrowstop-1-e { background-position: -208px -32px; }
126
+ .ui-icon-arrowstop-1-s { background-position: -224px -32px; }
127
+ .ui-icon-arrowstop-1-w { background-position: -240px -32px; }
128
+ .ui-icon-arrowthick-1-n { background-position: 0 -48px; }
129
+ .ui-icon-arrowthick-1-ne { background-position: -16px -48px; }
130
+ .ui-icon-arrowthick-1-e { background-position: -32px -48px; }
131
+ .ui-icon-arrowthick-1-se { background-position: -48px -48px; }
132
+ .ui-icon-arrowthick-1-s { background-position: -64px -48px; }
133
+ .ui-icon-arrowthick-1-sw { background-position: -80px -48px; }
134
+ .ui-icon-arrowthick-1-w { background-position: -96px -48px; }
135
+ .ui-icon-arrowthick-1-nw { background-position: -112px -48px; }
136
+ .ui-icon-arrowthick-2-n-s { background-position: -128px -48px; }
137
+ .ui-icon-arrowthick-2-ne-sw { background-position: -144px -48px; }
138
+ .ui-icon-arrowthick-2-e-w { background-position: -160px -48px; }
139
+ .ui-icon-arrowthick-2-se-nw { background-position: -176px -48px; }
140
+ .ui-icon-arrowthickstop-1-n { background-position: -192px -48px; }
141
+ .ui-icon-arrowthickstop-1-e { background-position: -208px -48px; }
142
+ .ui-icon-arrowthickstop-1-s { background-position: -224px -48px; }
143
+ .ui-icon-arrowthickstop-1-w { background-position: -240px -48px; }
144
+ .ui-icon-arrowreturnthick-1-w { background-position: 0 -64px; }
145
+ .ui-icon-arrowreturnthick-1-n { background-position: -16px -64px; }
146
+ .ui-icon-arrowreturnthick-1-e { background-position: -32px -64px; }
147
+ .ui-icon-arrowreturnthick-1-s { background-position: -48px -64px; }
148
+ .ui-icon-arrowreturn-1-w { background-position: -64px -64px; }
149
+ .ui-icon-arrowreturn-1-n { background-position: -80px -64px; }
150
+ .ui-icon-arrowreturn-1-e { background-position: -96px -64px; }
151
+ .ui-icon-arrowreturn-1-s { background-position: -112px -64px; }
152
+ .ui-icon-arrowrefresh-1-w { background-position: -128px -64px; }
153
+ .ui-icon-arrowrefresh-1-n { background-position: -144px -64px; }
154
+ .ui-icon-arrowrefresh-1-e { background-position: -160px -64px; }
155
+ .ui-icon-arrowrefresh-1-s { background-position: -176px -64px; }
156
+ .ui-icon-arrow-4 { background-position: 0 -80px; }
157
+ .ui-icon-arrow-4-diag { background-position: -16px -80px; }
158
+ .ui-icon-extlink { background-position: -32px -80px; }
159
+ .ui-icon-newwin { background-position: -48px -80px; }
160
+ .ui-icon-refresh { background-position: -64px -80px; }
161
+ .ui-icon-shuffle { background-position: -80px -80px; }
162
+ .ui-icon-transfer-e-w { background-position: -96px -80px; }
163
+ .ui-icon-transferthick-e-w { background-position: -112px -80px; }
164
+ .ui-icon-folder-collapsed { background-position: 0 -96px; }
165
+ .ui-icon-folder-open { background-position: -16px -96px; }
166
+ .ui-icon-document { background-position: -32px -96px; }
167
+ .ui-icon-document-b { background-position: -48px -96px; }
168
+ .ui-icon-note { background-position: -64px -96px; }
169
+ .ui-icon-mail-closed { background-position: -80px -96px; }
170
+ .ui-icon-mail-open { background-position: -96px -96px; }
171
+ .ui-icon-suitcase { background-position: -112px -96px; }
172
+ .ui-icon-comment { background-position: -128px -96px; }
173
+ .ui-icon-person { background-position: -144px -96px; }
174
+ .ui-icon-print { background-position: -160px -96px; }
175
+ .ui-icon-trash { background-position: -176px -96px; }
176
+ .ui-icon-locked { background-position: -192px -96px; }
177
+ .ui-icon-unlocked { background-position: -208px -96px; }
178
+ .ui-icon-bookmark { background-position: -224px -96px; }
179
+ .ui-icon-tag { background-position: -240px -96px; }
180
+ .ui-icon-home { background-position: 0 -112px; }
181
+ .ui-icon-flag { background-position: -16px -112px; }
182
+ .ui-icon-calendar { background-position: -32px -112px; }
183
+ .ui-icon-cart { background-position: -48px -112px; }
184
+ .ui-icon-pencil { background-position: -64px -112px; }
185
+ .ui-icon-clock { background-position: -80px -112px; }
186
+ .ui-icon-disk { background-position: -96px -112px; }
187
+ .ui-icon-calculator { background-position: -112px -112px; }
188
+ .ui-icon-zoomin { background-position: -128px -112px; }
189
+ .ui-icon-zoomout { background-position: -144px -112px; }
190
+ .ui-icon-search { background-position: -160px -112px; }
191
+ .ui-icon-wrench { background-position: -176px -112px; }
192
+ .ui-icon-gear { background-position: -192px -112px; }
193
+ .ui-icon-heart { background-position: -208px -112px; }
194
+ .ui-icon-star { background-position: -224px -112px; }
195
+ .ui-icon-link { background-position: -240px -112px; }
196
+ .ui-icon-cancel { background-position: 0 -128px; }
197
+ .ui-icon-plus { background-position: -16px -128px; }
198
+ .ui-icon-plusthick { background-position: -32px -128px; }
199
+ .ui-icon-minus { background-position: -48px -128px; }
200
+ .ui-icon-minusthick { background-position: -64px -128px; }
201
+ .ui-icon-close { background-position: -80px -128px; }
202
+ .ui-icon-closethick { background-position: -96px -128px; }
203
+ .ui-icon-key { background-position: -112px -128px; }
204
+ .ui-icon-lightbulb { background-position: -128px -128px; }
205
+ .ui-icon-scissors { background-position: -144px -128px; }
206
+ .ui-icon-clipboard { background-position: -160px -128px; }
207
+ .ui-icon-copy { background-position: -176px -128px; }
208
+ .ui-icon-contact { background-position: -192px -128px; }
209
+ .ui-icon-image { background-position: -208px -128px; }
210
+ .ui-icon-video { background-position: -224px -128px; }
211
+ .ui-icon-script { background-position: -240px -128px; }
212
+ .ui-icon-alert { background-position: 0 -144px; }
213
+ .ui-icon-info { background-position: -16px -144px; }
214
+ .ui-icon-notice { background-position: -32px -144px; }
215
+ .ui-icon-help { background-position: -48px -144px; }
216
+ .ui-icon-check { background-position: -64px -144px; }
217
+ .ui-icon-bullet { background-position: -80px -144px; }
218
+ .ui-icon-radio-off { background-position: -96px -144px; }
219
+ .ui-icon-radio-on { background-position: -112px -144px; }
220
+ .ui-icon-pin-w { background-position: -128px -144px; }
221
+ .ui-icon-pin-s { background-position: -144px -144px; }
222
+ .ui-icon-play { background-position: 0 -160px; }
223
+ .ui-icon-pause { background-position: -16px -160px; }
224
+ .ui-icon-seek-next { background-position: -32px -160px; }
225
+ .ui-icon-seek-prev { background-position: -48px -160px; }
226
+ .ui-icon-seek-end { background-position: -64px -160px; }
227
+ .ui-icon-seek-first { background-position: -80px -160px; }
228
+ .ui-icon-stop { background-position: -96px -160px; }
229
+ .ui-icon-eject { background-position: -112px -160px; }
230
+ .ui-icon-volume-off { background-position: -128px -160px; }
231
+ .ui-icon-volume-on { background-position: -144px -160px; }
232
+ .ui-icon-power { background-position: 0 -176px; }
233
+ .ui-icon-signal-diag { background-position: -16px -176px; }
234
+ .ui-icon-signal { background-position: -32px -176px; }
235
+ .ui-icon-battery-0 { background-position: -48px -176px; }
236
+ .ui-icon-battery-1 { background-position: -64px -176px; }
237
+ .ui-icon-battery-2 { background-position: -80px -176px; }
238
+ .ui-icon-battery-3 { background-position: -96px -176px; }
239
+ .ui-icon-circle-plus { background-position: 0 -192px; }
240
+ .ui-icon-circle-minus { background-position: -16px -192px; }
241
+ .ui-icon-circle-close { background-position: -32px -192px; }
242
+ .ui-icon-circle-triangle-e { background-position: -48px -192px; }
243
+ .ui-icon-circle-triangle-s { background-position: -64px -192px; }
244
+ .ui-icon-circle-triangle-w { background-position: -80px -192px; }
245
+ .ui-icon-circle-triangle-n { background-position: -96px -192px; }
246
+ .ui-icon-circle-arrow-e { background-position: -112px -192px; }
247
+ .ui-icon-circle-arrow-s { background-position: -128px -192px; }
248
+ .ui-icon-circle-arrow-w { background-position: -144px -192px; }
249
+ .ui-icon-circle-arrow-n { background-position: -160px -192px; }
250
+ .ui-icon-circle-zoomin { background-position: -176px -192px; }
251
+ .ui-icon-circle-zoomout { background-position: -192px -192px; }
252
+ .ui-icon-circle-check { background-position: -208px -192px; }
253
+ .ui-icon-circlesmall-plus { background-position: 0 -208px; }
254
+ .ui-icon-circlesmall-minus { background-position: -16px -208px; }
255
+ .ui-icon-circlesmall-close { background-position: -32px -208px; }
256
+ .ui-icon-squaresmall-plus { background-position: -48px -208px; }
257
+ .ui-icon-squaresmall-minus { background-position: -64px -208px; }
258
+ .ui-icon-squaresmall-close { background-position: -80px -208px; }
259
+ .ui-icon-grip-dotted-vertical { background-position: 0 -224px; }
260
+ .ui-icon-grip-dotted-horizontal { background-position: -16px -224px; }
261
+ .ui-icon-grip-solid-vertical { background-position: -32px -224px; }
262
+ .ui-icon-grip-solid-horizontal { background-position: -48px -224px; }
263
+ .ui-icon-gripsmall-diagonal-se { background-position: -64px -224px; }
264
+ .ui-icon-grip-diagonal-se { background-position: -80px -224px; }
265
+
266
+
267
+ /* Misc visuals
268
+ ----------------------------------*/
269
+
270
+ /* Corner radius */
271
+ .ui-corner-tl { -moz-border-radius-topleft: 4px; -webkit-border-top-left-radius: 4px; }
272
+ .ui-corner-tr { -moz-border-radius-topright: 4px; -webkit-border-top-right-radius: 4px; }
273
+ .ui-corner-bl { -moz-border-radius-bottomleft: 4px; -webkit-border-bottom-left-radius: 4px; }
274
+ .ui-corner-br { -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 4px; }
275
+ .ui-corner-top { -moz-border-radius-topleft: 4px; -webkit-border-top-left-radius: 4px; -moz-border-radius-topright: 4px; -webkit-border-top-right-radius: 4px; }
276
+ .ui-corner-bottom { -moz-border-radius-bottomleft: 4px; -webkit-border-bottom-left-radius: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 4px; }
277
+ .ui-corner-right { -moz-border-radius-topright: 4px; -webkit-border-top-right-radius: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 4px; }
278
+ .ui-corner-left { -moz-border-radius-topleft: 4px; -webkit-border-top-left-radius: 4px; -moz-border-radius-bottomleft: 4px; -webkit-border-bottom-left-radius: 4px; }
279
+ .ui-corner-all { -moz-border-radius: 4px; -webkit-border-radius: 4px; }
280
+
281
+ /* Overlays */
282
+ .ui-widget-overlay { background: #aaaaaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x; opacity: .30;filter:Alpha(Opacity=30); }
283
+ .ui-widget-shadow { margin: -8px 0 0 -8px; padding: 8px; background: #aaaaaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x; opacity: .30;filter:Alpha(Opacity=30); -moz-border-radius: 8px; -webkit-border-radius: 8px; }/* Datepicker
284
+ ----------------------------------*/
285
+ .ui-datepicker { width: 17em; padding: .2em .2em 0; }
286
+ .ui-datepicker .ui-datepicker-header { position:relative; padding:.2em 0; }
287
+ .ui-datepicker .ui-datepicker-prev, .ui-datepicker .ui-datepicker-next { position:absolute; top: 2px; width: 1.8em; height: 1.8em; }
288
+ .ui-datepicker .ui-datepicker-prev-hover, .ui-datepicker .ui-datepicker-next-hover { top: 1px; }
289
+ .ui-datepicker .ui-datepicker-prev { left:2px; }
290
+ .ui-datepicker .ui-datepicker-next { right:2px; }
291
+ .ui-datepicker .ui-datepicker-prev-hover { left:1px; }
292
+ .ui-datepicker .ui-datepicker-next-hover { right:1px; }
293
+ .ui-datepicker .ui-datepicker-prev span, .ui-datepicker .ui-datepicker-next span { display: block; position: absolute; left: 50%; margin-left: -8px; top: 50%; margin-top: -8px; }
294
+ .ui-datepicker .ui-datepicker-title { margin: 0 2.3em; line-height: 1.8em; text-align: center; }
295
+ .ui-datepicker .ui-datepicker-title select { float:left; font-size:1em; margin:1px 0; }
296
+ .ui-datepicker select.ui-datepicker-month-year {width: 100%;}
297
+ .ui-datepicker select.ui-datepicker-month,
298
+ .ui-datepicker select.ui-datepicker-year { width: 49%;}
299
+ .ui-datepicker .ui-datepicker-title select.ui-datepicker-year { float: right; }
300
+ .ui-datepicker table {width: 100%; font-size: .9em; border-collapse: collapse; margin:0 0 .4em; }
301
+ .ui-datepicker th { padding: .7em .3em; text-align: center; font-weight: bold; border: 0; }
302
+ .ui-datepicker td { border: 0; padding: 1px; }
303
+ .ui-datepicker td span, .ui-datepicker td a { display: block; padding: .2em; text-align: right; text-decoration: none; }
304
+ .ui-datepicker .ui-datepicker-buttonpane { background-image: none; margin: .7em 0 0 0; padding:0 .2em; border-left: 0; border-right: 0; border-bottom: 0; }
305
+ .ui-datepicker .ui-datepicker-buttonpane button { float: right; margin: .5em .2em .4em; cursor: pointer; padding: .2em .6em .3em .6em; width:auto; overflow:visible; }
306
+ .ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current { float:left; }
307
+
308
+ /* with multiple calendars */
309
+ .ui-datepicker.ui-datepicker-multi { width:auto; }
310
+ .ui-datepicker-multi .ui-datepicker-group { float:left; }
311
+ .ui-datepicker-multi .ui-datepicker-group table { width:95%; margin:0 auto .4em; }
312
+ .ui-datepicker-multi-2 .ui-datepicker-group { width:50%; }
313
+ .ui-datepicker-multi-3 .ui-datepicker-group { width:33.3%; }
314
+ .ui-datepicker-multi-4 .ui-datepicker-group { width:25%; }
315
+ .ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header { border-left-width:0; }
316
+ .ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header { border-left-width:0; }
317
+ .ui-datepicker-multi .ui-datepicker-buttonpane { clear:left; }
318
+ .ui-datepicker-row-break { clear:both; width:100%; }
319
+
320
+ /* RTL support */
321
+ .ui-datepicker-rtl { direction: rtl; }
322
+ .ui-datepicker-rtl .ui-datepicker-prev { right: 2px; left: auto; }
323
+ .ui-datepicker-rtl .ui-datepicker-next { left: 2px; right: auto; }
324
+ .ui-datepicker-rtl .ui-datepicker-prev:hover { right: 1px; left: auto; }
325
+ .ui-datepicker-rtl .ui-datepicker-next:hover { left: 1px; right: auto; }
326
+ .ui-datepicker-rtl .ui-datepicker-buttonpane { clear:right; }
327
+ .ui-datepicker-rtl .ui-datepicker-buttonpane button { float: left; }
328
+ .ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current { float:right; }
329
+ .ui-datepicker-rtl .ui-datepicker-group { float:right; }
330
+ .ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header { border-right-width:0; border-left-width:1px; }
331
+ .ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header { border-right-width:0; border-left-width:1px; }
332
+
333
+ /* IE6 IFRAME FIX (taken from datepicker 1.5.3 */
334
+ .ui-datepicker-cover {
335
+ display: none; /*sorry for IE5*/
336
+ display/**/: block; /*sorry for IE5*/
337
+ position: absolute; /*must have*/
338
+ z-index: -1; /*must have*/
339
+ filter: mask(); /*must have*/
340
+ top: -4px; /*must have*/
341
+ left: -4px; /*must have*/
342
+ width: 200px; /*must have*/
343
+ height: 200px; /*must have*/
344
+ }
345
+
346
+ /* Icon Cursor Mouseover */
347
+ img.ui-datepicker-trigger { cursor:pointer; }
templates/admin/media-csv_file.php ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div class="postbox-container">
2
+ <div class="postbox">
3
+ <h3 class="hndle"><?php _e( 'Export File', 'woo_ce' ); ?></h3>
4
+ <div class="inside">
5
+ <textarea style="font:12px Consolas, Monaco, Courier, monospace; width:100%; height:200px;"><?php echo esc_textarea( $contents ); ?></textarea>
6
+ </div>
7
+ <!-- .inside -->
8
+ </div>
9
+ <!-- .postbox -->
10
+
11
+ </div>
12
+ <!-- .postbox-container -->
templates/admin/media-export_details.php ADDED
@@ -0,0 +1,54 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <table class="widefat" style="font-family:monospace;">
2
+ <thead>
3
+
4
+ <tr>
5
+ <th colspan="2"><?php _e( 'Export Details', 'woo_ce' ); ?></th>
6
+ </tr>
7
+
8
+ </thead>
9
+ <tbody>
10
+
11
+ <tr>
12
+ <th style="width:20%;"><?php _e( 'Export type', 'woo_ce' ); ?></th>
13
+ <td><?php echo woo_ce_export_type_label( $export_type ); ?></td>
14
+ </tr>
15
+ <tr>
16
+ <th><?php _e( 'Filepath', 'woo_ce' ); ?></th>
17
+ <td><?php echo $filepath; ?></td>
18
+ </tr>
19
+ <tr>
20
+ <th><?php _e( 'Total columns', 'woo_ce' ); ?></th>
21
+ <td><?php echo ( ( $columns != false ) ? $columns : '-' ); ?></td>
22
+ </tr>
23
+ <tr>
24
+ <th><?php _e( 'Total rows', 'woo_ce' ); ?></th>
25
+ <td><?php echo ( ( $rows != false ) ? $rows : '-' ); ?></td>
26
+ </tr>
27
+ <tr>
28
+ <th><?php _e( 'Process time', 'woo_ce' ); ?></th>
29
+ <td><?php echo ( ( ( $start_time != false ) && ( $end_time != false ) ) ? woo_ce_display_time_elapsed( $start_time, $end_time ) : '-' ); ?></td>
30
+ </tr>
31
+ <tr>
32
+ <th><?php _e( 'Idle memory usage (start)', 'woo_ce' ); ?></th>
33
+ <td><?php echo ( ( $idle_memory_start != false ) ? woo_ce_display_memory( $idle_memory_start ) : '-' ); ?></td>
34
+ </tr>
35
+ <tr>
36
+ <th><?php _e( 'Memory usage prior to loading export type', 'woo_ce' ); ?></th>
37
+ <td><?php echo ( ( $data_memory_start != false ) ? woo_ce_display_memory( $data_memory_start ) : '-' ); ?></td>
38
+ </tr>
39
+ <tr>
40
+ <th><?php _e( 'Memory usage after loading export type', 'woo_ce' ); ?></th>
41
+ <td><?php echo ( ( $data_memory_end != false ) ? woo_ce_display_memory( $data_memory_end ) : '-' ); ?></td>
42
+ </tr>
43
+ <tr>
44
+ <th><?php _e( 'Memory usage at render time', 'woo_ce' ); ?></th>
45
+ <td>-</td>
46
+ </tr>
47
+ <tr>
48
+ <th><?php _e( 'Idle memory usage (end)', 'woo_ce' ); ?></th>
49
+ <td><?php echo ( ( $idle_memory_end != false ) ? woo_ce_display_memory( $idle_memory_end ) : '-' ); ?></td>
50
+ </tr>
51
+
52
+ </tbody>
53
+ </table>
54
+ <br />
templates/admin/tabs-archive.php ADDED
@@ -0,0 +1,79 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <ul class="subsubsub">
2
+ <li><a href="<?php echo add_query_arg( 'filter', null ); ?>"<?php woo_ce_archives_quicklink_current( 'all' ); ?>><?php _e( 'All', 'woo_ce' ); ?> <span class="count">(<?php woo_ce_archives_quicklink_count(); ?>)</span></a> |</li>
3
+ <li><a href="<?php echo add_query_arg( 'filter', 'product' ); ?>"<?php woo_ce_archives_quicklink_current( 'product' ); ?>><?php _e( 'Products', 'woo_ce' ); ?> <span class="count">(<?php woo_ce_archives_quicklink_count( 'product' ); ?>)</span></a> |</li>
4
+ <li><a href="<?php echo add_query_arg( 'filter', 'category' ); ?>"<?php woo_ce_archives_quicklink_current( 'category' ); ?>><?php _e( 'Categories', 'woo_ce' ); ?> <span class="count">(<?php woo_ce_archives_quicklink_count( 'category' ); ?>)</span></a> |</li>
5
+ <li><a href="<?php echo add_query_arg( 'filter', 'tag' ); ?>"<?php woo_ce_archives_quicklink_current( 'tag' ); ?>><?php _e( 'Tags', 'woo_ce' ); ?> <span class="count">(<?php woo_ce_archives_quicklink_count( 'tag' ); ?>)</span></a> |</li>
6
+ <li><?php _e( 'Brands', 'woo_ce' ); ?> <span class="count">(<?php woo_ce_archives_quicklink_count( 'brand' ); ?>)</span> |</li>
7
+ <li><?php _e( 'Orders', 'woo_ce' ); ?> <span class="count">(<?php woo_ce_archives_quicklink_count( 'order' ); ?>)</span> |</li>
8
+ <li><?php _e( 'Customers', 'woo_ce' ); ?> <span class="count">(<?php woo_ce_archives_quicklink_count( 'customer' ); ?>)</span> |</li>
9
+ <li><a href="<?php echo add_query_arg( 'filter', 'user' ); ?>"<?php woo_ce_archives_quicklink_current( 'user' ); ?>><?php _e( 'Users', 'woo_ce' ); ?> <span class="count">(<?php woo_ce_archives_quicklink_count( 'user' ); ?>)</span></a> |</li>
10
+ <li><?php _e( 'Coupon', 'woo_ce' ); ?> <span class="count">(<?php woo_ce_archives_quicklink_count( 'coupon' ); ?>)</span> |</li>
11
+ <li><?php _e( 'Subscriptions', 'woo_ce' ); ?> <span class="count">(<?php woo_ce_archives_quicklink_count( 'subscription' ); ?>)</span></li>
12
+ <li><?php _e( 'Product Vendors', 'woo_ce' ); ?> <span class="count">(<?php woo_ce_archives_quicklink_count( 'product_vendor' ); ?>)</span> |</li>
13
+ <!-- <li><?php _e( 'Attributes', 'woo_ce' ); ?> <span class="count">(<?php woo_ce_archives_quicklink_count( 'attribute' ); ?>)</span></li> -->
14
+ </ul>
15
+ <!-- .subsubsub -->
16
+ <br class="clear" />
17
+ <form action="" method="GET">
18
+ <table class="widefat fixed media" cellspacing="0">
19
+ <thead>
20
+
21
+ <tr>
22
+ <th scope="col" id="icon" class="manage-column column-icon"></th>
23
+ <th scope="col" id="title" class="manage-column column-title"><?php _e( 'Filename', 'woo_ce' ); ?></th>
24
+ <th scope="col" class="manage-column column-type"><?php _e( 'Type', 'woo_ce' ); ?></th>
25
+ <th scope="col" class="manage-column column-author"><?php _e( 'Author', 'woo_ce' ); ?></th>
26
+ <th scope="col" id="title" class="manage-column column-title"><?php _e( 'Date', 'woo_ce' ); ?></th>
27
+ </tr>
28
+
29
+ </thead>
30
+ <tfoot>
31
+
32
+ <tr>
33
+ <th scope="col" class="manage-column column-icon"></th>
34
+ <th scope="col" class="manage-column column-title"><?php _e( 'Filename', 'woo_ce' ); ?></th>
35
+ <th scope="col" class="manage-column column-type"><?php _e( 'Type', 'woo_ce' ); ?></th>
36
+ <th scope="col" class="manage-column column-author"><?php _e( 'Author', 'woo_ce' ); ?></th>
37
+ <th scope="col" class="manage-column column-title"><?php _e( 'Date', 'woo_ce' ); ?></th>
38
+ </tr>
39
+
40
+ </tfoot>
41
+ <tbody id="the-list">
42
+
43
+ <?php if( $files ) { ?>
44
+ <?php foreach( $files as $file ) { ?>
45
+ <tr id="post-<?php echo $file->ID; ?>" class="author-self status-<?php echo $file->post_status; ?>" valign="top">
46
+ <td class="column-icon media-icon">
47
+ <?php echo $file->media_icon; ?>
48
+ </td>
49
+ <td class="post-title page-title column-title">
50
+ <strong><a href="<?php echo $file->guid; ?>" class="row-title"><?php echo $file->post_title; ?></a></strong>
51
+ <div class="row-actions">
52
+ <span class="view"><a href="<?php echo get_edit_post_link( $file->ID ); ?>" title="<?php _e( 'Edit', 'woo_ce' ); ?>"><?php _e( 'Edit', 'woo_ce' ); ?></a></span> |
53
+ <span class="trash"><a href="<?php echo get_delete_post_link( $file->ID, '', true ); ?>" title="<?php _e( 'Delete Permanently', 'woo_ce' ); ?>"><?php _e( 'Delete', 'woo_ce' ); ?></a></span>
54
+ </div>
55
+ </td>
56
+ <td class="title">
57
+ <a href="<?php echo add_query_arg( 'filter', $file->export_type ); ?>"><?php echo $file->export_type_label; ?></a>
58
+ </td>
59
+ <td class="author column-author"><?php echo $file->post_author_name; ?></td>
60
+ <td class="date column-date"><?php echo $file->post_date; ?></td>
61
+ </tr>
62
+ <?php } ?>
63
+ <?php } else { ?>
64
+ <tr id="post-<?php echo $file->ID; ?>" class="author-self" valign="top">
65
+ <td colspan="3" class="colspanchange"><?php _e( 'No past exports were found.', 'woo_ce' ); ?></td>
66
+ </tr>
67
+ <?php } ?>
68
+
69
+ </tbody>
70
+ </table>
71
+ <div class="tablenav bottom">
72
+ <div class="tablenav-pages one-page">
73
+ <span class="displaying-num"><?php printf( __( '%d items', 'woo_ce' ), woo_ce_archives_quicklink_count() ); ?></span>
74
+ </div>
75
+ <!-- .tablenav-pages -->
76
+ <br class="clear">
77
+ </div>
78
+ <!-- .tablenav -->
79
+ </form>
templates/admin/tabs-export.php ADDED
@@ -0,0 +1,777 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <ul class="subsubsub">
2
+ <li><a href="#export-type"><?php _e( 'Export Type', 'woo_ce' ); ?></a> |</li>
3
+ <li><a href="#export-options"><?php _e( 'Export Options', 'woo_ce' ); ?></a></li>
4
+ <li>| <a href="#export-modules"><?php _e( 'Export Modules', 'woo_ce' ); ?></a></li>
5
+ <?php do_action( 'woo_ce_export_quicklinks' ); ?>
6
+ </ul>
7
+ <!-- .subsubsub -->
8
+ <br class="clear" />
9
+
10
+ <p><?php _e( 'Select an export type from the list below to export entries. Once you have selected an export type you may select the fields you would like to export and optional filters available for each export type. When you click the export button below, Store Exporter will create an export file for you to save to your computer.', 'woo_ce' ); ?></p>
11
+ <div id="poststuff">
12
+ <form method="post" action="<?php echo add_query_arg( array( 'failed' => null, 'empty' => null, 'message' => null ) ); ?>" id="postform">
13
+
14
+ <div id="export-type" class="postbox">
15
+ <h3 class="hndle"><?php _e( 'Export Type', 'woo_ce' ); ?></h3>
16
+ <div class="inside">
17
+ <p class="description"><?php _e( 'Select the data type you want to export.', 'woo_ce' ); ?></p>
18
+ <table class="form-table">
19
+
20
+ <tr>
21
+ <th>
22
+ <input type="radio" id="product" name="dataset" value="product"<?php disabled( $products, 0 ); ?><?php checked( $export_type, 'product' ); ?> />
23
+ <label for="product"><?php _e( 'Products', 'woo_ce' ); ?></label>
24
+ </th>
25
+ <td>
26
+ <span class="description">(<?php echo $products; ?>)</span>
27
+ </td>
28
+ </tr>
29
+
30
+ <tr>
31
+ <th>
32
+ <input type="radio" id="category" name="dataset" value="category"<?php disabled( $categories, 0 ); ?><?php checked( $export_type, 'category' ); ?> />
33
+ <label for="category"><?php _e( 'Categories', 'woo_ce' ); ?></label>
34
+ </th>
35
+ <td>
36
+ <span class="description">(<?php echo $categories; ?>)</span>
37
+ </td>
38
+ </tr>
39
+
40
+ <tr>
41
+ <th>
42
+ <input type="radio" id="tag" name="dataset" value="tag"<?php disabled( $tags, 0 ); ?><?php checked( $export_type, 'tag' ); ?> />
43
+ <label for="tag"><?php _e( 'Tags', 'woo_ce' ); ?></label>
44
+ </th>
45
+ <td>
46
+ <span class="description">(<?php echo $tags; ?>)</span>
47
+ </td>
48
+ </tr>
49
+
50
+ <tr>
51
+ <th>
52
+ <input type="radio" id="brand" name="dataset" value="brand"<?php disabled( $brands, 0 ); ?><?php checked( $export_type, 'brand' ); ?> />
53
+ <label for="brand"><?php _e( 'Brands', 'woo_ce' ); ?></label>
54
+ </th>
55
+ <td>
56
+ <span class="description">(<?php echo $brands; ?>)</span>
57
+ <span class="description"> - <?php printf( __( 'available in %s', 'woo_ce' ), $woo_cd_link ); ?></span>
58
+ </td>
59
+ </tr>
60
+
61
+ <tr>
62
+ <th>
63
+ <input type="radio" id="order" name="dataset" value="order"<?php disabled( $orders, 0 ); ?><?php checked( $export_type, 'order' ); ?>/>
64
+ <label for="order"><?php _e( 'Orders', 'woo_ce' ); ?></label>
65
+ </th>
66
+ <td>
67
+ <span class="description">(<?php echo $orders; ?>)</span>
68
+ <span class="description"> - <?php printf( __( 'available in %s', 'woo_ce' ), $woo_cd_link ); ?></span>
69
+ </td>
70
+ </tr>
71
+
72
+ <tr>
73
+ <th>
74
+ <input type="radio" id="customer" name="dataset" value="customer"<?php disabled( $customers, 0 ); ?><?php checked( $export_type, 'customer' ); ?>/>
75
+ <label for="customer"><?php _e( 'Customers', 'woo_ce' ); ?></label>
76
+ </th>
77
+ <td>
78
+ <span class="description">(<?php echo $customers; ?>)</span>
79
+ <span class="description"> - <?php printf( __( 'available in %s', 'woo_ce' ), $woo_cd_link ); ?></span>
80
+ </td>
81
+ </tr>
82
+
83
+ <tr>
84
+ <th>
85
+ <input type="radio" id="user" name="dataset" value="user"<?php disabled( $users, 0 ); ?><?php checked( $export_type, 'user' ); ?>/>
86
+ <label for="user"><?php _e( 'Users', 'woo_ce' ); ?></label>
87
+ </th>
88
+ <td>
89
+ <span class="description">(<?php echo $users; ?>)</span>
90
+ </td>
91
+ </tr>
92
+
93
+ <tr>
94
+ <th>
95
+ <input type="radio" id="coupon" name="dataset" value="coupon"<?php disabled( $coupons, 0 ); ?><?php checked( $export_type, 'coupon' ); ?> />
96
+ <label for="coupon"><?php _e( 'Coupons', 'woo_ce' ); ?></label>
97
+ </th>
98
+ <td>
99
+ <span class="description">(<?php echo $coupons; ?>)</span>
100
+ <span class="description"> - <?php printf( __( 'available in %s', 'woo_ce' ), $woo_cd_link ); ?></span>
101
+ </td>
102
+ </tr>
103
+
104
+ <tr>
105
+ <th>
106
+ <input type="radio" id="subscription" name="dataset" value="subscription"<?php disabled( $subscriptions, 0 ); ?><?php checked( $export_type, 'subscription' ); ?> />
107
+ <label for="subscription"><?php _e( 'Subscriptions', 'woo_ce' ); ?></label>
108
+ </th>
109
+ <td>
110
+ <span class="description">(<?php echo $subscriptions; ?>)</span>
111
+ <span class="description"> - <?php printf( __( 'available in %s', 'woo_ce' ), $woo_cd_link ); ?></span>
112
+ </td>
113
+ </tr>
114
+
115
+ <tr>
116
+ <th>
117
+ <input type="radio" id="product_vendor" name="dataset" value="product_vendor"<?php disabled( $product_vendors, 0 ); ?><?php checked( $export_type, 'product_vendor' ); ?> />
118
+ <label for="product_vendor"><?php _e( 'Product Vendors', 'woo_ce' ); ?></label>
119
+ </th>
120
+ <td>
121
+ <span class="description">(<?php echo $product_vendors; ?>)</span>
122
+ <span class="description"> - <?php printf( __( 'available in %s', 'woo_ce' ), $woo_cd_link ); ?></span>
123
+ </td>
124
+ </tr>
125
+
126
+ <!--
127
+ <tr>
128
+ <th>
129
+ <input type="radio" id="attribute" name="dataset" value="attribute"<?php disabled( $attributes, 0 ); ?><?php checked( $export_type, 'attribute' ); ?> />
130
+ <label for="attribute"><?php _e( 'Attributes', 'woo_ce' ); ?></label>
131
+ </th>
132
+ <td>
133
+ <span class="description">(<?php echo $attributes; ?>)</span>
134
+ </td>
135
+ </tr>
136
+ -->
137
+
138
+ </table>
139
+ <!-- .form-table -->
140
+ </div>
141
+ <!-- .inside -->
142
+ </div>
143
+ <!-- .postbox -->
144
+
145
+ <?php if( $product_fields ) { ?>
146
+ <div id="export-product" class="export-types">
147
+
148
+ <div class="postbox">
149
+ <h3 class="hndle">
150
+ <?php _e( 'Product Fields', 'woo_ce' ); ?>
151
+ <a href="<?php echo add_query_arg( array( 'tab' => 'fields', 'type' => 'product' ) ); ?>" style="float:right;"><?php _e( 'Configure', 'woo_ce' ); ?></a>
152
+ </h3>
153
+ <div class="inside">
154
+ <?php if( $products ) { ?>
155
+ <p class="description"><?php _e( 'Select the Product fields you would like to export, your field selection is saved for future exports.', 'woo_ce' ); ?></p>
156
+ <p><a href="javascript:void(0)" id="product-checkall" class="checkall"><?php _e( 'Check All', 'woo_ce' ); ?></a> | <a href="javascript:void(0)" id="product-uncheckall" class="uncheckall"><?php _e( 'Uncheck All', 'woo_ce' ); ?></a></p>
157
+ <table id="product-fields" class="ui-sortable">
158
+
159
+ <?php foreach( $product_fields as $product_field ) { ?>
160
+ <tr>
161
+ <td>
162
+ <label>
163
+ <input type="checkbox" name="product_fields[<?php echo $product_field['name']; ?>]" class="product_field"<?php ( isset( $product_field['default'] ) ? checked( $product_field['default'], 1 ) : '' ); ?><?php disabled( $product_field['disabled'], 1 ); ?> />
164
+ <?php echo $product_field['label']; ?>
165
+ <?php if( $product_field['disabled'] ) { ?><span class="description"> - <?php printf( __( 'available in %s', 'woo_ce' ), $woo_cd_link ); ?></span><?php } ?>
166
+ <input type="hidden" name="product_fields_order[<?php echo $product_field['name']; ?>]" class="field_order" value="<?php echo $product_field['order']; ?>" />
167
+ </label>
168
+ </td>
169
+ </tr>
170
+
171
+ <?php } ?>
172
+ </table>
173
+ <p class="submit">
174
+ <input type="submit" id="export_product" value="<?php _e( 'Export Products', 'woo_ce' ); ?> " class="button-primary" />
175
+ </p>
176
+ <p class="description"><?php _e( 'Can\'t find a particular Product field in the above export list?', 'woo_ce' ); ?> <a href="<?php echo $troubleshooting_url; ?>" target="_blank"><?php _e( 'Get in touch', 'woo_ce' ); ?></a>.</p>
177
+ <?php } else { ?>
178
+ <p><?php _e( 'No Products were found.', 'woo_ce' ); ?></p>
179
+ <?php } ?>
180
+ </div>
181
+ </div>
182
+ <!-- .postbox -->
183
+
184
+ <div id="export-products-filters" class="postbox">
185
+ <h3 class="hndle"><?php _e( 'Product Filters', 'woo_ce' ); ?></h3>
186
+ <div class="inside">
187
+
188
+ <?php do_action( 'woo_ce_export_product_options_before_table' ); ?>
189
+
190
+ <table class="form-table">
191
+ <?php do_action( 'woo_ce_export_product_options_table' ); ?>
192
+ </table>
193
+
194
+ <?php do_action( 'woo_ce_export_product_options_after_table' ); ?>
195
+
196
+ </div>
197
+ <!-- .inside -->
198
+
199
+ </div>
200
+ <!-- .postbox -->
201
+
202
+ </div>
203
+ <!-- #export-product -->
204
+
205
+ <?php } ?>
206
+ <?php if( $category_fields ) { ?>
207
+ <div id="export-category" class="export-types">
208
+
209
+ <div class="postbox">
210
+ <h3 class="hndle">
211
+ <?php _e( 'Category Fields', 'woo_ce' ); ?>
212
+ <a href="<?php echo add_query_arg( array( 'tab' => 'fields', 'type' => 'category' ) ); ?>" style="float:right;"><?php _e( 'Configure', 'woo_ce' ); ?></a>
213
+ </h3>
214
+ <div class="inside">
215
+ <p class="description"><?php _e( 'Select the Category fields you would like to export.', 'woo_ce' ); ?></p>
216
+ <p><a href="javascript:void(0)" id="category-checkall" class="checkall"><?php _e( 'Check All', 'woo_ce' ); ?></a> | <a href="javascript:void(0)" id="category-uncheckall" class="uncheckall"><?php _e( 'Uncheck All', 'woo_ce' ); ?></a></p>
217
+ <table id="category-fields" class="ui-sortable">
218
+
219
+ <?php foreach( $category_fields as $category_field ) { ?>
220
+ <tr>
221
+ <td>
222
+ <label>
223
+ <input type="checkbox" name="category_fields[<?php echo $category_field['name']; ?>]" class="category_field"<?php ( isset( $category_field['default'] ) ? checked( $category_field['default'], 1 ) : '' ); ?><?php disabled( $category_field['disabled'], 1 ); ?> />
224
+ <?php echo $category_field['label']; ?>
225
+ <input type="hidden" name="category_fields_order[<?php echo $category_field['name']; ?>]" class="field_order" value="" />
226
+ </label>
227
+ </td>
228
+ </tr>
229
+
230
+ <?php } ?>
231
+ </table>
232
+ <p class="submit">
233
+ <input type="submit" id="export_category" value="<?php _e( 'Export Categories', 'woo_ce' ); ?> " class="button-primary" />
234
+ </p>
235
+ <p class="description"><?php _e( 'Can\'t find a particular Category field in the above export list?', 'woo_ce' ); ?> <a href="<?php echo $troubleshooting_url; ?>" target="_blank"><?php _e( 'Get in touch', 'woo_ce' ); ?></a>.</p>
236
+ </div>
237
+ <!-- .inside -->
238
+ </div>
239
+ <!-- .postbox -->
240
+
241
+ <div id="export-categories-filters" class="postbox">
242
+ <h3 class="hndle"><?php _e( 'Category Filters', 'woo_ce' ); ?></h3>
243
+ <div class="inside">
244
+
245
+ <?php do_action( 'woo_ce_export_category_options_before_table' ); ?>
246
+
247
+ <table class="form-table">
248
+ <?php do_action( 'woo_ce_export_category_options_table' ); ?>
249
+ </table>
250
+
251
+ <?php do_action( 'woo_ce_export_category_options_after_table' ); ?>
252
+
253
+ </div>
254
+ <!-- .inside -->
255
+ </div>
256
+ <!-- #export-categories-filters -->
257
+
258
+ </div>
259
+ <!-- #export-category -->
260
+ <?php } ?>
261
+ <?php if( $tag_fields ) { ?>
262
+ <div id="export-tag" class="export-types">
263
+
264
+ <div class="postbox">
265
+ <h3 class="hndle">
266
+ <?php _e( 'Tag Fields', 'woo_ce' ); ?>
267
+ <a href="<?php echo add_query_arg( array( 'tab' => 'fields', 'type' => 'tag' ) ); ?>" style="float:right;"><?php _e( 'Configure', 'woo_ce' ); ?></a>
268
+ </h3>
269
+ <div class="inside">
270
+ <p class="description"><?php _e( 'Select the Tag fields you would like to export.', 'woo_ce' ); ?></p>
271
+ <p><a href="javascript:void(0)" id="tag-checkall" class="checkall"><?php _e( 'Check All', 'woo_ce' ); ?></a> | <a href="javascript:void(0)" id="tag-uncheckall" class="uncheckall"><?php _e( 'Uncheck All', 'woo_ce' ); ?></a></p>
272
+ <table id="tag-fields" class="ui-sortable">
273
+
274
+ <?php foreach( $tag_fields as $tag_field ) { ?>
275
+ <tr>
276
+ <td>
277
+ <label>
278
+ <input type="checkbox" name="tag_fields[<?php echo $tag_field['name']; ?>]" class="tag_field"<?php ( isset( $tag_field['default'] ) ? checked( $tag_field['default'], 1 ) : '' ); ?><?php disabled( $tag_field['disabled'], 1 ); ?> />
279
+ <?php echo $tag_field['label']; ?>
280
+ <input type="hidden" name="tag_fields_order[<?php echo $tag_field['name']; ?>]" class="field_order" value="" />
281
+ </label>
282
+ </td>
283
+ </tr>
284
+
285
+ <?php } ?>
286
+ </table>
287
+ <p class="submit">
288
+ <input type="submit" id="export_tag" value="<?php _e( 'Export Tags', 'woo_ce' ); ?> " class="button-primary" />
289
+ </p>
290
+ <p class="description"><?php _e( 'Can\'t find a particular Tag field in the above export list?', 'woo_ce' ); ?> <a href="<?php echo $troubleshooting_url; ?>" target="_blank"><?php _e( 'Get in touch', 'woo_ce' ); ?></a>.</p>
291
+ </div>
292
+ <!-- .inside -->
293
+ </div>
294
+ <!-- .postbox -->
295
+
296
+ <div id="export-tags-filters" class="postbox">
297
+ <h3 class="hndle"><?php _e( 'Product Tag Filters', 'woo_ce' ); ?></h3>
298
+ <div class="inside">
299
+
300
+ <?php do_action( 'woo_ce_export_tag_options_before_table' ); ?>
301
+
302
+ <table class="form-table">
303
+ <?php do_action( 'woo_ce_export_tag_options_table' ); ?>
304
+ </table>
305
+
306
+ <?php do_action( 'woo_ce_export_tag_options_after_table' ); ?>
307
+
308
+ </div>
309
+ <!-- .inside -->
310
+ </div>
311
+ <!-- #export-tags-filters -->
312
+
313
+ </div>
314
+ <!-- #export-tag -->
315
+ <?php } ?>
316
+
317
+ <?php if( $brand_fields ) { ?>
318
+ <div id="export-brand" class="export-types">
319
+
320
+ <div class="postbox">
321
+ <h3 class="hndle">
322
+ <?php _e( 'Brand Fields', 'woo_ce' ); ?>
323
+ </h3>
324
+ <div class="inside">
325
+ <?php if( $brands ) { ?>
326
+ <p class="description"><?php _e( 'Select the Brand fields you would like to export.', 'woo_ce' ); ?></p>
327
+ <p><a href="javascript:void(0)" id="brand-checkall" class="checkall"><?php _e( 'Check All', 'woo_ce' ); ?></a> | <a href="javascript:void(0)" id="brand-uncheckall" class="uncheckall"><?php _e( 'Uncheck All', 'woo_ce' ); ?></a></p>
328
+ <table id="brand-fields" class="ui-sortable">
329
+
330
+ <?php foreach( $brand_fields as $brand_field ) { ?>
331
+ <tr>
332
+ <td>
333
+ <label>
334
+ <input type="checkbox" name="brand_fields[<?php echo $brand_field['name']; ?>]" class="brand_field"<?php ( isset( $brand_field['default'] ) ? checked( $brand_field['default'], 1 ) : '' ); ?> disabled="disabled" />
335
+ <?php echo $brand_field['label']; ?>
336
+ </label>
337
+ </td>
338
+ </tr>
339
+
340
+ <?php } ?>
341
+ </table>
342
+ <p class="submit">
343
+ <input type="button" class="button button-disabled" value="<?php _e( 'Export Brands', 'woo_ce' ); ?>" />
344
+ </p>
345
+ <p class="description"><?php _e( 'Can\'t find a particular Brand field in the above export list?', 'woo_ce' ); ?> <a href="<?php echo $troubleshooting_url; ?>" target="_blank"><?php _e( 'Get in touch', 'woo_ce' ); ?></a>.</p>
346
+ <?php } else { ?>
347
+ <p><?php _e( 'No Brands were found.', 'woo_ce' ); ?></p>
348
+ <?php } ?>
349
+ </div>
350
+ <!-- .inside -->
351
+ </div>
352
+ <!-- .postbox -->
353
+
354
+ <div id="export-brands-filters" class="postbox">
355
+ <h3 class="hndle"><?php _e( 'Brand Filters', 'woo_ce' ); ?></h3>
356
+ <div class="inside">
357
+
358
+ <?php do_action( 'woo_ce_export_brand_options_before_table' ); ?>
359
+
360
+ <table class="form-table">
361
+ <?php do_action( 'woo_ce_export_brand_options_table' ); ?>
362
+ </table>
363
+
364
+ <?php do_action( 'woo_ce_export_brand_options_after_table' ); ?>
365
+
366
+ </div>
367
+ <!-- .inside -->
368
+ </div>
369
+ <!-- .postbox -->
370
+
371
+ </div>
372
+ <!-- #export-brand -->
373
+
374
+ <?php } ?>
375
+ <?php if( $order_fields ) { ?>
376
+ <div id="export-order" class="export-types">
377
+
378
+ <div class="postbox">
379
+ <h3 class="hndle">
380
+ <?php _e( 'Order Fields', 'woo_ce' ); ?>
381
+ </h3>
382
+ <div class="inside">
383
+
384
+ <?php if( $orders ) { ?>
385
+ <p class="description"><?php _e( 'Select the Order fields you would like to export.', 'woo_ce' ); ?></p>
386
+ <p><a href="javascript:void(0)" id="order-checkall" class="checkall"><?php _e( 'Check All', 'woo_ce' ); ?></a> | <a href="javascript:void(0)" id="order-uncheckall" class="uncheckall"><?php _e( 'Uncheck All', 'woo_ce' ); ?></a></p>
387
+ <table id="order-fields" class="ui-sortable">
388
+
389
+ <?php foreach( $order_fields as $order_field ) { ?>
390
+ <tr>
391
+ <td>
392
+ <label>
393
+ <input type="checkbox" name="order_fields[<?php echo $order_field['name']; ?>]" class="order_field"<?php ( isset( $order_field['default'] ) ? checked( $order_field['default'], 1 ) : '' ); ?> disabled="disabled" />
394
+ <?php echo $order_field['label']; ?>
395
+ </label>
396
+ </td>
397
+ </tr>
398
+
399
+ <?php } ?>
400
+ </table>
401
+ <p class="submit">
402
+ <input type="button" class="button button-disabled" value="<?php _e( 'Export Orders', 'woo_ce' ); ?>" />
403
+ </p>
404
+ <p class="description"><?php _e( 'Can\'t find a particular Order field in the above export list?', 'woo_ce' ); ?> <a href="<?php echo $troubleshooting_url; ?>" target="_blank"><?php _e( 'Get in touch', 'woo_ce' ); ?></a>.</p>
405
+ <?php } else { ?>
406
+ <p><?php _e( 'No Orders were found.', 'woo_ce' ); ?></p>
407
+ <?php } ?>
408
+
409
+ </div>
410
+ </div>
411
+ <!-- .postbox -->
412
+
413
+ <div id="export-orders-filters" class="postbox">
414
+ <h3 class="hndle"><?php _e( 'Order Filters', 'woo_ce' ); ?></h3>
415
+ <div class="inside">
416
+
417
+ <?php do_action( 'woo_ce_export_order_options_before_table' ); ?>
418
+
419
+ <table class="form-table">
420
+ <?php do_action( 'woo_ce_export_order_options_table' ); ?>
421
+ </table>
422
+
423
+ <?php do_action( 'woo_ce_export_order_options_after_table' ); ?>
424
+
425
+ </div>
426
+ <!-- .inside -->
427
+ </div>
428
+ <!-- .postbox -->
429
+
430
+ </div>
431
+ <!-- #export-order -->
432
+
433
+ <?php } ?>
434
+ <?php if( $customer_fields ) { ?>
435
+ <div id="export-customer" class="export-types">
436
+
437
+ <div class="postbox">
438
+ <h3 class="hndle">
439
+ <?php _e( 'Customer Fields', 'woo_ce' ); ?>
440
+ </h3>
441
+ <div class="inside">
442
+ <?php if( $customers ) { ?>
443
+ <p class="description"><?php _e( 'Select the Customer fields you would like to export.', 'woo_ce' ); ?></p>
444
+ <p><a href="javascript:void(0)" id="customer-checkall" class="checkall"><?php _e( 'Check All', 'woo_ce' ); ?></a> | <a href="javascript:void(0)" id="customer-uncheckall" class="uncheckall"><?php _e( 'Uncheck All', 'woo_ce' ); ?></a></p>
445
+ <table id="customer-fields" class="ui-sortable">
446
+
447
+ <?php foreach( $customer_fields as $customer_field ) { ?>
448
+ <tr>
449
+ <td>
450
+ <label>
451
+ <input type="checkbox" name="customer_fields[<?php echo $customer_field['name']; ?>]" class="customer_field"<?php ( isset( $customer_field['default'] ) ? checked( $customer_field['default'], 1 ) : '' ); ?> disabled="disabled" />
452
+ <?php echo $customer_field['label']; ?>
453
+ </label>
454
+ </td>
455
+ </tr>
456
+
457
+ <?php } ?>
458
+ </table>
459
+ <p class="submit">
460
+ <input type="button" class="button button-disabled" value="<?php _e( 'Export Customers', 'woo_ce' ); ?>" />
461
+ </p>
462
+ <p class="description"><?php _e( 'Can\'t find a particular Customer field in the above export list?', 'woo_ce' ); ?> <a href="<?php echo $troubleshooting_url; ?>" target="_blank"><?php _e( 'Get in touch', 'woo_ce' ); ?></a>.</p>
463
+ <?php } else { ?>
464
+ <p><?php _e( 'No Customers were found.', 'woo_ce' ); ?></p>
465
+ <?php } ?>
466
+ </div>
467
+ <!-- .inside -->
468
+ </div>
469
+ <!-- .postbox -->
470
+
471
+ <div id="export-customers-filters" class="postbox">
472
+ <h3 class="hndle"><?php _e( 'Customer Filters', 'woo_ce' ); ?></h3>
473
+ <div class="inside">
474
+
475
+ <?php do_action( 'woo_ce_export_customer_options_before_table' ); ?>
476
+
477
+ <table class="form-table">
478
+ <?php do_action( 'woo_ce_export_customer_options_table' ); ?>
479
+ </table>
480
+
481
+ <?php do_action( 'woo_ce_export_customer_options_after_table' ); ?>
482
+
483
+ </div>
484
+ <!-- .inside -->
485
+ </div>
486
+ <!-- .postbox -->
487
+
488
+ </div>
489
+ <!-- #export-customer -->
490
+
491
+ <?php } ?>
492
+ <?php if( $user_fields ) { ?>
493
+ <div id="export-user" class="export-types">
494
+
495
+ <div class="postbox">
496
+ <h3 class="hndle">
497
+ <?php _e( 'User Fields', 'woo_ce' ); ?>
498
+ <a href="<?php echo add_query_arg( array( 'tab' => 'fields', 'type' => 'user' ) ); ?>" style="float:right;"><?php _e( 'Configure', 'woo_ce' ); ?></a>
499
+ </h3>
500
+ <div class="inside">
501
+ <?php if( $users ) { ?>
502
+ <p class="description"><?php _e( 'Select the User fields you would like to export.', 'woo_ce' ); ?></p>
503
+ <p><a href="javascript:void(0)" id="user-checkall" class="checkall"><?php _e( 'Check All', 'woo_ce' ); ?></a> | <a href="javascript:void(0)" id="user-uncheckall" class="uncheckall"><?php _e( 'Uncheck All', 'woo_ce' ); ?></a></p>
504
+ <table id="user-fields" class="ui-sortable">
505
+
506
+ <?php foreach( $user_fields as $user_field ) { ?>
507
+ <tr>
508
+ <td>
509
+ <label>
510
+ <input type="checkbox" name="user_fields[<?php echo $user_field['name']; ?>]" class="user_field"<?php ( isset( $user_field['default'] ) ? checked( $user_field['default'], 1 ) : '' ); ?><?php disabled( $user_field['disabled'], 1 ); ?> />
511
+ <?php echo $user_field['label']; ?>
512
+ <?php if( $user_field['disabled'] ) { ?><span class="description"> - <?php printf( __( 'available in %s', 'woo_ce' ), $woo_cd_link ); ?></span><?php } ?>
513
+ <input type="hidden" name="user_fields_order[<?php echo $user_field['name']; ?>]" class="field_order" value="" />
514
+ </label>
515
+ </td>
516
+ </tr>
517
+
518
+ <?php } ?>
519
+ </table>
520
+ <p class="submit">
521
+ <input type="submit" id="export_user" class="button-primary" value="<?php _e( 'Export Users', 'woo_ce' ); ?>" />
522
+ </p>
523
+ <p class="description"><?php _e( 'Can\'t find a particular User field in the above export list?', 'woo_ce' ); ?> <a href="<?php echo $troubleshooting_url; ?>" target="_blank"><?php _e( 'Get in touch', 'woo_ce' ); ?></a>.</p>
524
+ <?php } else { ?>
525
+ <p><?php _e( 'No Users were found.', 'woo_ce' ); ?></p>
526
+ <?php } ?>
527
+ </div>
528
+ <!-- .inside -->
529
+ </div>
530
+ <!-- .postbox -->
531
+
532
+ <div id="export-users-filters" class="postbox">
533
+ <h3 class="hndle"><?php _e( 'User Filters', 'woo_ce' ); ?></h3>
534
+ <div class="inside">
535
+
536
+ <?php do_action( 'woo_ce_export_user_options_before_table' ); ?>
537
+
538
+ <table class="form-table">
539
+ <?php do_action( 'woo_ce_export_user_options_table' ); ?>
540
+ </table>
541
+
542
+ <?php do_action( 'woo_ce_export_user_options_after_table' ); ?>
543
+
544
+ </div>
545
+ <!-- .inside -->
546
+ </div>
547
+ <!-- .postbox -->
548
+
549
+ </div>
550
+ <!-- #export-user -->
551
+
552
+ <?php } ?>
553
+ <?php if( $coupon_fields ) { ?>
554
+ <div id="export-coupon" class="export-types">
555
+
556
+ <div class="postbox">
557
+ <h3 class="hndle">
558
+ <?php _e( 'Coupon Fields', 'woo_ce' ); ?>
559
+ </h3>
560
+ <div class="inside">
561
+ <?php if( $coupons ) { ?>
562
+ <p class="description"><?php _e( 'Select the Coupon fields you would like to export.', 'woo_ce' ); ?></p>
563
+ <p><a href="javascript:void(0)" id="coupon-checkall" class="checkall"><?php _e( 'Check All', 'woo_ce' ); ?></a> | <a href="javascript:void(0)" id="coupon-uncheckall" class="uncheckall"><?php _e( 'Uncheck All', 'woo_ce' ); ?></a></p>
564
+ <table id="coupon-fields" class="ui-sortable">
565
+
566
+ <?php foreach( $coupon_fields as $coupon_field ) { ?>
567
+ <tr>
568
+ <td>
569
+ <label>
570
+ <input type="checkbox" name="coupon_fields[<?php echo $coupon_field['name']; ?>]" class="coupon_field"<?php ( isset( $coupon_field['default'] ) ? checked( $coupon_field['default'], 1 ) : '' ); ?> disabled="disabled" />
571
+ <?php echo $coupon_field['label']; ?>
572
+ </label>
573
+ </td>
574
+ </tr>
575
+
576
+ <?php } ?>
577
+ </table>
578
+ <p class="submit">
579
+ <input type="button" class="button button-disabled" value="<?php _e( 'Export Coupons', 'woo_ce' ); ?>" />
580
+ </p>
581
+ <p class="description"><?php _e( 'Can\'t find a particular Coupon field in the above export list?', 'woo_ce' ); ?> <a href="<?php echo $troubleshooting_url; ?>" target="_blank"><?php _e( 'Get in touch', 'woo_ce' ); ?></a>.</p>
582
+ <?php } else { ?>
583
+ <p><?php _e( 'No Coupons were found.', 'woo_ce' ); ?></p>
584
+ <?php } ?>
585
+ </div>
586
+ <!-- .inside -->
587
+ </div>
588
+ <!-- .postbox -->
589
+
590
+ <div id="export-coupons-filters" class="postbox">
591
+ <h3 class="hndle"><?php _e( 'Coupon Filters', 'woo_ce' ); ?></h3>
592
+ <div class="inside">
593
+
594
+ <?php do_action( 'woo_ce_export_coupon_options_before_table' ); ?>
595
+
596
+ <table class="form-table">
597
+ <?php do_action( 'woo_ce_export_coupon_options_table' ); ?>
598
+ </table>
599
+
600
+ <?php do_action( 'woo_ce_export_coupon_options_after_table' ); ?>
601
+
602
+ </div>
603
+ <!-- .inside -->
604
+ </div>
605
+ <!-- .postbox -->
606
+
607
+ </div>
608
+ <!-- #export-coupon -->
609
+
610
+ <?php } ?>
611
+ <?php if( $subscription_fields ) { ?>
612
+ <div id="export-subscription" class="export-types">
613
+
614
+ <div class="postbox">
615
+ <h3 class="hndle">
616
+ <?php _e( 'Subscription Fields', 'woo_ce' ); ?>
617
+ </h3>
618
+ <div class="inside">
619
+ <?php if( $subscriptions ) { ?>
620
+ <p class="description"><?php _e( 'Select the Subscription fields you would like to export.', 'woo_ce' ); ?></p>
621
+ <p><a href="javascript:void(0)" id="subscription-checkall" class="checkall"><?php _e( 'Check All', 'woo_ce' ); ?></a> | <a href="javascript:void(0)" id="subscription-uncheckall" class="uncheckall"><?php _e( 'Uncheck All', 'woo_ce' ); ?></a></p>
622
+ <table id="subscription-fields" class="ui-sortable">
623
+
624
+ <?php foreach( $subscription_fields as $subscription_field ) { ?>
625
+ <tr>
626
+ <td>
627
+ <label>
628
+ <input type="checkbox" name="subscription_fields[<?php echo $subscription_field['name']; ?>]" class="subscription_field"<?php ( isset( $subscription_field['default'] ) ? checked( $subscription_field['default'], 1 ) : '' ); ?> disabled="disabled" />
629
+ <?php echo $subscription_field['label']; ?>
630
+ </label>
631
+ </td>
632
+ </tr>
633
+
634
+ <?php } ?>
635
+ </table>
636
+ <p class="submit">
637
+ <input type="button" class="button button-disabled" value="<?php _e( 'Export Subscriptions', 'woo_ce' ); ?>" />
638
+ </p>
639
+ <p class="description"><?php _e( 'Can\'t find a particular Subscription field in the above export list?', 'woo_ce' ); ?> <a href="<?php echo $troubleshooting_url; ?>" target="_blank"><?php _e( 'Get in touch', 'woo_ce' ); ?></a>.</p>
640
+ <?php } else { ?>
641
+ <p><?php _e( 'No Subscriptions were found.', 'woo_ce' ); ?></p>
642
+ <?php } ?>
643
+ </div>
644
+ <!-- .inside -->
645
+ </div>
646
+ <!-- .postbox -->
647
+ </div>
648
+ <!-- #export-subscription -->
649
+
650
+ <?php } ?>
651
+ <?php if( $product_vendor_fields ) { ?>
652
+ <div id="export-product_vendor" class="export-types">
653
+
654
+ <div class="postbox">
655
+ <h3 class="hndle">
656
+ <?php _e( 'Product Vendor Fields', 'woo_ce' ); ?>
657
+ </h3>
658
+ <div class="inside">
659
+ <?php if( $product_vendors ) { ?>
660
+ <p class="description"><?php _e( 'Select the Product Vendor fields you would like to export.', 'woo_ce' ); ?></p>
661
+ <p><a href="javascript:void(0)" id="product_vendor-checkall" class="checkall"><?php _e( 'Check All', 'woo_ce' ); ?></a> | <a href="javascript:void(0)" id="product_vendor-uncheckall" class="uncheckall"><?php _e( 'Uncheck All', 'woo_ce' ); ?></a></p>
662
+ <table id="product_vendor-fields" class="ui-sortable">
663
+
664
+ <?php foreach( $product_vendor_fields as $product_vendor_field ) { ?>
665
+ <tr>
666
+ <td>
667
+ <label>
668
+ <input type="checkbox" name="product_vendor_fields[<?php echo $product_vendor_field['name']; ?>]" class="product_vendor_field"<?php ( isset( $product_vendor_field['default'] ) ? checked( $product_vendor_field['default'], 1 ) : '' ); ?> disabled="disabled" />
669
+ <?php echo $product_vendor_field['label']; ?>
670
+ <input type="hidden" name="product_vendor_fields_order[<?php echo $product_vendor_field['name']; ?>]" class="field_order" value="" />
671
+ </label>
672
+ </td>
673
+ </tr>
674
+
675
+ <?php } ?>
676
+ </table>
677
+ <p class="submit">
678
+ <input type="button" class="button button-disabled" value="<?php _e( 'Export Product Vendors', 'woo_ce' ); ?>" />
679
+ </p>
680
+ <p class="description"><?php _e( 'Can\'t find a particular Product Vendor field in the above export list?', 'woo_ce' ); ?> <a href="<?php echo $troubleshooting_url; ?>" target="_blank"><?php _e( 'Get in touch', 'woo_ce' ); ?></a>.</p>
681
+ <?php } else { ?>
682
+ <p><?php _e( 'No Product Vendors were found.', 'woo_ce' ); ?></p>
683
+ <?php } ?>
684
+ </div>
685
+ <!-- .inside -->
686
+ </div>
687
+ <!-- .postbox -->
688
+ </div>
689
+ <!-- #export-product_vendor -->
690
+
691
+ <?php } ?>
692
+ <?php do_action( 'woo_ce_before_options' ); ?>
693
+
694
+ <div class="postbox" id="export-options">
695
+ <h3 class="hndle"><?php _e( 'Export Options', 'woo_ce' ); ?></h3>
696
+ <div class="inside">
697
+ <p class="description"><?php _e( 'You can find additional export options under the Settings tab at the top of this screen.', 'woo_ce' ); ?></p>
698
+
699
+ <?php do_action( 'woo_ce_export_options_before' ); ?>
700
+
701
+ <table class="form-table">
702
+
703
+ <?php do_action( 'woo_ce_export_options' ); ?>
704
+
705
+ <tr>
706
+ <th>
707
+ <label for="offset"><?php _e( 'Volume offset', 'woo_ce' ); ?></label> / <label for="limit_volume"><?php _e( 'Limit volume', 'woo_ce' ); ?></label>
708
+ </th>
709
+ <td>
710
+ <input type="text" size="3" id="offset" name="offset" value="<?php echo esc_attr( $offset ); ?>" size="5" class="text" title="<?php _e( 'Volume Offset', 'woo_ce' ); ?>" /> <?php _e( 'to', 'woo_ce' ); ?> <input type="text" size="3" id="limit_volume" name="limit_volume" value="<?php echo esc_attr( $limit_volume ); ?>" size="5" class="text" title="<?php _e( 'Limit Volume', 'woo_ce' ); ?>" />
711
+ <p class="description"><?php _e( 'Volume offset and limit allows for partial exporting of an export type (e.g. records 0 to 500, etc.). This is useful when encountering timeout and/or memory errors during the a large or memory intensive export. To be used effectively both fields must be filled. By default this is not used and is left empty.', 'woo_ce' ); ?></p>
712
+ </td>
713
+ </tr>
714
+
715
+ <?php do_action( 'woo_ce_export_options_table_after' ); ?>
716
+
717
+ </table>
718
+
719
+ <?php do_action( 'woo_ce_export_options_after' ); ?>
720
+
721
+ </div>
722
+ </div>
723
+ <!-- .postbox -->
724
+
725
+ <?php do_action( 'woo_ce_after_options' ); ?>
726
+
727
+ <input type="hidden" name="action" value="export" />
728
+ </form>
729
+
730
+ <?php do_action( 'woo_ce_export_after_form' ); ?>
731
+
732
+ <?php do_action( 'woo_ce_before_modules' ); ?>
733
+
734
+ <div id="export-modules" class="postbox">
735
+ <h3 class="hndle"><?php _e( 'Export Modules', 'woo_ce' ); ?></h3>
736
+ <div class="inside">
737
+ <p><?php _e( 'Export store details from other WooCommerce and WordPress Plugins, simply install and activate one of the below Plugins to enable those additional export options.', 'woo_ce' ); ?></p>
738
+ <?php if( $modules ) { ?>
739
+ <div class="table table_content">
740
+ <table class="woo_vm_version_table">
741
+ <?php foreach( $modules as $module ) { ?>
742
+ <tr>
743
+ <td class="export_module">
744
+ <?php if( $module['description'] ) { ?>
745
+ <strong><?php echo $module['title']; ?></strong>: <span class="description"><?php echo $module['description']; ?></span>
746
+ <?php } else { ?>
747
+ <strong><?php echo $module['title']; ?></strong>
748
+ <?php } ?>
749
+ </td>
750
+ <td class="status">
751
+ <div class="<?php woo_ce_modules_status_class( $module['status'] ); ?>">
752
+ <?php if( $module['status'] == 'active' ) { ?>
753
+ <div class="dashicons dashicons-yes" style="color:#008000;"></div><?php woo_ce_modules_status_label( $module['status'] ); ?>
754
+ <?php } else { ?>
755
+ <?php if( $module['url'] ) { ?>
756
+ <?php if( isset( $module['slug'] ) ) { echo '<div class="dashicons dashicons-download" style="color:#0074a2;"></div>'; } else { echo '<div class="dashicons dashicons-admin-links"></div>'; } ?>&nbsp;<a href="<?php echo $module['url']; ?>" target="_blank"<?php if( isset( $module['slug'] ) ) { echo ' title="' . __( 'Install via WordPress Plugin Directory', 'woo_ce' ) . '"'; } else { echo ' title="' . __( 'Visit the Plugin website', 'woo_ce' ) . '"'; } ?>><?php woo_ce_modules_status_label( $module['status'] ); ?></a>
757
+ <?php } ?>
758
+ <?php } ?>
759
+ </div>
760
+ </td>
761
+ </tr>
762
+ <?php } ?>
763
+ </table>
764
+ </div>
765
+ <!-- .table -->
766
+ <?php } else { ?>
767
+ <p><?php _e( 'No export modules are available at this time.', 'woo_ce' ); ?></p>
768
+ <?php } ?>
769
+ </div>
770
+ <!-- .inside -->
771
+ </div>
772
+ <!-- .postbox -->
773
+
774
+ <?php do_action( 'woo_ce_after_modules' ); ?>
775
+
776
+ </div>
777
+ <!-- #poststuff -->
templates/admin/tabs-fields.php ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <h3><?php _e( 'Field Editor', 'woo_ce' ); ?></h3>
2
+ <p><?php _e( 'Customise the field labels for this export type by filling in the fields, an empty field label will revert to the default Store Exporter field label at export time.', 'woo_ce' ); ?></p>
3
+ <?php if( $fields ) { ?>
4
+ <form method="post" id="postform">
5
+ <table class="form-table">
6
+ <tbody>
7
+ <?php foreach( $fields as $field ) { ?>
8
+ <?php if( isset( $field['name'] ) ) { ?>
9
+ <tr>
10
+ <th scope="row"><label for="<?php echo $field['name']; ?>"><?php echo $field['name']; ?></label></th>
11
+ <td>
12
+ <input type="text" name="fields[<?php echo $field['name']; ?>]" placeholder="<?php echo $field['label']; ?>" value="<?php if( isset( $labels[$field['name']] ) ) { echo $labels[$field['name']]; } ?>" class="regular-text all-options" />
13
+ </td>
14
+ </tr>
15
+ <?php } ?>
16
+ <?php } ?>
17
+ </tbody>
18
+ </table>
19
+ <!-- .form-table -->
20
+
21
+ <p class="submit">
22
+ <input type="submit" value="<?php _e( 'Save Changes', 'woo_ce' ); ?> " class="button-primary" />
23
+ </p>
24
+ <input type="hidden" name="action" value="save-fields" />
25
+ <input type="hidden" name="type" value="<?php echo esc_attr( $export_type ); ?>" />
26
+
27
+ </form>
28
+ <?php } ?>
templates/admin/tabs-overview.php ADDED
@@ -0,0 +1,98 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div class="overview-left">
2
+
3
+ <h3><div class="dashicons dashicons-migrate"></div>&nbsp;<a href="<?php echo add_query_arg( 'tab', 'export' ); ?>"><?php _e( 'Export', 'woo_ce' ); ?></a></h3>
4
+ <p><?php _e( 'Export store details out of WooCommerce into a CSV-formatted file.', 'woo_ce' ); ?></p>
5
+ <ul class="ul-disc">
6
+ <li>
7
+ <a href="<?php echo add_query_arg( 'tab', 'export' ); ?>#export-product"><?php _e( 'Export Products', 'woo_ce' ); ?></a>
8
+ </li>
9
+ <li>
10
+ <a href="<?php echo add_query_arg( 'tab', 'export' ); ?>#export-category"><?php _e( 'Export Categories', 'woo_ce' ); ?></a>
11
+ </li>
12
+ <li>
13
+ <a href="<?php echo add_query_arg( 'tab', 'export' ); ?>#export-tag"><?php _e( 'Export Tags', 'woo_ce' ); ?></a>
14
+ </li>
15
+ <li>
16
+ <a href="<?php echo add_query_arg( 'tab', 'export' ); ?>#export-brand"><?php _e( 'Export Brands', 'woo_ce' ); ?></a>
17
+ <span class="description">(<?php printf( __( 'available in %s', 'woo_ce' ), $woo_cd_link ); ?>)</span>
18
+ </li>
19
+ <li>
20
+ <a href="<?php echo add_query_arg( 'tab', 'export' ); ?>#export-order"><?php _e( 'Export Orders', 'woo_ce' ); ?></a>
21
+ <span class="description">(<?php printf( __( 'available in %s', 'woo_ce' ), $woo_cd_link ); ?>)</span>
22
+ </li>
23
+ <li>
24
+ <a href="<?php echo add_query_arg( 'tab', 'export' ); ?>#export-customer"><?php _e( 'Export Customers', 'woo_ce' ); ?></a>
25
+ <span class="description">(<?php printf( __( 'available in %s', 'woo_ce' ), $woo_cd_link ); ?>)</span>
26
+ </li>
27
+ <li>
28
+ <a href="<?php echo add_query_arg( 'tab', 'export' ); ?>#export-user"><?php _e( 'Export Users', 'woo_ce' ); ?></a>
29
+ </li>
30
+ <li>
31
+ <a href="<?php echo add_query_arg( 'tab', 'export' ); ?>#export-coupon"><?php _e( 'Export Coupons', 'woo_ce' ); ?></a>
32
+ <span class="description">(<?php printf( __( 'available in %s', 'woo_ce' ), $woo_cd_link ); ?>)</span>
33
+ </li>
34
+ <li>
35
+ <a href="<?php echo add_query_arg( 'tab', 'export' ); ?>#export-subscription"><?php _e( 'Export Subscriptions', 'woo_ce' ); ?></a>
36
+ <span class="description">(<?php printf( __( 'available in %s', 'woo_ce' ), $woo_cd_link ); ?>)</span>
37
+ </li>
38
+ <li>
39
+ <a href="<?php echo add_query_arg( 'tab', 'export' ); ?>#export-product_vendor"><?php _e( 'Export Product Vendors', 'woo_ce' ); ?></a>
40
+ <span class="description">(<?php printf( __( 'available in %s', 'woo_ce' ), $woo_cd_link ); ?>)</span>
41
+ </li>
42
+ <!--
43
+ <li>
44
+ <a href="<?php echo add_query_arg( 'tab', 'export' ); ?>#export-attribute"><?php _e( 'Export Attributes', 'woo_ce' ); ?></a>
45
+ <span class="description">(<?php printf( __( 'available in %s', 'woo_ce' ), $woo_cd_link ); ?>)</span>
46
+ </li>
47
+ -->
48
+ </ul>
49
+
50
+ <h3><div class="dashicons dashicons-list-view"></div>&nbsp;<a href="<?php echo add_query_arg( 'tab', 'archive' ); ?>"><?php _e( 'Archives', 'woo_ce' ); ?></a></h3>
51
+ <p><?php _e( 'Download copies of prior store exports.', 'woo_ce' ); ?></p>
52
+
53
+ <h3><div class="dashicons dashicons-admin-settings"></div>&nbsp;<a href="<?php echo add_query_arg( 'tab', 'settings' ); ?>"><?php _e( 'Settings', 'woo_ce' ); ?></a></h3>
54
+ <p><?php _e( 'Manage export options from a single detailed screen.', 'woo_ce' ); ?></p>
55
+
56
+ <h3><div class="dashicons dashicons-hammer"></div>&nbsp;<a href="<?php echo add_query_arg( 'tab', 'tools' ); ?>"><?php _e( 'Tools', 'woo_ce' ); ?></a></h3>
57
+ <p><?php _e( 'Export tools for WooCommerce.', 'woo_ce' ); ?></p>
58
+
59
+ <hr />
60
+ <label class="description">
61
+ <input type="checkbox" disabled="disabled" /> <?php _e( 'Jump to Export screen in the future', 'woo_ce' ); ?>
62
+ <span class="description"> - <?php printf( __( 'available in %s', 'woo_ce' ), $woo_cd_link ); ?></span>
63
+ </label>
64
+
65
+ </div>
66
+ <!-- .overview-left -->
67
+ <div class="welcome-panel overview-right">
68
+ <h3>
69
+ <!-- <span><a href="#"><attr title="<?php _e( 'Dismiss this message', 'woo_ce' ); ?>"><?php _e( 'Dismiss', 'woo_ce' ); ?></attr></a></span> -->
70
+ <?php _e( 'Upgrade to Pro', 'woo_ce' ); ?>
71
+ </h3>
72
+ <p class="clear"><?php _e( 'Upgrade to Store Exporter Deluxe to unlock business focused e-commerce features within Store Exporter, including:', 'woo_ce' ); ?></p>
73
+ <ul class="ul-disc">
74
+ <li><?php _e( 'Select export date ranges', 'woo_ce' ); ?></li>
75
+ <li><?php _e( 'Select export fields to export', 'woo_ce' ); ?></li>
76
+ <li><?php _e( 'Filter exports by multiple filter options', 'woo_ce' ); ?></li>
77
+ <li><?php _e( 'Export Orders', 'woo_ce' ); ?></li>
78
+ <li><?php _e( 'Export custom Order and Order Item meta', 'woo_ce' ); ?></li>
79
+ <li><?php _e( 'Export Customers', 'woo_ce' ); ?></li>
80
+ <li><?php _e( 'Export Coupons', 'woo_ce' ); ?></li>
81
+ <li><?php _e( 'Export Subscriptions', 'woo_ce' ); ?></li>
82
+ <li><?php _e( 'Export Product Vendors', 'woo_ce' ); ?></li>
83
+ <li><?php _e( 'CRON export engine', 'woo_ce' ); ?></li>
84
+ <li><?php _e( 'Schedule automatic exports with filtering options', 'woo_ce' ); ?></li>
85
+ <li><?php _e( 'Export to remote POST', 'woo_ce' ); ?></li>
86
+ <li><?php _e( 'Export to e-mail addresses', 'woo_ce' ); ?></li>
87
+ <li><?php _e( 'Export to remote FTP', 'woo_ce' ); ?></li>
88
+ <li><?php _e( 'Export to XML file', 'woo_ce' ); ?></li>
89
+ <li><?php _e( 'Export to Excel 2007 (XLS) file', 'woo_ce' ); ?></li>
90
+ <li><?php _e( 'Premium Support', 'woo_ce' ); ?></li>
91
+ <li><?php _e( '...and more.', 'woo_ce' ); ?></li>
92
+ </ul>
93
+ <p>
94
+ <a href="<?php echo $woo_cd_url; ?>" target="_blank" class="button"><?php _e( 'More Features', 'woo_ce' ); ?></a>&nbsp;
95
+ <a href="<?php echo $woo_cd_url; ?>" target="_blank" class="button button-primary"><?php _e( 'Buy Now', 'woo_ce' ); ?></a>
96
+ </p>
97
+ </div>
98
+ <!-- .overview-right -->
templates/admin/tabs-settings.php ADDED
@@ -0,0 +1,149 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <ul class="subsubsub">
2
+ <li><a href="#general-settings"><?php _e( 'General Settings', 'woo_ce' ); ?></a> |</li>
3
+ <li><a href="#csv-settings"><?php _e( 'CSV Settings', 'woo_ce' ); ?></a></li>
4
+ <?php do_action( 'woo_ce_export_settings_top' ); ?>
5
+ </ul>
6
+ <!-- .subsubsub -->
7
+ <br class="clear" />
8
+
9
+ <form method="post">
10
+ <table class="form-table">
11
+ <tbody>
12
+
13
+ <?php do_action( 'woo_ce_export_settings_before' ); ?>
14
+
15
+ <tr id="general-settings">
16
+ <td colspan="2" style="padding:0;">
17
+ <h3><div class="dashicons dashicons-admin-settings"></div>&nbsp;<?php _e( 'General Settings', 'woo_ce' ); ?></h3>
18
+ <p class="description"><?php _e( 'Manage export options across Store Exporter from this screen.', 'woo_ce' ); ?></p>
19
+ </td>
20
+ </tr>
21
+
22
+ <tr valign="top">
23
+ <th scope="row"><label for="export_filename"><?php _e( 'Export filename', 'woo_ce' ); ?></label></th>
24
+ <td>
25
+ <input type="text" name="export_filename" id="export_filename" value="<?php echo esc_attr( $export_filename ); ?>" class="large-text code" />
26
+ <p class="description"><?php _e( 'The filename of the exported export type. Tags can be used: ', 'woo_ce' ); ?> <code>%dataset%</code>, <code>%date%</code>, <code>%time%</code>, <code>%store_name%</code>.</p>
27
+ </td>
28
+ </tr>
29
+
30
+ <tr>
31
+ <th>
32
+ <label for="delete_file"><?php _e( 'Enable archives', 'woo_ce' ); ?></label>
33
+ </th>
34
+ <td>
35
+ <select id="delete_file" name="delete_file">
36
+ <option value="0"<?php selected( $delete_file, 0 ); ?>><?php _e( 'Yes', 'woo_ce' ); ?></option>
37
+ <option value="1"<?php selected( $delete_file, 1 ); ?>><?php _e( 'No', 'woo_ce' ); ?></option>
38
+ </select>
39
+ <p class="description"><?php _e( 'Save copies of exports to the WordPress Media for later downloading. By default this option is turned on.', 'woo_ce' ); ?></p>
40
+ </td>
41
+ </tr>
42
+ <tr>
43
+ <th>
44
+ <label for="encoding"><?php _e( 'Character encoding', 'woo_ce' ); ?></label>
45
+ </th>
46
+ <td>
47
+ <?php if( $file_encodings ) { ?>
48
+ <select id="encoding" name="encoding">
49
+ <option value=""><?php _e( 'System default', 'woo_ce' ); ?></option>
50
+ <?php foreach( $file_encodings as $key => $chr ) { ?>
51
+ <option value="<?php echo $chr; ?>"<?php selected( $chr, $encoding ); ?>><?php echo $chr; ?></option>
52
+ <?php } ?>
53
+ </select>
54
+ <?php } else { ?>
55
+ <p class="description"><?php _e( 'Character encoding options are unavailable in PHP 4, contact your hosting provider to update your site install to use PHP 5 or higher.', 'woo_ce' ); ?></p>
56
+ <?php } ?>
57
+ </td>
58
+ </tr>
59
+ <tr>
60
+ <th><?php _e( 'Date format', 'woo_ce' ); ?></th>
61
+ <td>
62
+ <fieldset>
63
+ <label title="F j, Y"><input type="radio" name="date_format" value="F j, Y"<?php checked( $date_format, 'F j, Y' ); ?>> <span><?php echo date( 'F j, Y' ); ?></span></label><br>
64
+ <label title="Y/m/d"><input type="radio" name="date_format" value="Y/m/d"<?php checked( $date_format, 'Y/m/d' ); ?>> <span><?php echo date( 'Y/m/d' ); ?></span></label><br>
65
+ <label title="m/d/Y"><input type="radio" name="date_format" value="m/d/Y"<?php checked( $date_format, 'm/d/Y' ); ?>> <span><?php echo date( 'm/d/Y' ); ?></span></label><br>
66
+ <label title="d/m/Y"><input type="radio" name="date_format" value="d/m/Y"<?php checked( $date_format, 'd/m/Y' ); ?>> <span><?php echo date( 'd/m/Y' ); ?></span></label><br>
67
+ <label><input type="radio" name="date_format" value="custom"<?php checked( in_array( $date_format, array( 'F j, Y', 'Y/m/d', 'm/d/Y', 'd/m/Y' ) ), false ); ?>/> <?php _e( 'Custom', 'woo_ce' ); ?>: </label><input type="text" name="date_format_custom" value="<?php echo sanitize_text_field( $date_format ); ?>" class="text" />
68
+ <p><a href="http://codex.wordpress.org/Formatting_Date_and_Time" target="_blank"><?php _e( 'Documentation on date and time formatting', 'woo_ce' ); ?></a>.</p>
69
+ </fieldset>
70
+ <p class="description"><?php _e( 'The date format option affects how date\'s are presented within your export file. Default is set to DD/MM/YYYY.', 'woo_ce' ); ?></p>
71
+ </td>
72
+ </tr>
73
+ <?php if( !ini_get( 'safe_mode' ) ) { ?>
74
+ <tr>
75
+ <th>
76
+ <label for="timeout"><?php _e( 'Script timeout', 'woo_ce' ); ?></label>
77
+ </th>
78
+ <td>
79
+ <select id="timeout" name="timeout">
80
+ <option value="600"<?php selected( $timeout, 600 ); ?>><?php printf( __( '%s minutes', 'woo_ce' ), 10 ); ?></option>
81
+ <option value="1800"<?php selected( $timeout, 1800 ); ?>><?php printf( __( '%s minutes', 'woo_ce' ), 30 ); ?></option>
82
+ <option value="3600"<?php selected( $timeout, 3600 ); ?>><?php printf( __( '%s hour', 'woo_ce' ), 1 ); ?></option>
83
+ <option value="0"<?php selected( $timeout, 0 ); ?>><?php _e( 'Unlimited', 'woo_ce' ); ?></option>
84
+ </select>
85
+ <p class="description"><?php _e( 'Script timeout defines how long Store Exporter is \'allowed\' to process your export file, once the time limit is reached the export process halts.', 'woo_ce' ); ?></p>
86
+ </td>
87
+ </tr>
88
+ <?php } ?>
89
+
90
+ <?php do_action( 'woo_ce_export_settings_general' ); ?>
91
+
92
+ <tr id="csv-settings">
93
+ <td colspan="2" style="padding:0;">
94
+ <hr />
95
+ <h3><div class="dashicons dashicons-media-spreadsheet"></div>&nbsp;<?php _e( 'CSV Settings', 'woo_ce' ); ?></h3>
96
+ </td>
97
+ </tr>
98
+ <tr>
99
+ <th>
100
+ <label for="delimiter"><?php _e( 'Field delimiter', 'woo_ce' ); ?></label>
101
+ </th>
102
+ <td>
103
+ <input type="text" size="3" id="delimiter" name="delimiter" value="<?php echo esc_attr( $delimiter ); ?>" maxlength="1" class="text" />
104
+ <p class="description"><?php _e( 'The field delimiter is the character separating each cell in your CSV. This is typically the \',\' (comma) character.', 'woo_pc' ); ?></p>
105
+ </td>
106
+ </tr>
107
+ <tr>
108
+ <th>
109
+ <label for="category_separator"><?php _e( 'Category separator', 'woo_ce' ); ?></label>
110
+ </th>
111
+ <td>
112
+ <input type="text" size="3" id="category_separator" name="category_separator" value="<?php echo esc_attr( $category_separator ); ?>" maxlength="1" class="text" />
113
+ <p class="description"><?php _e( 'The Product Category separator allows you to assign individual Products to multiple Product Categories/Tags/Images at a time. It is suggested to use the \'|\' (vertical pipe) character between each item. For instance: <code>Clothing|Mens|Shirts</code>.', 'woo_ce' ); ?></p>
114
+ </td>
115
+ </tr>
116
+ <tr>
117
+ <th>
118
+ <label for="bom"><?php _e( 'Add BOM character', 'woo_ce' ); ?></label>
119
+ </th>
120
+ <td>
121
+ <select id="bom" name="bom">
122
+ <option value="1"<?php selected( $bom, 1 ); ?>><?php _e( 'Yes', 'woo_ce' ); ?></option>
123
+ <option value="0"<?php selected( $bom, 0 ); ?>><?php _e( 'No', 'woo_ce' ); ?></option>
124
+ </select>
125
+ <p class="description"><?php _e( 'Mark the CSV file as UTF8 by adding a byte order mark (BOM) to the export, useful for non-English character sets.', 'woo_ce' ); ?></p>
126
+ </td>
127
+ </tr>
128
+ <tr>
129
+ <th>
130
+ <label for="escape_formatting"><?php _e( 'Field escape formatting', 'woo_ce' ); ?></label>
131
+ </th>
132
+ <td>
133
+ <label><input type="radio" name="escape_formatting" value="all"<?php checked( $escape_formatting, 'all' ); ?> />&nbsp;<?php _e( 'Escape all fields', 'woo_ce' ); ?></label><br />
134
+ <label><input type="radio" name="escape_formatting" value="excel"<?php checked( $escape_formatting, 'excel' ); ?> />&nbsp;<?php _e( 'Escape fields as Excel would', 'woo_ce' ); ?></label>
135
+ <p class="description"><?php _e( 'Choose the field escape format that suits your spreadsheet software (e.g. Excel).', 'woo_ce' ); ?></p>
136
+ </td>
137
+ </tr>
138
+
139
+ <?php do_action( 'woo_ce_export_settings_after' ); ?>
140
+
141
+ </tbody>
142
+ </table>
143
+ <!-- .form-table -->
144
+ <p class="submit">
145
+ <input type="submit" name="submit" id="submit" class="button button-primary" value="<?php _e( 'Save Changes', 'woo_ce' ); ?>" />
146
+ </p>
147
+ <input type="hidden" name="action" value="save-settings" />
148
+ </form>
149
+ <?php do_action( 'woo_ce_export_settings_bottom' ); ?>
templates/admin/tabs-tools.php ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <h3><div class="dashicons dashicons-hammer"></div>&nbsp;<?php _e( 'WooCommerce Tools', 'woo_ce' ); ?></h3>
2
+ <p class="description"><?php _e( 'Extend your store with other WooCommerce extensions from us.', 'woo_ce' ); ?></p>
3
+ <div id="poststuff">
4
+
5
+ <div id="tools" class="postbox">
6
+ <h3 class="hndle"><?php _e( 'Tools', 'woo_pd' ); ?></h3>
7
+ <div class="inside">
8
+ <table class="form-table">
9
+
10
+ <tr>
11
+ <td>
12
+ <a href="<?php echo $woo_pd_url; ?>"<?php echo $woo_pd_target; ?>><?php _e( 'Import Products from CSV', 'woo_ce' ); ?></a>
13
+ <p class="description"><?php _e( 'Use Product Importer Deluxe to import Product changes back into your WooCommerce store.', 'woo_ce' ); ?></p>
14
+ </td>
15
+ </tr>
16
+
17
+ <tr>
18
+ <td>
19
+ <a href="<?php echo $woo_st_url; ?>"<?php echo $woo_st_target; ?>><?php _e( 'Store Toolkit', 'woo_ce' ); ?></a>
20
+ <p class="description"><?php _e( 'Store Toolkit includes a growing set of commonly-used WooCommerce administration tools aimed at web developers and store maintainers.', 'woo_ce' ); ?></p>
21
+ </td>
22
+ </tr>
23
+
24
+ </table>
25
+ </div>
26
+ </div>
27
+ <!-- .postbox -->
28
+
29
+ </div>
30
+ <!-- #poststuff -->
templates/admin/tabs.php ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div id="content">
2
+
3
+ <h2 class="nav-tab-wrapper">
4
+ <a data-tab-id="overview" class="nav-tab<?php woo_ce_admin_active_tab( 'overview' ); ?>" href="<?php echo add_query_arg( array( 'page' => 'woo_ce', 'tab' => 'overview' ), 'admin.php' ); ?>"><?php _e( 'Overview', 'woo_ce' ); ?></a>
5
+ <a data-tab-id="export" class="nav-tab<?php woo_ce_admin_active_tab( 'export' ); ?>" href="<?php echo add_query_arg( array( 'page' => 'woo_ce', 'tab' => 'export' ), 'admin.php' ); ?>"><?php _e( 'Export', 'woo_ce' ); ?></a>
6
+ <a data-tab-id="archive" class="nav-tab<?php woo_ce_admin_active_tab( 'archive' ); ?>" href="<?php echo add_query_arg( array( 'page' => 'woo_ce', 'tab' => 'archive' ), 'admin.php' ); ?>"><?php _e( 'Archives', 'woo_ce' ); ?></a>
7
+ <a data-tab-id="settings" class="nav-tab<?php woo_ce_admin_active_tab( 'settings' ); ?>" href="<?php echo add_query_arg( array( 'page' => 'woo_ce', 'tab' => 'settings' ), 'admin.php' ); ?>"><?php _e( 'Settings', 'woo_ce' ); ?></a>
8
+ <a data-tab-id="tools" class="nav-tab<?php woo_ce_admin_active_tab( 'tools' ); ?>" href="<?php echo add_query_arg( array( 'page' => 'woo_ce', 'tab' => 'tools' ), 'admin.php' ); ?>"><?php _e( 'Tools', 'woo_ce' ); ?></a>
9
+ </h2>
10
+ <?php woo_ce_tab_template( $tab ); ?>
11
+
12
+ </div>
13
+ <!-- #content -->
templates/admin/woocommerce-admin_dashboard_vm-plugins.css ADDED
@@ -0,0 +1,55 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .woo_vm_version_table {
2
+ color:#333;
3
+ width:100%;
4
+ }
5
+ .woo_vm_version_table th {
6
+ border-bottom:1px solid #ddd;
7
+ padding-bottom:0.2em;
8
+ }
9
+ .woo_vm_version_table td {
10
+ border-bottom:1px solid #f9f9f9;
11
+ padding:0.3em 0;
12
+ }
13
+ .woo_vm_version_table td.version, .woo_vm_version_table td.status {
14
+ font-size:12px;
15
+ }
16
+ .woo_vm_version_table td.version {
17
+ color:#666;
18
+ }
19
+ .woo_vm_version_table td.version span {
20
+ font-size:13px;
21
+ color:#333;
22
+ }
23
+ .woo_vm_version_table td.status {
24
+ text-align:center;
25
+ border:1px dotted #ddd;
26
+ }
27
+ .woo_vm_version_table td.status .green {
28
+ color:#008000;
29
+ }
30
+ .woo_vm_version_table td.status .red {
31
+ color:#ff0000;
32
+ }
33
+ .woo_vm_version_table td.status .yellow {
34
+ color:#e66f00;
35
+ }
36
+ #woo_vm_status_widget p {
37
+ font-size:12px;
38
+ }
39
+ #woo_vm_status_widget .message {
40
+ color:#000;
41
+ font-size:12px;
42
+ margin-bottom:1em;
43
+ padding:9px 9px 8px 9px;
44
+ background-color:#ffffe0;
45
+ border-color:#e6db55;
46
+ border-width:1px;
47
+ border-style:solid;
48
+ -moz-border-radius:5px;
49
+ -khtml-border-radius:5px;
50
+ -webkit-border-radius:5px;
51
+ border-radius:5px;
52
+ }
53
+ #woo_vm_status_widget .link {
54
+ text-align:right;
55
+ }