blocks
8 years ago
options
8 years ago
template
8 years ago
google.php
8 years ago
index.php
8 years ago
options.php
8 years ago
process.php
8 years ago
template.php
8 years ago
variation_options.php
8 years ago
variation_options_common.php
8 years ago
process.php
261 lines
| 1 | <h2 class="wpallexport-wp-notices"></h2> |
| 2 | |
| 3 | <div class="inner-content wpallexport-step-6 wpallexport-wrapper"> |
| 4 | |
| 5 | <div class="wpallexport-header"> |
| 6 | <div class="wpallexport-logo"></div> |
| 7 | <div class="wpallexport-title"> |
| 8 | <p><?php _e('WP All Export', 'wp_all_export_plugin'); ?></p> |
| 9 | <h2><?php _e('Export to XML / CSV', 'wp_all_export_plugin'); ?></h2> |
| 10 | </div> |
| 11 | <div class="wpallexport-links"> |
| 12 | <a href="http://www.wpallimport.com/support/" |
| 13 | target="_blank"><?php _e('Support', 'wp_all_export_plugin'); ?></a> | <a |
| 14 | href="http://www.wpallimport.com/documentation/" |
| 15 | target="_blank"><?php _e('Documentation', 'wp_all_export_plugin'); ?></a> |
| 16 | </div> |
| 17 | |
| 18 | <div class="clear"></div> |
| 19 | <div class="processing_step_1"> |
| 20 | |
| 21 | <div class="clear"></div> |
| 22 | |
| 23 | <div class="step_description"> |
| 24 | <h2><?php _e('Export <span id="status">in Progress...</span>', 'wp_all_export_plugin') ?></h2> |
| 25 | <h3 id="process_notice"><?php _e('Exporting may take some time. Please do not close your browser or refresh the page until the process is complete.', 'wp_all_export_plugin'); ?></h3> |
| 26 | </div> |
| 27 | <div |
| 28 | class="wpallexport_process_wrapper_<?php echo $update_previous->id; ?> wpallexport_process_parent_wrapper"> |
| 29 | <div class="wpallexport_processbar rad14"> |
| 30 | <div class="rad14"></div> |
| 31 | </div> |
| 32 | <div class="export_progress"> |
| 33 | <span class="left_progress"><?php _e('Time Elapsed', 'wp_all_export_plugin'); ?> <span id="then">00:00:00</span></span> |
| 34 | <span class="center_progress"><span class="percents_count">0</span>%</span> |
| 35 | <span class="right_progress"><?php _e('Exported', 'wp_all_export_plugin'); ?> <span |
| 36 | class="created_count"><?php echo $update_previous->exported; ?></span></span> |
| 37 | </div> |
| 38 | </div> |
| 39 | <?php |
| 40 | if (XmlExportWooCommerceOrder::$is_active && $update_previous->options['export_type'] == 'specific'): |
| 41 | |
| 42 | $exportList = new PMXE_Export_List(); |
| 43 | foreach ($exportList->getBy('parent_id', $update_previous->id)->convertRecords() as $child_export) { |
| 44 | $is_render_child_progress = true; |
| 45 | switch ($child_export->export_post_type) { |
| 46 | case 'product': |
| 47 | if (!$update_previous->options['order_include_poducts']) $is_render_child_progress = false; |
| 48 | break; |
| 49 | case 'shop_coupon': |
| 50 | if (!$update_previous->options['order_include_coupons']) $is_render_child_progress = false; |
| 51 | break; |
| 52 | case 'shop_customer': |
| 53 | if (!$update_previous->options['order_include_customers']) $is_render_child_progress = false; |
| 54 | break; |
| 55 | } |
| 56 | |
| 57 | if (!$is_render_child_progress) continue; |
| 58 | |
| 59 | ?> |
| 60 | <div class="clear"></div> |
| 61 | <div |
| 62 | class="wpallexport_process_wrapper_<?php echo $child_export->id; ?> wpallexport_process_child_wrapper"> |
| 63 | <div class="wpallexport_processbar rad14"> |
| 64 | <div class="rad14"></div> |
| 65 | </div> |
| 66 | <div class="export_progress"> |
| 67 | <span class="left_progress"> |
| 68 | <span class="center_progress"> |
| 69 | <span |
| 70 | class="percents_count">0</span>%</span> <?php printf(__("Export %ss", "wp_all_export_plugin"), ucwords(str_replace("_", " ", str_replace("shop", "", $child_export->export_post_type)))); ?></span> |
| 71 | <span class="right_progress"><?php _e('Exported', 'wp_all_export_plugin'); ?> <span |
| 72 | class="created_count">0</span></span> |
| 73 | </div> |
| 74 | </div> |
| 75 | <?php |
| 76 | } |
| 77 | |
| 78 | endif; |
| 79 | ?> |
| 80 | </div> |
| 81 | |
| 82 | <div id="export_finished"> |
| 83 | <h3><?php _e('WP All Export successfully exported your data!', 'wp_all_export_plugin'); ?></h3> |
| 84 | <p style="margin-bottom: 40px;"><?php _e('Download Data', 'wp_all_export_plugin'); ?></p> |
| 85 | <div class="input wp_all_export_download"> |
| 86 | <div class="input"> |
| 87 | <button class="button button-primary button-hero wpallexport-large-button download_data" |
| 88 | rel="<?php echo add_query_arg(array('action' => 'download', 'id' => $update_previous->id, '_wpnonce' => wp_create_nonce('_wpnonce-download_feed')), $this->baseUrl); ?>"><?php echo strtoupper(wp_all_export_get_export_format($update_previous->options)); ?></button> |
| 89 | </div> |
| 90 | <?php if (!empty($update_previous->options['split_large_exports'])): ?> |
| 91 | <div class="input" style="margin-left: 10px;"> |
| 92 | <button class="button button-primary button-hero wpallexport-large-button download_data" |
| 93 | rel="<?php echo add_query_arg(array('page' => 'pmxe-admin-manage', 'id' => $update_previous->id, 'action' => 'split_bundle', '_wpnonce' => wp_create_nonce('_wpnonce-download_split_bundle')), $this->baseUrl); ?>"><?php printf(__('Split %ss', 'wp_all_export_plugin'), strtoupper(wp_all_export_get_export_format($update_previous->options))); ?></button> |
| 94 | </div> |
| 95 | <?php endif; ?> |
| 96 | <?php if (PMXE_Export_Record::is_bundle_supported($update_previous->options)): ?> |
| 97 | <div class="input" style="margin-left: 10px;"> |
| 98 | <button class="button button-primary button-hero wpallexport-large-button download_data" |
| 99 | rel="<?php echo add_query_arg(array('page' => 'pmxe-admin-manage', 'id' => $update_previous->id, 'action' => 'bundle', '_wpnonce' => wp_create_nonce('_wpnonce-download_bundle')), $this->baseUrl); ?>"><?php _e('Bundle', 'wp_all_export_plugin'); ?></button> |
| 100 | <span><?php _e('Settings & Data for WP All Import', 'wp_all_export_plugin'); ?></span> |
| 101 | </div> |
| 102 | <?php endif; ?> |
| 103 | </div> |
| 104 | <hr> |
| 105 | <a href="<?php echo add_query_arg(array('page' => 'pmxe-admin-manage'), remove_query_arg(array('id', 'page'), $this->baseUrl)); ?>" |
| 106 | id="manage_imports"><?php _e('Manage Exports', 'wp_all_export_plugin') ?></a> |
| 107 | </div> |
| 108 | |
| 109 | </div> |
| 110 | |
| 111 | <a href="http://soflyy.com/" target="_blank" |
| 112 | class="wpallexport-created-by"><?php _e('Created by', 'wp_all_export_plugin'); ?> <span></span></a> |
| 113 | |
| 114 | </div> |
| 115 | |
| 116 | <script type="text/javascript"> |
| 117 | (function ($) { |
| 118 | function toHHMMSS(string) { |
| 119 | var sec_num = parseInt(string, 10); // don't forget the second param |
| 120 | var hours = Math.floor(sec_num / 3600); |
| 121 | var minutes = Math.floor((sec_num - (hours * 3600)) / 60); |
| 122 | var seconds = sec_num - (hours * 3600) - (minutes * 60); |
| 123 | |
| 124 | if (hours < 10) { |
| 125 | hours = "0" + hours; |
| 126 | } |
| 127 | if (minutes < 10) { |
| 128 | minutes = "0" + minutes; |
| 129 | } |
| 130 | if (seconds < 10) { |
| 131 | seconds = "0" + seconds; |
| 132 | } |
| 133 | return hours + ':' + minutes + ':' + seconds; |
| 134 | |
| 135 | } |
| 136 | |
| 137 | $(function () { |
| 138 | |
| 139 | $('#status').each(function () { |
| 140 | var $this = $(this); |
| 141 | if ($this.html().match(/\.{3}$/)) { |
| 142 | var dots = 0; |
| 143 | var status = $this.html().replace(/\.{3}$/, ''); |
| 144 | var interval; |
| 145 | interval = setInterval(function () { |
| 146 | if ($this.html().match(new RegExp(status + '\\.{1,3}$', ''))) { |
| 147 | $this.html(status + '...'.substr(0, dots++ % 3 + 1)); |
| 148 | } else { |
| 149 | $('#process_notice').hide(); |
| 150 | clearInterval(interval); |
| 151 | } |
| 152 | }, 1000); |
| 153 | } |
| 154 | |
| 155 | var then = $('#then'); |
| 156 | var start_date = new Date(); |
| 157 | var current_date = new Date(); |
| 158 | |
| 159 | update = function () { |
| 160 | current_date = Date.now(); |
| 161 | var duration = Math.floor((current_date - start_date) / 1000); |
| 162 | duration = toHHMMSS(duration); |
| 163 | if ($('#process_notice').is(':visible')) then.html(duration); |
| 164 | }; |
| 165 | update(); |
| 166 | setInterval(update, 1000); |
| 167 | |
| 168 | interval = setInterval(function () { |
| 169 | |
| 170 | $('div[class^=wpallexport_process_wrapper]').each(function () { |
| 171 | var percents = $(this).find('.percents_count').html(); |
| 172 | $(this).find('.wpallexport_processbar div').css({'width': ((parseInt(percents) > 100 || percents == undefined) ? 100 : percents) + '%'}); |
| 173 | }); |
| 174 | |
| 175 | }, 1000); |
| 176 | |
| 177 | $('.wpallexport_processbar').css({'visibility': 'visible'}); |
| 178 | |
| 179 | }); |
| 180 | |
| 181 | var request = { |
| 182 | action: 'wpallexport', |
| 183 | security: wp_all_export_security |
| 184 | }; |
| 185 | |
| 186 | function wp_all_export_process(queue_export) { |
| 187 | |
| 188 | var $URL = ajaxurl; |
| 189 | |
| 190 | if (queue_export !== false) { |
| 191 | $URL += '?id=' + queue_export; |
| 192 | } |
| 193 | else { |
| 194 | if (typeof export_id != "undefined") { |
| 195 | if ($URL.indexOf("?") == -1) { |
| 196 | $URL += '?id=' + export_id; |
| 197 | } |
| 198 | else { |
| 199 | $URL += '&id=' + export_id; |
| 200 | } |
| 201 | } |
| 202 | } |
| 203 | |
| 204 | $.ajax({ |
| 205 | type: 'POST', |
| 206 | url: $URL, |
| 207 | data: request, |
| 208 | success: function (response) { |
| 209 | |
| 210 | if (response === null) { |
| 211 | $('#status').html('Error'); |
| 212 | window.onbeforeunload = false; |
| 213 | $('#process_notice').after(request.responseText); |
| 214 | return; |
| 215 | } |
| 216 | |
| 217 | var $process_wrapper = $('.wpallexport_process_wrapper_' + response.export_id); |
| 218 | |
| 219 | $process_wrapper.find('.created_count').html(response.exported); |
| 220 | $process_wrapper.find('.percents_count').html(response.percentage); |
| 221 | $process_wrapper.find('.wpallexport_processbar div').css({'width': response.percentage + '%'}); |
| 222 | |
| 223 | if (response.done) { |
| 224 | if (response.queue_export) { |
| 225 | wp_all_export_process(response.queue_export); |
| 226 | } |
| 227 | else { |
| 228 | $('#status').html('Complete'); |
| 229 | window.onbeforeunload = false; |
| 230 | |
| 231 | setTimeout(function () { |
| 232 | |
| 233 | $('#export_finished').fadeIn(); |
| 234 | |
| 235 | }, 1000); |
| 236 | } |
| 237 | } |
| 238 | else { |
| 239 | wp_all_export_process(response.export_id); |
| 240 | } |
| 241 | }, |
| 242 | error: function (request, status, error) { |
| 243 | $('#status').html('Error'); |
| 244 | window.onbeforeunload = false; |
| 245 | $('#process_notice').after(request.responseText); |
| 246 | }, |
| 247 | dataType: "json" |
| 248 | }); |
| 249 | }; |
| 250 | |
| 251 | wp_all_export_process(<?php echo $update_previous->id; ?>); |
| 252 | |
| 253 | window.onbeforeunload = function () { |
| 254 | return 'WARNING:\nExport process in under way, leaving the page will interrupt\nthe operation and most likely to cause leftovers in posts.'; |
| 255 | }; |
| 256 | |
| 257 | }); |
| 258 | })(jQuery); |
| 259 | |
| 260 | //]]> |
| 261 | </script> |