NewHavenSoftware_CMSAPI - Version 9.0.1.13

Version Notes

9.0.1.13 02/03/2015

Updated configuration display. Added the current website id and the store view id to the configuration page

9.0.1.12 01/20/2014

Updated Saved CC support. Added framework for storing extension data in the Magento database. Deprecated the cmsapiCustomFields method. Added the cmsapiCustomFieldsObject method for more advanced usage of custom field data and nested arrays

9.0.1.11 01/08/2014

Updated custom fields to better support 3rd party classes. The third party class needs to support the info method accepting an order increment id as the only parameter

Download this release

Release Info

Developer Jason Morrison
Extension NewHavenSoftware_CMSAPI
Version 9.0.1.13
Comparing to
See all releases


Code changes from version 9.0.1.12 to 9.0.1.13

app/code/community/NewHavenSoftware/CMSAPI/Model/Formdata/Storeviewid.php ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class NewHavenSoftware_CMSAPI_Model_FormData_Storeviewid extends Mage_Core_Model_Config_Data {
3
+ public function _afterLoad() {
4
+ $_storeCode = $this->getStore();
5
+ $_websiteCode = $this->getWebsite();
6
+ $_storeId = 0;
7
+
8
+ if (strlen($_storeCode)) {
9
+ $_storeId = Mage::getModel('core/store')->load($_storeCode)->getId();
10
+ } else {
11
+ if (strlen($_websiteCode)) {
12
+ $_id = Mage::getModel('core/website')->load($_websiteCode)->getId();
13
+ $_storeId = Mage::app()->getWebsite($_id)->getDefaultStore()->getId();
14
+ }
15
+ }
16
+
17
+ $this->setValue($_storeId);
18
+
19
+ return $this;
20
+ }
21
+ }
app/code/community/NewHavenSoftware/CMSAPI/Model/Formdata/Websiteid.php ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class NewHavenSoftware_CMSAPI_Model_FormData_Websiteid extends Mage_Core_Model_Config_Data {
3
+ public function _afterLoad() {
4
+ $_storeCode = $this->getStore();
5
+ $_websiteCode = $this->getWebsite();
6
+ $_id = 0;
7
+
8
+ if (strlen($_storeCode)) {
9
+ $_storeId = Mage::getModel('core/store')->load($_storeCode)->getId();
10
+ $_id = Mage::app()->getStore($_storeId)->getWebsiteId();
11
+ } elseif (strlen($_websiteCode)) {
12
+ $_id = Mage::getModel('core/website')->load($_websiteCode)->getId();
13
+ }
14
+
15
+ $this->setValue($_id);
16
+
17
+ return $this;
18
+ }
19
+ }
app/code/community/NewHavenSoftware/CMSAPI/Model/Resource/General/Setup.php ADDED
@@ -0,0 +1,4 @@
 
 
 
 
1
+ <?php
2
+ class NewHavenSoftware_CMSAPI_Model_Resource_General_Setup extends Mage_Core_Model_Resource_Setup {
3
+
4
+ }
app/code/community/NewHavenSoftware/CMSAPI/Model/Sales/Order/Invoice/Api/V2.php ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class NewHavenSoftware_CMSAPI_Model_Sales_Order_Invoice_Api_V2 extends Mage_Sales_Model_Order_Invoice_Api_V2 {
3
+ public function items($filters = null) {
4
+ $result = parent::items($filters);
5
+
6
+ // populate the order_increment_id to avoid an external api call to info
7
+ foreach($result as $key => $item) {
8
+ $_info = parent::info($item['increment_id']);
9
+ $result[$key]['order_increment_id'] = $_info['order_increment_id'];
10
+ }
11
+ return $result;
12
+ }
13
+ }
app/code/community/NewHavenSoftware/CMSAPI/etc/api.xml CHANGED
@@ -64,6 +64,18 @@
64
  </info>
65
  </methods>
66
  </cmsapi_sales_order>
 
 
 
 
 
 
 
 
 
 
 
 
67
  <cmsapi_catalog_product translate="title" module="cmsapi">
68
  <model>cmsapi/catalog_product_api</model>
