TGM_Voodoo_Ext - Version 1.0.0

Version Notes

Release Notes

Download this release

Release Info

Developer Top Gear Media
Extension TGM_Voodoo_Ext
Version 1.0.0
Comparing to
See all releases


Version 1.0.0

app/code/community/TGM/Voodoo/Block/Backend/Page/Footer.php ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class TGM_Voodoo_Block_Backend_Page_Footer
3
+ extends Mage_Adminhtml_Block_Abstract
4
+ implements Varien_Data_Form_Element_Renderer_Interface
5
+ {
6
+
7
+ /**
8
+ * Render fieldset html
9
+ *
10
+ * @param Varien_Data_Form_Element_Abstract $element
11
+ * @return string
12
+ */
13
+ public function render(Varien_Data_Form_Element_Abstract $element)
14
+ {
15
+ $html = '
16
+ <div style="border-top: 2px solid #ddd; margin-top: 15px; padding:10px; text-align: right; font-size:10px;>"
17
+ <p>Powered By: <span style="font-size: 12px; font-weight: bold; color:#333;">Voodoo SMS</span> </p>
18
+ </div>
19
+ </div>
20
+ ';
21
+
22
+ return $html;
23
+ }
24
+ }
app/code/community/TGM/Voodoo/Block/Backend/Page/Header.php ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class TGM_Voodoo_Block_Backend_Page_Header
3
+ extends Mage_Adminhtml_Block_Abstract
4
+ implements Varien_Data_Form_Element_Renderer_Interface
5
+ {
6
+
7
+ /**
8
+ * Render fieldset html
9
+ *
10
+ * @param Varien_Data_Form_Element_Abstract $element
11
+ * @return string
12
+ */
13
+ public function render(Varien_Data_Form_Element_Abstract $element)
14
+ {
15
+ $html = '<div style="background:#EAF0EE;border:1px solid #CCCCCC;margin-bottom:10px;padding:20px 15px 15px; border-radius: 5px;">
16
+ <img src="'.$this->getSkinUrl().'/images/magepal.png" style="margin: 0 auto;"/>
17
+ <div style="margin: 0 auto;">
18
+
19
+ <h4 style="color:#EA7601;">Voodoo SMS Extension Community Edition v1.0.0 by <a target="_blank" href="http://www.topgearmedia.co.uk"><strong>Top Gear Media</strong></a></h4>
20
+ <h4>This module requires an account,
21
+ API username/password and SMS credits with <a href="http://www.voodoosms.com">www.voodoosms.com</a>.
22
+ <br>To register an account <a href="http://www.voodoosms.com/portal.html">click here</a>
23
+ <br>To view instructions on how to configure this module <a href="http://www.voodoosms.com/portal/help/online_help/?help=69&p=173#help_detail_post_173">click here</a></h4>
24
+ <p>Query? Feel free to contact the team by <a href="http://www.voodoosms.com/contact-us.html" target="_blank">clicking here</a></p>
25
+ </div>
26
+
27
+ ';
28
+
29
+ return $html;
30
+ }
31
+ }
app/code/community/TGM/Voodoo/Block/Credits.php ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class TGM_Voodoo_Block_Credits extends Mage_Adminhtml_Block_System_Config_Form_Field
3
+ {
4
+ protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
5
+ {
6
+ $this->setElement($element);
7
+ $credit = Mage::getModel('voodoo/voodoo')->getCredit();
8
+ if ($credit == '401: Unauthorized') {
9
+ $credit = 'There is an error check verification message';
10
+ $html ="<div style='font-size: 12px;'>$credit</div><a target='_blank' href='https://www.voodoosms.com/portal/account/addcredit'>Add More Credits</a>";
11
+ }
12
+ else{
13
+ $credits = explode('.',$credit);
14
+ $url = 'http://www.voodoosms.com/register.html';
15
+ if($credit[0]>0){
16
+ $html ="<div style='font-weight:bold;font-size: 14px;'>$credits[0]</div><a target='_blank' href='https://www.voodoosms.com/portal/account/addcredit'>Add More Credits</a>";
17
+ }
18
+ else{
19
+ $html ="<div style='font-weight:bold;font-size: 14px;'>You have insufficient credits</div><a target='_blank' href='https://www.voodoosms.com/portal/account/addcredit'>Add More Credits</a>";
20
+ }
21
+ }
22
+ return $html;
23
+ }
24
+ }
25
+
26
+ ?>
app/code/community/TGM/Voodoo/Block/GrabAccount.php ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class TGM_Voodoo_Block_GrabAccount extends Mage_Adminhtml_Block_System_Config_Form_Field
3
+ {
4
+ protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
5
+ {
6
+ $this->setElement($element);
7
+ $url = 'http://www.voodoosms.com/register.html';
8
+ $html = $this->getLayout()->createBlock('adminhtml/widget_button')
9
+ ->setType('button')
10
+ ->setClass('button')
11
+ ->setLabel(Mage::helper('voodoo')->__('Link Account'))
12
+ ->setOnClick("window.open('$url','window1','width=870, height=705, scrollbars=1, resizable=1'); return false;")
13
+ ->toHtml();
14
+ return $html;
15
+ }
16
+ }
17
+ ?>
app/code/community/TGM/Voodoo/Block/GrabApiAccount.php ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class TGM_Voodoo_Block_GrabApiAccount extends Mage_Adminhtml_Block_System_Config_Form_Field
3
+ {
4
+ protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
5
+ {
6
+ $this->setElement($element);
7
+ $url = 'http://www.voodoosms.com/portal/broadcast/api';
8
+ $html = $this->getLayout()->createBlock('adminhtml/widget_button')
9
+ ->setType('button')
10
+ ->setClass('button')
11
+ ->setLabel(Mage::helper('voodoo')->__('Get Voodoo API'))
12
+ ->setOnClick("window.open('$url','window1','width=870, height=705, scrollbars=1, resizable=1'); return false;")
13
+ ->toHtml();
14
+ return $html;
15
+ }
16
+ }
17
+ ?>
app/code/community/TGM/Voodoo/Block/OtherVerifications.php ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class TGM_Voodoo_Block_OtherVerifications extends Mage_Adminhtml_Block_System_Config_Form_Field
3
+ {
4
+ protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
5
+ {
6
+ $this->setElement($element);
7
+ $verified = Mage::getModel('voodoo/voodoo')->verify_others();
8
+ if($verified == 1){
9
+ $verified = "Configuration is correct according to our API documentation";
10
+ $html ="<div style='font-weight: bold; font-size: 14px; color:green;'>$verified</div>";
11
+ }
12
+ else{
13
+ $verified = "You have entered any non permitted word to see the whole list of these word check documentation.";
14
+ $html ="<div style='font-weight: bold; font-size: 14px; color:red;'>$verified</div>";
15
+ }
16
+ return $html;
17
+ }
18
+ }
19
+ ?>
app/code/community/TGM/Voodoo/Block/VerifyApiAccount.php ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class TGM_Voodoo_Block_VerifyApiAccount extends Mage_Adminhtml_Block_System_Config_Form_Field
3
+ {
4
+ protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
5
+ {
6
+ $this->setElement($element);
7
+
8
+ $verified = Mage::getModel('voodoo/voodoo')->verify_api();
9
+ if ($verified != '1') {
10
+ $verified = 'Enter correct combination of username and password';
11
+ $html ="<div style='font-weight: bold; font-size: 14px; color:red;'>$verified</div>";
12
+ }
13
+ else{
14
+ $verified = "Your username and password are correct";
15
+ $html ="<div style='font-weight: bold; font-size: 14px; color:green;'>$verified</div>";
16
+ }
17
+
18
+ return $html;
19
+
20
+
21
+
22
+ }
23
+ }
24
+ ?>
app/code/community/TGM/Voodoo/Helper/Data-test.php ADDED
@@ -0,0 +1,195 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class TGM_Voodoo_Helper_Dataaa extends Mage_Core_Helper_Abstract
3
+ {
4
+
5
+ const EXT_PATH = 'voodoo/';
6
+
7
+ public function isEnabled($case){
8
+ switch($case){
9
+ case 1:
10
+ return Mage::getStoreConfig(self::EXT_PATH.'orders/enabled');
11
+ break;
12
+ case 2:
13
+ return Mage::getStoreConfig(self::EXT_PATH.'order_hold/enabled');
14
+ break;
15
+ case 3:
16
+ return Mage::getStoreConfig(self::EXT_PATH.'order_unhold/enabled');
17
+ break;
18
+ case 4:
19
+ return Mage::getStoreConfig(self::EXT_PATH.'order_cancelled/enabled');
20
+ break;
21
+ case 5:
22
+ return Mage::getStoreConfig(self::EXT_PATH.'order_shipment/enabled');
23
+ break;
24
+ }
25
+ }
26
+
27
+ public function getUsername()
28
+ {
29
+ return Mage::getStoreConfig(self::EXT_PATH.'enter/username');
30
+ }
31
+
32
+ public function getPassword()
33
+ {
34
+ return Mage::getStoreConfig(self::EXT_PATH.'enter/password');
35
+ }
36
+
37
+ public function getSender($case)
38
+ {
39
+ switch($case){
40
+ case 1:
41
+ return Mage::getStoreConfig(self::EXT_PATH.'orders/sender');
42
+ break;
43
+ case 2:
44
+ return Mage::getStoreConfig(self::EXT_PATH.'order_hold/sender');
45
+ break;
46
+ case 3:
47
+ return Mage::getStoreConfig(self::EXT_PATH.'order_unhold/sender');
48
+ break;
49
+ case 4:
50
+ return Mage::getStoreConfig(self::EXT_PATH.'order_cancelled/sender');
51
+ break;
52
+ case 5:
53
+ return Mage::getStoreConfig(self::EXT_PATH.'order_shipment/sender');
54
+ break;
55
+ }
56
+ }
57
+
58
+ public function getMessage(Mage_Sales_Model_Order $order,$case)
59
+ {
60
+ $billingAddress = $order->getBillingAddress();
61
+ $codes = array('{{firstname}}','{{middlename}}','{{lastname}}','{{fax}}','{{postal}}','{{city}}','{{email}}','{{order_id}}');
62
+ $accurate = array($billingAddress->getFirstname(),
63
+ $billingAddress->getMiddlename(),
64
+ $billingAddress->getLastname(),
65
+ $billingAddress->getFax(),
66
+ $billingAddress->getPostcode(),
67
+ $billingAddress->getCity(),
68
+ $billingAddress->getEmail(),
69
+ $order->getIncrementId()
70
+ );
71
+
72
+ switch($case){
73
+ case 1:
74
+ return str_replace($codes,$accurate,Mage::getStoreConfig(self::EXT_PATH.'orders/message'));
75
+ break;
76
+ case 2:
77
+ return str_replace($codes,$accurate,Mage::getStoreConfig(self::EXT_PATH.'order_hold/message'));
78
+ break;
79
+ case 3:
80
+ return str_replace($codes,$accurate,Mage::getStoreConfig(self::EXT_PATH.'order_unhold/message'));
81
+ break;
82
+ case 4:
83
+ return str_replace($codes,$accurate,Mage::getStoreConfig(self::EXT_PATH.'order_cancelled/message'));
84
+ break;
85
+ case 5:
86
+ return str_replace($codes,$accurate,Mage::getStoreConfig(self::EXT_PATH.'order_shipment/message'));
87
+ break;
88
+ }
89
+ }
90
+ public function getDestination(Mage_Sales_Model_Order $order)
91
+ {
92
+ $billingAddress = $order->getBillingAddress();
93
+ $number = $billingAddress->getTelephone();
94
+ return $number;
95
+ }
96
+
97
+ public function isNotifyEnabled($case){
98
+ switch($case){
99
+ case 1:
100
+ return Mage::getStoreConfig(self::EXT_PATH.'orders/notify');
101
+ break;
102
+ case 2:
103
+ return Mage::getStoreConfig(self::EXT_PATH.'order_hold/notify');
104
+ break;
105
+ case 3:
106
+ return Mage::getStoreConfig(self::EXT_PATH.'order_unhold/notify');
107
+ break;
108
+ case 4:
109
+ return Mage::getStoreConfig(self::EXT_PATH.'order_cancelled/notify');
110
+ break;
111
+ case 5:
112
+ return Mage::getStoreConfig(self::EXT_PATH.'order_shipment/notify');
113
+ break;
114
+ }
115
+ }
116
+
117
+ public function getAdminDestination($case){
118
+ switch($case){
119
+ case 1:
120
+ return Mage::getStoreConfig(self::EXT_PATH.'orders/receiver');
121
+ break;
122
+ case 2:
123
+ return Mage::getStoreConfig(self::EXT_PATH.'order_hold/receiver');
124
+ break;
125
+ case 3:
126
+ return Mage::getStoreConfig(self::EXT_PATH.'order_unhold/receiver');
127
+ break;
128
+ case 4:
129
+ return Mage::getStoreConfig(self::EXT_PATH.'order_cancelled/receiver');
130
+ break;
131
+ case 5:
132
+ return Mage::getStoreConfig(self::EXT_PATH.'order_shipment/receiver');
133
+ break;
134
+ }
135
+ }
136
+
137
+ public function voodoo($url) {
138
+ try {
139
+ $smsSent = $this->file_get_contents_curl($url);
140
+ }
141
+ catch(Exception $e) {
142
+ $smsSent = '';
143
+ }
144
+ if($smsSent) {
145
+ switch($smsSent) {
146
+ case '401: Unauthorized':
147
+ $status_message = Mage::helper('voodoo')->__('Voodoo Username or password incorrect (UNAUTHORIZED).');
148
+ $status = Mage::helper('voodoo')->__('Not sent');
149
+ break;
150
+ case '403: Forbidden':
151
+ $status_message = Mage::helper('voodoo')->__('Wrong Number Inserted (FORBIDDEN).');
152
+ $status = Mage::helper('voodoo')->__('Not sent');
153
+ break;
154
+ case '400: Bad request':
155
+ $status_message = Mage::helper('voodoo')->__('There might be something wrong happened (BAD REQUEST).');
156
+ $status = Mage::helper('voodoo')->__('Not sent');
157
+ break;
158
+ case '402: Not enough credit':
159
+ $status_message = Mage::helper('voodoo')->__('Insufficient Credit to send (NOT ENOUGH CREDIT).');
160
+ $status = Mage::helper('voodoo')->__('Not sent');
161
+ break;
162
+ case '513: Message too Large':
163
+ $status_message = Mage::helper('voodoo')->__('Too long message to send (LARGE MESSAGE).');
164
+ $status = Mage::helper('voodoo')->__('Not sent');
165
+ break;
166
+ default:
167
+ $status_message = Mage::helper('voodoo')->__('Sms successfully sent.');
168
+ $status = Mage::helper('voodoo')->__('Sent');
169
+ break;
170
+ }
171
+ }
172
+ else {
173
+ $status_message = Mage::helper('voodoo')->__('Not able to send the sms. Please contact the developer.');
174
+ $status = 'Not sent';
175
+ }
176
+ $ret['status_message'] = $status_message;
177
+ $ret['status'] = $status;
178
+ return $ret;
179
+ }
180
+
181
+ public function file_get_contents_curl($url) {
182
+ $ch = curl_init();
183
+ curl_setopt($ch, CURLOPT_HEADER, 0);
184
+ curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
185
+ curl_setopt($ch, CURLOPT_URL, $url);
186
+ $data = curl_exec($ch);
187
+ curl_close($ch);
188
+ return $data;
189
+ }
190
+ public function credits($url){
191
+ $credits = $this->file_get_contents_curl($url);
192
+ return $credits;
193
+ }
194
+
195
+ }
app/code/community/TGM/Voodoo/Helper/Data.php ADDED
@@ -0,0 +1,284 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class TGM_Voodoo_Helper_Data extends Mage_Core_Helper_Abstract
4
+ {
5
+ const CONFIG_PATH = 'voodoo/';
6
+
7
+ public function isOrdersEnabled()
8
+ {
9
+ return Mage::getStoreConfig(self::CONFIG_PATH.'orders/enabled');
10
+ }
11
+
12
+ public function isOrderHoldEnabled()
13
+ {
14
+ return Mage::getStoreConfig(self::CONFIG_PATH.'order_hold/enabled');
15
+ }
16
+
17
+ public function isOrderUnholdEnabled()
18
+ {
19
+ return Mage::getStoreConfig(self::CONFIG_PATH.'order_unhold/enabled');
20
+ }
21
+
22
+ public function isOrderCanceledEnabled()
23
+ {
24
+ return Mage::getStoreConfig(self::CONFIG_PATH.'order_canceled/enabled');
25
+ }
26
+
27
+ public function isShipmentsEnabled()
28
+ {
29
+ return Mage::getStoreConfig(self::CONFIG_PATH.'shipments/enabled');
30
+ }
31
+
32
+ public function getUsername()
33
+ {
34
+ return Mage::getStoreConfig(self::CONFIG_PATH.'enter/username');
35
+ }
36
+
37
+ public function getPassword()
38
+ {
39
+ return Mage::getStoreConfig(self::CONFIG_PATH.'enter/password');
40
+ }
41
+
42
+ public function getSender()
43
+ {
44
+ return Mage::getStoreConfig(self::CONFIG_PATH.'orders/sender');
45
+ }
46
+
47
+ public function getSenderForOrderHold()
48
+ {
49
+ return Mage::getStoreConfig(self::CONFIG_PATH.'order_hold/sender');
50
+ }
51
+
52
+ public function getSenderForOrderUnhold()
53
+ {
54
+ return Mage::getStoreConfig(self::CONFIG_PATH.'order_unhold/sender');
55
+ }
56
+
57
+ public function getSenderForOrderCanceled()
58
+ {
59
+ return Mage::getStoreConfig(self::CONFIG_PATH.'order_canceled/sender');
60
+ }
61
+
62
+ public function getSenderForShipment()
63
+ {
64
+ return Mage::getStoreConfig(self::CONFIG_PATH.'shipments/sender');
65
+ }
66
+
67
+ public function getMessage(Mage_Sales_Model_Order $order)
68
+ {
69
+ $billingAddress = $order->getBillingAddress();
70
+ $codes = array('{{firstname}}','{{middlename}}','{{lastname}}','{{fax}}','{{postal}}','{{city}}','{{email}}','{{order_id}}');
71
+ $accurate = array($billingAddress->getFirstname(),
72
+ $billingAddress->getMiddlename(),
73
+ $billingAddress->getLastname(),
74
+ $billingAddress->getFax(),
75
+ $billingAddress->getPostcode(),
76
+ $billingAddress->getCity(),
77
+ $billingAddress->getEmail(),
78
+ $order->getIncrementId()
79
+ );
80
+
81
+ return str_replace($codes,$accurate,Mage::getStoreConfig(self::CONFIG_PATH.'orders/message'));
82
+ }
83
+
84
+ public function getMessageForOrderHold(Mage_Sales_Model_Order $order)
85
+ {
86
+ $billingAddress = $order->getBillingAddress();
87
+ $codes = array('{{firstname}}','{{middlename}}','{{lastname}}','{{fax}}','{{postal}}','{{city}}','{{email}}','{{order_id}}');
88
+ $accurate = array($billingAddress->getFirstname(),
89
+ $billingAddress->getMiddlename(),
90
+ $billingAddress->getLastname(),
91
+ $billingAddress->getFax(),
92
+ $billingAddress->getPostcode(),
93
+ $billingAddress->getCity(),
94
+ $billingAddress->getEmail(),
95
+ $order->getIncrementId()
96
+ );
97
+
98
+ return str_replace($codes,$accurate,Mage::getStoreConfig(self::CONFIG_PATH.'order_hold/message'));
99
+ }
100
+
101
+ public function getMessageForOrderUnhold(Mage_Sales_Model_Order $order)
102
+ {
103
+ $billingAddress = $order->getBillingAddress();
104
+ $codes = array('{{firstname}}','{{middlename}}','{{lastname}}','{{fax}}','{{postal}}','{{city}}','{{email}}','{{order_id}}');
105
+ $accurate = array($billingAddress->getFirstname(),
106
+ $billingAddress->getMiddlename(),
107
+ $billingAddress->getLastname(),
108
+ $billingAddress->getFax(),
109
+ $billingAddress->getPostcode(),
110
+ $billingAddress->getCity(),
111
+ $billingAddress->getEmail(),
112
+ $order->getIncrementId()
113
+ );
114
+
115
+ return str_replace($codes,$accurate,Mage::getStoreConfig(self::CONFIG_PATH.'order_unhold/message'));
116
+ }
117
+
118
+ public function getMessageForOrderCanceled(Mage_Sales_Model_Order $order)
119
+ {
120
+ $billingAddress = $order->getBillingAddress();
121
+ $codes = array('{{firstname}}','{{middlename}}','{{lastname}}','{{fax}}','{{postal}}','{{city}}','{{email}}','{{order_id}}');
122
+ $accurate = array($billingAddress->getFirstname(),
123
+ $billingAddress->getMiddlename(),
124
+ $billingAddress->getLastname(),
125
+ $billingAddress->getFax(),
126
+ $billingAddress->getPostcode(),
127
+ $billingAddress->getCity(),
128
+ $billingAddress->getEmail(),
129
+ $order->getIncrementId()
130
+ );
131
+
132
+ return str_replace($codes,$accurate,Mage::getStoreConfig(self::CONFIG_PATH.'order_canceled/message'));
133
+ }
134
+
135
+ public function getMessageForShipment(Mage_Sales_Model_Order $order)
136
+ {
137
+ $billingAddress = $order->getBillingAddress();
138
+ $codes = array('{{firstname}}','{{middlename}}','{{lastname}}','{{fax}}','{{postal}}','{{city}}','{{email}}','{{order_id}}');
139
+ $accurate = array($billingAddress->getFirstname(),
140
+ $billingAddress->getMiddlename(),
141
+ $billingAddress->getLastname(),
142
+ $billingAddress->getFax(),
143
+ $billingAddress->getPostcode(),
144
+ $billingAddress->getCity(),
145
+ $billingAddress->getEmail(),
146
+ $order->getIncrementId()
147
+ );
148
+
149
+ return str_replace($codes,$accurate,Mage::getStoreConfig(self::CONFIG_PATH.'shipments/message'));
150
+ }
151
+
152
+ public function getTelephoneFromOrder(Mage_Sales_Model_Order $order)
153
+ {
154
+ $billingAddress = $order->getBillingAddress();
155
+
156
+
157
+ $number = $billingAddress->getTelephone();
158
+ return $number;
159
+ }
160
+
161
+ //admin Notifier functions on order
162
+ public function isOrdersNotify()
163
+ {
164
+ return Mage::getStoreConfig(self::CONFIG_PATH.'orders/notify');
165
+ }
166
+
167
+ public function getAdminTelephone()
168
+ {
169
+ return Mage::getStoreConfig(self::CONFIG_PATH.'orders/receiver');
170
+ }
171
+
172
+ //admin Notifier functions on order hold
173
+ public function isOrdersHoldNotify()
174
+ {
175
+ return Mage::getStoreConfig(self::CONFIG_PATH.'order_hold/notify');
176
+ }
177
+
178
+ public function getAdminHoldTelephone()
179
+ {
180
+ return Mage::getStoreConfig(self::CONFIG_PATH.'order_hold/receiver');
181
+ }
182
+
183
+ //admin Notifier functions on order Unhold
184
+ public function isOrdersUnholdNotify()
185
+ {
186
+ return Mage::getStoreConfig(self::CONFIG_PATH.'order_unhold/notify');
187
+ }
188
+
189
+ public function getAdminUnholdTelephone()
190
+ {
191
+ return Mage::getStoreConfig(self::CONFIG_PATH.'order_unhold/receiver');
192
+ }
193
+
194
+ //admin Notifier functions on order cancelled
195
+ public function isOrdersCancelledNotify()
196
+ {
197
+ return Mage::getStoreConfig(self::CONFIG_PATH.'order_canceled/notify');
198
+ }
199
+
200
+ public function getAdminCancelledTelephone()
201
+ {
202
+ return Mage::getStoreConfig(self::CONFIG_PATH.'order_canceled/receiver');
203
+ }
204
+
205
+ //admin Notifier functions on order shipment
206
+ public function isOrdersShipmentsNotify()
207
+ {
208
+ return Mage::getStoreConfig(self::CONFIG_PATH.'shipments/notify');
209
+ }
210
+
211
+ public function getAdminShipmentsTelephone()
212
+ {
213
+ return Mage::getStoreConfig(self::CONFIG_PATH.'shipments/receiver');
214
+ }
215
+
216
+
217
+ public function voodoo($url) {
218
+ try {
219
+ $sendSms = $this->file_get_contents_curl($url);
220
+ }
221
+ catch(Exception $e) {
222
+ $sendSms = '';
223
+ }
224
+ if($sendSms) {
225
+ switch($sendSms) {
226
+ case '401: Unauthorized':
227
+ $status_message = Mage::helper('voodoo')->__('Voodoo Username or password incorrect (UNAUTHORIZED).');
228
+ $status = Mage::helper('voodoo')->__('Not sent');
229
+ break;
230
+ case '403: Forbidden':
231
+ $status_message = Mage::helper('voodoo')->__('Wrong Number Inserted (FORBIDDEN).');
232
+ $status = Mage::helper('voodoo')->__('Not sent');
233
+ break;
234
+ case '400: Bad request':
235
+ $status_message = Mage::helper('voodoo')->__('There might be something wrong happened (BAD REQUEST).');
236
+ $status = Mage::helper('voodoo')->__('Not sent');
237
+ break;
238
+ case '402: Not enough credit':
239
+ $status_message = Mage::helper('voodoo')->__('Insufficient Credit to send (NOT ENOUGH CREDIT).');
240
+ $status = Mage::helper('voodoo')->__('Not sent');
241
+ break;
242
+ case '513: Message too Large':
243
+ $status_message = Mage::helper('voodoo')->__('Too long message to send (LARGE MESSAGE).');
244
+ $status = Mage::helper('voodoo')->__('Not sent');
245
+ break;
246
+ default:
247
+ $status_message = Mage::helper('voodoo')->__('Sms successfully sent.');
248
+ $status = Mage::helper('voodoo')->__('Sent');
249
+ break;
250
+ }
251
+ }
252
+ else {
253
+ $status_message = Mage::helper('voodoo')->__('Not able to send the sms. Please contact the developer.');
254
+ $status = 'Not sent';
255
+ }
256
+ $ret['status_message'] = $status_message;
257
+ $ret['status'] = $status;
258
+ return $ret;
259
+ }
260
+
261
+ public function file_get_contents_curl($url) {
262
+ $ch = curl_init();
263
+ curl_setopt($ch, CURLOPT_HEADER, 0);
264
+ curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
265
+ curl_setopt($ch, CURLOPT_URL, $url);
266
+ $data = curl_exec($ch);
267
+ curl_close($ch);
268
+ return $data;
269
+ }
270
+ public function credits($url){
271
+ $credits = $this->file_get_contents_curl($url);
272
+ return $credits;
273
+ }
274
+ public function verify_api($url)
275
+ {
276
+ $verified = $this->file_get_contents_curl($url);
277
+ return $verified;
278
+ }
279
+ public function verify_others($url)
280
+ {
281
+ $verify_others = $this->file_get_contents_curl($url);
282
+ return $verify_others;
283
+ }
284
+ }
app/code/community/TGM/Voodoo/Model/Mysql4/Mysql4/Voodoo.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class TGM_Voodoo_Model_Mysql4_Voodoo extends Mage_Core_Model_Mysql4_Abstract
4
+ {
5
+ public function _construct()
6
+ {
7
+ // Note that the sendsms_id refers to the key field in your database table.
8
+ $this->_init('voodoo/voodoo', 'voodoo_id');
9
+ }
10
+ }
app/code/community/TGM/Voodoo/Model/Mysql4/Mysql4/Voodoo/Collection.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class TGM_Voodoo_Model_Mysql4_Voodoo_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
4
+ {
5
+ public function _construct()
6
+ {
7
+ parent::_construct();
8
+ $this->_init('voodoo/voodoo');
9
+ }
10
+ }
app/code/community/TGM/Voodoo/Model/Mysql4/Voodoo.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class TGM_Voodoo_Model_Mysql4_Voodoo extends Mage_Core_Model_Mysql4_Abstract
4
+ {
5
+ public function _construct()
6
+ {
7
+ // Note that the sendsms_id refers to the key field in your database table.
8
+ $this->_init('voodoo/voodoo', 'voodoo_id');
9
+ }
10
+ }
app/code/community/TGM/Voodoo/Model/Mysql4/Voodoo/Collection.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class TGM_Voodoo_Model_Mysql4_Voodoo_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
4
+ {
5
+ public function _construct()
6
+ {
7
+ parent::_construct();
8
+ $this->_init('voodoo/voodoo');
9
+ }
10
+ }
app/code/community/TGM/Voodoo/Model/Observer.php ADDED
@@ -0,0 +1,327 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class TGM_Voodoo_Model_Observer
3
+ {
4
+ public function sendSmsOnOrderCreated(Varien_Event_Observer $observer)
5
+ {
6
+ if($this->getHelper()->isOrdersEnabled()) {
7
+ $orders = $observer->getEvent()->getOrderIds();
8
+ $order = Mage::getModel('sales/order')->load($orders['0']);
9
+ if ($order instanceof Mage_Sales_Model_Order) {
10
+ $host = "http://www.voodoosms.com/";
11
+ $path = "vsapi/server.php";
12
+ $username = $this->getHelper()->getUsername();
13
+ $password = $this->getHelper()->getPassword();;
14
+ $smsto = $this->getHelper()->getTelephoneFromOrder($order);
15
+ $smsfrom = $this->getHelper()->getSender();;
16
+ $smsmsg = $this->getHelper()->getMessage($order);;
17
+ $data = '?method=sendSMS';
18
+ $data .= '&username=' . urlencode($username);
19
+ $data .= '&password=' . urlencode($password);
20
+ $data .= '&destination=' . urlencode($smsto);
21
+ $data .= '&originator=' . urlencode($smsfrom);
22
+ $data .= '&message=' . urlencode($smsmsg);
23
+ $data .= '&validity=300';
24
+ $url = $host.$path.$data;
25
+ $sendSms = $this->getHelper()->voodoo($url);
26
+ try {
27
+ Mage::getModel('voodoo/voodoo')
28
+ ->setOrderId($order->getIncrementId())
29
+ ->setFrom($smsfrom)
30
+ ->setTo($smsto)
31
+ ->setSmsMessage($smsmsg)
32
+ ->setStatus($sendSms['status'])
33
+ ->setStatusMessage($sendSms['status_message'])
34
+ ->setCreatedTime(now())
35
+ ->save();
36
+ }
37
+ catch (Exception $e) {}
38
+
39
+ if($this->getHelper()->isOrdersNotify() and $this->getHelper()->getAdminTelephone()) {
40
+ $smsto = $this->getHelper()->getAdminTelephone();
41
+ $smsmsg = Mage::helper('voodoo')->__('A new order has been placed: %s',$order->getIncrementId());
42
+ $data = '?method=sendSMS';
43
+ $data .= '&username=' . urlencode($username);
44
+ $data .= '&password=' . urlencode($password);
45
+ $data .= '&destination=' . urlencode($smsto);
46
+ $data .= '&originator=' . urlencode($smsfrom);
47
+ $data .= '&message=' . urlencode($smsmsg);
48
+ $data .= '&validity=300';
49
+ $url = $host.$path.$data;
50
+ $sendSms = $this->getHelper()->voodoo($url);
51
+ try {
52
+ Mage::getModel('voodoo/voodoo')
53
+ ->setOrderId($order->getIncrementId())
54
+ ->setFrom($smsfrom)
55
+ ->setTo($smsto)
56
+ ->setSmsMessage($smsmsg)
57
+ ->setStatus($sendSms['status'])
58
+ ->setStatusMessage($sendSms['status_message'])
59
+ ->setCreatedTime(now())
60
+ ->save();
61
+ }
62
+ catch (Exception $e) {}
63
+ }
64
+ }
65
+ }
66
+ }
67
+
68
+ public function sendSmsOnOrderHold(Varien_Event_Observer $observer)
69
+ {
70
+ if($this->getHelper()->isOrderHoldEnabled()) {
71
+ $order = $observer->getOrder();
72
+ if ($order instanceof Mage_Sales_Model_Order) {
73
+ if ($order->getState() !== $order->getOrigData('state') && $order->getState() === Mage_Sales_Model_Order::STATE_HOLDED) {
74
+ $host = "http://www.voodoosms.com/";
75
+ $path = "vsapi/server.php";
76
+ $username = $this->getHelper()->getUsername();
77
+ $password = $this->getHelper()->getPassword();
78
+ $smsto = $this->getHelper()->getTelephoneFromOrder($order);
79
+ $smsfrom = $this->getHelper()->getSenderForOrderHold();
80
+ $smsmsg = $this->getHelper()->getMessageForOrderHold($order);
81
+ $data = '?method=sendSMS';
82
+ $data .= '&username=' . urlencode($username);
83
+ $data .= '&password=' . urlencode($password);
84
+ $data .= '&destination=' . urlencode($smsto);
85
+ $data .= '&originator=' . urlencode($smsfrom);
86
+ $data .= '&message=' . urlencode($smsmsg);
87
+ $data .= '&validity=300';
88
+ $url = $host.$path.$data;
89
+ $sendSms = $this->getHelper()->voodoo($url);
90
+ try {
91
+ Mage::getModel('voodoo/voodoo')
92
+ ->setOrderId($order->getIncrementId())
93
+ ->setFrom($smsfrom)
94
+ ->setTo($smsto)
95
+ ->setSmsMessage($smsmsg)
96
+ ->setStatus($sendSms['status'])
97
+ ->setStatusMessage($sendSms['status_message'])
98
+ ->setCreatedTime(now())
99
+ ->save();
100
+ }
101
+ catch (Exception $e) {}
102
+ if($this->getHelper()->isOrdersHoldNotify() and $this->getHelper()->getAdminHoldTelephone()) {
103
+ $smsto = $this->getHelper()->getAdminHoldTelephone();
104
+ $smsmsg = Mage::helper('voodoo')->__('%s has been placed on hold',$order->getIncrementId());
105
+ $data = '?method=sendSMS';
106
+ $data .= '&username=' . urlencode($username);
107
+ $data .= '&password=' . urlencode($password);
108
+ $data .= '&destination=' . urlencode($smsto);
109
+ $data .= '&originator=' . urlencode($smsfrom);
110
+ $data .= '&message=' . urlencode($smsmsg);
111
+ $data .= '&validity=300';
112
+ $url = $host.$path.$data;
113
+ $sendSms = $this->getHelper()->voodoo($url);
114
+ try {
115
+ Mage::getModel('voodoo/voodoo')
116
+ ->setOrderId($order->getIncrementId())
117
+ ->setFrom($smsfrom)
118
+ ->setTo($smsto)
119
+ ->setSmsMessage($smsmsg)
120
+ ->setStatus($sendSms['status'])
121
+ ->setStatusMessage($sendSms['status_message'])
122
+ ->setCreatedTime(now())
123
+ ->save();
124
+ }
125
+ catch (Exception $e) {}
126
+ }
127
+ }
128
+ }
129
+ }
130
+ }
131
+
132
+ public function sendSmsOnOrderUnhold(Varien_Event_Observer $observer)
133
+ {
134
+ if($this->getHelper()->isOrderUnholdEnabled()) {
135
+ $order = $observer->getOrder();
136
+ if ($order instanceof Mage_Sales_Model_Order) {
137
+ if ($order->getState() !== $order->getOrigData('state') && $order->getOrigData('state') === Mage_Sales_Model_Order::STATE_HOLDED) {
138
+ $host = "http://www.voodoosms.com/";
139
+ $path = "vsapi/server.php";
140
+ $username = $this->getHelper()->getUsername();
141
+ $password = $this->getHelper()->getPassword();
142
+ $smsto = $this->getHelper()->getTelephoneFromOrder($order);
143
+ $smsfrom = $this->getHelper()->getSenderForOrderUnhold();
144
+ $smsmsg = $this->getHelper()->getMessageForOrderUnhold($order);
145
+ $data = '?method=sendSMS';
146
+ $data .= '&username=' . urlencode($username);
147
+ $data .= '&password=' . urlencode($password);
148
+ $data .= '&destination=' . urlencode($smsto);
149
+ $data .= '&originator=' . urlencode($smsfrom);
150
+ $data .= '&message=' . urlencode($smsmsg);
151
+ $data .= '&validity=300';
152
+ $url = $host.$path.$data;
153
+ $sendSms = $this->getHelper()->voodoo($url);
154
+ try {
155
+ Mage::getModel('voodoo/voodoo')
156
+ ->setOrderId($order->getIncrementId())
157
+ ->setFrom($smsfrom)
158
+ ->setTo($smsto)
159
+ ->setSmsMessage($smsmsg)
160
+ ->setStatus($sendSms['status'])
161
+ ->setStatusMessage($sendSms['status_message'])
162
+ ->setCreatedTime(now())
163
+ ->save();
164
+ }
165
+ catch (Exception $e) {}
166
+ if($this->getHelper()->isOrdersUnholdNotify() and $this->getHelper()->getAdminUnholdTelephone()) {
167
+ $smsto = $this->getHelper()->getAdminUnholdTelephone();
168
+ $smsmsg = Mage::helper('voodoo')->__('%s has been placed on unhold',$order->getIncrementId());
169
+ $data = '?method=sendSMS';
170
+ $data .= '&username=' . urlencode($username);
171
+ $data .= '&password=' . urlencode($password);
172
+ $data .= '&destination=' . urlencode($smsto);
173
+ $data .= '&originator=' . urlencode($smsfrom);
174
+ $data .= '&message=' . urlencode($smsmsg);
175
+ $data .= '&validity=300';
176
+ $url = $host.$path.$data;
177
+ $sendSms = $this->getHelper()->voodoo($url);
178
+ try {
179
+ Mage::getModel('voodoo/voodoo')
180
+ ->setOrderId($order->getIncrementId())
181
+ ->setFrom($smsfrom)
182
+ ->setTo($smsto)
183
+ ->setSmsMessage($smsmsg)
184
+ ->setStatus($sendSms['status'])
185
+ ->setStatusMessage($sendSms['status_message'])
186
+ ->setCreatedTime(now())
187
+ ->save();
188
+ }
189
+ catch (Exception $e) {}
190
+ }
191
+ }
192
+ }
193
+ }
194
+ }
195
+
196
+ public function sendSmsOnOrderCanceled(Varien_Event_Observer $observer)
197
+ {
198
+ if($this->getHelper()->isOrderCanceledEnabled()) {
199
+ $order = $observer->getOrder();
200
+ if ($order instanceof Mage_Sales_Model_Order) {
201
+ if ($order->getState() !== $order->getOrigData('state') && $order->getState() === Mage_Sales_Model_Order::STATE_CANCELED) {
202
+ $host = "http://www.voodoosms.com/";
203
+ $path = "vsapi/server.php";
204
+ $username = $this->getHelper()->getUsername();
205
+ $password = $this->getHelper()->getPassword();
206
+ $smsto = $this->getHelper()->getTelephoneFromOrder($order);
207
+ $smsfrom = $this->getHelper()->getSenderForOrderCanceled();
208
+ $smsmsg = $this->getHelper()->getMessageForOrderCanceled($order);
209
+ $data = '?method=sendSMS';
210
+ $data .= '&username=' . urlencode($username);
211
+ $data .= '&password=' . urlencode($password);
212
+ $data .= '&destination=' . urlencode($smsto);
213
+ $data .= '&originator=' . urlencode($smsfrom);
214
+ $data .= '&message=' . urlencode($smsmsg);
215
+ $data .= '&validity=300';
216
+ $url = $host.$path.$data;
217
+ $sendSms = $this->getHelper()->voodoo($url);
218
+ try {
219
+ Mage::getModel('voodoo/voodoo')
220
+ ->setOrderId($order->getIncrementId())
221
+ ->setFrom($smsfrom)
222
+ ->setTo($smsto)
223
+ ->setSmsMessage($smsmsg)
224
+ ->setStatus($sendSms['status'])
225
+ ->setStatusMessage($sendSms['status_message'])
226
+ ->setCreatedTime(now())
227
+ ->save();
228
+ }
229
+ catch (Exception $e) {}
230
+ if($this->getHelper()->isOrdersCancelledNotify() and $this->getHelper()->getAdminCancelledTelephone()) {
231
+ $smsto = $this->getHelper()->getAdminCancelledTelephone();
232
+ $smsmsg = Mage::helper('voodoo')->__('%s has been placed cancelled',$order->getIncrementId());
233
+ $data = '?method=sendSMS';
234
+ $data .= '&username=' . urlencode($username);
235
+ $data .= '&password=' . urlencode($password);
236
+ $data .= '&destination=' . urlencode($smsto);
237
+ $data .= '&originator=' . urlencode($smsfrom);
238
+ $data .= '&message=' . urlencode($smsmsg);
239
+ $data .= '&validity=300';
240
+ $url = $host.$path.$data;
241
+ $sendSms = $this->getHelper()->voodoo($url);
242
+ try {
243
+ Mage::getModel('voodoo/voodoo')
244
+ ->setOrderId($order->getIncrementId())
245
+ ->setFrom($smsfrom)
246
+ ->setTo($smsto)
247
+ ->setSmsMessage($smsmsg)
248
+ ->setStatus($sendSms['status'])
249
+ ->setStatusMessage($sendSms['status_message'])
250
+ ->setCreatedTime(now())
251
+ ->save();
252
+ }
253
+ catch (Exception $e) {}
254
+ }
255
+ }
256
+ }
257
+ }
258
+ }
259
+
260
+ public function sendSmsOnShipmentCreated(Varien_Event_Observer $observer)
261
+ {
262
+ if($this->getHelper()->isShipmentsEnabled()) {
263
+ $shipment = $observer->getEvent()->getShipment();
264
+ $order = $shipment->getOrder();
265
+ if ($order instanceof Mage_Sales_Model_Order) {
266
+ $host = "http://www.voodoosms.com/";
267
+ $path = "vsapi/server.php";
268
+ $username = $this->getHelper()->getUsername();
269
+ $password = $this->getHelper()->getPassword();
270
+ $smsto = $this->getHelper()->getTelephoneFromOrder($order);
271
+ $smsfrom = $this->getHelper()->getSenderForShipment();
272
+ $smsmsg = $this->getHelper()->getMessageForShipment($order);
273
+ $data = '?method=sendSMS';
274
+ $data .= '&username=' . urlencode($username);
275
+ $data .= '&password=' . urlencode($password);
276
+ $data .= '&destination=' . urlencode($smsto);
277
+ $data .= '&originator=' . urlencode($smsfrom);
278
+ $data .= '&message=' . urlencode($smsmsg);
279
+ $data .= '&validity=300';
280
+ $url = $host.$path.$data;
281
+ $sendSms = $this->getHelper()->voodoo($url);
282
+ try {
283
+ Mage::getModel('voodoo/voodoo')
284
+ ->setOrderId($order->getIncrementId())
285
+ ->setFrom($smsfrom)
286
+ ->setTo($smsto)
287
+ ->setSmsMessage($smsmsg)
288
+ ->setStatus($sendSms['status'])
289
+ ->setStatusMessage($sendSms['status_message'])
290
+ ->setCreatedTime(now())
291
+ ->save();
292
+ }
293
+ catch (Exception $e) {}
294
+ if($this->getHelper()->isOrdersShipmentsNotify() and $this->getHelper()->getAdminShipmentsTelephone()) {
295
+ $smsto = $this->getHelper()->getAdminTelephone();
296
+ $smsmsg = Mage::helper('voodoo')->__('%s is on shipment state',$order->getIncrementId());
297
+ $data = '?method=sendSMS';
298
+ $data .= '&username=' . urlencode($username);
299
+ $data .= '&password=' . urlencode($password);
300
+ $data .= '&destination=' . urlencode($smsto);
301
+ $data .= '&originator=' . urlencode($smsfrom);
302
+ $data .= '&message=' . urlencode($smsmsg);
303
+ $data .= '&validity=300';
304
+ $url = $host.$path.$data;
305
+ $sendSms = $this->getHelper()->voodoo($url);
306
+ try {
307
+ Mage::getModel('voodoo/voodoo')
308
+ ->setOrderId($order->getIncrementId())
309
+ ->setFrom($smsfrom)
310
+ ->setTo($smsto)
311
+ ->setSmsMessage($smsmsg)
312
+ ->setStatus($sendSms['status'])
313
+ ->setStatusMessage($sendSms['status_message'])
314
+ ->setCreatedTime(now())
315
+ ->save();
316
+ }
317
+ catch (Exception $e) {}
318
+ }
319
+ }
320
+ }
321
+ }
322
+
323
+ public function getHelper()
324
+ {
325
+ return Mage::helper('voodoo/Data');
326
+ }
327
+ }
app/code/community/TGM/Voodoo/Model/Observerrrr.php ADDED
@@ -0,0 +1,327 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class TGM_Voodoo_Model_Observerrrr
3
+ {
4
+ public function sendSmsOnOrderCreated(Varien_Event_Observer $observer)
5
+ {
6
+ if($this->getHelper()->isEnabled(1)) {
7
+ $orders = $observer->getEvent()->getOrderIds();
8
+ $order = Mage::getModel('sales/order')->load($orders['0']);
9
+ if ($order instanceof Mage_Sales_Model_Order) {
10
+ $host = "http://www.voodoosms.com/";
11
+ $path = "vsapi/server.php";
12
+ $username = $this->getHelper()->getUsername();
13
+ $password = $this->getHelper()->getPassword();
14
+ $smsto = $this->getHelper()->getDestination($order);
15
+ $smsfrom = $this->getHelper()->getSender(1);
16
+ $smsmsg = $this->getHelper()->getMessage($order,1);;
17
+ $data = '?method=sendSMS';
18
+ $data .= '&username=' . urlencode($username);
19
+ $data .= '&password=' . urlencode($password);
20
+ $data .= '&destination=' . urlencode($smsto);
21
+ $data .= '&originator=' . urlencode($smsfrom);
22
+ $data .= '&message=' . urlencode($smsmsg);
23
+ $data .= '&validity=300';
24
+ $url = $host.$path.$data;
25
+ $sendSms = $this->getHelper()->voodoo($url);
26
+ try {
27
+ Mage::getModel('voodoo/voodoo')
28
+ ->setOrderId($order->getIncrementId())
29
+ ->setFrom($smsfrom)
30
+ ->setTo($smsto)
31
+ ->setSmsMessage($smsmsg)
32
+ ->setStatus($sendSms['status'])
33
+ ->setStatusMessage($sendSms['status_message'])
34
+ ->setCreatedTime(now())
35
+ ->save();
36
+ }
37
+ catch (Exception $e) {}
38
+
39
+ if($this->getHelper()->isNotifyEnabled(1) and $this->getHelper()->getAdminDestination(1)) {
40
+ $smsto = $this->getHelper()->getAdminDestination(1);
41
+ $smsmsg = Mage::helper('voodoo')->__('A new order has been placed: %s',$order->getIncrementId());
42
+ $data = '?method=sendSMS';
43
+ $data .= '&username=' . urlencode($username);
44
+ $data .= '&password=' . urlencode($password);
45
+ $data .= '&destination=' . urlencode($smsto);
46
+ $data .= '&originator=' . urlencode($smsfrom);
47
+ $data .= '&message=' . urlencode($smsmsg);
48
+ $data .= '&validity=300';
49
+ $url = $host.$path.$data;
50
+ $sendSms = $this->getHelper()->voodoo($url);
51
+ try {
52
+ Mage::getModel('voodoo/voodoo')
53
+ ->setOrderId($order->getIncrementId())
54
+ ->setFrom($smsfrom)
55
+ ->setTo($smsto)
56
+ ->setSmsMessage($smsmsg)
57
+ ->setStatus($sendSms['status'])
58
+ ->setStatusMessage($sendSms['status_message'])
59
+ ->setCreatedTime(now())
60
+ ->save();
61
+ }
62
+ catch (Exception $e) {}
63
+ }
64
+ }
65
+ }
66
+ }
67
+
68
+ public function sendSmsOnOrderHold(Varien_Event_Observer $observer)
69
+ {
70
+ if($this->getHelper()->isEnabled(2)) {
71
+ $order = $observer->getOrder();
72
+ if ($order instanceof Mage_Sales_Model_Order) {
73
+ if ($order->getState() !== $order->getOrigData('state') && $order->getState() === Mage_Sales_Model_Order::STATE_HOLDED) {
74
+ $host = "http://www.voodoosms.com/";
75
+ $path = "vsapi/server.php";
76
+ $username = $this->getHelper()->getUsername();
77
+ $password = $this->getHelper()->getPassword();;
78
+ $smsto = $this->getHelper()->getDestination($order);
79
+ $smsfrom = $this->getHelper()->getSender(2);
80
+ $smsmsg = $this->getHelper()->getMessage($order,2);
81
+ $data = '?method=sendSMS';
82
+ $data .= '&username=' . urlencode($username);
83
+ $data .= '&password=' . urlencode($password);
84
+ $data .= '&destination=' . urlencode($smsto);
85
+ $data .= '&originator=' . urlencode($smsfrom);
86
+ $data .= '&message=' . urlencode($smsmsg);
87
+ $data .= '&validity=300';
88
+ $url = $host.$path.$data;
89
+ $sendSms = $this->getHelper()->voodoo($url);
90
+ try {
91
+ Mage::getModel('voodoo/voodoo')
92
+ ->setOrderId($order->getIncrementId())
93
+ ->setFrom($smsfrom)
94
+ ->setTo($smsto)
95
+ ->setSmsMessage($smsmsg)
96
+ ->setStatus($sendSms['status'])
97
+ ->setStatusMessage($sendSms['status_message'])
98
+ ->setCreatedTime(now())
99
+ ->save();
100
+ }
101
+ catch (Exception $e) {}
102
+ if($this->getHelper()->isNotifyEnabled(2) and $this->getHelper()->getAdminDestination(2)) {
103
+ $smsto = $this->getHelper()->getAdminDestination(2);
104
+ $smsmsg = Mage::helper('voodoo')->__('%s has been placed on hold',$order->getIncrementId());
105
+ $data = '?method=sendSMS';
106
+ $data .= '&username=' . urlencode($username);
107
+ $data .= '&password=' . urlencode($password);
108
+ $data .= '&destination=' . urlencode($smsto);
109
+ $data .= '&originator=' . urlencode($smsfrom);
110
+ $data .= '&message=' . urlencode($smsmsg);
111
+ $data .= '&validity=300';
112
+ $url = $host.$path.$data;
113
+ $sendSms = $this->getHelper()->voodoo($url);
114
+ try {
115
+ Mage::getModel('voodoo/voodoo')
116
+ ->setOrderId($order->getIncrementId())
117
+ ->setFrom($smsfrom)
118
+ ->setTo($smsto)
119
+ ->setSmsMessage($smsmsg)
120
+ ->setStatus($sendSms['status'])
121
+ ->setStatusMessage($sendSms['status_message'])
122
+ ->setCreatedTime(now())
123
+ ->save();
124
+ }
125
+ catch (Exception $e) {}
126
+ }
127
+ }
128
+ }
129
+ }
130
+ }
131
+
132
+ public function sendSmsOnOrderUnhold(Varien_Event_Observer $observer)
133
+ {
134
+ if($this->getHelper()->isEnabled(3)) {
135
+ $order = $observer->getOrder();
136
+ if ($order instanceof Mage_Sales_Model_Order) {
137
+ if ($order->getState() !== $order->getOrigData('state') && $order->getOrigData('state') === Mage_Sales_Model_Order::STATE_HOLDED) {
138
+ $host = "http://www.voodoosms.com/";
139
+ $path = "vsapi/server.php";
140
+ $username = $this->getHelper()->getUsername();
141
+ $password = $this->getHelper()->getPassword();;
142
+ $smsto = $this->getHelper()->getDestination($order);
143
+ $smsfrom = $this->getHelper()->getSender(3);
144
+ $smsmsg = $this->getHelper()->getMessage($order,3);
145
+ $data = '?method=sendSMS';
146
+ $data .= '&username=' . urlencode($username);
147
+ $data .= '&password=' . urlencode($password);
148
+ $data .= '&destination=' . urlencode($smsto);
149
+ $data .= '&originator=' . urlencode($smsfrom);
150
+ $data .= '&message=' . urlencode($smsmsg);
151
+ $data .= '&validity=300';
152
+ $url = $host.$path.$data;
153
+ $sendSms = $this->getHelper()->voodoo($url);
154
+ try {
155
+ Mage::getModel('voodoo/voodoo')
156
+ ->setOrderId($order->getIncrementId())
157
+ ->setFrom($smsfrom)
158
+ ->setTo($smsto)
159
+ ->setSmsMessage($smsmsg)
160
+ ->setStatus($sendSms['status'])
161
+ ->setStatusMessage($sendSms['status_message'])
162
+ ->setCreatedTime(now())
163
+ ->save();
164
+ }
165
+ catch (Exception $e) {}
166
+ if($this->getHelper()->isNotifyEnabled(3) and $this->getHelper()->getAdminDestination(3)) {
167
+ $smsto = $this->getHelper()->getAdminDestination(3);
168
+ $smsmsg = Mage::helper('voodoo')->__('%s has been placed on unhold',$order->getIncrementId());
169
+ $data = '?method=sendSMS';
170
+ $data .= '&username=' . urlencode($username);
171
+ $data .= '&password=' . urlencode($password);
172
+ $data .= '&destination=' . urlencode($smsto);
173
+ $data .= '&originator=' . urlencode($smsfrom);
174
+ $data .= '&message=' . urlencode($smsmsg);
175
+ $data .= '&validity=300';
176
+ $url = $host.$path.$data;
177
+ $sendSms = $this->getHelper()->voodoo($url);
178
+ try {
179
+ Mage::getModel('voodoo/voodoo')
180
+ ->setOrderId($order->getIncrementId())
181
+ ->setFrom($smsfrom)
182
+ ->setTo($smsto)
183
+ ->setSmsMessage($smsmsg)
184
+ ->setStatus($sendSms['status'])
185
+ ->setStatusMessage($sendSms['status_message'])
186
+ ->setCreatedTime(now())
187
+ ->save();
188
+ }
189
+ catch (Exception $e) {}
190
+ }
191
+ }
192
+ }
193
+ }
194
+ }
195
+
196
+ public function sendSmsOnOrderCanceled(Varien_Event_Observer $observer)
197
+ {
198
+ if($this->getHelper()->isEnabled(4)) {
199
+ $order = $observer->getOrder();
200
+ if ($order instanceof Mage_Sales_Model_Order) {
201
+ if ($order->getState() !== $order->getOrigData('state') && $order->getState() === Mage_Sales_Model_Order::STATE_CANCELED) {
202
+ $host = "http://www.voodoosms.com/";
203
+ $path = "vsapi/server.php";
204
+ $username = $this->getHelper()->getUsername();
205
+ $password = $this->getHelper()->getPassword();;
206
+ $smsto = $this->getHelper()->getDestination($order);
207
+ $smsfrom = $this->getHelper()->getSender(4);
208
+ $smsmsg = $this->getHelper()->getMessage($order,4);
209
+ $data = '?method=sendSMS';
210
+ $data .= '&username=' . urlencode($username);
211
+ $data .= '&password=' . urlencode($password);
212
+ $data .= '&destination=' . urlencode($smsto);
213
+ $data .= '&originator=' . urlencode($smsfrom);
214
+ $data .= '&message=' . urlencode($smsmsg);
215
+ $data .= '&validity=300';
216
+ $url = $host.$path.$data;
217
+ $sendSms = $this->getHelper()->voodoo($url);
218
+ try {
219
+ Mage::getModel('voodoo/voodoo')
220
+ ->setOrderId($order->getIncrementId())
221
+ ->setFrom($smsfrom)
222
+ ->setTo($smsto)
223
+ ->setSmsMessage($smsmsg)
224
+ ->setStatus($sendSms['status'])
225
+ ->setStatusMessage($sendSms['status_message'])
226
+ ->setCreatedTime(now())
227
+ ->save();
228
+ }
229
+ catch (Exception $e) {}
230
+ if($this->getHelper()->isNotifyEnabled(4) and $this->getHelper()->getAdminDestination(4)) {
231
+ $smsto = $this->getHelper()->getAdminDestination(4);
232
+ $smsmsg = Mage::helper('voodoo')->__('%s has been placed cancelled',$order->getIncrementId());
233
+ $data = '?method=sendSMS';
234
+ $data .= '&username=' . urlencode($username);
235
+ $data .= '&password=' . urlencode($password);
236
+ $data .= '&destination=' . urlencode($smsto);
237
+ $data .= '&originator=' . urlencode($smsfrom);
238
+ $data .= '&message=' . urlencode($smsmsg);
239
+ $data .= '&validity=300';
240
+ $url = $host.$path.$data;
241
+ $sendSms = $this->getHelper()->voodoo($url);
242
+ try {
243
+ Mage::getModel('voodoo/voodoo')
244
+ ->setOrderId($order->getIncrementId())
245
+ ->setFrom($smsfrom)
246
+ ->setTo($smsto)
247
+ ->setSmsMessage($smsmsg)
248
+ ->setStatus($sendSms['status'])
249
+ ->setStatusMessage($sendSms['status_message'])
250
+ ->setCreatedTime(now())
251
+ ->save();
252
+ }
253
+ catch (Exception $e) {}
254
+ }
255
+ }
256
+ }
257
+ }
258
+ }
259
+
260
+ public function sendSmsOnShipmentCreated(Varien_Event_Observer $observer)
261
+ {
262
+ if($this->getHelper()->isEnabled(5)) {
263
+ $shipment = $observer->getEvent()->getShipment();
264
+ $order = $shipment->getOrder();
265
+ if ($order instanceof Mage_Sales_Model_Order) {
266
+ $host = "http://www.voodoosms.com/";
267
+ $path = "vsapi/server.php";
268
+ $username = $this->getHelper()->getUsername();
269
+ $password = $this->getHelper()->getPassword();;
270
+ $smsto = $this->getHelper()->getDestination($order);
271
+ $smsfrom = $this->getHelper()->getSender(5);
272
+ $smsmsg = $this->getHelper()->getMessage($order,5);
273
+ $data = '?method=sendSMS';
274
+ $data .= '&username=' . urlencode($username);
275
+ $data .= '&password=' . urlencode($password);
276
+ $data .= '&destination=' . urlencode($smsto);
277
+ $data .= '&originator=' . urlencode($smsfrom);
278
+ $data .= '&message=' . urlencode($smsmsg);
279
+ $data .= '&validity=300';
280
+ $url = $host.$path.$data;
281
+ $sendSms = $this->getHelper()->voodoo($url);
282
+ try {
283
+ Mage::getModel('voodoo/voodoo')
284
+ ->setOrderId($order->getIncrementId())
285
+ ->setFrom($smsfrom)
286
+ ->setTo($smsto)
287
+ ->setSmsMessage($smsmsg)
288
+ ->setStatus($sendSms['status'])
289
+ ->setStatusMessage($sendSms['status_message'])
290
+ ->setCreatedTime(now())
291
+ ->save();
292
+ }
293
+ catch (Exception $e) {}
294
+ if($this->getHelper()->isNotifyEnabled(5) and $this->getHelper()->getAdminDestination(5)) {
295
+ $smsto = $this->getHelper()->getAdminDestination(5);
296
+ $smsmsg = Mage::helper('voodoo')->__('%s is on shipment state',$order->getIncrementId());
297
+ $data = '?method=sendSMS';
298
+ $data .= '&username=' . urlencode($username);
299
+ $data .= '&password=' . urlencode($password);
300
+ $data .= '&destination=' . urlencode($smsto);
301
+ $data .= '&originator=' . urlencode($smsfrom);
302
+ $data .= '&message=' . urlencode($smsmsg);
303
+ $data .= '&validity=300';
304
+ $url = $host.$path.$data;
305
+ $sendSms = $this->getHelper()->voodoo($url);
306
+ try {
307
+ Mage::getModel('voodoo/voodoo')
308
+ ->setOrderId($order->getIncrementId())
309
+ ->setFrom($smsfrom)
310
+ ->setTo($smsto)
311
+ ->setSmsMessage($smsmsg)
312
+ ->setStatus($sendSms['status'])
313
+ ->setStatusMessage($sendSms['status_message'])
314
+ ->setCreatedTime(now())
315
+ ->save();
316
+ }
317
+ catch (Exception $e) {}
318
+ }
319
+ }
320
+ }
321
+ }
322
+
323
+ public function getHelper()
324
+ {
325
+ return Mage::helper('voodoo/Data');
326
+ }
327
+ }
app/code/community/TGM/Voodoo/Model/Voodoo.php ADDED
@@ -0,0 +1,86 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class TGM_Voodoo_Model_Voodoo extends Mage_Core_Model_Abstract
4
+ {
5
+ const CONFIG_PATH = 'voodoo/';
6
+ public function _construct()
7
+ {
8
+ parent::_construct();
9
+ $this->_init('voodoo/voodoo');
10
+ }
11
+
12
+ public function getCredit(){
13
+ $username = Mage::helper('voodoo/Data')->getUsername();
14
+ $password = Mage::helper('voodoo/Data')->getPassword();
15
+ $host = "http://www.voodoosms.com/";
16
+ $path = "vsapi/server.php";
17
+ $data = '?method=get_credit';
18
+ $data .= '&username=' . urlencode($username);
19
+ $data .= '&password=' . urlencode($password);
20
+ $url = $host.$path.$data;
21
+ $credits = Mage::helper('voodoo/Data')->credits($url);
22
+ return $credits;
23
+ }
24
+
25
+ public function verify_api(){
26
+ $username = Mage::helper('voodoo/Data')->getUsername();
27
+ $password = Mage::helper('voodoo/Data')->getPassword();
28
+ $host = "http://www.voodoosms.com/";
29
+ $path = "vsapi/server-test.php";
30
+ $data = '?method=verify_api';
31
+ $data .= '&username='.urlencode($username);
32
+ $data .= '&password='.urlencode($password);
33
+ $url = $host.$path.$data;
34
+ $verified = Mage::helper('voodoo/Data')->verify_api($url);
35
+ return $verified;
36
+ }
37
+
38
+ public function verify_others(){
39
+ $originator = array();
40
+ $originator[0] = Mage::getStoreConfig(self::CONFIG_PATH.'orders/sender');
41
+ $originator[1] = Mage::getStoreConfig(self::CONFIG_PATH.'order_hold/sender');
42
+ $originator[2] = Mage::getStoreConfig(self::CONFIG_PATH.'order_unhold/sender');
43
+ $originator[3] = Mage::getStoreConfig(self::CONFIG_PATH.'order_canceled/sender');;
44
+ $originator[4] = Mage::getStoreConfig(self::CONFIG_PATH.'shipments/sender');
45
+
46
+ $message = array();
47
+ $message[0] = Mage::getStoreConfig(self::CONFIG_PATH.'orders/message');
48
+ $message[1] = Mage::getStoreConfig(self::CONFIG_PATH.'order_hold/message');
49
+ $message[2] = Mage::getStoreConfig(self::CONFIG_PATH.'order_unhold/message');
50
+ $message[3] = Mage::getStoreConfig(self::CONFIG_PATH.'order_canceled/message');
51
+ $message[4] = Mage::getStoreConfig(self::CONFIG_PATH.'shipments/message');
52
+
53
+ $verify_others = 1;
54
+ foreach ($originator as $row){
55
+ $url = "www.voodoosms.com/vsapi/server-test.php?method=validate_nonperm_words";
56
+ $url.="&message=$row&type=2";
57
+ $verify_others&= Mage::helper('voodoo/Data')->verify_others($url);
58
+
59
+ }
60
+ foreach ($message as $row){
61
+ $url = "www.voodoosms.com/vsapi/server-test.php?method=validate_nonperm_words";
62
+ $url.="&message=$row&type=1";
63
+ $verify_others&= Mage::helper('voodoo/Data')->verify_others($url);
64
+
65
+ }
66
+ return $verify_others;
67
+ }
68
+
69
+ /*public function exportOrder($order,$sendSms)
70
+ {
71
+ $dirPath = Mage::getBaseDir('var') . DS . 'export';
72
+
73
+ //if the export directory does not exist, create it
74
+ if (!is_dir($dirPath)) {
75
+ mkdir($dirPath, 0777, true);
76
+ }
77
+ file_put_contents(
78
+ $dirPath. DS .$order->getIncrementId().'.txt',
79
+ $sendSms
80
+ );
81
+
82
+ return true;
83
+ }
84
+ */
85
+
86
+ }
app/code/community/TGM/Voodoo/controllers/IndexController.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class TGM_Voodoo_IndexController extends Mage_Core_Controller_Front_Action
3
+ {
4
+ public function indexAction()
5
+ {
6
+ $this->loadLayout();
7
+ $this->renderLayout();
8
+ }
9
+ }
app/code/community/TGM/Voodoo/etc/config.xml ADDED
@@ -0,0 +1,206 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * @category TGM
5
+ * @package TGM_Voodoo
6
+ * @author TGM
7
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
8
+ */
9
+ -->
10
+ <config>
11
+ <modules>
12
+ <TGM_Voodoo>
13
+ <version>1.0.0</version>
14
+ </TGM_Voodoo>
15
+ </modules>
16
+ <admin>
17
+ <routers>
18
+ <voodoo>
19
+ <use>admin</use>
20
+ <args>
21
+ <module>TGM_Voodoo</module>
22
+ <frontName>voodoo</frontName>
23
+ </args>
24
+ </voodoo>
25
+ </routers>
26
+ </admin>
27
+ <adminhtml>
28
+ <translate>
29
+ <modules>
30
+ <tgm_voodoo>
31
+ <files>
32
+ <default>TGM_Voodoo.csv</default>
33
+ </files>
34
+ </tgm_voodoo>
35
+ </modules>
36
+ </translate>
37
+ <menu>
38
+ <voodoo translate="title" module="voodoo">
39
+ <title>SMS</title>
40
+ <sort_order>60</sort_order>
41
+ <children>
42
+ <settings translate="title" module="voodoo">
43
+ <title>Settings</title>
44
+ <sort_order>15</sort_order>
45
+ <action>adminhtml/system_config/edit/section/voodoo</action>
46
+ </settings>
47
+ </children>
48
+ </voodoo>
49
+ </menu>
50
+ <acl>
51
+ <resources>
52
+ <all>
53
+ <title>Allow Everything</title>
54
+ </all>
55
+ <admin>
56
+ <children>
57
+ <voodoo translate="title" module="voodoo">
58
+ <title>Voodoo Sms</title>
59
+ <sort_order>15</sort_order>
60
+ <children>
61
+ <settings translate="title" module="voodoo">
62
+ <title>Settings</title>
63
+ <sort_order>15</sort_order>
64
+ </settings>
65
+ </children>
66
+ </voodoo>
67
+ <system>
68
+ <children>
69
+ <config>
70
+ <children>
71
+ <voodoo translate="title" module="voodoo">
72
+ <title>Voodoo SMS</title>
73
+ <sort_order>15</sort_order>
74
+ </voodoo>
75
+ </children>
76
+ </config>
77
+ </children>
78
+ </system>
79
+ </children>
80
+ </admin>
81
+ </resources>
82
+ </acl>
83
+ <layout>
84
+ <updates>
85
+ <voodoo>
86
+ <file>voodoo.xml</file>
87
+ </voodoo>
88
+ </updates>
89
+ </layout>
90
+ </adminhtml>
91
+ <global>
92
+ <models>
93
+ <voodoo>
94
+ <class>TGM_Voodoo_Model</class>
95
+ <resourceModel>voodoo_mysql4</resourceModel>
96
+ </voodoo>
97
+ <voodoo_mysql4>
98
+ <class>TGM_Voodoo_Model_Mysql4</class>
99
+ <entities>
100
+ <voodoo>
101
+ <table>voodoo</table>
102
+ </voodoo>
103
+ </entities>
104
+ </voodoo_mysql4>
105
+ </models>
106
+ <resources>
107
+ <voodoo_setup>
108
+ <setup>
109
+ <module>TGM_Voodoo</module>
110
+ </setup>
111
+ <connection>
112
+ <use>core_setup</use>
113
+ </connection>
114
+ </voodoo_setup>
115
+ <voodoo_write>
116
+ <connection>
117
+ <use>core_write</use>
118
+ </connection>
119
+ </voodoo_write>
120
+ <voodoo_read>
121
+ <connection>
122
+ <use>core_read</use>
123
+ </connection>
124
+ </voodoo_read>
125
+ </resources>
126
+ <blocks>
127
+ <voodoo>
128
+ <class>TGM_Voodoo_Block</class>
129
+ </voodoo>
130
+ </blocks>
131
+ <helpers>
132
+ <voodoo>
133
+ <class>TGM_Voodoo_Helper</class>
134
+ </voodoo>
135
+ </helpers>
136
+ <events>
137
+ <checkout_onepage_controller_success_action>
138
+ <observers>
139
+ <TGM_Voodoo_Created>
140
+ <type>singleton</type>
141
+ <class>TGM_Voodoo_Model_Observer</class>
142
+ <method>sendSmsOnOrderCreated</method>
143
+ </TGM_Voodoo_Created>
144
+ </observers>
145
+ </checkout_onepage_controller_success_action>
146
+ <sales_order_save_after>
147
+ <observers>
148
+ <TGM_Voodoo_Order_Hold>
149
+ <type>singleton</type>
150
+ <class>TGM_Voodoo_Model_Observer</class>
151
+ <method>sendSmsOnOrderHold</method>
152
+ </TGM_Voodoo_Order_Hold>
153
+ <TGM_Voodoo_Order_Unhold>
154
+ <type>singleton</type>
155
+ <class>TGM_Voodoo_Model_Observer</class>
156
+ <method>sendSmsOnOrderUnhold</method>
157
+ </TGM_Voodoo_Order_Unhold>
158
+ <TGM_Voodoo_Order_Canceled>
159
+ <type>singleton</type>
160
+ <class>TGM_Voodoo_Model_Observer</class>
161
+ <method>sendSmsOnOrderCanceled</method>
162
+ </TGM_Voodoo_Order_Canceled>
163
+ </observers>
164
+ </sales_order_save_after>
165
+ <sales_order_shipment_save_after>
166
+ <observers>
167
+ <TGM_Voodoo_Shipment_Created>
168
+ <type>singleton</type>
169
+ <class>TGM_Voodoo_Model_Observer</class>
170
+ <method>sendSmsOnShipmentCreated</method>
171
+ </TGM_Voodoo_Shipment_Created>
172
+ </observers>
173
+ </sales_order_shipment_save_after>
174
+ </events>
175
+ </global>
176
+ <default>
177
+ <voodoo>
178
+ <orders>
179
+ <enabled>0</enabled>
180
+ <sender>Your Store</sender>
181
+ <message>Hello {{firstname}}. We have received your order. Thanks alot</message>
182
+ <notify>0</notify>
183
+ </orders>
184
+ <order_hold>
185
+ <enabled>0</enabled>
186
+ <sender>Your Store</sender>
187
+ <message>Hello {{firstname}}. Your order is on hold. Order id is {{order_id}}</message>
188
+ </order_hold>
189
+ <order_unhold>
190
+ <enabled>0</enabled>
191
+ <sender>Your Store</sender>
192
+ <message>Hello {{firstname}}. Your status is now unhold for order {{order_id}}.</message>
193
+ </order_unhold>
194
+ <order_canceled>
195
+ <enabled>0</enabled>
196
+ <sender>Your Store</sender>
197
+ <message>Hello {{firstname}}. Sorry your order has been cancelled. Order number {{order_id}}</message>
198
+ </order_canceled>
199
+ <shipments>
200
+ <enabled>0</enabled>
201
+ <sender>Your Store</sender>
202
+ <message>Hello {{firstname}}. Your order is now on shipment. You will get it soon. Thank you for buying from us.</message>
203
+ </shipments>
204
+ </voodoo>
205
+ </default>
206
+ </config>
app/code/community/TGM/Voodoo/etc/system.xml ADDED
@@ -0,0 +1,424 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <tabs>
4
+ <tgm translate="label" module="voodoo">
5
+ <label><![CDATA[<div style="position: absolute;"><img id="magepal_block" style="height:20px; width:65px;" src="" alt="" border="0" /></div>&nbsp;<script>$('magepal_block').src = SKIN_URL + "images/magepal.png";</script>]]></label>
6
+ <sort_order>1000</sort_order>
7
+ </tgm>
8
+ </tabs>
9
+ <sections>
10
+ <voodoo translate="label" module="voodoo">
11
+ <label>SMS - Settings</label>
12
+ <tab>tgm</tab>
13
+ <frontend_type>text</frontend_type>
14
+ <sort_order>75</sort_order>
15
+ <show_in_default>1</show_in_default>
16
+ <show_in_website>1</show_in_website>
17
+ <show_in_store>1</show_in_store>
18
+ <groups>
19
+ <header>
20
+ <frontend_model>voodoo/backend_page_header</frontend_model>
21
+ <sort_order>0</sort_order>
22
+ <show_in_default>1</show_in_default>
23
+ <show_in_website>1</show_in_website>
24
+ <show_in_store>1</show_in_store>
25
+ </header>
26
+ <enter translate="label">
27
+ <label>Enter API Username and Password</label>
28
+ <frontend_type>text</frontend_type>
29
+ <sort_order>10</sort_order>
30
+ <show_in_default>1</show_in_default>
31
+ <show_in_website>1</show_in_website>
32
+ <show_in_store>1</show_in_store>
33
+ <fields>
34
+ <username translate="label">
35
+ <label>Voodoo API Username</label>
36
+ <comment>Enter your voodoo api Username</comment>
37
+ <tooltip>Your username must be the same as your voodoo api username</tooltip>
38
+ <frontend_type>text</frontend_type>
39
+ <sort_order>5</sort_order>
40
+ <show_in_default>1</show_in_default>
41
+ <show_in_website>1</show_in_website>
42
+ <show_in_store>1</show_in_store>
43
+ </username>
44
+ <password translate="label">
45
+ <label>Voodoo API Password</label>
46
+ <comment>Enter your voodoo api Password</comment>
47
+ <tooltip>Your password must be the same as your voodoo api password</tooltip>
48
+ <frontend_type>password</frontend_type>
49
+ <sort_order>10</sort_order>
50
+ <show_in_default>1</show_in_default>
51
+ <show_in_website>1</show_in_website>
52
+ <show_in_store>1</show_in_store>
53
+ </password>
54
+ <verify translate="label">
55
+ <frontend_model>voodoo/verifyApiAccount</frontend_model>
56
+ <sort_order>15</sort_order>
57
+ <show_in_default>1</show_in_default>
58
+ <show_in_website>1</show_in_website>
59
+ <show_in_store>1</show_in_store>
60
+ </verify>
61
+ <verifiesss translate="label">
62
+ <frontend_model>voodoo/otherVerifications</frontend_model>
63
+ <sort_order>30</sort_order>
64
+ <show_in_default>1</show_in_default>
65
+ <show_in_website>1</show_in_website>
66
+ <show_in_store>1</show_in_store>
67
+ </verifiesss>
68
+ <grabApiAccount translate="label">
69
+ <label>Create API Login</label>
70
+ <comment>Click above to set an API username and password</comment>
71
+ <frontend_model>voodoo/grabApiAccount</frontend_model>
72
+ <sort_order>20</sort_order>
73
+ <show_in_default>1</show_in_default>
74
+ <show_in_website>1</show_in_website>
75
+ <show_in_store>1</show_in_store>
76
+ </grabApiAccount>
77
+ <credits translate="label">
78
+ <label>Your Current Credits</label>
79
+ <comment>Click above to get more credits </comment>
80
+ <frontend_model>voodoo/credits</frontend_model>
81
+ <sort_order>25</sort_order>
82
+ <show_in_default>1</show_in_default>
83
+ <show_in_website>1</show_in_website>
84
+ <show_in_store>1</show_in_store>
85
+ </credits>
86
+ </fields>
87
+ </enter>
88
+ <orders translate="label">
89
+ <label>When new order is placed</label>
90
+ <frontend_type>text</frontend_type>
91
+ <sort_order>15</sort_order>
92
+ <show_in_default>1</show_in_default>
93
+ <show_in_website>1</show_in_website>
94
+ <show_in_store>1</show_in_store>
95
+ <fields>
96
+ <enabled translate="label comment">
97
+ <label>Enabled</label>
98
+ <comment>This option will send sms when an order is placed</comment>
99
+ <frontend_type>select</frontend_type>
100
+ <source_model>adminhtml/system_config_source_yesno</source_model>
101
+ <sort_order>5</sort_order>
102
+ <show_in_default>1</show_in_default>
103
+ <show_in_website>1</show_in_website>
104
+ <show_in_store>1</show_in_store>
105
+ </enabled>
106
+ <sender translate="label comment">
107
+ <label>Enter the Sender ID</label>
108
+ <comment>‘Company’ e.g. 'My Store’ (max: 11 alphanumeric characters. This is who the SMS will appear from when received)</comment>
109
+ <tooltip>You can enter upto 11 digits or characters</tooltip>
110
+ <validate>required-entry validate-length minimum-length-1 maximum-length-11</validate>
111
+ <frontend_type>text</frontend_type>
112
+ <sort_order>10</sort_order>
113
+ <show_in_default>1</show_in_default>
114
+ <show_in_website>1</show_in_website>
115
+ <show_in_store>1</show_in_store>
116
+ </sender>
117
+ <message translate="label comment">
118
+ <label>Enter the Message</label>
119
+ <comment>Your Message Content, (Max 160 character)</comment>
120
+ <validate>required-entry validate-length minimum-length-1 maximum-length-160</validate>
121
+ <tooltip>Enter your default message. You can use {{firstname}} for Firstname, {{middlename}} for Middlename, {{lastname}} for Lastname, {{fax}} for Fax, {{postal}} for Post Code, {{city}} for City, {{email}} for EmailAddress and {{order_id}} for Order Number.</tooltip>
122
+ <frontend_type>textarea</frontend_type>
123
+ <sort_order>15</sort_order>
124
+ <show_in_default>1</show_in_default>
125
+ <show_in_website>1</show_in_website>
126
+ <show_in_store>1</show_in_store>
127
+ </message>
128
+ <notify translate="label comment">
129
+ <label>Admin Alerts</label>
130
+ <comment>This option will send sms to the admin when an order is placed</comment>
131
+ <frontend_type>select</frontend_type>
132
+ <source_model>adminhtml/system_config_source_yesno</source_model>
133
+ <sort_order>20</sort_order>
134
+ <show_in_default>1</show_in_default>
135
+ <show_in_website>1</show_in_website>
136
+ <show_in_store>1</show_in_store>
137
+ </notify>
138
+ <receiver translate="label comment">
139
+ <label>Admin Mobile</label>
140
+ <comment>ex: 447624803605</comment>
141
+ <validate>required-entry</validate>
142
+ <frontend_type>text</frontend_type>
143
+ <sort_order>25</sort_order>
144
+ <show_in_default>1</show_in_default>
145
+ <show_in_website>1</show_in_website>
146
+ <show_in_store>1</show_in_store>
147
+ <depends>
148
+ <notify>1</notify>
149
+ </depends>
150
+ </receiver>
151
+ </fields>
152
+ </orders>
153
+ <order_hold translate="label">
154
+ <label>When Order Status is set to Hold</label>
155
+ <frontend_type>text</frontend_type>
156
+ <sort_order>20</sort_order>
157
+ <show_in_default>1</show_in_default>
158
+ <show_in_website>1</show_in_website>
159
+ <show_in_store>1</show_in_store>
160
+ <fields>
161
+ <enabled translate="label comment">
162
+ <label>Enabled</label>
163
+ <comment>This option will send sms when order status is set to hold</comment>
164
+ <frontend_type>select</frontend_type>
165
+ <source_model>adminhtml/system_config_source_yesno</source_model>
166
+ <sort_order>5</sort_order>
167
+ <show_in_default>1</show_in_default>
168
+ <show_in_website>1</show_in_website>
169
+ <show_in_store>1</show_in_store>
170
+ </enabled>
171
+ <sender translate="label comment">
172
+ <label>Enter the Sender ID</label>
173
+ <comment>‘Company’ e.g. 'My Store’ (max: 11 alphanumeric characters. This is who the SMS will appear from when received)</comment>
174
+ <tooltip>You can enter upto 11 digits or characters</tooltip>
175
+ <validate>required-entry validate-length minimum-length-1 maximum-length-11</validate>
176
+ <frontend_type>text</frontend_type>
177
+ <sort_order>10</sort_order>
178
+ <show_in_default>1</show_in_default>
179
+ <show_in_website>1</show_in_website>
180
+ <show_in_store>1</show_in_store>
181
+ </sender>
182
+ <message translate="label comment">
183
+ <label>Enter the Message</label>
184
+ <comment>Your Message Content, (Max 160 character)</comment>
185
+ <validate>required-entry validate-length minimum-length-1 maximum-length-160</validate>
186
+ <tooltip>Enter your default message. You can use {{firstname}} for Firstname, {{middlename}} for Middlename, {{lastname}} for Lastname, {{fax}} for Fax, {{postal}} for Post Code, {{city}} for City, {{email}} for EmailAddress and {{order_id}} for Order Number.</tooltip>
187
+ <frontend_type>textarea</frontend_type>
188
+ <sort_order>15</sort_order>
189
+ <show_in_default>1</show_in_default>
190
+ <show_in_website>1</show_in_website>
191
+ <show_in_store>1</show_in_store>
192
+ </message>
193
+ <notify translate="label comment">
194
+ <label>Admin Alerts</label>
195
+ <comment>This option will send sms to the admin when an order is placed</comment>
196
+ <frontend_type>select</frontend_type>
197
+ <source_model>adminhtml/system_config_source_yesno</source_model>
198
+ <sort_order>20</sort_order>
199
+ <show_in_default>1</show_in_default>
200
+ <show_in_website>1</show_in_website>
201
+ <show_in_store>1</show_in_store>
202
+ </notify>
203
+ <receiver translate="label comment">
204
+ <label>Admin Mobile</label>
205
+ <comment>ex: 447624803605</comment>
206
+ <validate>required-entry</validate>
207
+ <frontend_type>text</frontend_type>
208
+ <sort_order>25</sort_order>
209
+ <show_in_default>1</show_in_default>
210
+ <show_in_website>1</show_in_website>
211
+ <show_in_store>1</show_in_store>
212
+ <depends>
213
+ <notify>1</notify>
214
+ </depends>
215
+ </receiver>
216
+ </fields>
217
+ </order_hold>
218
+ <order_unhold translate="label">
219
+ <label>When Order Status is set to Unhold</label>
220
+ <frontend_type>text</frontend_type>
221
+ <sort_order>25</sort_order>
222
+ <show_in_default>1</show_in_default>
223
+ <show_in_website>1</show_in_website>
224
+ <show_in_store>1</show_in_store>
225
+ <fields>
226
+ <enabled translate="label comment">
227
+ <label>Enabled</label>
228
+ <comment>This option will send sms when order status is set to unhold</comment>
229
+ <frontend_type>select</frontend_type>
230
+ <source_model>adminhtml/system_config_source_yesno</source_model>
231
+ <sort_order>5</sort_order>
232
+ <show_in_default>1</show_in_default>
233
+ <show_in_website>1</show_in_website>
234
+ <show_in_store>1</show_in_store>
235
+ </enabled>
236
+ <sender translate="label comment">
237
+ <label>Enter the Sender ID</label>
238
+ <comment>‘Company’ e.g. 'My Store’ (max: 11 alphanumeric characters. This is who the SMS will appear from when received)</comment>
239
+ <tooltip>You can enter upto 11 digits or characters</tooltip>
240
+ <validate>required-entry validate-length minimum-length-1 maximum-length-11</validate>
241
+ <frontend_type>text</frontend_type>
242
+ <sort_order>10</sort_order>
243
+ <show_in_default>1</show_in_default>
244
+ <show_in_website>1</show_in_website>
245
+ <show_in_store>1</show_in_store>
246
+ </sender>
247
+ <message translate="label comment">
248
+ <label>Enter the Message</label>
249
+ <comment>Your Message Content, (Max 160 character)</comment>
250
+ <validate>required-entry validate-length minimum-length-1 maximum-length-160</validate>
251
+ <tooltip>Enter your default message. You can use {{firstname}} for Firstname, {{middlename}} for Middlename, {{lastname}} for Lastname, {{fax}} for Fax, {{postal}} for Post Code, {{city}} for City, {{email}} for EmailAddress and {{order_id}} for Order Number.</tooltip>
252
+ <frontend_type>textarea</frontend_type>
253
+ <sort_order>15</sort_order>
254
+ <show_in_default>1</show_in_default>
255
+ <show_in_website>1</show_in_website>
256
+ <show_in_store>1</show_in_store>
257
+ </message>
258
+ <notify translate="label comment">
259
+ <label>Admin Alerts</label>
260
+ <comment>This option will send sms to the admin when an order is placed</comment>
261
+ <frontend_type>select</frontend_type>
262
+ <source_model>adminhtml/system_config_source_yesno</source_model>
263
+ <sort_order>20</sort_order>
264
+ <show_in_default>1</show_in_default>
265
+ <show_in_website>1</show_in_website>
266
+ <show_in_store>1</show_in_store>
267
+ </notify>
268
+ <receiver translate="label comment">
269
+ <label>Admin Mobile</label>
270
+ <comment>ex: 447624803605</comment>
271
+ <validate>required-entry</validate>
272
+ <frontend_type>text</frontend_type>
273
+ <sort_order>25</sort_order>
274
+ <show_in_default>1</show_in_default>
275
+ <show_in_website>1</show_in_website>
276
+ <show_in_store>1</show_in_store>
277
+ <depends>
278
+ <notify>1</notify>
279
+ </depends>
280
+ </receiver>
281
+ </fields>
282
+ </order_unhold>
283
+ <order_canceled translate="label">
284
+ <label>When Order is Cancelled</label>
285
+ <frontend_type>text</frontend_type>
286
+ <sort_order>30</sort_order>
287
+ <show_in_default>1</show_in_default>
288
+ <show_in_website>1</show_in_website>
289
+ <show_in_store>1</show_in_store>
290
+ <fields>
291
+ <enabled translate="label comment">
292
+ <label>Enabled</label>
293
+ <comment>This option will send sms to customer when the order is cancelled</comment>
294
+ <frontend_type>select</frontend_type>
295
+ <source_model>adminhtml/system_config_source_yesno</source_model>
296
+ <sort_order>5</sort_order>
297
+ <show_in_default>1</show_in_default>
298
+ <show_in_website>1</show_in_website>
299
+ <show_in_store>1</show_in_store>
300
+ </enabled>
301
+ <sender translate="label comment">
302
+ <label>Enter the Sender ID</label>
303
+ <comment>‘Company’ e.g. 'My Store’ (max: 11 alphanumeric characters. This is who the SMS will appear from when received)</comment>
304
+ <tooltip>You can enter upto 11 digits or characters</tooltip>
305
+ <validate>required-entry validate-length minimum-length-1 maximum-length-11</validate>
306
+ <frontend_type>text</frontend_type>
307
+ <sort_order>10</sort_order>
308
+ <show_in_default>1</show_in_default>
309
+ <show_in_website>1</show_in_website>
310
+ <show_in_store>1</show_in_store>
311
+ </sender>
312
+ <message translate="label comment">
313
+ <label>Enter the Message</label>
314
+ <comment>Your Message Content, (Max 160 character)</comment>
315
+ <validate>required-entry validate-length minimum-length-1 maximum-length-160</validate>
316
+ <tooltip>Enter your default message. You can use {{firstname}} for Firstname, {{middlename}} for Middlename, {{lastname}} for Lastname, {{fax}} for Fax, {{postal}} for Post Code, {{city}} for City, {{email}} for EmailAddress and {{order_id}} for Order Number.</tooltip>
317
+ <frontend_type>textarea</frontend_type>
318
+ <sort_order>15</sort_order>
319
+ <show_in_default>1</show_in_default>
320
+ <show_in_website>1</show_in_website>
321
+ <show_in_store>1</show_in_store>
322
+ </message>
323
+ <notify translate="label comment">
324
+ <label>Admin Alerts</label>
325
+ <comment>This option will send sms to the admin when an order is placed</comment>
326
+ <frontend_type>select</frontend_type>
327
+ <source_model>adminhtml/system_config_source_yesno</source_model>
328
+ <sort_order>20</sort_order>
329
+ <show_in_default>1</show_in_default>
330
+ <show_in_website>1</show_in_website>
331
+ <show_in_store>1</show_in_store>
332
+ </notify>
333
+ <receiver translate="label comment">
334
+ <label>Admin Mobile</label>
335
+ <comment>ex: 447624803605</comment>
336
+ <validate>required-entry</validate>
337
+ <frontend_type>text</frontend_type>
338
+ <sort_order>25</sort_order>
339
+ <show_in_default>1</show_in_default>
340
+ <show_in_website>1</show_in_website>
341
+ <show_in_store>1</show_in_store>
342
+ <depends>
343
+ <notify>1</notify>
344
+ </depends>
345
+ </receiver>
346
+ </fields>
347
+ </order_canceled>
348
+ <shipments translate="label">
349
+ <label>When Order is set for shipment</label>
350
+ <frontend_type>text</frontend_type>
351
+ <sort_order>35</sort_order>
352
+ <show_in_default>1</show_in_default>
353
+ <show_in_website>1</show_in_website>
354
+ <show_in_store>1</show_in_store>
355
+ <fields>
356
+ <enabled translate="label comment">
357
+ <label>Enabled</label>
358
+ <comment>It will send sms when the order send on shipment</comment>
359
+ <frontend_type>select</frontend_type>
360
+ <source_model>adminhtml/system_config_source_yesno</source_model>
361
+ <sort_order>5</sort_order>
362
+ <show_in_default>1</show_in_default>
363
+ <show_in_website>1</show_in_website>
364
+ <show_in_store>1</show_in_store>
365
+ </enabled>
366
+ <sender translate="label comment">
367
+ <label>Enter the Sender ID</label>
368
+ <comment>‘Company’ e.g. 'My Store’ (max: 11 alphanumeric characters. This is who the SMS will appear from when received)</comment>
369
+ <tooltip>You can enter upto 11 digits or characters</tooltip>
370
+ <validate>required-entry validate-length minimum-length-1 maximum-length-11</validate>
371
+ <frontend_type>text</frontend_type>
372
+ <sort_order>10</sort_order>
373
+ <show_in_default>1</show_in_default>
374
+ <show_in_website>1</show_in_website>
375
+ <show_in_store>1</show_in_store>
376
+ </sender>
377
+ <message translate="label comment">
378
+ <label>Enter the Message</label>
379
+ <comment>Your Message Content, (Max 160 character)</comment>
380
+ <validate>required-entry validate-length minimum-length-1 maximum-length-160</validate>
381
+ <tooltip>Enter your default message. You can use {{firstname}} for Firstname, {{middlename}} for Middlename, {{lastname}} for Lastname, {{fax}} for Fax, {{postal}} for Post Code, {{city}} for City, {{email}} for EmailAddress and {{order_id}} for Order Number.</tooltip>
382
+ <frontend_type>textarea</frontend_type>
383
+ <sort_order>15</sort_order>
384
+ <show_in_default>1</show_in_default>
385
+ <show_in_website>1</show_in_website>
386
+ <show_in_store>1</show_in_store>
387
+ </message>
388
+ <notify translate="label comment">
389
+ <label>Admin Alerts</label>
390
+ <comment>This option will send sms to the admin when an order is placed</comment>
391
+ <frontend_type>select</frontend_type>
392
+ <source_model>adminhtml/system_config_source_yesno</source_model>
393
+ <sort_order>20</sort_order>
394
+ <show_in_default>1</show_in_default>
395
+ <show_in_website>1</show_in_website>
396
+ <show_in_store>1</show_in_store>
397
+ </notify>
398
+ <receiver translate="label comment">
399
+ <label>Admin Mobile</label>
400
+ <comment>ex: 447624803605</comment>
401
+ <validate>required-entry</validate>
402
+ <frontend_type>text</frontend_type>
403
+ <sort_order>25</sort_order>
404
+ <show_in_default>1</show_in_default>
405
+ <show_in_website>1</show_in_website>
406
+ <show_in_store>1</show_in_store>
407
+ <depends>
408
+ <notify>1</notify>
409
+ </depends>
410
+ </receiver>
411
+ </fields>
412
+ </shipments>
413
+ <footer>
414
+ <frontend_model>voodoo/backend_page_footer</frontend_model>
415
+ <sort_order>71</sort_order>
416
+ <show_in_default>1</show_in_default>
417
+ <show_in_website>1</show_in_website>
418
+ <show_in_store>1</show_in_store>
419
+ </footer>
420
+ </groups>
421
+
422
+ </voodoo>
423
+ </sections>
424
+ </config>
app/code/community/TGM/Voodoo/sql/voodoo_setup/mysql4-install-1.0.0.php ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ //this is the installer file..
3
+ //here we create the table for voodoo sms extension
4
+ // it contains some fields which are listed below
5
+ /*
6
+ *voodoo_id: primary key for the table
7
+ * order_id: store order id for sms message
8
+ * from: where the
9
+ */
10
+ $installer = $this;
11
+
12
+ $installer->startSetup();
13
+
14
+ $installer->run("
15
+
16
+ DROP TABLE IF EXISTS {$this->getTable('voodoo')};
17
+ CREATE TABLE {$this->getTable('voodoo')} (
18
+ `voodoo_id` int(11) unsigned NOT NULL AUTO_INCREMENT,
19
+ `order_id` varchar(255) NOT NULL DEFAULT '',
20
+ `from` varchar(255) NOT NULL DEFAULT '',
21
+ `to` varchar(255) NOT NULL DEFAULT '',
22
+ `sms_message` text NOT NULL,
23
+ `status` varchar(255) NOT NULL DEFAULT '',
24
+ `status_message` varchar(255) NOT NULL DEFAULT '',
25
+ `created_time` datetime DEFAULT NULL,
26
+ PRIMARY KEY (`voodoo_id`)
27
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
28
+
29
+ ");
30
+
31
+ $installer->endSetup();
app/design/adminhtml/default/default/layout/voodoo.xml ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <layout version="0.1.0">
3
+ <voodoo_adminhtml_voodoo_index>
4
+ <reference name="content">
5
+ <block type="voodoo/adminhtml_voodoo" name="voodoo" />
6
+ </reference>
7
+ </voodoo_adminhtml_voodoo_index>
8
+ </layout>
app/etc/modules/TGM_Voodoo.xml ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * @category MN
5
+ * @package MN_Sendsms
6
+ * @author 24x
7
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
8
+ */
9
+ -->
10
+ <config>
11
+ <modules>
12
+ <TGM_Voodoo>
13
+ <active>true</active>
14
+ <codePool>community</codePool>
15
+ </TGM_Voodoo>
16
+ </modules>
17
+ </config>
app/locale/en_US/TGM_Voodoo.csv ADDED
@@ -0,0 +1,53 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Voodoo,Voodoo
2
+ Manage Text Messages,Manage Text Messages
3
+ Send Manual Message(s),Send Manual Message(s)
4
+ Settings,Settings
5
+ Sms Notifications,Sms Notifications
6
+ Buy Credits/Pricing,Buy Credits/Pricing
7
+ Getting Started,Getting Started
8
+ Get an Account,Get an Account
9
+ Get a FREE account with 5 FREE credits,Get a FREE account with 5 FREE credits
10
+ If you are outside the UK please email magentosms@24xemail.com for an account. This is to ensure that your account will operate through the fastest and most reliable routes within your country.,If you are outside the UK please email magentosms@24xemail.com for an account. This is to ensure that your account will operate through the fastest and most reliable routes within your country.
11
+ General,General
12
+ Voodoo Username,Voodoo Username
13
+ Voodoo Password,Voodoo Password
14
+ Orders,Orders
15
+ Enabled,Enabled
16
+ Automatically sends a text message to the customer when an order is made,Automatically sends a text message to the customer when an order is made
17
+ Sender,Sender
18
+ Name of the sender,Name of the sender
19
+ Message,Message
20
+ Message Template (160 characters),Message Template (160 characters)
21
+ Notify Admin,Notify Admin
22
+ Automatically sends a text message also to the Admin when an order is made,Automatically sends a text message also to the Admin when an order is made
23
+ Admin Telephone,Admin Telephone
24
+ ex: +40740123456,ex: +40740123456
25
+ A new order has been placed: %s,A new order has been placed: %s
26
+ Order Hold,Order Hold
27
+ Automatically sends a text message to the customer when an order is placed on hold,Automatically sends a text message to the customer when an order is placed on hold
28
+ Order Canceled,Order Canceled
29
+ Automatically sends a text message to the customer when an order has been canceled,Automatically sends a text message to the customer when an order has been canceled
30
+ Order Unhold,Order Unhold
31
+ Automatically sends a text message to the customer when an order has been released from holding status,Automatically sends a text message to the customer when an order has been released from holding status
32
+ Send Manual SMS,Send Manual SMS
33
+ From,From
34
+ To (or Order number)," ""To (or Order number)"""
35
+ Voodoo Username or password incorrect.,Voodoo Username or password incorrect.
36
+ SmsTo missing.,SmsTo missing.
37
+ SmsFrom missing.,SmsFrom missing.
38
+ SmsMsg missing.,SmsMsg missing.
39
+ Insufficient credits.,Insufficient credits.
40
+ Sms successfully sent.,Sms successfully sent.
41
+ Not sent,Not sent
42
+ Sent,Sent
43
+ Not able to send the sms. Please contact the developer.,Not able to send the sms. Please contact the developer.
44
+ Name or Telephone,Name or Telephone
45
+ Telephone (ex: +40740123456),Telephone (ex: +40740123456)
46
+ Telephone (ex: +40740123456 or 100000001),Telephone (ex: +40740123456 or 100000001)
47
+ Order,Order
48
+ Admin Notification,Admin Notification
49
+ Shipment,Shipment
50
+ Manual SMS,Manual SMS
51
+ Shipments,Shipments
52
+ Automatically sends a text message to the customer when the shipment is made,Automatically sends a text message to the customer when the shipment is made
53
+ There was an error while getting the 24x interface. Please contact the developer.,There was an error while getting the 24x interface. Please contact the developer.
package.xml ADDED
@@ -0,0 +1,43 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <package>
3
+ <name>TGM_Voodoo_Ext</name>
4
+ <version>1.0.0</version>
5
+ <stability>stable</stability>
6
+ <license uri="http://opensource.org/licenses/osl-3.0.php">OSL v3.0</license>
7
+ <channel>community</channel>
8
+ <extends/>
9
+ <summary>Our extension will integrate SMS features into your Magento store for free. When an order is placed, shipped or status changed you can confirm with your customer and/or store admin via a text message sent directly to their mobile phone.</summary>
10
+ <description>What does it do?&#xD;
11
+ Our extension will integrate SMS features into your Magento store for free. When an order is placed, shipped or status changed you can confirm with your customer and/or store admin via a text message sent directly to their mobile phone.&#xD;
12
+ What we do different?&#xD;
13
+ Our team of UK support staff and account managers will work closely with you to help you get the most out of your SMS integration. We will work with you to enhance your brand and increase your ROI. Don&#x2019;t think of SMS as a cost, it&#x2019;s an opportunity.&#xD;
14
+ This extension uses the Bulk SMS Ltd gateway (http://www.voodoosms.com) and you will need to create a free account at this site. You will be given 25 FREE credits to see how this works, with no commitment to purchase any further credits. Bulk SMS Ltd guarantees to be the cheapest provider and will price match any equivalent competitor rate.&#xD;
15
+ Features&#xD;
16
+ Send SMS to customers on new orders&#xD;
17
+ Send SMS to customers on status updates, e.g. order shipped&#xD;
18
+ Send SMS using your brand or domain as the Sender ID (Messages appear from &#x2018;YourCompany&#x2019;)&#xD;
19
+ Full Delivery reporting &amp; data cleansing service included&#xD;
20
+ Fast, easy setup - Free Installation available&#xD;
21
+ No integration costs, no monthly subscriptions &amp; a price match promise&#xD;
22
+ Pay per message, and credits never expire&#xD;
23
+ Full reports and web portal available for bulk SMS promotion campaigns&#xD;
24
+ UK Account Management &amp; Support Team available&#xD;
25
+ Installation&#xD;
26
+ Installing this module is simple and full instructions are provided; however, if you would like assistance then please contact your Bulk SMS Ltd account manager who would be happy to arrange a slot for a technician to install this for you for FREE.&#xD;
27
+ Extension Key: (same as used in the packaging process? &#x2018;Voodoo_SMS&#x2019;?)&#xD;
28
+ Extension Categories: 1) Customer Experience/Checkout 2) Site Management/Customer Service 3) Marketing/Advertising &amp; Marketing&#xD;
29
+ Extension Locale: &#x2018;English (United Kingdom) / English (United Kingdom)'&#xD;
30
+ Extension Icon: (provided by design team) the &#x2018;Label&#x2019; should be &#x2018;Voodoo SMS Text Message'&#xD;
31
+ tick &#x2018;Is Free&#x2019;&#xD;
32
+ select which versions it works with? (hopefully 1.5.0.0 &amp; later?)&#xD;
33
+ Licence type: &#x2018;OSL&#x2019;&#xD;
34
+ Release Version: &#x2018;1.0.0'&#xD;
35
+ Release Stability: 'Stable'</description>
36
+ <notes>Release Notes</notes>
37
+ <authors><author><name>Top Gear Media</name><user>bulksms</user><email>team@voodoosms.com</email></author></authors>
38
+ <date>2014-06-25</date>
39
+ <time>13:13:38</time>
40
+ <contents><target name="magecommunity"><dir name="TGM"><dir name="Voodoo"><dir name="Block"><dir name="Backend"><dir name="Page"><file name="Footer.php" hash="c7a672484710de89eb6af0524da0bf83"/><file name="Header.php" hash="079f7c8873efbc5f8fcedfa9693508f5"/></dir></dir><file name="Credits.php" hash="f4473f43731901738a4cf079b2338e18"/><file name="GrabAccount.php" hash="3cd93790751c055d2bbb3a8498f25671"/><file name="GrabApiAccount.php" hash="79850ed22302447ac5e3a4ca905a1f55"/><file name="OtherVerifications.php" hash="5ac53ed1f31324f79181baf3287341a0"/><file name="VerifyApiAccount.php" hash="24cbec5d74d126a210af1d48e28a6262"/></dir><dir name="Helper"><file name="Data-test.php" hash="fd966d8e4228fe12db45a6c7cc2d00ba"/><file name="Data.php" hash="3cbb62d6c5637288d2b4596958c26bfd"/></dir><dir name="Model"><dir name="Mysql4"><dir name="Mysql4"><dir name="Voodoo"><file name="Collection.php" hash="c97ac45e6c51ddb7ce3349561a542561"/></dir><file name="Voodoo.php" hash="a4bf4656536e83dfc07557b7748a6a42"/></dir><dir name="Voodoo"><file name="Collection.php" hash="c97ac45e6c51ddb7ce3349561a542561"/></dir><file name="Voodoo.php" hash="a4bf4656536e83dfc07557b7748a6a42"/></dir><file name="Observer.php" hash="53d09851c42f019374e47b486e65fdbc"/><file name="Observerrrr.php" hash="4b35d15fd32bb11722e7b502bc6ebffa"/><file name="Voodoo.php" hash="897384a33203189e4756da6cf5588acb"/></dir><dir name="controllers"><file name="IndexController.php" hash="50654ac2e787445270ca5a9500534814"/></dir><dir name="etc"><file name="config.xml" hash="f4816e36dd294eab6e5ca00e9f56af36"/><file name="system.xml" hash="231a1470e4d7af188dc6830d34e5aa3a"/></dir><dir name="sql"><dir name="voodoo_setup"><file name="mysql4-install-1.0.0.php" hash="a5655c337e114fc9e5ebc2dafb219ae2"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="voodoo.xml" hash="bc7bef231534b55ebbeb52f9c77b56b6"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="TGM_Voodoo.xml" hash="bcde093f727f9acafb250e280873b4e7"/></dir></target><target name="magelocale"><dir name="en_US"><file name="TGM_Voodoo.csv" hash="70e4f1215f0542fce3651720c32ce67a"/></dir></target><target name="mageskin"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="images"><file name="magepal.png" hash="24887cb06828b73676ab1dcd69977c79"/></dir></dir></dir></dir></target></contents>
41
+ <compatible/>
42
+ <dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php></required></dependencies>
43
+ </package>
skin/adminhtml/default/default/images/magepal.png ADDED
Binary file