Version Notes
Fixed an issue with dates throwing errors
Download this release
Release Info
| Developer | Simon Cooper |
| Extension | Swift_Swiftplugin |
| Version | 1.4.5 |
| Comparing to | |
| See all releases | |
Code changes from version 1.4.4 to 1.4.5
- app/code/community/Swift/Swiftplugin/Block/Swiftblock.php +3 -1
- app/code/community/Swift/Swiftplugin/Model/Observer.php +7 -0
- app/code/community/Swift/Swiftplugin/controllers/OrdersController.php +1 -1
- app/code/community/Swift/Swiftplugin/etc/config.xml +1 -1
- lib/SwiftAPI/SwiftAPI.php +5 -38
- lib/SwiftAPI/SwiftAPI_Request.php +4 -1
- lib/SwiftAPI/SwiftAPI_Request_EmailPackage.php +12 -1
- lib/SwiftAPI/SwiftAPI_Request_Order.php +12 -6
- lib/SwiftAPI/SwiftAPI_Request_PastOrder.php +16 -10
- lib/SwiftAPI/SwiftAPI_Request_ViewMail.php +1 -4
- package.xml +5 -5
app/code/community/Swift/Swiftplugin/Block/Swiftblock.php
CHANGED
|
@@ -103,7 +103,7 @@ class Swift_Swiftplugin_Block_Swiftblock extends Mage_Core_Block_Template {
|
|
| 103 |
break;
|
| 104 |
case SwiftAPI::OPERATION_ORDER:
|
| 105 |
$data = $this->getOrderData();
|
| 106 |
-
$this->request = new SwiftAPI_Request_Order($domain, $user, $swiftEmail, $data['forename'], $data['surname'], $data['products'], $version);
|
| 107 |
break;
|
| 108 |
case SwiftAPI::OPERATION_SUBSCRIPTION:
|
| 109 |
$this->request = new SwiftAPI_Request_Subscription($domain, $user, $swiftEmail, $version);
|
|
@@ -153,6 +153,8 @@ class Swift_Swiftplugin_Block_Swiftblock extends Mage_Core_Block_Template {
|
|
| 153 |
*/
|
| 154 |
private function getOrderData() {
|
| 155 |
$data = array();
|
|
|
|
|
|
|
| 156 |
$data['forename'] = Mage::getSingleton('core/session')->getSwiftForename(true);
|
| 157 |
$data['surname'] = Mage::getSingleton('core/session')->getSwiftSurname(true);
|
| 158 |
$data['products'] = array();
|
| 103 |
break;
|
| 104 |
case SwiftAPI::OPERATION_ORDER:
|
| 105 |
$data = $this->getOrderData();
|
| 106 |
+
$this->request = new SwiftAPI_Request_Order($domain, $user, $swiftEmail, $data['forename'], $data['surname'], $data['products'], $data['order_id'], null, $version, $data['created']);
|
| 107 |
break;
|
| 108 |
case SwiftAPI::OPERATION_SUBSCRIPTION:
|
| 109 |
$this->request = new SwiftAPI_Request_Subscription($domain, $user, $swiftEmail, $version);
|
| 153 |
*/
|
| 154 |
private function getOrderData() {
|
| 155 |
$data = array();
|
| 156 |
+
$data['order_id'] = Mage::getSingleton('core/session')->getSwiftOrderId(true);
|
| 157 |
+
$data['created'] = Mage::getSingleton('core/session')->getSwiftOrderCreated(true);
|
| 158 |
$data['forename'] = Mage::getSingleton('core/session')->getSwiftForename(true);
|
| 159 |
$data['surname'] = Mage::getSingleton('core/session')->getSwiftSurname(true);
|
| 160 |
$data['products'] = array();
|
app/code/community/Swift/Swiftplugin/Model/Observer.php
CHANGED
|
@@ -61,12 +61,19 @@ class Swift_SwiftPlugin_Model_Observer
|
|
| 61 |
$event = $observer->getEvent();
|
| 62 |
if (!is_null($event)) {
|
| 63 |
$quote = $event->getQuote();
|
|
|
|
|
|
|
|
|
|
| 64 |
if (!is_null($quote)) {
|
| 65 |
// collect data about the order
|
| 66 |
$orderdata = $quote->getData();
|
|
|
|
|
|
|
| 67 |
$items = $quote->getAllVisibleItems();
|
| 68 |
// collect data about the orderer and assign them to session
|
| 69 |
Mage::getSingleton('core/session')->setProductOrderSuccessFlag(true);
|
|
|
|
|
|
|
| 70 |
Mage::getSingleton('core/session')->setSwiftForename($orderdata['customer_firstname']);
|
| 71 |
Mage::getSingleton('core/session')->setSwiftSurname($orderdata['customer_lastname']);
|
| 72 |
Mage::getSingleton('core/session')->setSwiftEmail($orderdata['customer_email']);
|
| 61 |
$event = $observer->getEvent();
|
| 62 |
if (!is_null($event)) {
|
| 63 |
$quote = $event->getQuote();
|
| 64 |
+
$order = $event->getOrder();
|
| 65 |
+
|
| 66 |
+
|
| 67 |
if (!is_null($quote)) {
|
| 68 |
// collect data about the order
|
| 69 |
$orderdata = $quote->getData();
|
| 70 |
+
$orderdata2 = $order->getData();
|
| 71 |
+
|
| 72 |
$items = $quote->getAllVisibleItems();
|
| 73 |
// collect data about the orderer and assign them to session
|
| 74 |
Mage::getSingleton('core/session')->setProductOrderSuccessFlag(true);
|
| 75 |
+
Mage::getSingleton('core/session')->setSwiftOrderId($orderdata2['entity_id']);
|
| 76 |
+
Mage::getSingleton('core/session')->setSwiftOrderCreated($orderdata['created_at']);
|
| 77 |
Mage::getSingleton('core/session')->setSwiftForename($orderdata['customer_firstname']);
|
| 78 |
Mage::getSingleton('core/session')->setSwiftSurname($orderdata['customer_lastname']);
|
| 79 |
Mage::getSingleton('core/session')->setSwiftEmail($orderdata['customer_email']);
|
app/code/community/Swift/Swiftplugin/controllers/OrdersController.php
CHANGED
|
@@ -42,7 +42,7 @@ class Swift_Swiftplugin_OrdersController extends Mage_Core_Controller_Front_Acti
|
|
| 42 |
foreach($visibleItems as $order_item_key => $orderItem) {
|
| 43 |
$products[] = array('product' => $orderItem->getId(), 'price' => $orderItem->getPrice(), 'quantity' => $orderItem->getData('qty_ordered'));
|
| 44 |
}
|
| 45 |
-
$request = new SwiftAPI_Request_PastOrder($domain, $user, $order->getCustomerEmail()
|
| 46 |
|
| 47 |
$options = array (
|
| 48 |
'http' => array(
|
| 42 |
foreach($visibleItems as $order_item_key => $orderItem) {
|
| 43 |
$products[] = array('product' => $orderItem->getId(), 'price' => $orderItem->getPrice(), 'quantity' => $orderItem->getData('qty_ordered'));
|
| 44 |
}
|
| 45 |
+
$request = new SwiftAPI_Request_PastOrder($domain, $user, $order->getCustomerEmail(), $order->getCustomerFirstname(), $order->getCustomerLastname(), $products, $order->getId(), null, null, $order->getCreatedAt());
|
| 46 |
|
| 47 |
$options = array (
|
| 48 |
'http' => array(
|
app/code/community/Swift/Swiftplugin/etc/config.xml
CHANGED
|
@@ -2,7 +2,7 @@
|
|
| 2 |
<config>
|
| 3 |
<modules>
|
| 4 |
<Swift_Swiftplugin>
|
| 5 |
-
<version>1.4.
|
| 6 |
</Swift_Swiftplugin>
|
| 7 |
</modules>
|
| 8 |
<frontend>
|
| 2 |
<config>
|
| 3 |
<modules>
|
| 4 |
<Swift_Swiftplugin>
|
| 5 |
+
<version>1.4.5</version>
|
| 6 |
</Swift_Swiftplugin>
|
| 7 |
</modules>
|
| 8 |
<frontend>
|
lib/SwiftAPI/SwiftAPI.php
CHANGED
|
@@ -11,7 +11,7 @@ class SwiftAPI
|
|
| 11 |
// Class constants.
|
| 12 |
//////////////////////////////////////////////////////////////////////////////
|
| 13 |
|
| 14 |
-
const VERSION =
|
| 15 |
|
| 16 |
const OPERATION_HOME = 'home';
|
| 17 |
const OPERATION_PRODUCT = 'product';
|
|
@@ -24,8 +24,9 @@ class SwiftAPI
|
|
| 24 |
const OPERATION_UNSUBSCRIBE = 'unsubscribe';
|
| 25 |
const OPERATION_PING = 'ping';
|
| 26 |
const OPERATION_EMAILPACKAGE = 'emailpackage';
|
|
|
|
| 27 |
|
| 28 |
-
const SWIFTAPI_CRM_URL =
|
| 29 |
|
| 30 |
|
| 31 |
//////////////////////////////////////////////////////////////////////////////
|
|
@@ -71,8 +72,8 @@ class SwiftAPI
|
|
| 71 |
$ivlen = mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_CBC);
|
| 72 |
|
| 73 |
// Split message into data and initialization vector components.
|
| 74 |
-
|
| 75 |
-
|
| 76 |
|
| 77 |
// Decrypt data and trim trailing NULL bytes.
|
| 78 |
$json = rtrim(mcrypt_decrypt(MCRYPT_RIJNDAEL_256, $key, $data, MCRYPT_MODE_CBC, $iv), "\0");
|
|
@@ -107,17 +108,6 @@ class SwiftAPI
|
|
| 107 |
));
|
| 108 |
}
|
| 109 |
|
| 110 |
-
|
| 111 |
-
/////////////////
|
| 112 |
-
// Public: Link()
|
| 113 |
-
/////////////////
|
| 114 |
-
|
| 115 |
-
public static function Link(SwiftAPI_Request $request, $key, $content, Site $site)
|
| 116 |
-
{
|
| 117 |
-
return '<a href="'. $site->getSslUrl() . self::SWIFTAPI_CRM_URL . '?' . self::Query($request, $key) . '">' . $content . '</a>';
|
| 118 |
-
}
|
| 119 |
-
|
| 120 |
-
|
| 121 |
///////////////////
|
| 122 |
// Public: Script()
|
| 123 |
///////////////////
|
|
@@ -173,8 +163,6 @@ class SwiftAPI
|
|
| 173 |
http.open("POST","'. self::SWIFTAPI_CRM_URL .'", true);
|
| 174 |
|
| 175 |
http.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
|
| 176 |
-
http.setRequestHeader("Content-length", query.length);
|
| 177 |
-
http.setRequestHeader("Connection", "close");
|
| 178 |
|
| 179 |
http.onreadystatechange= function()
|
| 180 |
{
|
|
@@ -210,26 +198,5 @@ class SwiftAPI
|
|
| 210 |
}
|
| 211 |
|
| 212 |
}
|
| 213 |
-
|
| 214 |
-
if ( !function_exists( 'hex2bin' ) ) {
|
| 215 |
-
|
| 216 |
-
function hex2bin($hexstr) {
|
| 217 |
-
$n = strlen($hexstr);
|
| 218 |
-
$sbin="";
|
| 219 |
-
$i=0;
|
| 220 |
-
while($i<$n) {
|
| 221 |
-
$a =substr($hexstr,$i,2);
|
| 222 |
-
$c = pack("H*",$a);
|
| 223 |
-
if ($i==0){
|
| 224 |
-
$sbin=$c;
|
| 225 |
-
}
|
| 226 |
-
else {
|
| 227 |
-
$sbin.=$c;
|
| 228 |
-
}
|
| 229 |
-
$i+=2;
|
| 230 |
-
}
|
| 231 |
-
return $sbin;
|
| 232 |
-
}
|
| 233 |
-
}
|
| 234 |
|
| 235 |
?>
|
| 11 |
// Class constants.
|
| 12 |
//////////////////////////////////////////////////////////////////////////////
|
| 13 |
|
| 14 |
+
const VERSION = 3;
|
| 15 |
|
| 16 |
const OPERATION_HOME = 'home';
|
| 17 |
const OPERATION_PRODUCT = 'product';
|
| 24 |
const OPERATION_UNSUBSCRIBE = 'unsubscribe';
|
| 25 |
const OPERATION_PING = 'ping';
|
| 26 |
const OPERATION_EMAILPACKAGE = 'emailpackage';
|
| 27 |
+
const OPERATION_ORDERPACKAGE = 'orderpackage';
|
| 28 |
|
| 29 |
+
const SWIFTAPI_CRM_URL = '//api.swiftcrm.net';
|
| 30 |
|
| 31 |
|
| 32 |
//////////////////////////////////////////////////////////////////////////////
|
| 72 |
$ivlen = mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_CBC);
|
| 73 |
|
| 74 |
// Split message into data and initialization vector components.
|
| 75 |
+
$iv = substr($message, 0, $ivlen);
|
| 76 |
+
$data = substr($message, $ivlen);
|
| 77 |
|
| 78 |
// Decrypt data and trim trailing NULL bytes.
|
| 79 |
$json = rtrim(mcrypt_decrypt(MCRYPT_RIJNDAEL_256, $key, $data, MCRYPT_MODE_CBC, $iv), "\0");
|
| 108 |
));
|
| 109 |
}
|
| 110 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 111 |
///////////////////
|
| 112 |
// Public: Script()
|
| 113 |
///////////////////
|
| 163 |
http.open("POST","'. self::SWIFTAPI_CRM_URL .'", true);
|
| 164 |
|
| 165 |
http.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
|
|
|
|
|
|
|
| 166 |
|
| 167 |
http.onreadystatechange= function()
|
| 168 |
{
|
| 198 |
}
|
| 199 |
|
| 200 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 201 |
|
| 202 |
?>
|
lib/SwiftAPI/SwiftAPI_Request.php
CHANGED
|
@@ -13,6 +13,7 @@ require_once('SwiftAPI_Request_Subscription.php');
|
|
| 13 |
require_once('SwiftAPI_Request_ViewMail.php');
|
| 14 |
require_once('SwiftAPI_Request_SendMail.php');
|
| 15 |
require_once('SwiftAPI_Request_EmailPackage.php');
|
|
|
|
| 16 |
|
| 17 |
|
| 18 |
abstract class SwiftAPI_Request
|
|
@@ -43,7 +44,7 @@ abstract class SwiftAPI_Request
|
|
| 43 |
$this -> operation = $operation;
|
| 44 |
$this -> user = $user;
|
| 45 |
$this -> version = $version ? $version : SwiftAPI::VERSION;
|
| 46 |
-
$this -> date = $date ? $date :
|
| 47 |
}
|
| 48 |
|
| 49 |
|
|
@@ -85,6 +86,8 @@ abstract class SwiftAPI_Request
|
|
| 85 |
return SwiftAPI_Request_Unsubscribe::Create($fields);
|
| 86 |
case SwiftAPI::OPERATION_EMAILPACKAGE:
|
| 87 |
return SwiftAPI_Request_EmailPackage::Create($fields);
|
|
|
|
|
|
|
| 88 |
default:
|
| 89 |
throw new SwiftAPI_Exception('SwiftAPI_Request::Create(): Invalid operation: "' . $fields -> operation . '".');
|
| 90 |
}
|
| 13 |
require_once('SwiftAPI_Request_ViewMail.php');
|
| 14 |
require_once('SwiftAPI_Request_SendMail.php');
|
| 15 |
require_once('SwiftAPI_Request_EmailPackage.php');
|
| 16 |
+
require_once('SwiftAPI_Request_OrderPackage.php');
|
| 17 |
|
| 18 |
|
| 19 |
abstract class SwiftAPI_Request
|
| 44 |
$this -> operation = $operation;
|
| 45 |
$this -> user = $user;
|
| 46 |
$this -> version = $version ? $version : SwiftAPI::VERSION;
|
| 47 |
+
$this -> date = $date ? $date : date('Y-m-d H:i:s');
|
| 48 |
}
|
| 49 |
|
| 50 |
|
| 86 |
return SwiftAPI_Request_Unsubscribe::Create($fields);
|
| 87 |
case SwiftAPI::OPERATION_EMAILPACKAGE:
|
| 88 |
return SwiftAPI_Request_EmailPackage::Create($fields);
|
| 89 |
+
case SwiftAPI::OPERATION_ORDERPACKAGE:
|
| 90 |
+
return SwiftAPI_Request_OrderPackage::Create($fields);
|
| 91 |
default:
|
| 92 |
throw new SwiftAPI_Exception('SwiftAPI_Request::Create(): Invalid operation: "' . $fields -> operation . '".');
|
| 93 |
}
|
lib/SwiftAPI/SwiftAPI_Request_EmailPackage.php
CHANGED
|
@@ -8,6 +8,7 @@ class SwiftAPI_Request_EmailPackage extends SwiftAPI_Request {
|
|
| 8 |
|
| 9 |
public $emailPackage;
|
| 10 |
public $site;
|
|
|
|
| 11 |
|
| 12 |
|
| 13 |
//////////////////////////////////////////////////////////////////////////////
|
|
@@ -18,12 +19,21 @@ class SwiftAPI_Request_EmailPackage extends SwiftAPI_Request {
|
|
| 18 |
// Public: __construct()
|
| 19 |
////////////////////////
|
| 20 |
|
| 21 |
-
public function __construct($domain, $user, $site, $emailPackage, $version = NULL, $date = NULL)
|
| 22 |
{
|
| 23 |
$this -> emailPackage = $emailPackage;
|
| 24 |
$this -> site = $site;
|
|
|
|
| 25 |
parent::__construct($domain, SwiftAPI::OPERATION_EMAILPACKAGE, $user, $version, $date);
|
| 26 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 27 |
|
| 28 |
|
| 29 |
///////////////////
|
|
@@ -52,6 +62,7 @@ class SwiftAPI_Request_EmailPackage extends SwiftAPI_Request {
|
|
| 52 |
$fields -> user,
|
| 53 |
$fields -> site,
|
| 54 |
$fields -> emailPackage,
|
|
|
|
| 55 |
$fields -> version,
|
| 56 |
$fields -> date
|
| 57 |
);
|
| 8 |
|
| 9 |
public $emailPackage;
|
| 10 |
public $site;
|
| 11 |
+
public $is_mail_function;
|
| 12 |
|
| 13 |
|
| 14 |
//////////////////////////////////////////////////////////////////////////////
|
| 19 |
// Public: __construct()
|
| 20 |
////////////////////////
|
| 21 |
|
| 22 |
+
public function __construct($domain, $user, $site, $emailPackage, $is_mail_function = false, $version = NULL, $date = NULL)
|
| 23 |
{
|
| 24 |
$this -> emailPackage = $emailPackage;
|
| 25 |
$this -> site = $site;
|
| 26 |
+
$this->is_mail_function = $is_mail_function;
|
| 27 |
parent::__construct($domain, SwiftAPI::OPERATION_EMAILPACKAGE, $user, $version, $date);
|
| 28 |
}
|
| 29 |
+
|
| 30 |
+
/**
|
| 31 |
+
* Sets all schedules
|
| 32 |
+
* because this isn't important and is related to the SwiftCRM_Scheduling not the plugin itself I want to make this optional
|
| 33 |
+
*/
|
| 34 |
+
public function setSchedules($schedules) {
|
| 35 |
+
$this->schedules = $schedules;
|
| 36 |
+
}
|
| 37 |
|
| 38 |
|
| 39 |
///////////////////
|
| 62 |
$fields -> user,
|
| 63 |
$fields -> site,
|
| 64 |
$fields -> emailPackage,
|
| 65 |
+
$fields -> is_mail_function,
|
| 66 |
$fields -> version,
|
| 67 |
$fields -> date
|
| 68 |
);
|
lib/SwiftAPI/SwiftAPI_Request_Order.php
CHANGED
|
@@ -16,7 +16,8 @@ class SwiftAPI_Request_Order extends SwiftAPI_Request
|
|
| 16 |
public $forename;
|
| 17 |
public $surname;
|
| 18 |
public $products;
|
| 19 |
-
|
|
|
|
| 20 |
|
| 21 |
//////////////////////////////////////////////////////////////////////////////
|
| 22 |
// Public functions
|
|
@@ -26,12 +27,15 @@ class SwiftAPI_Request_Order extends SwiftAPI_Request
|
|
| 26 |
// Public: __construct()
|
| 27 |
////////////////////////
|
| 28 |
|
| 29 |
-
public function __construct($domain, $user, $email, $forename, $surname, array $products, $version = NULL, $date = NULL)
|
| 30 |
{
|
| 31 |
-
$this -> email
|
| 32 |
-
$this -> forename
|
| 33 |
-
$this -> surname
|
| 34 |
-
$this -> products
|
|
|
|
|
|
|
|
|
|
| 35 |
|
| 36 |
parent::__construct($domain, SwiftAPI::OPERATION_ORDER, $user, $version, $date);
|
| 37 |
}
|
|
@@ -68,6 +72,8 @@ class SwiftAPI_Request_Order extends SwiftAPI_Request
|
|
| 68 |
$fields -> forename,
|
| 69 |
$fields -> surname,
|
| 70 |
$fields -> products,
|
|
|
|
|
|
|
| 71 |
$fields -> version,
|
| 72 |
$fields -> date
|
| 73 |
);
|
| 16 |
public $forename;
|
| 17 |
public $surname;
|
| 18 |
public $products;
|
| 19 |
+
public $orderId;
|
| 20 |
+
public $orderStatus;
|
| 21 |
|
| 22 |
//////////////////////////////////////////////////////////////////////////////
|
| 23 |
// Public functions
|
| 27 |
// Public: __construct()
|
| 28 |
////////////////////////
|
| 29 |
|
| 30 |
+
public function __construct($domain, $user, $email, $forename, $surname, array $products, $orderId = null, $orderStatus = null, $version = NULL, $date = NULL)
|
| 31 |
{
|
| 32 |
+
$this -> email = $email;
|
| 33 |
+
$this -> forename = $forename;
|
| 34 |
+
$this -> surname = $surname;
|
| 35 |
+
$this -> products = $products;
|
| 36 |
+
$this -> orderId = $orderId;
|
| 37 |
+
$this -> orderStatus = $orderStatus;
|
| 38 |
+
|
| 39 |
|
| 40 |
parent::__construct($domain, SwiftAPI::OPERATION_ORDER, $user, $version, $date);
|
| 41 |
}
|
| 72 |
$fields -> forename,
|
| 73 |
$fields -> surname,
|
| 74 |
$fields -> products,
|
| 75 |
+
isset($fields -> orderId) ? $fields -> orderId : null,
|
| 76 |
+
isset($fields -> orderStatus) ? $fields -> orderStatus : null,
|
| 77 |
$fields -> version,
|
| 78 |
$fields -> date
|
| 79 |
);
|
lib/SwiftAPI/SwiftAPI_Request_PastOrder.php
CHANGED
|
@@ -16,6 +16,8 @@ class SwiftAPI_Request_PastOrder extends SwiftAPI_Request
|
|
| 16 |
public $forename;
|
| 17 |
public $surname;
|
| 18 |
public $products;
|
|
|
|
|
|
|
| 19 |
|
| 20 |
|
| 21 |
//////////////////////////////////////////////////////////////////////////////
|
|
@@ -26,12 +28,14 @@ class SwiftAPI_Request_PastOrder extends SwiftAPI_Request
|
|
| 26 |
// Public: __construct()
|
| 27 |
////////////////////////
|
| 28 |
|
| 29 |
-
public function __construct($domain, $user, $email, $forename, $surname, array $products, $version = NULL, $date = NULL)
|
| 30 |
{
|
| 31 |
-
$this -> email
|
| 32 |
-
$this -> forename
|
| 33 |
-
$this -> surname
|
| 34 |
-
$this -> products
|
|
|
|
|
|
|
| 35 |
|
| 36 |
parent::__construct($domain, SwiftAPI::OPERATION_PASTORDER, $user, $version, $date);
|
| 37 |
}
|
|
@@ -48,11 +52,11 @@ class SwiftAPI_Request_PastOrder extends SwiftAPI_Request
|
|
| 48 |
if(empty($fields -> email))
|
| 49 |
throw new SwiftAPI_Exception('SwiftAPI_Request_PastOrder::Create(): "email" field is missing or empty.');
|
| 50 |
|
| 51 |
-
if(empty($fields -> forename))
|
| 52 |
-
throw new SwiftAPI_Exception('SwiftAPI_Request_PastOrder::Create(): "forename" field is missing or empty.');
|
| 53 |
-
|
| 54 |
-
if(empty($fields -> surname))
|
| 55 |
-
throw new SwiftAPI_Exception('SwiftAPI_Request_PastOrder::Create(): "surname" field is missing or empty.');
|
| 56 |
|
| 57 |
if(empty($fields -> products))
|
| 58 |
throw new SwiftAPI_Exception('SwiftAPI_Request_PastOrder::Create(): "products" field is missing or empty.');
|
|
@@ -68,6 +72,8 @@ class SwiftAPI_Request_PastOrder extends SwiftAPI_Request
|
|
| 68 |
$fields -> forename,
|
| 69 |
$fields -> surname,
|
| 70 |
$fields -> products,
|
|
|
|
|
|
|
| 71 |
$fields -> version,
|
| 72 |
$fields -> date
|
| 73 |
);
|
| 16 |
public $forename;
|
| 17 |
public $surname;
|
| 18 |
public $products;
|
| 19 |
+
public $orderId;
|
| 20 |
+
public $orderStatus;
|
| 21 |
|
| 22 |
|
| 23 |
//////////////////////////////////////////////////////////////////////////////
|
| 28 |
// Public: __construct()
|
| 29 |
////////////////////////
|
| 30 |
|
| 31 |
+
public function __construct($domain, $user, $email, $forename, $surname, array $products, $orderId = null, $orderStatus = null, $version = NULL, $date = NULL)
|
| 32 |
{
|
| 33 |
+
$this -> email = $email;
|
| 34 |
+
$this -> forename = $forename;
|
| 35 |
+
$this -> surname = $surname;
|
| 36 |
+
$this -> products = $products;
|
| 37 |
+
$this -> orderId = $orderId;
|
| 38 |
+
$this -> orderStatus = $orderStatus;
|
| 39 |
|
| 40 |
parent::__construct($domain, SwiftAPI::OPERATION_PASTORDER, $user, $version, $date);
|
| 41 |
}
|
| 52 |
if(empty($fields -> email))
|
| 53 |
throw new SwiftAPI_Exception('SwiftAPI_Request_PastOrder::Create(): "email" field is missing or empty.');
|
| 54 |
|
| 55 |
+
// if(empty($fields -> forename))
|
| 56 |
+
// throw new SwiftAPI_Exception('SwiftAPI_Request_PastOrder::Create(): "forename" field is missing or empty.');
|
| 57 |
+
//
|
| 58 |
+
// if(empty($fields -> surname))
|
| 59 |
+
// throw new SwiftAPI_Exception('SwiftAPI_Request_PastOrder::Create(): "surname" field is missing or empty.');
|
| 60 |
|
| 61 |
if(empty($fields -> products))
|
| 62 |
throw new SwiftAPI_Exception('SwiftAPI_Request_PastOrder::Create(): "products" field is missing or empty.');
|
| 72 |
$fields -> forename,
|
| 73 |
$fields -> surname,
|
| 74 |
$fields -> products,
|
| 75 |
+
isset($fields -> orderId) ? $fields -> orderId : null,
|
| 76 |
+
isset($fields -> orderStatus) ? $fields -> orderStatus : null,
|
| 77 |
$fields -> version,
|
| 78 |
$fields -> date
|
| 79 |
);
|
lib/SwiftAPI/SwiftAPI_Request_ViewMail.php
CHANGED
|
@@ -25,7 +25,7 @@ class SwiftAPI_Request_ViewMail extends SwiftAPI_Request
|
|
| 25 |
// Public: __construct()
|
| 26 |
////////////////////////
|
| 27 |
|
| 28 |
-
public function __construct($domain, $user, $email, $product, $emailId, $version = NULL, $date = NULL)
|
| 29 |
{
|
| 30 |
$this -> email = $email;
|
| 31 |
$this -> product = $product;
|
|
@@ -49,9 +49,6 @@ class SwiftAPI_Request_ViewMail extends SwiftAPI_Request
|
|
| 49 |
if(empty($fields -> product))
|
| 50 |
throw new SwiftAPI_Exception('SwiftAPI_Request_ViewMail::Create(): "product" field is missing or empty.');
|
| 51 |
|
| 52 |
-
if(empty($fields -> emailId))
|
| 53 |
-
throw new SwiftAPI_Exception('SwiftAPI_Request_ViewMail::Create(): "emailId" field is missing or empty.');
|
| 54 |
-
|
| 55 |
return new self
|
| 56 |
(
|
| 57 |
$fields -> domain,
|
| 25 |
// Public: __construct()
|
| 26 |
////////////////////////
|
| 27 |
|
| 28 |
+
public function __construct($domain, $user, $email, $product, $emailId = null, $version = NULL, $date = NULL)
|
| 29 |
{
|
| 30 |
$this -> email = $email;
|
| 31 |
$this -> product = $product;
|
| 49 |
if(empty($fields -> product))
|
| 50 |
throw new SwiftAPI_Exception('SwiftAPI_Request_ViewMail::Create(): "product" field is missing or empty.');
|
| 51 |
|
|
|
|
|
|
|
|
|
|
| 52 |
return new self
|
| 53 |
(
|
| 54 |
$fields -> domain,
|
package.xml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
| 1 |
<?xml version="1.0"?>
|
| 2 |
<package>
|
| 3 |
<name>Swift_Swiftplugin</name>
|
| 4 |
-
<version>1.4.
|
| 5 |
<stability>stable</stability>
|
| 6 |
<license uri="http://opensource.org/licenses/LGPL-3.0">LGPL</license>
|
| 7 |
<channel>community</channel>
|
|
@@ -18,11 +18,11 @@ The extension uses background JavaScript calls to collect and store the customer
|
|
| 18 |
<p>
|
| 19 |
The extension is easy to set up and uses Magento’s built in features to collect information and send emails to the customers. Visit swiftcrm.net for prices and free trails.
|
| 20 |
</p></description>
|
| 21 |
-
<notes>Fixed an issue with
|
| 22 |
<authors><author><name>Simon Cooper</name><user>Netready</user><email>simon@netready.biz</email></author></authors>
|
| 23 |
-
<date>2016-05-
|
| 24 |
-
<time>09:
|
| 25 |
-
<contents><target name="magelib"><dir name="libXML"><file name="xml.php" hash="c20ca4a39971acf4605247712186b9ec"/></dir><dir name="SwiftAPI"><file name="SwiftAPI.php" hash="
|
| 26 |
<compatible/>
|
| 27 |
<dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php><extension><name>mcrypt</name><min/><max/></extension></required></dependencies>
|
| 28 |
</package>
|
| 1 |
<?xml version="1.0"?>
|
| 2 |
<package>
|
| 3 |
<name>Swift_Swiftplugin</name>
|
| 4 |
+
<version>1.4.5</version>
|
| 5 |
<stability>stable</stability>
|
| 6 |
<license uri="http://opensource.org/licenses/LGPL-3.0">LGPL</license>
|
| 7 |
<channel>community</channel>
|
| 18 |
<p>
|
| 19 |
The extension is easy to set up and uses Magento’s built in features to collect information and send emails to the customers. Visit swiftcrm.net for prices and free trails.
|
| 20 |
</p></description>
|
| 21 |
+
<notes>Fixed an issue with dates throwing errors</notes>
|
| 22 |
<authors><author><name>Simon Cooper</name><user>Netready</user><email>simon@netready.biz</email></author></authors>
|
| 23 |
+
<date>2016-05-10</date>
|
| 24 |
+
<time>09:36:03</time>
|
| 25 |
+
<contents><target name="magelib"><dir name="libXML"><file name="xml.php" hash="c20ca4a39971acf4605247712186b9ec"/></dir><dir name="SwiftAPI"><file name="SwiftAPI.php" hash="4a3e384d05e8113c34f7251841b0dcbc"/><file name="SwiftAPI_Exception.php" hash="879b899a7961f4de1212b7296ccafb16"/><file name="SwiftAPI_Product.php" hash="063922cccb485d81c6022de5c4e8e044"/><file name="SwiftAPI_Request.php" hash="bbd113950c050532ea131738fb8432cb"/><file name="SwiftAPI_Request_Cart.php" hash="f8955c78200ddb0512adb5214fd64bb2"/><file name="SwiftAPI_Request_EmailPackage.php" hash="1574f461582500a524160d3db8371d37"/><file name="SwiftAPI_Request_Home.php" hash="9268da121dd10db50d5c2675afd1c65e"/><file name="SwiftAPI_Request_Order.php" hash="6e938a92e9949809653e2207a8c5a5c7"/><file name="SwiftAPI_Request_OrderPackage.php" hash="91724705e976182c0bb1d7d7d6fc786f"/><file name="SwiftAPI_Request_PastOrder.php" hash="90ac5fb44bd1ad61f39d277d268e3575"/><file name="SwiftAPI_Request_Ping.php" hash="e5e13b71682f8230711d5d2f28f9a534"/><file name="SwiftAPI_Request_Product.php" hash="e5fab27bb2dd45946ed8c143a18fe3c4"/><file name="SwiftAPI_Request_SendMail.php" hash="ba04382a3df6b3e179aed5fe3e809de7"/><file name="SwiftAPI_Request_Subscription.php" hash="5545738b941d8ca4dca69b6059a0cce4"/><file name="SwiftAPI_Request_Unsubscribe.php" hash="78aa37cc0ecb98d501674350a4a409c9"/><file name="SwiftAPI_Request_ViewMail.php" hash="f0eb0236c7f6e1fa194d8f05f865a7d8"/><dir name="doc"><file name="SwiftAPI-Specification.html" hash="3be495e89f1555d138a9314052e2c627"/></dir><file name="index.php" hash="82886bb98883bd5868ea04c7d8c88ba5"/><file name="php.ini" hash="ef29c923925a1d1bbc8879c22297daa4"/></dir></target><target name="magecommunity"><dir name="Swift"><dir name="Swiftplugin"><dir name="Block"><dir name="Adminhtml"><dir name="Swift"><dir name="Edit"><file name="Form.php" hash="bd80ab8170f7f2286f13ac579e5249d9"/><dir name="Tab"><file name="Form.php" hash="3d15c45cb2205acabc20376f41a9bd5b"/><file name="Instruct.php" hash="9f34075cc9cdfa92b7876c33fda514de"/></dir><file name="Tabs.php" hash="993769f682fad7d28df79ff3acea97cc"/></dir><file name="Edit.php" hash="d93f75dbaaa7266d91e828b3208fbf2d"/></dir></dir><file name="Swiftblock.php" hash="8b4f72297c8af67374c695b44003867d"/></dir><dir name="Helper"><file name="Data.php" hash="4281667b622843620ef59e990b551cec"/></dir><dir name="Model"><dir name="Mysql4"><dir name="Swift"><file name="Collection.php" hash="82de0fe56cd875d3e78c8fc690424ee1"/></dir><file name="Swift.php" hash="252d5f2ecb1119804b415758d2db6800"/></dir><file name="Observer.php" hash="8bb4dd498a57f1166ed1c85a2b8ab0e0"/><file name="Swift.php" hash="1f9e49d4db7f8987cfd8858061fedc6a"/><file name="XmlProduct.php" hash="db9f967fa05d48f3d8cc44d8ae4e6958"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="IndexController.php" hash="92604a30880c89fbe7885780520096cc"/></dir><file name="MailController.php" hash="af10fe5d485b1742ba5095510f2deea4"/><file name="OrdersController.php" hash="8e9f8bc8f669ab30fc1793e31a149053"/><file name="VersionController.php" hash="b9bebb51f946430a2dc7bfc82f96bf36"/><file name="XmlController.php" hash="995d16b26f21a06eb01f258a20e015fc"/></dir><dir name="etc"><file name="config.xml" hash="6fd2cfc895150d5b8c8d3ac4fbc19a2e"/></dir><dir name="sql"><dir name="swift_setup"><file name="install-1.1.13.php" hash="2447b5645fc36738373678473cec88dc"/><file name="install-1.1.2.php" hash="00832a00c34cb4c997a96330cb28cbfb"/><file name="upgrade-1.1.2-1.1.12.php" hash="cbe3c3fa07facb7b720d7dd518acbeca"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="swift.xml" hash="d80a5229e30cf4b76f5a5150ac1c27c3"/></dir><dir name="template"><dir name="swift"><file name="swiftplugin.phtml" hash="d4d25148e09529e457b6436d7655627b"/></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Swift_all.xml" hash="0ae5a788c805a9fc79b402fe7a02e54d"/></dir></target></contents>
|
| 26 |
<compatible/>
|
| 27 |
<dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php><extension><name>mcrypt</name><min/><max/></extension></required></dependencies>
|
| 28 |
</package>
|