69
  <acl>catalog/product</acl>
64
  </info>
65
  </methods>
66
  </cmsapi_sales_order>
67
+ <cmsapi_sales_order_invoice translate="title" module="cmsapi">
68
+ <model>cmsapi/sales_order_invoice_api</model>
69
+ <acl>sales/order/invoice</acl>
70
+ <title>Order Invoice API</title>
71
+ <methods>
72
+ <list translate="title" module="sales">
73
+ <title>Retrieve list of invoices by filters</title>
74
+ <method>items</method>
75
+ <acl>sales/order/invoice/info</acl>
76
+ </list>
77
+ </methods>
78
+ </cmsapi_sales_order_invoice>
79
  <cmsapi_catalog_product translate="title" module="cmsapi">
80
  <model>cmsapi/catalog_product_api</model>
81
  <acl>catalog/product</acl>
app/code/community/NewHavenSoftware/CMSAPI/etc/config.xml CHANGED
@@ -1,9 +1,18 @@
1
  <?xml version="1.0"?>
2
 
3
  <config>
 
 
 
 
 
 
 
 
 
4
  <modules>
5
  <NewHavenSoftware_CMSAPI>
6
- <version>9.0.1.12</version>
7
  </NewHavenSoftware_CMSAPI>
8
  </modules>
9
  <adminhtml>
@@ -50,6 +59,9 @@
50
  <rewrite>
51
  <order_api_v2>NewHavenSoftware_CMSAPI_Model_Sales_Order_Api_V2</order_api_v2>
52
  </rewrite>
 
 
 
53
  </sales>
54
  <payment>
55
  <rewrite>
1
  <?xml version="1.0"?>
2
 
3
  <config>
4
+ <!-- example default section
5
+ <default>
6
+ <cmsapi>
7
+ <information>
8
+ <websiteid>default value</websiteid>
9
+ </information>
10
+ </cmsapi>
11
+ </default>
12
+ -->
13
  <modules>
14
  <NewHavenSoftware_CMSAPI>
15
+ <version>9.0.1.13</version>
16
  </NewHavenSoftware_CMSAPI>
17
  </modules>
18
  <adminhtml>
59
  <rewrite>
60
  <order_api_v2>NewHavenSoftware_CMSAPI_Model_Sales_Order_Api_V2</order_api_v2>
61
  </rewrite>
62
+ <rewrite>
63
+ <order_invoice_api_v2>NewHavenSoftware_CMSAPI_Model_Sales_Order_Invoice_Api_V2</order_invoice_api_v2>
64
+ </rewrite>
65
  </sales>
66
  <payment>
67
  <rewrite>
app/code/community/NewHavenSoftware/CMSAPI/etc/system.xml CHANGED
@@ -28,6 +28,35 @@
28
  </customfields>
29
  </fields>
30
  </config>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
31
  </groups>
32
  </cmsapi>
33
  </sections>
28
  </customfields>
29
  </fields>
30
  </config>
31
+ <information translate="label">
32
+ <label>Website and Store View Data</label>
33
+ <frontend_type>text</frontend_type>
34
+ <expanded>1</expanded>
35
+ <sort_order>2</sort_order>
36
+ <show_in_default>1</show_in_default>
37
+ <show_in_website>1</show_in_website>
38
+ <show_in_store>1</show_in_store>
39
+ <fields>
40
+ <websiteid translate="label">
41
+ <label>Website ID:</label>
42
+ <frontend_type>label</frontend_type>
43
+ <backend_model>cmsapi/formdata_websiteid</backend_model>
44
+ <sort_order>1</sort_order>
45
+ <show_in_default>1</show_in_default>
46
+ <show_in_website>1</show_in_website>
47
+ <show_in_store>1</show_in_store>
48
+ </websiteid>
49
+ <storeview translate="label">
50
+ <label>Store View ID:</label>
51
+ <frontend_type>label</frontend_type>
52
+ <backend_model>cmsapi/formdata_Storeviewid</backend_model>
53
+ <sort_order>2</sort_order>
54
+ <show_in_default>1</show_in_default>
55
+ <show_in_website>1</show_in_website>
56
+ <show_in_store>1</show_in_store>
57
+ </storeview>
58
+ </fields>
59
+ </information>
60
  </groups>
