options
11 years ago
template
11 years ago
confirm.php
11 years ago
element.php
11 years ago
error.php
11 years ago
evaluate.php
11 years ago
evaluate_variations.php
11 years ago
index.php
11 years ago
options.php
11 years ago
preview.php
11 years ago
preview_images.php
11 years ago
preview_prices.php
11 years ago
preview_taxonomies.php
11 years ago
process-complete.php
11 years ago
process.php
11 years ago
tag.php
11 years ago
template.php
11 years ago
warning.php
11 years ago
process.php
305 lines
| 1 | <h2 class="wpallimport-wp-notices"></h2> |
| 2 | |
| 3 | <div class="inner-content wpallimport-step-6 wpallimport-wrapper"> |
| 4 | |
| 5 | <div class="wpallimport-header"> |
| 6 | <div class="wpallimport-logo"></div> |
| 7 | <div class="wpallimport-title"> |
| 8 | <p><?php _e('WP All Import', 'pmxi_plugin'); ?></p> |
| 9 | <h2><?php _e('Import XML / CSV', 'pmxi_plugin'); ?></h2> |
| 10 | </div> |
| 11 | <div class="wpallimport-links"> |
| 12 | <a href="http://www.wpallimport.com/support/" target="_blank"><?php _e('Support', 'pmxi_plugin'); ?></a> | <a href="http://www.wpallimport.com/documentation/" target="_blank"><?php _e('Documentation', 'pmxi_plugin'); ?></a> |
| 13 | </div> |
| 14 | |
| 15 | <div class="clear"></div> |
| 16 | <div class="processing_step_1"> |
| 17 | |
| 18 | <div class="clear"></div> |
| 19 | |
| 20 | <div class="step_description"> |
| 21 | <h2><?php _e('Import <span id="status">in Progress</span>', 'pmxi_plugin') ?></h2> |
| 22 | <h3 id="process_notice"><?php _e('Importing may take some time. Please do not close your browser or refresh the page until the process is complete.', 'pmxi_plugin'); ?></h3> |
| 23 | |
| 24 | </div> |
| 25 | <div id="processbar" class="rad14"> |
| 26 | <div class="rad14"></div> |
| 27 | </div> |
| 28 | <div id="import_progress"> |
| 29 | <span id="left_progress"><?php _e('Time Elapsed', 'pmxi_plugin');?> <span id="then">00:00:00</span></span> |
| 30 | <span id="center_progress"><span id="percents_count">0</span>%</span> |
| 31 | <span id="right_progress"><?php _e('Created','pmxi_plugin');?> <span id="created_count"><?php echo $update_previous->created; ?></span> / <?php _e('Updated','pmxi_plugin');?> <span id="updated_count"><?php echo $update_previous->updated; ?></span> <?php _e('of', 'pmxi_plugin');?> <span id="of"><?php echo $update_previous->count; ?></span> <?php _e('records', 'pmxi_plugin'); ?></span> |
| 32 | </div> |
| 33 | </div> |
| 34 | |
| 35 | <div id="import_finished"> |
| 36 | <h1><?php _e('Import Complete!', 'pmxi_plugin'); ?></h1> |
| 37 | <h3><?php printf(__('WP All Import successfully imported your file <span>%s</span> into your WordPress installation!','pmxi_plugin'), (PMXI_Plugin::$session->source['type'] != 'url') ? basename(PMXI_Plugin::$session->source['path']) : PMXI_Plugin::$session->source['path'])?></h3> |
| 38 | <?php if ($ajax_processing): ?> |
| 39 | <p class="wpallimport-log-details"><?php printf(__('There were <span class="wpallimport-errors-count">%s</span> errors and <span class="wpallimport-warnings-count">%s</span> warnings in this import. You can see these in the import log.', 'pmxi_plugin'), 0, 0); ?></p> |
| 40 | <?php elseif ((int) PMXI_Plugin::$session->errors or (int) PMXI_Plugin::$session->warnings): ?> |
| 41 | <p class="wpallimport-log-details" style="display:block;"><?php printf(__('There were <span class="wpallimport-errors-count">%s</span> errors and <span class="wpallimport-warnings-count">%s</span> warnings in this import. You can see these in the import log.', 'pmxi_plugin'), PMXI_Plugin::$session->errors, PMXI_Plugin::$session->warnings); ?></p> |
| 42 | <?php endif; ?> |
| 43 | <hr> |
| 44 | <a href="<?php echo add_query_arg(array('id' => $update_previous->id, 'page' => 'pmxi-admin-history'), $this->baseUrl); ?>" id="download_log"><?php _e('View Logs','pmxi_plugin');?></a> |
| 45 | <a href="<?php echo add_query_arg(array('page' => 'pmxi-admin-manage'), remove_query_arg(array('id','page'), $this->baseUrl)); ?>" id="manage_imports"><?php _e('Manage Imports', 'pmxi_plugin') ?></a> |
| 46 | </div> |
| 47 | |
| 48 | </div> |
| 49 | |
| 50 | <div class="wpallimport-modal-message rad4"><?php printf(__('WP All Import tried to process <span id="wpallimport-records-per-iteration">%s</span> records in one iteration, but your server terminated the process before it could finish. <a href="javascript:void(0);" id="wpallimport-try-again">Click here to try again</a>, but with only <span id="wpallimport-new-records-per-iteration">%s</span> records per iteration.', 'pmxi_plugin'), $update_previous->options['records_per_request'], ((ceil($update_previous->options['records_per_request']/2)) ? ceil($update_previous->options['records_per_request']/2) : 1)); ?></div> |
| 51 | |
| 52 | <fieldset id="logwrapper"> |
| 53 | <legend><?php _e('Log','pmxi_plugin');?></legend> |
| 54 | <div id="loglist"></div> |
| 55 | </fieldset> |
| 56 | |
| 57 | <input type="hidden" class="count_failures" value="0"/> |
| 58 | <input type="hidden" class="records_per_request" value="<?php echo $update_previous->options['records_per_request']; ?>"/> |
| 59 | <span id="wpallimport-error-terminated" style="display:none;"><?php printf(__('Unfortunately, your server terminated the import process. Click here for our <a href="%s" target="_blank">troubleshooting guide</a>, or ask your web host to look in your error_log file for an error that takes place at the same time you are trying to run your import, and fix whatever setting is causing the import to fail.', 'pmxi_plugin'), 'http://www.wpallimport.com/documentation/server-terminated-import'); ?></span> |
| 60 | |
| 61 | <a href="http://soflyy.com/" target="_blank" class="wpallimport-created-by"><?php _e('Created by', 'pmxi_plugin'); ?> <span></span></a> |
| 62 | |
| 63 | </div> |
| 64 | |
| 65 | <script type="text/javascript"> |
| 66 | //<![CDATA[ |
| 67 | (function($){ |
| 68 | |
| 69 | window.onbeforeunload = function () { |
| 70 | return 'WARNING:\nImport process in under way, leaving the page will interrupt\nthe operation and most likely to cause leftovers in posts.'; |
| 71 | }; |
| 72 | |
| 73 | var odd = false; |
| 74 | var interval; |
| 75 | |
| 76 | function write_log(){ |
| 77 | |
| 78 | $('.progress-msg').each(function(i){ |
| 79 | |
| 80 | if ($('#loglist').find('p').length > 350) $('#loglist').html(''); |
| 81 | |
| 82 | <?php if ( ! $ajax_processing ): ?> |
| 83 | if ($(this).find('.processing_info').length) { |
| 84 | $('#created_count').html($(this).find('.created_count').html()); |
| 85 | $('#updated_count').html($(this).find('.updated_count').html()); |
| 86 | $('#percents_count').html($(this).find('.percents_count').html()); |
| 87 | } |
| 88 | <?php endif; ?> |
| 89 | |
| 90 | if ( ! $(this).find('.processing_info').length ){ |
| 91 | $('#loglist').append('<p ' + ((odd) ? 'class="odd"' : 'class="even"') + '>' + $(this).html() + '</p>'); |
| 92 | odd = !odd; |
| 93 | } |
| 94 | //$('#loglist').animate({ scrollTop: $('#loglist').get(0).scrollHeight }, 0); |
| 95 | $(this).remove(); |
| 96 | }); |
| 97 | } |
| 98 | |
| 99 | $('#status').each(function () { |
| 100 | |
| 101 | var then = $('#then'); |
| 102 | start_date = moment().sod(); |
| 103 | update = function(){ |
| 104 | var duration = moment.duration({'seconds' : 1}); |
| 105 | start_date.add(duration); |
| 106 | |
| 107 | if ($('#process_notice').is(':visible') && ! $('.wpallimport-modal-message').is(':visible')) then.html(start_date.format('HH:mm:ss')); |
| 108 | }; |
| 109 | update(); |
| 110 | setInterval(update, 1000); |
| 111 | |
| 112 | var $this = $(this); |
| 113 | |
| 114 | interval = setInterval(function () { |
| 115 | |
| 116 | write_log(); |
| 117 | |
| 118 | var percents = $('#percents_count').html(); |
| 119 | $('#processbar div').css({'width': ((parseInt(percents) > 100 || percents == undefined) ? 100 : percents) + '%'}); |
| 120 | |
| 121 | |
| 122 | }, 1000); |
| 123 | |
| 124 | $('#processbar').css({'visibility':'visible'}); |
| 125 | |
| 126 | |
| 127 | |
| 128 | <?php if ( $ajax_processing ): ?> |
| 129 | |
| 130 | var import_id = '<?php echo $update_previous->id; ?>'; |
| 131 | |
| 132 | var records_per_request = $('.records_per_request').val(); |
| 133 | |
| 134 | function parse_element(failures){ |
| 135 | |
| 136 | $.post('admin.php?page=pmxi-admin-import&action=process&id=' + import_id + '&failures=' + failures, {}, function (data) { |
| 137 | |
| 138 | // responce with error |
| 139 | if (data != null && typeof data.created != "undefined"){ |
| 140 | |
| 141 | $('.wpallimport-modal-message').hide(); |
| 142 | $('#created_count').html(data.created); |
| 143 | $('#updated_count').html(data.updated); |
| 144 | $('#warnings').html(data.warnings); |
| 145 | $('#errors').html(data.errors); |
| 146 | $('#percents_count').html(data.percentage); |
| 147 | $('#processbar div').css({'width': data.percentage + '%'}); |
| 148 | |
| 149 | records_per_request = data.records_per_request; |
| 150 | |
| 151 | if ( data.done ){ |
| 152 | clearInterval(update); |
| 153 | clearInterval(interval); |
| 154 | |
| 155 | setTimeout(function() { |
| 156 | |
| 157 | $('#loglist').append(data.log); |
| 158 | $('#process_notice').hide(); |
| 159 | $('.processing_step_1').hide(); |
| 160 | $('#import_finished').fadeIn(); |
| 161 | |
| 162 | if ( parseInt(data.errors) || parseInt(data.warnings)){ |
| 163 | $('.wpallimport-log-details').find('.wpallimport-errors-count').html(data.errors); |
| 164 | $('.wpallimport-log-details').find('.wpallimport-warnings-count').html(data.warnings); |
| 165 | $('.wpallimport-log-details').show(); |
| 166 | } |
| 167 | |
| 168 | }, 1000); |
| 169 | } |
| 170 | else{ |
| 171 | $('#loglist').append(data.log); |
| 172 | parse_element(0); |
| 173 | } |
| 174 | |
| 175 | write_log(); |
| 176 | |
| 177 | } else { |
| 178 | var count_failures = parseInt($('.count_failures').val()); |
| 179 | count_failures++; |
| 180 | $('.count_failures').val(count_failures); |
| 181 | |
| 182 | if (count_failures > 4 || records_per_request < 2){ |
| 183 | $('#process_notice').hide(); |
| 184 | $('.wpallimport-modal-message').html($('#wpallimport-error-terminated').html()).show(); |
| 185 | |
| 186 | if (data != null && typeof data != 'undefined'){ |
| 187 | $('#status').html('Error ' + '<span class="pmxi_error_msg">' + data.responseText + '</span>'); |
| 188 | } |
| 189 | else{ |
| 190 | $('#status').html('Error'); |
| 191 | } |
| 192 | clearInterval(update); |
| 193 | window.onbeforeunload = false; |
| 194 | |
| 195 | var request = { |
| 196 | action:'import_failed', |
| 197 | id: '<?php echo $update_previous->id; ?>' |
| 198 | }; |
| 199 | |
| 200 | $.ajax({ |
| 201 | type: 'POST', |
| 202 | url: ajaxurl, |
| 203 | data: request, |
| 204 | success: function(response) { |
| 205 | |
| 206 | }, |
| 207 | error: function(request) { |
| 208 | |
| 209 | }, |
| 210 | dataType: "json" |
| 211 | }); |
| 212 | |
| 213 | } |
| 214 | else{ |
| 215 | $('#wpallimport-records-per-iteration').html(records_per_request); |
| 216 | $('#wpallimport-new-records-per-iteration').html(Math.ceil(parseInt(records_per_request)/2)); |
| 217 | records_per_request = Math.ceil(parseInt(records_per_request)/2); |
| 218 | $('.wpallimport-modal-message').show(); |
| 219 | //parse_element(1); |
| 220 | } |
| 221 | return; |
| 222 | } |
| 223 | |
| 224 | }, 'json').fail(function(data) { |
| 225 | |
| 226 | var count_failures = parseInt($('.count_failures').val()); |
| 227 | count_failures++; |
| 228 | $('.count_failures').val(count_failures); |
| 229 | |
| 230 | if (count_failures > 4 || records_per_request < 2 ){ |
| 231 | $('#process_notice').hide(); |
| 232 | $('.wpallimport-modal-message').html($('#wpallimport-error-terminated').html()).show(); |
| 233 | |
| 234 | if (data != null && typeof data != 'undefined'){ |
| 235 | $('#status').html('Error ' + '<span class="pmxi_error_msg">' + data.responseText + '</span>'); |
| 236 | } |
| 237 | else{ |
| 238 | $('#status').html('Error'); |
| 239 | } |
| 240 | clearInterval(update); |
| 241 | window.onbeforeunload = false; |
| 242 | |
| 243 | var request = { |
| 244 | action:'import_failed', |
| 245 | id: '<?php echo $update_previous->id; ?>' |
| 246 | }; |
| 247 | |
| 248 | $.ajax({ |
| 249 | type: 'POST', |
| 250 | url: ajaxurl, |
| 251 | data: request, |
| 252 | success: function(response) { |
| 253 | |
| 254 | }, |
| 255 | error: function(request) { |
| 256 | |
| 257 | }, |
| 258 | dataType: "json" |
| 259 | }); |
| 260 | } |
| 261 | else{ |
| 262 | $('#wpallimport-records-per-iteration').html(records_per_request); |
| 263 | $('#wpallimport-new-records-per-iteration').html(Math.ceil(parseInt(records_per_request)/2)); |
| 264 | records_per_request = Math.ceil(parseInt(records_per_request)/2); |
| 265 | $('.wpallimport-modal-message').show(); |
| 266 | //parse_element(1); |
| 267 | } |
| 268 | |
| 269 | }); |
| 270 | } |
| 271 | |
| 272 | $('#wpallimport-try-again').click(function(){ |
| 273 | parse_element(1); |
| 274 | $('.wpallimport-modal-message').hide(); |
| 275 | }); |
| 276 | |
| 277 | $('#processbar').css({'visibility':'visible'}); |
| 278 | |
| 279 | parse_element(0); |
| 280 | |
| 281 | <?php else: ?> |
| 282 | |
| 283 | complete = function(){ |
| 284 | if ($('#status').html() == 'Complete'){ |
| 285 | setTimeout(function() { |
| 286 | $('#process_notice').hide(); |
| 287 | $('.processing_step_1').hide(); |
| 288 | $('#import_finished').fadeIn(); |
| 289 | }, 1000); |
| 290 | clearInterval(update); |
| 291 | clearInterval(complete); |
| 292 | } |
| 293 | }; |
| 294 | setInterval(complete, 1000); |
| 295 | complete(); |
| 296 | |
| 297 | <?php endif; ?> |
| 298 | |
| 299 | }); |
| 300 | |
| 301 | })(jQuery); |
| 302 | |
| 303 | //]]> |
| 304 | </script> |
| 305 |