Version Notes
Pagination in following:
* sales_order.search
* ol_catalog_product.search
Download this release
Release Info
Developer | Sharoon Thomas |
Extension | Openlabs_OpenERPConnector |
Version | 1.6.0 |
Comparing to | |
See all releases |
Code changes from version 1.5.0 to 1.6.0
app/code/community/Openlabs/OpenERPConnector/Model/Sales/Order/Api.php
CHANGED
@@ -24,9 +24,15 @@ class Openlabs_OpenERPConnector_Model_Sales_Order_Api extends Mage_Sales_Model_O
|
|
24 |
$collection = Mage::getModel("sales/order")->getCollection()
|
25 |
->addAttributeToSelect('increment_id')
|
26 |
->addAttributeToFilter('imported', array('eq' => $data['imported']));
|
|
|
|
|
|
|
|
|
|
|
27 |
|
28 |
if(isset($data['limit'])) {
|
29 |
$collection->setPageSize($data['limit']);
|
|
|
30 |
$collection->setOrder('entity_id', 'ASC');
|
31 |
}
|
32 |
|
@@ -36,9 +42,22 @@ class Openlabs_OpenERPConnector_Model_Sales_Order_Api extends Mage_Sales_Model_O
|
|
36 |
$collection->addAttributeToFilter($field, $value);
|
37 |
}
|
38 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
39 |
|
40 |
foreach ($collection as $order) {
|
41 |
-
$
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
42 |
}
|
43 |
|
44 |
return $result;
|
24 |
$collection = Mage::getModel("sales/order")->getCollection()
|
25 |
->addAttributeToSelect('increment_id')
|
26 |
->addAttributeToFilter('imported', array('eq' => $data['imported']));
|
27 |
+
if(isset($data['fields']) && is_array($data['fields'])) {
|
28 |
+
foreach($data['fields'] as $field) {
|
29 |
+
$collection->addAttributeToSelect($field);
|
30 |
+
}
|
31 |
+
}
|
32 |
|
33 |
if(isset($data['limit'])) {
|
34 |
$collection->setPageSize($data['limit']);
|
35 |
+
$collection->setCurPage($data['page']);
|
36 |
$collection->setOrder('entity_id', 'ASC');
|
37 |
}
|
38 |
|
42 |
$collection->addAttributeToFilter($field, $value);
|
43 |
}
|
44 |
}
|
45 |
+
$result['perPage'] = $collection->getPageSize();
|
46 |
+
$result['totalCount'] = $collection->getSize();
|
47 |
+
$result['page'] = $collection->getCurPage();
|
48 |
+
$result['hasNext'] = $collection->getLastPageNumber() > $collection->getCurPage();
|
49 |
+
$result['lastPage'] = intval($collection->getLastPageNumber());
|
50 |
+
$result['items'] = array();
|
51 |
|
52 |
foreach ($collection as $order) {
|
53 |
+
$res = array();
|
54 |
+
$res['increment_id'] = $order['increment_id'];
|
55 |
+
if(isset($data['fields']) && is_array($data['fields'])) {
|
56 |
+
foreach($data['fields'] as $field) {
|
57 |
+
$res[$field] = $order[$field];
|
58 |
+
}
|
59 |
+
}
|
60 |
+
$result['items'][] = $res;
|
61 |
}
|
62 |
|
63 |
return $result;
|
package.xml
CHANGED
@@ -1,18 +1,20 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Openlabs_OpenERPConnector</name>
|
4 |
-
<version>1.
|
5 |
<stability>stable</stability>
|
6 |
<license>GPL</license>
|
7 |
<channel>community</channel>
|
8 |
<extends/>
|
9 |
<summary>Magento core API extension for multi website Open ERP connector by Openlabs</summary>
|
10 |
<description>This magento extension, by Openlabs, provides additional API methods for use by the Multi website, Multi Store, Multi Product category synchronization connector.</description>
|
11 |
-
<notes>
|
|
|
|
|
12 |
<authors><author><name>Sharoon Thomas</name><user>sharoonthomas</user><email>sharoon.thomas@openlabs.co.in</email></author><author><name>Shalabh Aggarwal</name><user>shalabhaggarwal</user><email>shalabh.aggarwal@openlabs.co.in</email></author><author><name>Tarun Bhardwaj</name><user>tarunbhardwaj</user><email>tarun.bhardwaj@openlabs.co.in</email></author></authors>
|
13 |
-
<date>2015-
|
14 |
-
<time>
|
15 |
-
<contents><target name="magecommunity"><dir name="Openlabs"><dir name="OpenERPConnector"><dir name="Helper"><file name="Data.php" hash="d6d1ba003a7e1829e80e8692992866f7"/></dir><dir name="Model"><dir name="Catalog"><dir name="Product"><file name="Api.php" hash="e5f24f16a927f88e1b295fac284a15f4"/></dir></dir><file name="Observer.php" hash="b5560fbef16fa606631cc63e3facc18e"/><dir name="Oerpcatalog"><dir name="Category"><file name="Api.php" hash="6bb5d4c85aa902d5e5622d134e701dc8"/></dir></dir><dir name="Oerpstock"><dir name="Item"><file name="Api.php" hash="9f670a819761d7df761ab652ec54d87f"/></dir></dir><dir name="Olcatalog"><file name="Categories.php" hash="f32d484e6b19ffffcb8cf4a9a0b2d6aa"/><dir name="Product"><file name="Attribute.php" hash="4b42d7383df615b39e4f32b60a7b10ae"/><file name="Attributegroup.php" hash="1da056b3e29dd6a9c39b9a8eb2e2f35f"/><file name="Attributeset.php" hash="6d6cf53a5caa826b02477a2e6df99bac"/><file name="Link.php" hash="d76025645a95690073ab05e78f6ef3b8"/><file name="Tierprice.php" hash="6e98518a51288820a2a84c5bbc5f701c"/></dir><file name="Products.php" hash="f28bca52102ca505a92bd77888c76930"/></dir><dir name="Olcore"><file name="Groups.php" hash="a8cb32a7ee82ae2e90acdc5b74e7045e"/><file name="Storeviews.php" hash="da8507a0557f086f15bb5117fc51794c"/><file name="Website.php" hash="eaad7c9d2df3dcd0b4b43b7cfb6278c7"/></dir><dir name="Olcustomer"><file name="Address.php" hash="c73dcbf74304507beb524a714a5b1f38"/><file name="Customer.php" hash="d92d4a07f857355e4585fed88582b5a0"/><file name="Group.php" hash="f58c02cc27df40074231b37fd17f163a"/><file name="Subscriber.php" hash="0c67a5cff9808b66343e0c6889015b4f"/></dir><dir name="Sales"><dir name="Order"><file name="Api.php" hash="
|
16 |
<compatible/>
|
17 |
<dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
|
18 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Openlabs_OpenERPConnector</name>
|
4 |
+
<version>1.6.0</version>
|
5 |
<stability>stable</stability>
|
6 |
<license>GPL</license>
|
7 |
<channel>community</channel>
|
8 |
<extends/>
|
9 |
<summary>Magento core API extension for multi website Open ERP connector by Openlabs</summary>
|
10 |
<description>This magento extension, by Openlabs, provides additional API methods for use by the Multi website, Multi Store, Multi Product category synchronization connector.</description>
|
11 |
+
<notes>Pagination in following:
|
12 |
+
* sales_order.search
|
13 |
+
* ol_catalog_product.search</notes>
|
14 |
<authors><author><name>Sharoon Thomas</name><user>sharoonthomas</user><email>sharoon.thomas@openlabs.co.in</email></author><author><name>Shalabh Aggarwal</name><user>shalabhaggarwal</user><email>shalabh.aggarwal@openlabs.co.in</email></author><author><name>Tarun Bhardwaj</name><user>tarunbhardwaj</user><email>tarun.bhardwaj@openlabs.co.in</email></author></authors>
|
15 |
+
<date>2015-05-15</date>
|
16 |
+
<time>17:24:35</time>
|
17 |
+
<contents><target name="magecommunity"><dir name="Openlabs"><dir name="OpenERPConnector"><dir name="Helper"><file name="Data.php" hash="d6d1ba003a7e1829e80e8692992866f7"/></dir><dir name="Model"><dir name="Catalog"><dir name="Product"><file name="Api.php" hash="e5f24f16a927f88e1b295fac284a15f4"/></dir></dir><file name="Observer.php" hash="b5560fbef16fa606631cc63e3facc18e"/><dir name="Oerpcatalog"><dir name="Category"><file name="Api.php" hash="6bb5d4c85aa902d5e5622d134e701dc8"/></dir></dir><dir name="Oerpstock"><dir name="Item"><file name="Api.php" hash="9f670a819761d7df761ab652ec54d87f"/></dir></dir><dir name="Olcatalog"><file name="Categories.php" hash="f32d484e6b19ffffcb8cf4a9a0b2d6aa"/><dir name="Product"><file name="Attribute.php" hash="4b42d7383df615b39e4f32b60a7b10ae"/><file name="Attributegroup.php" hash="1da056b3e29dd6a9c39b9a8eb2e2f35f"/><file name="Attributeset.php" hash="6d6cf53a5caa826b02477a2e6df99bac"/><file name="Link.php" hash="d76025645a95690073ab05e78f6ef3b8"/><file name="Tierprice.php" hash="6e98518a51288820a2a84c5bbc5f701c"/></dir><file name="Products.php" hash="f28bca52102ca505a92bd77888c76930"/></dir><dir name="Olcore"><file name="Groups.php" hash="a8cb32a7ee82ae2e90acdc5b74e7045e"/><file name="Storeviews.php" hash="da8507a0557f086f15bb5117fc51794c"/><file name="Website.php" hash="eaad7c9d2df3dcd0b4b43b7cfb6278c7"/></dir><dir name="Olcustomer"><file name="Address.php" hash="c73dcbf74304507beb524a714a5b1f38"/><file name="Customer.php" hash="d92d4a07f857355e4585fed88582b5a0"/><file name="Group.php" hash="f58c02cc27df40074231b37fd17f163a"/><file name="Subscriber.php" hash="0c67a5cff9808b66343e0c6889015b4f"/></dir><dir name="Sales"><dir name="Order"><file name="Api.php" hash="82daadad10adb6a0f13df2dd5f205855"/></dir></dir></dir><dir name="controllers"><dir name="Adminhtml"><file name="InitController.php" hash="3a38633c8dade14429cec867ec2635db"/></dir><file name="OpenerpconnectorController.php" hash="de2872248abdeafaab32518fe5ea687f"/></dir><dir name="etc"><file name="api.xml" hash="e31a5004c9046dd22148a065d8b8dad6"/><file name="config.xml" hash="97905b82822a4a88a4e65a155d8a2917"/></dir><dir name="sql"><dir name="openerpconnector_setup"><file name="mysql4-install-0.0.1.php" hash="111c7d4be6cf7a2f8b8b58de6d360bfe"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Openlabs_OpenERPConnector.xml" hash="1887ddfb260c7bfc18ea5ad1c9fa6481"/></dir></target></contents>
|
18 |
<compatible/>
|
19 |
<dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
|
20 |
</package>
|