61
  </cmsapi>
62
  </sections>
app/code/community/NewHavenSoftware/CMSAPI/sql/cmsapi_setup/general-install-9.0.1.9.php ADDED
@@ -0,0 +1,2 @@
 
 
1
+ <?php
2
+ $installer = $this;
package.xml CHANGED
@@ -1,7 +1,7 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>NewHavenSoftware_CMSAPI</name>
4
- <version>9.0.1.12</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/osl-3.0.php">OSL v3.0</license>
7
  <channel>community</channel>
@@ -11,26 +11,25 @@
11
  &#xD;
12
  Adds the following to the v2 API:&#xD;
13
  &lt;ol&gt;&lt;ul&gt;&lt;strong&gt;cmsapiChecknhsInstalled:&lt;/strong&gt; To verify this extension has been added to the API&lt;/ul&gt;&#xD;
14
- &lt;ul&gt;&lt;strong&gt;cmsapiCustomFieldsObject:&lt;/strong&gt; This API call is used to get order level data based on the fields entered in System Configuration that may not be published in the v2 API. This function returns an object array of key value pairs.&lt;/ul&gt;&#xD;
15
- &lt;ul&gt;&lt;strong&gt;cmsapiCustomPayment:&lt;/strong&gt; This API call allows CMS to pull in payments that are using the Saved CC payment method&lt;/ul&gt;&#xD;
16
- &lt;ul&gt;&lt;strong&gt;cmsapiGiftMessageInfo:&lt;/strong&gt; This API call is used to gain access to the "To" and "From" fields used in gift messages&lt;/ul&gt;&#xD;
17
  &lt;ul&gt;Extend &lt;strong&gt;catalogProductCreate:&lt;/strong&gt; to allow the passing of additional productdata fields: configurable_products and configurable_attributes (structure documented in the wsdl) &lt;/ul&gt;&#xD;
18
  &lt;ul&gt;Extend &lt;strong&gt;salesProductInfo:&lt;/strong&gt; for items the product_options property was changed to json (from serialized php). This is required for downloading orders containing configurable products&lt;/ul&gt;&#xD;
19
  &lt;/ol&gt;&#xD;
20
  &#xD;
21
- This extension is recommended for integration with the CMS eCMS module.&lt;br /&gt;&lt;br /&gt;</description>
22
- <notes>&lt;strong&gt;9.0.1.12&lt;/strong&gt; 01/20/2014&lt;br /&gt;&#xD;
23
- Updated Saved CC support. Added framework for storing extension data in the Magento database. Depricated the cmsapiCustomFields method. Added the cmsapiCustomFieldsObject method for more advanced usage of custom field data and nested arrays&lt;br /&gt;&lt;br /&gt;&#xD;
24
  &#xD;
25
- &lt;strong&gt;9.0.1.11&lt;/strong&gt; 01/08/2014&lt;br /&gt;&#xD;
26
- Updated custom fields to better support 3rd party classes. The third party class needs to support the info method accepting an order increment id as the only parameter&lt;br /&gt;&lt;br /&gt;&#xD;
27
  &#xD;
28
- &lt;strong&gt;9.0.1.10&lt;/strong&gt; 11/12/2013&lt;br /&gt;&#xD;
29
- Updated support for size and color products. This update is required for any size and/or color products. Also in this version is a fix for blank screens or errors when attempting to configure roles. &lt;br /&gt;&lt;br /&gt;</notes>
30
  <authors><author><name>Jason Morrison</name><user>nhsjason</user><email>jmorrison@newhavensoftware.com</email></author></authors>
