Version Notes
API URL update.
Download this release
Release Info
| Developer | Jugal |
| Extension | Xrely_Autocomplete |
| Version | 1.0.2 |
| Comparing to | |
| See all releases | |
Code changes from version 1.0.1 to 1.0.2
- app/code/community/Xrely/Autocomplete/Model/Settings.php +12 -2
- app/code/community/Xrely/Autocomplete/controllers/Adminhtml/PublishController.php +100 -83
- app/code/community/Xrely/Autocomplete/sql/xrely_autocomplete_setup/install-1.0.0.0.php +6 -2
- app/design/adminhtml/default/default/template/xrely_autocomplete/progress.phtml +66 -24
- package.xml +4 -4
app/code/community/Xrely/Autocomplete/Model/Settings.php
CHANGED
|
@@ -19,15 +19,25 @@ class Xrely_Autocomplete_Model_Settings extends Mage_Core_Model_Abstract
|
|
| 19 |
return $id;
|
| 20 |
}
|
| 21 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 22 |
public function totalProcessed()
|
| 23 |
{
|
| 24 |
-
return $this->getCollection()->addFieldToFilter('type', 1)->load()->getSize();
|
| 25 |
}
|
| 26 |
|
| 27 |
public function isProcessed($prodId)
|
| 28 |
{
|
| 29 |
$collection = $this->getCollection();
|
| 30 |
-
$collection->addFieldToFilter('type',1);
|
| 31 |
$collection->addFieldToFilter('eid',$prodId);
|
| 32 |
return $collection->count() > 0;
|
| 33 |
}
|
| 19 |
return $id;
|
| 20 |
}
|
| 21 |
|
| 22 |
+
public function markSent($productId)
|
| 23 |
+
{
|
| 24 |
+
$resource = Mage::getSingleton('core/resource');
|
| 25 |
+
$write = $resource->getConnection('core_write');
|
| 26 |
+
$updateTable = $resource->getTableName('xrely_autocomplete/settings');
|
| 27 |
+
$data = array("type" => "1");
|
| 28 |
+
$where = "eid = '$productId'";
|
| 29 |
+
$write->update($updateTable, $data, $where);
|
| 30 |
+
}
|
| 31 |
+
|
| 32 |
public function totalProcessed()
|
| 33 |
{
|
| 34 |
+
return $this->getCollection()->addFieldToFilter('type', '1')->load()->getSize();
|
| 35 |
}
|
| 36 |
|
| 37 |
public function isProcessed($prodId)
|
| 38 |
{
|
| 39 |
$collection = $this->getCollection();
|
| 40 |
+
$collection->addFieldToFilter('type','1');
|
| 41 |
$collection->addFieldToFilter('eid',$prodId);
|
| 42 |
return $collection->count() > 0;
|
| 43 |
}
|
app/code/community/Xrely/Autocomplete/controllers/Adminhtml/PublishController.php
CHANGED
|
@@ -3,6 +3,14 @@
|
|
| 3 |
class Xrely_Autocomplete_Adminhtml_PublishController extends Mage_Adminhtml_Controller_Action
|
| 4 |
{
|
| 5 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6 |
const STATUS_IN_PROGRESS = 1;
|
| 7 |
const STATUS_DONE_NOW = 2;
|
| 8 |
const STATUS_DONE_IN_PAST = 3;
|
|
@@ -19,13 +27,52 @@ class Xrely_Autocomplete_Adminhtml_PublishController extends Mage_Adminhtml_Cont
|
|
| 19 |
$this->renderLayout();
|
| 20 |
}
|
| 21 |
|
| 22 |
-
public function
|
| 23 |
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 24 |
set_time_limit(0);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 25 |
$helper = Mage::helper('xrely_autocomplete');
|
| 26 |
-
$collection = Mage::getResourceModel('reports/product_collection');
|
| 27 |
-
$collection->addStoreFilter();
|
| 28 |
-
$products = Mage::getModel('catalog/product')->getCollection();
|
| 29 |
$i = 0;
|
| 30 |
$pData = array();
|
| 31 |
$pData["client"] = "magento";
|
|
@@ -51,9 +98,8 @@ class Xrely_Autocomplete_Adminhtml_PublishController extends Mage_Adminhtml_Cont
|
|
| 51 |
$markProd = array();
|
| 52 |
foreach ($products as $prod)
|
| 53 |
{
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
$product = Mage::getModel('catalog/product')->load($prod->getId());
|
| 57 |
$catCollection = $product->getCategoryCollection()
|
| 58 |
->addAttributeToSelect('name')
|
| 59 |
->addAttributeToSelect('url')
|
|
@@ -79,90 +125,61 @@ class Xrely_Autocomplete_Adminhtml_PublishController extends Mage_Adminhtml_Cont
|
|
| 79 |
'categories' => $catList
|
| 80 |
)
|
| 81 |
);
|
| 82 |
-
$markProd[] = $product->getId();
|
| 83 |
-
|
| 84 |
-
|
| 85 |
-
|
| 86 |
-
|
| 87 |
-
|
| 88 |
-
|
| 89 |
-
|
| 90 |
-
|
| 91 |
-
|
| 92 |
-
|
| 93 |
-
*/
|
| 94 |
|
| 95 |
-
|
| 96 |
-
|
| 97 |
-
|
| 98 |
-
|
| 99 |
-
case 'upgrade':
|
| 100 |
-
echo json_encode(
|
| 101 |
-
array(
|
| 102 |
-
'status' => array(
|
| 103 |
-
'code' => self::STATUS_UPGRADE,
|
| 104 |
-
'link' => Mage::helper("adminhtml")->getUrl("xrely_autocomplete/adminhtml_redirect/upgrade"),
|
| 105 |
-
'text' => $resp['text'],
|
| 106 |
-
'current' => $model->totalProcessed(),
|
| 107 |
-
'total' => $model->getTotalProduct()
|
| 108 |
-
)
|
| 109 |
-
)
|
| 110 |
-
);
|
| 111 |
-
break;
|
| 112 |
-
default:
|
| 113 |
-
break;
|
| 114 |
-
}
|
| 115 |
-
die;
|
| 116 |
-
}
|
| 117 |
-
else
|
| 118 |
-
{
|
| 119 |
-
foreach ($markProd as $prodId) {
|
| 120 |
-
$model->markProduct($prodId);
|
| 121 |
-
}
|
| 122 |
-
$markProd = array();
|
| 123 |
-
}
|
| 124 |
echo json_encode(
|
| 125 |
-
|
| 126 |
-
|
| 127 |
-
|
| 128 |
-
|
| 129 |
-
|
|
|
|
|
|
|
|
|
|
| 130 |
)
|
| 131 |
-
)
|
| 132 |
-
|
| 133 |
-
|
| 134 |
-
|
| 135 |
-
if($processed >= $totalProduct)
|
| 136 |
-
Mage::getModel('core/config')->saveConfig('xrely_autocomplete/config/ini_sync', 1);
|
| 137 |
-
die;
|
| 138 |
-
$pData["magentoData"]["items"] = [];
|
| 139 |
}
|
|
|
|
| 140 |
}
|
| 141 |
-
|
| 142 |
{
|
| 143 |
-
/*
|
| 144 |
-
* Call to API
|
| 145 |
-
*/
|
| 146 |
foreach ($markProd as $prodId) {
|
| 147 |
-
|
| 148 |
-
|
| 149 |
-
$markProd = array();
|
| 150 |
-
echo json_encode(
|
| 151 |
-
array(
|
| 152 |
-
'status' => array(
|
| 153 |
-
'code' => self::STATUS_IN_PROGRESS,
|
| 154 |
-
'current' => $model->totalProcessed(),
|
| 155 |
-
'total' => $model->getTotalProduct()
|
| 156 |
-
)
|
| 157 |
-
)
|
| 158 |
-
);
|
| 159 |
-
$helper->sync($pData);
|
| 160 |
-
$processed = $model->totalProcessed();
|
| 161 |
-
$totalProduct = $model->getTotalProduct();
|
| 162 |
-
if($processed >= $totalProduct)
|
| 163 |
-
Mage::getModel('core/config')->saveConfig('xrely_autocomplete/config/ini_sync', 1);
|
| 164 |
-
die;
|
| 165 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 166 |
}
|
| 167 |
|
| 168 |
public function statusAction()
|
| 3 |
class Xrely_Autocomplete_Adminhtml_PublishController extends Mage_Adminhtml_Controller_Action
|
| 4 |
{
|
| 5 |
|
| 6 |
+
/*
|
| 7 |
+
* Batch size, Can be configured by you
|
| 8 |
+
* ===========================
|
| 9 |
+
*/
|
| 10 |
+
const BATCH_SIZE = 100;
|
| 11 |
+
/*
|
| 12 |
+
* ===========================
|
| 13 |
+
*/
|
| 14 |
const STATUS_IN_PROGRESS = 1;
|
| 15 |
const STATUS_DONE_NOW = 2;
|
| 16 |
const STATUS_DONE_IN_PAST = 3;
|
| 27 |
$this->renderLayout();
|
| 28 |
}
|
| 29 |
|
| 30 |
+
public function initAction()
|
| 31 |
{
|
| 32 |
+
|
| 33 |
+
$resource = Mage::getSingleton('core/resource');
|
| 34 |
+
$writeConnection = $resource->getConnection('core_write');
|
| 35 |
+
$table = $resource->getTableName('catalog/product');
|
| 36 |
+
$insertTable = Mage::getSingleton('core/resource')->getTableName('xrely_autocomplete/settings');
|
| 37 |
+
$query = "INSERT INTO {$insertTable} (`id`, `type`, `eid`, `key`, `value`, `comment`) SELECT NULL, '0', cpe.entity_id, CONCAT('p:', cpe.entity_id) , '".date('Y-m-d')."', NULL FROM {$table} as cpe left join ".$resource->getTableName('xrely_autocomplete/settings')." as x on x.eid = cpe.entity_id where x.eid is null;";
|
| 38 |
+
$writeConnection->query($query);
|
| 39 |
+
$model = Mage::getModel('xrely_autocomplete/settings');
|
| 40 |
+
$processed = $model->totalProcessed();
|
| 41 |
+
$totalProduct = $model->getTotalProduct();
|
| 42 |
+
if($processed >= $totalProduct)
|
| 43 |
+
{
|
| 44 |
+
Mage::getModel('core/config')->saveConfig('xrely_autocomplete/config/ini_sync', 1);
|
| 45 |
+
echo json_encode(
|
| 46 |
+
array(
|
| 47 |
+
'status' => array(
|
| 48 |
+
'code' => self::STATUS_DONE_IN_PAST,
|
| 49 |
+
'current' => $model->totalProcessed(),
|
| 50 |
+
'total' => $model->getTotalProduct()
|
| 51 |
+
)
|
| 52 |
+
)
|
| 53 |
+
);
|
| 54 |
+
die;
|
| 55 |
+
}
|
| 56 |
+
echo json_encode(
|
| 57 |
+
array(
|
| 58 |
+
'status' => array(
|
| 59 |
+
'code' => self::STATUS_IN_PROGRESS,
|
| 60 |
+
'current' => $model->totalProcessed(),
|
| 61 |
+
'total' => $model->getTotalProduct()
|
| 62 |
+
)
|
| 63 |
+
)
|
| 64 |
+
);
|
| 65 |
+
}
|
| 66 |
+
|
| 67 |
+
public function prepareAction()
|
| 68 |
+
{
|
| 69 |
set_time_limit(0);
|
| 70 |
+
$resource = Mage::getSingleton('core/resource');
|
| 71 |
+
$readConnection = $resource->getConnection('core_read');
|
| 72 |
+
$query = 'SELECT eid FROM ' . $resource->getTableName('xrely_autocomplete/settings') ." where type != '1' LIMIT ".self::BATCH_SIZE.";";
|
| 73 |
+
$results = $readConnection->fetchAll($query);
|
| 74 |
+
$products = array_column($results,'eid');
|
| 75 |
$helper = Mage::helper('xrely_autocomplete');
|
|
|
|
|
|
|
|
|
|
| 76 |
$i = 0;
|
| 77 |
$pData = array();
|
| 78 |
$pData["client"] = "magento";
|
| 98 |
$markProd = array();
|
| 99 |
foreach ($products as $prod)
|
| 100 |
{
|
| 101 |
+
|
| 102 |
+
$product = Mage::getModel('catalog/product')->load($prod);
|
|
|
|
| 103 |
$catCollection = $product->getCategoryCollection()
|
| 104 |
->addAttributeToSelect('name')
|
| 105 |
->addAttributeToSelect('url')
|
| 125 |
'categories' => $catList
|
| 126 |
)
|
| 127 |
);
|
| 128 |
+
$markProd[] = $product->getId();
|
| 129 |
+
|
| 130 |
+
}
|
| 131 |
+
if ((count($markProd) + $processed) >= $totalProduct)
|
| 132 |
+
$pData["lastpage"] = true;
|
| 133 |
+
else
|
| 134 |
+
$pData["lastpage"] = false;
|
| 135 |
+
/*
|
| 136 |
+
* Call to API
|
| 137 |
+
*/
|
| 138 |
+
$resp = json_decode($helper->sync($pData),true);
|
|
|
|
| 139 |
|
| 140 |
+
if(!$resp['success'])
|
| 141 |
+
{
|
| 142 |
+
switch ($resp['action']) {
|
| 143 |
+
case 'upgrade':
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 144 |
echo json_encode(
|
| 145 |
+
array(
|
| 146 |
+
'status' => array(
|
| 147 |
+
'code' => self::STATUS_UPGRADE,
|
| 148 |
+
'link' => Mage::helper("adminhtml")->getUrl("xrely_autocomplete/adminhtml_redirect/upgrade"),
|
| 149 |
+
'text' => $resp['text'],
|
| 150 |
+
'current' => $model->totalProcessed(),
|
| 151 |
+
'total' => $model->getTotalProduct()
|
| 152 |
+
)
|
| 153 |
)
|
| 154 |
+
);
|
| 155 |
+
break;
|
| 156 |
+
default:
|
| 157 |
+
break;
|
|
|
|
|
|
|
|
|
|
|
|
|
| 158 |
}
|
| 159 |
+
die;
|
| 160 |
}
|
| 161 |
+
else
|
| 162 |
{
|
|
|
|
|
|
|
|
|
|
| 163 |
foreach ($markProd as $prodId) {
|
| 164 |
+
$model->markSent($prodId);
|
| 165 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 166 |
}
|
| 167 |
+
$processed = $model->totalProcessed();
|
| 168 |
+
$totalProduct = $model->getTotalProduct();
|
| 169 |
+
if($processed >= $totalProduct)
|
| 170 |
+
{
|
| 171 |
+
Mage::getModel('core/config')->saveConfig('xrely_autocomplete/config/ini_sync', 1);
|
| 172 |
+
}
|
| 173 |
+
echo json_encode(
|
| 174 |
+
array(
|
| 175 |
+
'status' => array(
|
| 176 |
+
'code' => self::STATUS_IN_PROGRESS,
|
| 177 |
+
'current' => $model->totalProcessed(),
|
| 178 |
+
'total' => $model->getTotalProduct()
|
| 179 |
+
)
|
| 180 |
+
)
|
| 181 |
+
);
|
| 182 |
+
|
| 183 |
}
|
| 184 |
|
| 185 |
public function statusAction()
|
app/code/community/Xrely/Autocomplete/sql/xrely_autocomplete_setup/install-1.0.0.0.php
CHANGED
|
@@ -28,7 +28,11 @@ $table = $installer->getConnection()
|
|
| 28 |
'nullable' => false,
|
| 29 |
), 'Value')
|
| 30 |
->addColumn('comment', Varien_Db_Ddl_Table::TYPE_TEXT, null, array(
|
| 31 |
-
|
| 32 |
-
), 'Comment')
|
|
|
|
|
|
|
|
|
|
|
|
|
| 33 |
$installer->getConnection()->createTable($table);
|
| 34 |
$installer->endSetup();
|
| 28 |
'nullable' => false,
|
| 29 |
), 'Value')
|
| 30 |
->addColumn('comment', Varien_Db_Ddl_Table::TYPE_TEXT, null, array(
|
| 31 |
+
'nullable' => true,
|
| 32 |
+
), 'Comment')
|
| 33 |
+
->addIndex(
|
| 34 |
+
'xrely_autocomplete_eid_index',
|
| 35 |
+
'eid'
|
| 36 |
+
);;
|
| 37 |
$installer->getConnection()->createTable($table);
|
| 38 |
$installer->endSetup();
|
app/design/adminhtml/default/default/template/xrely_autocomplete/progress.phtml
CHANGED
|
@@ -37,13 +37,13 @@
|
|
| 37 |
|
| 38 |
</ul>
|
| 39 |
</div>
|
| 40 |
-
<p><?php // echo Mage::helper('adminhtml')->__('We\'re in our typing table, coding away more features for Magento. Thank you for your patience.') ?></p>
|
| 41 |
<script>
|
| 42 |
var urls = <?php
|
| 43 |
echo json_encode(
|
| 44 |
array(
|
| 45 |
'prepare' => array(
|
| 46 |
-
'init' => Mage::helper('adminhtml')->getUrl('xrely_autocomplete/adminhtml_publish/
|
|
|
|
| 47 |
'status' => Mage::helper('adminhtml')->getUrl('xrely_autocomplete/adminhtml_publish/status')
|
| 48 |
),
|
| 49 |
'sync' => array(
|
|
@@ -62,8 +62,9 @@ echo json_encode(
|
|
| 62 |
else
|
| 63 |
styler = Element.setStyle;
|
| 64 |
|
| 65 |
-
logger.insert("<li><strong>
|
| 66 |
-
|
|
|
|
| 67 |
{
|
| 68 |
new Ajax.Request(urls.prepare.init, {
|
| 69 |
method: 'get',
|
|
@@ -75,29 +76,40 @@ echo json_encode(
|
|
| 75 |
/*
|
| 76 |
* Sync Completes
|
| 77 |
*/
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
|
| 83 |
-
if(data.status.code == 3)
|
| 84 |
-
{
|
| 85 |
-
logger.insert("<li><strong>Syncronization is done</strong></li><li><a href='JavaScript:window.close()'>close window</a></li>");
|
| 86 |
-
return;
|
| 87 |
-
}
|
| 88 |
-
if(data.status.code == 4)
|
| 89 |
-
{
|
| 90 |
-
logger.insert("<li><strong>"+data.status.text+" <a href='"+data.status.link+"'><b>upgrade</b></a></strong></li><li><a href='JavaScript:window.close()'>close window</a></li>");
|
| 91 |
-
return;
|
| 92 |
-
}
|
| 93 |
-
if(!$$("ul.logger li.productCount")[0])
|
| 94 |
{
|
| 95 |
-
|
|
|
|
|
|
|
|
|
|
| 96 |
}
|
| 97 |
-
|
| 98 |
{
|
| 99 |
-
|
|
|
|
| 100 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 101 |
if(data.status.current != data.status.total)
|
| 102 |
{
|
| 103 |
start();
|
|
@@ -109,6 +121,36 @@ echo json_encode(
|
|
| 109 |
}
|
| 110 |
});
|
| 111 |
}
|
| 112 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 113 |
|
| 114 |
</script>
|
| 37 |
|
| 38 |
</ul>
|
| 39 |
</div>
|
|
|
|
| 40 |
<script>
|
| 41 |
var urls = <?php
|
| 42 |
echo json_encode(
|
| 43 |
array(
|
| 44 |
'prepare' => array(
|
| 45 |
+
'init' => Mage::helper('adminhtml')->getUrl('xrely_autocomplete/adminhtml_publish/init'),
|
| 46 |
+
'start' => Mage::helper('adminhtml')->getUrl('xrely_autocomplete/adminhtml_publish/prepare'),
|
| 47 |
'status' => Mage::helper('adminhtml')->getUrl('xrely_autocomplete/adminhtml_publish/status')
|
| 48 |
),
|
| 49 |
'sync' => array(
|
| 62 |
else
|
| 63 |
styler = Element.setStyle;
|
| 64 |
|
| 65 |
+
logger.insert("<li><strong>Preparing for Sync</strong></li>");
|
| 66 |
+
$$("ul.logger")[0].insert("<li class='productCount'><strong><span>"+0+"/"+0+"</span> Product has been processes </strong></li>");
|
| 67 |
+
function init()
|
| 68 |
{
|
| 69 |
new Ajax.Request(urls.prepare.init, {
|
| 70 |
method: 'get',
|
| 76 |
/*
|
| 77 |
* Sync Completes
|
| 78 |
*/
|
| 79 |
+
data = JSON.parse(transport.responseText);
|
| 80 |
+
try{
|
| 81 |
+
styleBar(data);
|
| 82 |
+
$$("ul.logger li.productCount span")[0].update(data.status.current+"/"+data.status.total);
|
| 83 |
+
} catch(ex)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 84 |
{
|
| 85 |
+
if(console && console.log)
|
| 86 |
+
{
|
| 87 |
+
console.log("Sumething unexpected happend");
|
| 88 |
+
}
|
| 89 |
}
|
| 90 |
+
if(setUpdate(data))
|
| 91 |
{
|
| 92 |
+
logger.insert("<li><strong>Starting Sync</strong></li>");
|
| 93 |
+
start();
|
| 94 |
}
|
| 95 |
+
}
|
| 96 |
+
});
|
| 97 |
+
}
|
| 98 |
+
function start()
|
| 99 |
+
{
|
| 100 |
+
new Ajax.Request(urls.prepare.start, {
|
| 101 |
+
method: 'get',
|
| 102 |
+
onCreate : function ()
|
| 103 |
+
{
|
| 104 |
+
// ;
|
| 105 |
+
},
|
| 106 |
+
onComplete: function (transport) {
|
| 107 |
+
/*
|
| 108 |
+
* Sync Completes
|
| 109 |
+
*/
|
| 110 |
+
data = JSON.parse(transport.responseText);
|
| 111 |
+
styleBar(data);
|
| 112 |
+
setUpdate(data);
|
| 113 |
if(data.status.current != data.status.total)
|
| 114 |
{
|
| 115 |
start();
|
| 121 |
}
|
| 122 |
});
|
| 123 |
}
|
| 124 |
+
function setUpdate (data) {
|
| 125 |
+
if(data.status.code == 3)
|
| 126 |
+
{
|
| 127 |
+
logger.insert("<li><strong>Syncronization is done</strong></li><li><a href='JavaScript:window.close()'>close window</a></li>");
|
| 128 |
+
return;
|
| 129 |
+
}
|
| 130 |
+
if(data.status.code == 4)
|
| 131 |
+
{
|
| 132 |
+
logger.insert("<li><strong>"+data.status.text+" <a href='"+data.status.link+"'><b>upgrade</b></a></strong></li><li><a href='JavaScript:window.close()'>close window</a></li>");
|
| 133 |
+
return;
|
| 134 |
+
}
|
| 135 |
+
if(!$$("ul.logger li.productCount")[0])
|
| 136 |
+
{
|
| 137 |
+
$$("ul.logger")[0].insert("<li class='productCount'><strong><span>"+data.status.current+"/"+data.status.total+"</span> Product has been processes </strong></li>");
|
| 138 |
+
}
|
| 139 |
+
else
|
| 140 |
+
{
|
| 141 |
+
$$("ul.logger li.productCount span")[0].update(data.status.current+"/"+data.status.total);
|
| 142 |
+
return true;
|
| 143 |
+
}
|
| 144 |
+
return false;
|
| 145 |
+
}
|
| 146 |
+
function styleBar (data) {
|
| 147 |
+
|
| 148 |
+
percentage = Math.ceil((data.status.current/data.status.total)*100);
|
| 149 |
+
styler.call(this,($$("div.sync-bar")[0]),{width:percentage + "%"});
|
| 150 |
+
styler.call(this,($$("div.sync-status")[0]),{marginLeft: percentage+"%"});
|
| 151 |
+
$$("div.sync-status b")[0].update(Math.ceil((data.status.current/data.status.total)*100)+"%");
|
| 152 |
+
|
| 153 |
+
}
|
| 154 |
+
init();
|
| 155 |
|
| 156 |
</script>
|
package.xml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
| 1 |
<?xml version="1.0"?>
|
| 2 |
<package>
|
| 3 |
<name>Xrely_Autocomplete</name>
|
| 4 |
-
<version>1.0.
|
| 5 |
<stability>stable</stability>
|
| 6 |
<license uri="http://opensource.org/licenses/mit-license.php">MITL</license>
|
| 7 |
<channel>community</channel>
|
|
@@ -10,9 +10,9 @@
|
|
| 10 |
<description>Xrely Autocomplete</description>
|
| 11 |
<notes>API URL update.</notes>
|
| 12 |
<authors><author><name>Jugal</name><user>jugal4343</user><email>jugal@xrely.com</email></author></authors>
|
| 13 |
-
<date>
|
| 14 |
-
<time>
|
| 15 |
-
<contents><target name="magecommunity"><dir name="Xrely"><dir name="Autocomplete"><dir name="Block"><dir name="Adminhtml"><file name="Design.php" hash="958be5829c6267e5132921a304c41cfa"/><file name="Notifications.php" hash="1dcbbd1610b3c510806a56f4d2c771f4"/><file name="Progress.php" hash="17f43ab2159894b64c192ca44b8ee749"/><file name="Redirect.php" hash="14bbb1d6d6fabed9758e22ee0b3eb498"/><file name="Syncbtn.php" hash="e02efc91a9e5d6e4fa688c3cbf19d991"/><file name="Thumb.php" hash="9fb6939e7299ed56253836c63054d0f7"/><file name="Upgrade.php" hash="cdc090fb56dc0a77776bfefad641b785"/></dir><file name="Js.php" hash="34eef2d142a53c3719ec4d04f7fd2fc6"/><file name="Sync.php" hash="63fef0ebe3312a69525d2908b48f70b9"/></dir><dir name="Helper"><file name="Data.php" hash="dda83388b6543b60214d830799ec00b6"/></dir><dir name="Model"><dir name="Adminhtml"><file name="Thumb.php" hash="fe325ff721c9138d4afbe6d231d9347e"/></dir><file name="Observer.php" hash="c051fe823adcdc45cf0d4d39cf20f4ac"/><dir name="Resource"><dir name="Settings"><file name="Collection.php" hash="08356fd322c09e673bde0efcbb8ca9af"/></dir><file name="Settings.php" hash="03e4e14935ba8d81c324a4c2fbe9fc77"/></dir><file name="Settings.php" hash="
|
| 16 |
<compatible/>
|
| 17 |
<dependencies><required><php><min>5.0.0</min><max>6.0.0</max></php></required></dependencies>
|
| 18 |
</package>
|
| 1 |
<?xml version="1.0"?>
|
| 2 |
<package>
|
| 3 |
<name>Xrely_Autocomplete</name>
|
| 4 |
+
<version>1.0.2</version>
|
| 5 |
<stability>stable</stability>
|
| 6 |
<license uri="http://opensource.org/licenses/mit-license.php">MITL</license>
|
| 7 |
<channel>community</channel>
|
| 10 |
<description>Xrely Autocomplete</description>
|
| 11 |
<notes>API URL update.</notes>
|
| 12 |
<authors><author><name>Jugal</name><user>jugal4343</user><email>jugal@xrely.com</email></author></authors>
|
| 13 |
+
<date>2016-03-22</date>
|
| 14 |
+
<time>19:37:48</time>
|
| 15 |
+
<contents><target name="magecommunity"><dir name="Xrely"><dir name="Autocomplete"><dir name="Block"><dir name="Adminhtml"><file name="Design.php" hash="958be5829c6267e5132921a304c41cfa"/><file name="Notifications.php" hash="1dcbbd1610b3c510806a56f4d2c771f4"/><file name="Progress.php" hash="17f43ab2159894b64c192ca44b8ee749"/><file name="Redirect.php" hash="14bbb1d6d6fabed9758e22ee0b3eb498"/><file name="Syncbtn.php" hash="e02efc91a9e5d6e4fa688c3cbf19d991"/><file name="Thumb.php" hash="9fb6939e7299ed56253836c63054d0f7"/><file name="Upgrade.php" hash="cdc090fb56dc0a77776bfefad641b785"/></dir><file name="Js.php" hash="34eef2d142a53c3719ec4d04f7fd2fc6"/><file name="Sync.php" hash="63fef0ebe3312a69525d2908b48f70b9"/></dir><dir name="Helper"><file name="Data.php" hash="dda83388b6543b60214d830799ec00b6"/></dir><dir name="Model"><dir name="Adminhtml"><file name="Thumb.php" hash="fe325ff721c9138d4afbe6d231d9347e"/></dir><file name="Observer.php" hash="c051fe823adcdc45cf0d4d39cf20f4ac"/><dir name="Resource"><dir name="Settings"><file name="Collection.php" hash="08356fd322c09e673bde0efcbb8ca9af"/></dir><file name="Settings.php" hash="03e4e14935ba8d81c324a4c2fbe9fc77"/></dir><file name="Settings.php" hash="382c8bfeabad9600c98e042cbfb722dc"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="PublishController.php" hash="8799bdac49e5f121477c38b553d09135"/><file name="RedirectController.php" hash="e2cfebffb4e1d776886b2dd165778c67"/></dir><file name="ListenController.php" hash="569e4420bd9f83cacdeb60ddbe8e4666"/></dir><dir name="data"><dir name="xrely_autocomplete_setup"><file name="data-install-1.0.0.0.php" hash="5b7152cfaca84e5f6d61f16340a8953a"/></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="6ede1531da8ecaf2be33fa2a56e3d1d4"/><file name="config.xml" hash="16a19107d044feade470ea55c4fbbb02"/><file name="system.xml" hash="0ab99a205e49e1ad0844d67a9c03b4e7"/></dir><dir name="sql"><dir name="xrely_autocomplete_setup"><file name="install-1.0.0.0.php" hash="f73139cbdd14add1264db405425fe841"/></dir></dir></dir></dir></target><target name="mageweb"><dir name="."><dir name="js"><dir name="xrely_autocomplete"><file name="admin.js" hash="635f3d1a915a6a5521db2992a20ac7ce"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Xrely_Autocomplete.xml" hash="c114c9109d18628e9afb8c04c1776ee1"/></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="xrely_autocomplete.xml" hash="9a34dc0c48f6d3e39888aebd72ab573c"/></dir><dir name="template"><dir name="xrely_autocomplete"><file name="notification.phtml" hash="849b047815142a22b5254467188a7462"/><file name="progress.phtml" hash="f16f659d571da65e6770620a2fa25351"/></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="xrely_autocomplete.xml" hash="95dd91d0e1f3a624e2cd00db890c1a8a"/></dir><dir name="template"><dir name="autocomplete"><file name="js.phtml" hash="9f45aa72565bfbaa0b48e6bceddba71d"/><file name="post_redirect.phtml" hash="da2a203dca5e777d2b2c2fc3553c3d2f"/></dir></dir></dir></dir></dir></target></contents>
|
| 16 |
<compatible/>
|
| 17 |
<dependencies><required><php><min>5.0.0</min><max>6.0.0</max></php></required></dependencies>
|
| 18 |
</package>
|
