Skip to content

Commit

Permalink
+ Fixed to compatble with Magento CE 1.7x + Magento CE 1.6.x
Browse files Browse the repository at this point in the history
+ Fixed bugs
+ Tuning to improve performance.
  • Loading branch information
quynhvv committed May 15, 2015
1 parent d5240f3 commit 0a5bb04
Show file tree
Hide file tree
Showing 12 changed files with 133 additions and 222 deletions.
10 changes: 5 additions & 5 deletions js/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,11 @@
$('INPUT[name="select_all_object"]').prop('checked', true).trigger('change');

//reset event
$("button.reset").on('click', function(){
if ($('INPUT[name="reset"]').length){
$('INPUT[name="reset"]').val(1);
}
});
// $("button.reset").on('click', function(){
// if ($('INPUT[name="reset"]').length){
// $('INPUT[name="reset"]').val(1);
// }
// });

//add disabled class after click on a button
$(".btn").on('click', function(){
Expand Down
282 changes: 98 additions & 184 deletions protected/controllers/MigrateController.php

Large diffs are not rendered by default.

Binary file modified protected/data/ub_tool.db
Binary file not shown.
15 changes: 14 additions & 1 deletion protected/models/MigrateSteps.php
Original file line number Diff line number Diff line change
Expand Up @@ -393,11 +393,24 @@ public static function getTotalSalesChildObject($objectId){
public static function getMG1VersionOptions(){
$options = array(
'mage19x' => Yii::t('frontend', 'Magento 1.9.x'),
'mage18x' => Yii::t('frontend', 'Magento 1.8.x')
'mage18x' => Yii::t('frontend', 'Magento 1.8.x'),
'mage17x' => Yii::t('frontend', 'Magento 1.7.x'),
'mage16x' => Yii::t('frontend', 'Magento 1.6.x')
);
return $options;
}

public static function getMG1Version(){
$ver = NULL;
$step = MigrateSteps::model()->findByPk(1);
if ($step){
$settings = (object)json_decode($step->migrated_data);
$ver = $settings->mg1_version;
}

return $ver;
}

public static function replaceCatalogRuleModels($data){
$finds = array(
's:34:"catalogrule/rule_condition_combine"',
Expand Down
6 changes: 2 additions & 4 deletions protected/views/migrate/step2.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@
<?php if ($step->status == MigrateSteps::STATUS_NOT_DONE): ?>
<button type="submit" class="btn btn-primary"><?php echo Yii::t('frontend', 'Start'); ?></button>
<?php else: ?>
<input type="hidden" id="reset" name="reset" value="0" />
<button type="submit" class="btn btn-danger reset"><?php echo Yii::t('frontend', 'Reset'); ?></button>
<a href="<?php echo Yii::app()->createUrl("migrate/reset/step/" . $step->sorder); ?>" class="btn btn-danger"><?php echo Yii::t('frontend', 'Reset'); ?></a>
<a href="<?php echo Yii::app()->createUrl("migrate/step" . ++$step->sorder); ?>" class="btn btn-primary"><?php echo Yii::t('frontend', 'Next Step'); ?></a>
<?php endif; ?>
</div>
Expand Down Expand Up @@ -91,8 +90,7 @@
<?php if ($step->status == MigrateSteps::STATUS_NOT_DONE): ?>
<button type="submit" class="btn btn-primary"><?php echo Yii::t('frontend', 'Start'); ?></button>
<?php else: ?>
<input type="hidden" id="reset" name="reset" value="0" />
<button type="submit" class="btn btn-danger reset"><?php echo Yii::t('frontend', 'Reset'); ?></button>
<a href="<?php echo Yii::app()->createUrl("migrate/reset/step/" . $step->sorder); ?>" class="btn btn-danger"><?php echo Yii::t('frontend', 'Reset'); ?></a>
<a href="<?php echo Yii::app()->createUrl("migrate/step" . ++$step->sorder); ?>" class="btn btn-primary"><?php echo Yii::t('frontend', 'Next Step'); ?></a>
<?php endif; ?>
</div>
Expand Down
6 changes: 2 additions & 4 deletions protected/views/migrate/step3.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@
<?php if ($step->status == MigrateSteps::STATUS_NOT_DONE): ?>
<button type="submit" class="btn btn-primary"><?php echo Yii::t('frontend', 'Start'); ?></button>
<?php else: ?>
<input type="hidden" id="reset" name="reset" value="0" />
<button type="submit" class="btn btn-danger reset"><?php echo Yii::t('frontend', 'Reset'); ?></button>
<a href="<?php echo Yii::app()->createUrl("migrate/reset/step/" . $step->sorder); ?>" class="btn btn-danger"><?php echo Yii::t('frontend', 'Reset'); ?></a>
<a href="<?php echo Yii::app()->createUrl("migrate/step" . ++$step->sorder); ?>" class="btn btn-primary"><?php echo Yii::t('frontend', 'Next Step'); ?></a>
<?php endif; ?>
</div>
Expand Down Expand Up @@ -81,8 +80,7 @@
<?php if ($step->status == MigrateSteps::STATUS_NOT_DONE): ?>
<button type="submit" class="btn btn-primary"><?php echo Yii::t('frontend', 'Start'); ?></button>
<?php else: ?>
<input type="hidden" id="reset" name="reset" value="0" />
<button type="submit" class="btn btn-danger reset"><?php echo Yii::t('frontend', 'Reset'); ?></button>
<a href="<?php echo Yii::app()->createUrl("migrate/reset/step/" . $step->sorder); ?>" class="btn btn-danger"><?php echo Yii::t('frontend', 'Reset'); ?></a>
<a href="<?php echo Yii::app()->createUrl("migrate/step" . ++$step->sorder); ?>" class="btn btn-primary"><?php echo Yii::t('frontend', 'Next Step'); ?></a>
<?php endif; ?>
</div>
Expand Down
6 changes: 2 additions & 4 deletions protected/views/migrate/step4.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@
<?php if ($step->status == MigrateSteps::STATUS_NOT_DONE): ?>
<button type="submit" class="btn btn-primary"><?php echo Yii::t('frontend', 'Start'); ?></button>
<?php else: ?>
<input type="hidden" id="reset" name="reset" value="0" />
<button type="submit" class="btn btn-danger reset"><?php echo Yii::t('frontend', 'Reset'); ?></button>
<a href="<?php echo Yii::app()->createUrl("migrate/reset/step/" . $step->sorder); ?>" class="btn btn-danger"><?php echo Yii::t('frontend', 'Reset'); ?></a>
<a href="<?php echo Yii::app()->createUrl("migrate/step" . ++$step->sorder); ?>" class="btn btn-primary"><?php echo Yii::t('frontend', 'Next Step'); ?></a>
<?php endif; ?>
</div>
Expand Down Expand Up @@ -135,8 +134,7 @@
<?php if ($step->status == MigrateSteps::STATUS_NOT_DONE): ?>
<button type="submit" class="btn btn-primary"><?php echo Yii::t('frontend', 'Start'); ?></button>
<?php else: ?>
<input type="hidden" id="reset" name="reset" value="0" />
<button type="submit" class="btn btn-danger reset"><?php echo Yii::t('frontend', 'Reset'); ?></button>
<a href="<?php echo Yii::app()->createUrl("migrate/reset/step/" . $step->sorder); ?>" class="btn btn-danger"><?php echo Yii::t('frontend', 'Reset'); ?></a>
<a href="<?php echo Yii::app()->createUrl("migrate/step" . ++$step->sorder); ?>" class="btn btn-primary"><?php echo Yii::t('frontend', 'Next Step'); ?></a>
<?php endif; ?>
</div>
Expand Down
6 changes: 2 additions & 4 deletions protected/views/migrate/step5.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@
<?php if ($step->status == MigrateSteps::STATUS_NOT_DONE): ?>
<button type="submit" class="btn btn-primary"><?php echo Yii::t('frontend', 'Start'); ?></button>
<?php else: ?>
<input type="hidden" id="reset" name="reset" value="0" />
<button type="submit" class="btn btn-danger reset"><?php echo Yii::t('frontend', 'Reset'); ?></button>
<a href="<?php echo Yii::app()->createUrl("migrate/reset/step/" . $step->sorder); ?>" class="btn btn-danger"><?php echo Yii::t('frontend', 'Reset'); ?></a>
<a href="<?php echo Yii::app()->createUrl("migrate/step" . ++$step->sorder); ?>" class="btn btn-primary"><?php echo Yii::t('frontend', 'Next Step'); ?></a>
<?php endif; ?>
</div>
Expand Down Expand Up @@ -68,8 +67,7 @@
<?php if ($step->status == MigrateSteps::STATUS_NOT_DONE): ?>
<button type="submit" class="btn btn-primary"><?php echo Yii::t('frontend', 'Start'); ?></button>
<?php else: ?>
<input type="hidden" id="reset" name="reset" value="0" />
<button type="submit" class="btn btn-danger reset"><?php echo Yii::t('frontend', 'Reset'); ?></button>
<a href="<?php echo Yii::app()->createUrl("migrate/reset/step/" . $step->sorder); ?>" class="btn btn-danger"><?php echo Yii::t('frontend', 'Reset'); ?></a>
<a href="<?php echo Yii::app()->createUrl("migrate/step" . ++$step->sorder); ?>" class="btn btn-primary"><?php echo Yii::t('frontend', 'Next Step'); ?></a>
<?php endif; ?>
</div>
Expand Down
6 changes: 2 additions & 4 deletions protected/views/migrate/step6.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@
<?php if ($step->status == MigrateSteps::STATUS_NOT_DONE): ?>
<button type="submit" class="btn btn-primary"><?php echo Yii::t('frontend', 'Start'); ?></button>
<?php else: ?>
<input type="hidden" id="reset" name="reset" value="0" />
<button type="submit" class="btn btn-danger reset"><?php echo Yii::t('frontend', 'Reset'); ?></button>
<a href="<?php echo Yii::app()->createUrl("migrate/reset/step/" . $step->sorder); ?>" class="btn btn-danger"><?php echo Yii::t('frontend', 'Reset'); ?></a>
<a href="<?php echo Yii::app()->createUrl("migrate/step" . ++$step->sorder); ?>" class="btn btn-primary"><?php echo Yii::t('frontend', 'Next Step'); ?></a>
<?php endif; ?>
</div>
Expand Down Expand Up @@ -57,8 +56,7 @@
<?php if ($step->status == MigrateSteps::STATUS_NOT_DONE): ?>
<button type="submit" class="btn btn-primary"><?php echo Yii::t('frontend', 'Start'); ?></button>
<?php else: ?>
<input type="hidden" id="reset" name="reset" value="0" />
<button type="submit" class="btn btn-danger reset"><?php echo Yii::t('frontend', 'Reset'); ?></button>
<a href="<?php echo Yii::app()->createUrl("migrate/reset/step/" . $step->sorder); ?>" class="btn btn-danger"><?php echo Yii::t('frontend', 'Reset'); ?></a>
<a href="<?php echo Yii::app()->createUrl("migrate/step" . ++$step->sorder); ?>" class="btn btn-primary"><?php echo Yii::t('frontend', 'Next Step'); ?></a>
<?php endif; ?>
</div>
Expand Down
6 changes: 2 additions & 4 deletions protected/views/migrate/step7.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@
<?php if ($step->status == MigrateSteps::STATUS_NOT_DONE): ?>
<button type="submit" class="btn btn-primary"><?php echo Yii::t('frontend', 'Start'); ?></button>
<?php else: ?>
<input type="hidden" id="reset" name="reset" value="0" />
<button type="submit" class="btn btn-danger reset"><?php echo Yii::t('frontend', 'Reset'); ?></button>
<a href="<?php echo Yii::app()->createUrl("migrate/reset/step/" . $step->sorder); ?>" class="btn btn-danger"><?php echo Yii::t('frontend', 'Reset'); ?></a>
<a href="<?php echo Yii::app()->createUrl("migrate/step" . ++$step->sorder); ?>" class="btn btn-primary"><?php echo Yii::t('frontend', 'Next Step'); ?></a>
<?php endif; ?>
</div>
Expand Down Expand Up @@ -55,8 +54,7 @@
<?php if ($step->status == MigrateSteps::STATUS_NOT_DONE): ?>
<button type="submit" class="btn btn-primary"><?php echo Yii::t('frontend', 'Start'); ?></button>
<?php else: ?>
<input type="hidden" id="reset" name="reset" value="0" />
<button type="submit" class="btn btn-danger reset"><?php echo Yii::t('frontend', 'Reset'); ?></button>
<a href="<?php echo Yii::app()->createUrl("migrate/reset/step/" . $step->sorder); ?>" class="btn btn-danger"><?php echo Yii::t('frontend', 'Reset'); ?></a>
<a href="<?php echo Yii::app()->createUrl("migrate/step" . ++$step->sorder); ?>" class="btn btn-primary"><?php echo Yii::t('frontend', 'Next Step'); ?></a>
<?php endif; ?>
</div>
Expand Down
6 changes: 2 additions & 4 deletions protected/views/migrate/step8.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@
<?php if ($step->status == MigrateSteps::STATUS_NOT_DONE): ?>
<button type="submit" class="btn btn-primary"><?php echo Yii::t('frontend', 'Start'); ?></button>
<?php else: ?>
<input type="hidden" id="reset" name="reset" value="0" />
<button type="submit" class="btn btn-danger reset"><?php echo Yii::t('frontend', 'Reset'); ?></button>
<a href="<?php echo Yii::app()->createUrl("migrate/reset/step/" . $step->sorder); ?>" class="btn btn-danger"><?php echo Yii::t('frontend', 'Reset'); ?></a>
<a href="<?php echo Yii::app()->createUrl("migrate/step" . ++$step->sorder); ?>" class="btn btn-primary"><?php echo Yii::t('frontend', 'Next Step'); ?></a>
<?php endif; ?>
</div>
Expand Down Expand Up @@ -60,8 +59,7 @@
<?php if ($step->status == MigrateSteps::STATUS_NOT_DONE): ?>
<button type="submit" class="btn btn-primary"><?php echo Yii::t('frontend', 'Start'); ?></button>
<?php else: ?>
<input type="hidden" id="reset" name="reset" value="0" />
<button type="submit" class="btn btn-danger reset"><?php echo Yii::t('frontend', 'Reset'); ?></button>
<a href="<?php echo Yii::app()->createUrl("migrate/reset/step/" . $step->sorder); ?>" class="btn btn-danger"><?php echo Yii::t('frontend', 'Reset'); ?></a>
<a href="<?php echo Yii::app()->createUrl("migrate/step" . ++$step->sorder); ?>" class="btn btn-primary"><?php echo Yii::t('frontend', 'Next Step'); ?></a>
<?php endif; ?>
</div>
Expand Down
6 changes: 2 additions & 4 deletions protected/views/migrate/step9.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@
<?php if ($step->status == MigrateSteps::STATUS_NOT_DONE): ?>
<button type="submit" class="btn btn-primary"><?php echo Yii::t('frontend', 'Start'); ?></button>
<?php else: ?>
<input type="hidden" id="reset" name="reset" value="0" />
<button type="submit" class="btn btn-danger reset"><?php echo Yii::t('frontend', 'Reset'); ?></button>
<a href="<?php echo Yii::app()->createUrl("migrate/reset/step/" . $step->sorder); ?>" class="btn btn-danger"><?php echo Yii::t('frontend', 'Reset'); ?></a>
<?php endif; ?>
</div>
<!--// Form Buttons-->
Expand Down Expand Up @@ -59,8 +58,7 @@
<?php if ($step->status == MigrateSteps::STATUS_NOT_DONE): ?>
<button type="submit" class="btn btn-primary"><?php echo Yii::t('frontend', 'Start'); ?></button>
<?php else: ?>
<input type="hidden" id="reset" name="reset" value="0" />
<button type="submit" class="btn btn-danger reset"><?php echo Yii::t('frontend', 'Reset'); ?></button>
<a href="<?php echo Yii::app()->createUrl("migrate/reset/step/" . $step->sorder); ?>" class="btn btn-danger"><?php echo Yii::t('frontend', 'Reset'); ?></a>
<?php endif; ?>
</div>
<!--// Form Buttons-->
Expand Down

0 comments on commit 0a5bb04

Please sign in to comment.