31
- <date>2014-08-28</date>
32
- <time>18:22:05</time>
33
- <contents><target name="magecommunity"><dir name="NewHavenSoftware"><dir name="CMSAPI"><dir name="Helper"><file name="Data.php" hash="c0802d9a61543d36c4afea5a24038e99"/></dir><dir name="Model"><dir name="Catalog"><dir name="Product"><dir name="Api"><file name="V2.php" hash="4bb4f10d96309b7adcf6f5e3cadb0450"/></dir></dir></dir><dir name="Check"><dir name="Api"><file name="V2.php" hash="f589ff6d45ee96855afe53461092813e"/></dir></dir><dir name="Custom"><dir name="Api"><file name="V2.php" hash="9fc895c87b6d6f66859d2de0528c778e"/></dir></dir><dir name="Gift"><dir name="Message"><dir name="Api"><file name="V2.php" hash="0a5ffdd3fc3760b311970169858d5475"/></dir></dir></dir><file name="Observer.php" hash="e0dd0d6633c7444e92c0caaed3228ff4"/><dir name="Payment"><dir name="Method"><file name="Ccsave.php" hash="45b452bb026658506b26645b1b0c0cec"/></dir></dir><file name="Queue.php" hash="5a0e876dbd9aff660a9bc1fc83c1ce1a"/><dir name="Resource"><file name="Queue.php" hash="92f454caba9979af5e61eedbf4524cf4"/><file name="Setup.php" hash="42c3233e31ecd255e117d1781d9ed08d"/></dir><dir name="Sales"><dir name="Order"><dir name="Api"><file name="V2.php" hash="86bbc553d3784a7afe4810af21e6a709"/></dir></dir></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="ba4c36dbd3d346c3561fb5822d5fd3b4"/><file name="api.xml" hash="b85ff9958eaa56058461773b619274c1"/><file name="config.xml" hash="1c4f081cef3b8a0d78eaafcf39345c29"/><file name="system.xml" hash="3e71dda77aa28dd02afc40816ecd908e"/><file name="wsdl.xml" hash="a22c14c3adf8405c96ce53dbbfc7332c"/></dir><dir name="sql"><dir name="cmsapi_setup"><file name="install-9.0.1.12.php" hash="0c411170976bee3cabda7c3699588505"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="NewHavenSoftware_CMSAPI.xml" hash="4c5fe5d61b389c00a8e54970a29017a0"/></dir></target></contents>
34
  <compatible/>
35
- <dependencies><required><php><min>5.1.0</min><max>5.5.6</max></php></required></dependencies>
36
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>NewHavenSoftware_CMSAPI</name>
4
+ <version>9.0.1.13</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/osl-3.0.php">OSL v3.0</license>
7
  <channel>community</channel>
11
  &#xD;
12
  Adds the following to the v2 API:&#xD;
13
  &lt;ol&gt;&lt;ul&gt;&lt;strong&gt;cmsapiChecknhsInstalled:&lt;/strong&gt; To verify this extension has been added to the API&lt;/ul&gt;&#xD;
14
+ &lt;ul&gt;&lt;strong&gt;cmsapiCustomFields:&lt;/strong&gt; This API call is used to get order level data based on the fields entered in System Configuration that may not be published in the v2 API&lt;/ul&gt;&#xD;
15
+ &lt;ul&gt;&lt;strong&gt;cmsapiGiftMessageInfo:&lt;/strong&gt; This API call is used to gain access to the &amp;quot;To&amp;quot; and &amp;quot;From&amp;quot; fields used in gift messages&lt;/ul&gt;&#xD;
 
16
  &lt;ul&gt;Extend &lt;strong&gt;catalogProductCreate:&lt;/strong&gt; to allow the passing of additional productdata fields: configurable_products and configurable_attributes (structure documented in the wsdl) &lt;/ul&gt;&#xD;
17
  &lt;ul&gt;Extend &lt;strong&gt;salesProductInfo:&lt;/strong&gt; for items the product_options property was changed to json (from serialized php). This is required for downloading orders containing configurable products&lt;/ul&gt;&#xD;
18
  &lt;/ol&gt;&#xD;
19
  &#xD;
20
+ This extension is required for integration with the CMS eCMS module.&lt;br /&gt;&lt;br /&gt;</description>
21
+ <notes>&lt;strong&gt;9.0.1.13&lt;/strong&gt; 02/03/2015&lt;br /&gt;&#xD;
22
+ Updated configuration display. Added the current website id and the store view id to the configuration page&lt;br /&gt;&lt;br /&gt;&#xD;
23
  &#xD;
24
+ &lt;strong&gt;9.0.1.12&lt;/strong&gt; 01/20/2014&lt;br /&gt;&#xD;
25
+ Updated Saved CC support. Added framework for storing extension data in the Magento database. Deprecated the cmsapiCustomFields method. Added the cmsapiCustomFieldsObject method for more advanced usage of custom field data and nested arrays&lt;br /&gt;&lt;br /&gt;&#xD;
26
  &#xD;
27
+ &lt;strong&gt;9.0.1.11&lt;/strong&gt; 01/08/2014&lt;br /&gt;&#xD;
28
+ Updated custom fields to better support 3rd party classes. The third party class needs to support the info method accepting an order increment id as the only parameter&lt;br /&gt;&lt;br /&gt;</notes>
29
  <authors><author><name>Jason Morrison</name><user>nhsjason</user><email>jmorrison@newhavensoftware.com</email></author></authors>
30
+ <date>2015-12-16</date>
31
+ <time>20:51:28</time>
32
+ <contents><target name="magecommunity"><dir name="NewHavenSoftware"><dir name="CMSAPI"><dir name="Helper"><file name="Data.php" hash="c0802d9a61543d36c4afea5a24038e99"/></dir><dir name="Model"><dir name="Catalog"><dir name="Product"><dir name="Api"><file name="V2.php" hash="4bb4f10d96309b7adcf6f5e3cadb0450"/></dir></dir></dir><dir name="Check"><dir name="Api"><file name="V2.php" hash="f589ff6d45ee96855afe53461092813e"/></dir></dir><dir name="Custom"><dir name="Api"><file name="V2.php" hash="9fc895c87b6d6f66859d2de0528c778e"/></dir></dir><dir name="Formdata"><file name="Storeviewid.php" hash="fa7b7a16d11f0d9428751f62a48ef065"/><file name="Websiteid.php" hash="b1c3f0b7b9f870b543ee4eace6e6e614"/></dir><dir name="Gift"><dir name="Message"><dir name="Api"><file name="V2.php" hash="0a5ffdd3fc3760b311970169858d5475"/></dir></dir></dir><file name="Observer.php" hash="e0dd0d6633c7444e92c0caaed3228ff4"/><dir name="Payment"><dir name="Method"><file name="Ccsave.php" hash="45b452bb026658506b26645b1b0c0cec"/></dir></dir><file name="Queue.php" hash="5a0e876dbd9aff660a9bc1fc83c1ce1a"/><dir name="Resource"><dir name="General"><file name="Setup.php" hash="2969c4fb3ceee1c2376712d5a069a89e"/></dir><file name="Queue.php" hash="92f454caba9979af5e61eedbf4524cf4"/><file name="Setup.php" hash="42c3233e31ecd255e117d1781d9ed08d"/></dir><dir name="Sales"><dir name="Order"><dir name="Api"><file name="V2.php" hash="86bbc553d3784a7afe4810af21e6a709"/></dir><dir name="Invoice"><dir name="Api"><file name="V2.php" hash="a42a96aacbbd4dd05612bf0db3eadfef"/></dir></dir></dir></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="ba4c36dbd3d346c3561fb5822d5fd3b4"/><file name="api.xml" hash="caf65d4c02a016341d693b8afe1a963d"/><file name="config.xml" hash="aaf69a44aa8211ad347d0a667058982c"/><file name="system.xml" hash="537b84688f4efb8625c249aa397e1930"/><file name="wsdl.xml" hash="a22c14c3adf8405c96ce53dbbfc7332c"/></dir><dir name="sql"><dir name="cmsapi_setup"><file name="general-install-9.0.1.9.php" hash="70bc17bb54c0be0b95f5974f700ef442"/><file name="install-9.0.1.12.php" hash="0c411170976bee3cabda7c3699588505"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="NewHavenSoftware_CMSAPI.xml" hash="4c5fe5d61b389c00a8e54970a29017a0"/></dir></target></contents>
33
  <compatible/>
34
+ <dependencies><required><php><min>5.2.0</min><max>7.0.0</max></php></required></dependencies>
35
  </package>