Numerno_Euromsg - Version 1.0.0

Version Notes

Initial Release
* Transactional Emails
* Email Logging
* Email Delivery Tracking
* Transactional SMS
* SMS Logging
* SMS Delivery Tracking
* Customer Data Integration with euro.message Platform
* Catalog Data Integration with euro.message Platform

Build Date: 2015-11-24

Download this release

Release Info

Developer Numerno
Extension Numerno_Euromsg
Version 1.0.0
Comparing to
See all releases


Version 1.0.0

Files changed (75) hide show
  1. app/code/local/Numerno/Euromsg/Block/Adminhtml/Customer/Grid.php +74 -0
  2. app/code/local/Numerno/Euromsg/Block/Adminhtml/Form/Field/Attribute.php +99 -0
  3. app/code/local/Numerno/Euromsg/Block/Adminhtml/Form/Field/Attributes.php +117 -0
  4. app/code/local/Numerno/Euromsg/Block/Adminhtml/Form/Field/CustomerAttribute.php +105 -0
  5. app/code/local/Numerno/Euromsg/Block/Adminhtml/Form/Field/CustomerAttributes.php +163 -0
  6. app/code/local/Numerno/Euromsg/Block/Adminhtml/Form/Field/SyncNow.php +90 -0
  7. app/code/local/Numerno/Euromsg/Block/Adminhtml/Grid/ExportJs.php +53 -0
  8. app/code/local/Numerno/Euromsg/Block/Adminhtml/Mail/Logs.php +50 -0
  9. app/code/local/Numerno/Euromsg/Block/Adminhtml/Mail/Logs/Grid.php +102 -0
  10. app/code/local/Numerno/Euromsg/Block/Adminhtml/Newsletter/Subscriber/Grid.php +74 -0
  11. app/code/local/Numerno/Euromsg/Block/Adminhtml/Sales/Order/Comments/View.php +75 -0
  12. app/code/local/Numerno/Euromsg/Block/Adminhtml/Sales/Order/View/History.php +73 -0
  13. app/code/local/Numerno/Euromsg/Block/Adminhtml/Sms/Logs.php +50 -0
  14. app/code/local/Numerno/Euromsg/Block/Adminhtml/Sms/Logs/Grid.php +121 -0
  15. app/code/local/Numerno/Euromsg/Block/Adminhtml/Sms/Renderer/Customer.php +55 -0
  16. app/code/local/Numerno/Euromsg/Block/Adminhtml/Sms/Subscribers.php +50 -0
  17. app/code/local/Numerno/Euromsg/Block/Adminhtml/Sms/Subscribers/Grid.php +121 -0
  18. app/code/local/Numerno/Euromsg/Helper/Data.php +273 -0
  19. app/code/local/Numerno/Euromsg/Helper/Post.php +72 -0
  20. app/code/local/Numerno/Euromsg/Helper/Sms.php +96 -0
  21. app/code/local/Numerno/Euromsg/Model/Core/Email.php +75 -0
  22. app/code/local/Numerno/Euromsg/Model/Core/Email/Queue.php +110 -0
  23. app/code/local/Numerno/Euromsg/Model/Core/Email/Template.php +58 -0
  24. app/code/local/Numerno/Euromsg/Model/Cron.php +265 -0
  25. app/code/local/Numerno/Euromsg/Model/Export/Adapter/Csv.php +123 -0
  26. app/code/local/Numerno/Euromsg/Model/Export/Entity/Member.php +587 -0
  27. app/code/local/Numerno/Euromsg/Model/Export/Entity/Product.php +510 -0
  28. app/code/local/Numerno/Euromsg/Model/Io/Sftp.php +50 -0
  29. app/code/local/Numerno/Euromsg/Model/Mail.php +70 -0
  30. app/code/local/Numerno/Euromsg/Model/Mail/Log.php +53 -0
  31. app/code/local/Numerno/Euromsg/Model/Mail/Transport/EuroMessage.php +123 -0
  32. app/code/local/Numerno/Euromsg/Model/Newsletter/Subscriber/Collection.php +98 -0
  33. app/code/local/Numerno/Euromsg/Model/Observer.php +390 -0
  34. app/code/local/Numerno/Euromsg/Model/Platform.php +184 -0
  35. app/code/local/Numerno/Euromsg/Model/Platform/Abstract.php +103 -0
  36. app/code/local/Numerno/Euromsg/Model/Platform/Member.php +146 -0
  37. app/code/local/Numerno/Euromsg/Model/Platform/Post.php +98 -0
  38. app/code/local/Numerno/Euromsg/Model/Platform/PostSms.php +156 -0
  39. app/code/local/Numerno/Euromsg/Model/Platform/Report.php +62 -0
  40. app/code/local/Numerno/Euromsg/Model/Process.php +214 -0
  41. app/code/local/Numerno/Euromsg/Model/Resource/Mail/Log.php +48 -0
  42. app/code/local/Numerno/Euromsg/Model/Resource/Mail/Log/Collection.php +48 -0
  43. app/code/local/Numerno/Euromsg/Model/Resource/Process.php +77 -0
  44. app/code/local/Numerno/Euromsg/Model/Resource/Process/Collection.php +48 -0
  45. app/code/local/Numerno/Euromsg/Model/Resource/Sms.php +48 -0
  46. app/code/local/Numerno/Euromsg/Model/Resource/Sms/Collection.php +48 -0
  47. app/code/local/Numerno/Euromsg/Model/Sms.php +124 -0
  48. app/code/local/Numerno/Euromsg/Model/System/Config/Backend/Attributes.php +57 -0
  49. app/code/local/Numerno/Euromsg/Model/System/Config/Backend/Cron.php +101 -0
  50. app/code/local/Numerno/Euromsg/Model/System/Config/Source/Cron/Frequency.php +65 -0
  51. app/code/local/Numerno/Euromsg/Model/System/Config/Source/Cron/Hours.php +65 -0
  52. app/code/local/Numerno/Euromsg/Model/System/Config/Source/Customer/Attributes.php +58 -0
  53. app/code/local/Numerno/Euromsg/Model/System/Config/Source/Customer/DataSource.php +59 -0
  54. app/code/local/Numerno/Euromsg/Model/System/Config/Source/Dwh/LangId.php +66 -0
  55. app/code/local/Numerno/Euromsg/Model/System/Config/Source/Dwh/Policy.php +58 -0
  56. app/code/local/Numerno/Euromsg/Model/System/Config/Source/Dwh/Report.php +58 -0
  57. app/code/local/Numerno/Euromsg/Model/System/Config/Source/Platform.php +70 -0
  58. app/code/local/Numerno/Euromsg/Model/System/Config/Source/Sms/Method.php +58 -0
  59. app/code/local/Numerno/Euromsg/Model/System/Config/Source/Sms/Permit.php +53 -0
  60. app/code/local/Numerno/Euromsg/controllers/Adminhtml/EuromsgController.php +152 -0
  61. app/code/local/Numerno/Euromsg/controllers/Adminhtml/NewsletterController.php +49 -0
  62. app/code/local/Numerno/Euromsg/controllers/Adminhtml/SmsController.php +104 -0
  63. app/code/local/Numerno/Euromsg/etc/adminhtml.xml +114 -0
  64. app/code/local/Numerno/Euromsg/etc/config.xml +344 -0
  65. app/code/local/Numerno/Euromsg/etc/system.xml +950 -0
  66. app/code/local/Numerno/Euromsg/sql/euromsg_setup/install-1.0.0.php +262 -0
  67. app/design/adminhtml/default/default/layout/euromsg.xml +81 -0
  68. app/design/adminhtml/default/default/template/euromsg/form/field/sync_now.phtml +54 -0
  69. app/design/adminhtml/default/default/template/euromsg/grid/export_js.phtml +79 -0
  70. app/design/adminhtml/default/default/template/euromsg/sales/order/comments/view.phtml +90 -0
  71. app/design/adminhtml/default/default/template/euromsg/sales/order/view/history.phtml +97 -0
  72. app/etc/modules/Numerno_Euromsg.xml +40 -0
  73. app/locale/tr_TR/Numerno_Euromsg.csv +181 -0
  74. package.xml +28 -0
  75. skin/adminhtml/default/default/images/euromsg/euromsg_logo.png +0 -0
app/code/local/Numerno/Euromsg/Block/Adminhtml/Customer/Grid.php ADDED
@@ -0,0 +1,74 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Numerno - Euro.message Magento Extension
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the NUMERNO EUROMESSAGE MAGENTO EXTENSION License, which extends the Open Software
8
+ * License (OSL 3.0). The Euro.message Magento Extension License is available at this URL:
9
+ * http://numerno.com/licenses/euromsg-ce.txt The Open Software License is available at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ *
12
+ * DISCLAIMER
13
+ *
14
+ * By adding to, editing, or in any way modifying this code, Numerno is not held liable for any inconsistencies or
15
+ * abnormalities in the behaviour of this code. By adding to, editing, or in any way modifying this code, the Licensee
16
+ * terminates any agreement of support offered by Numerno, outlined in the provided Euro.message Magento Extension
17
+ * License.
18
+ * Upon discovery of modified code in the process of support, the Licensee is still held accountable for any and all
19
+ * billable time Numerno spent during the support process. Numerno does not guarantee compatibility with any other
20
+ * Magento extension. Numerno is not responsbile for any inconsistencies or abnormalities in the behaviour of this
21
+ * code if caused by other Magento extension.
22
+ * If you did not receive a copy of the license, please send an email to info@numerno.com or call +90-212-223-5093,
23
+ * so we can send you a copy immediately.
24
+ *
25
+ * @category [Numerno]
26
+ * @package [Numerno_Euromsg]
27
+ * @copyright Copyright (c) 2015 Numerno Bilisim Hiz. Tic. Ltd. Sti. (http://numerno.com/)
28
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
29
+ */
30
+
31
+ /**
32
+ * Customer Grid
33
+ *
34
+ * @category Numerno
35
+ * @package Numerno_Euromsg
36
+ * @author Numerno Bilisim Hiz. Tic. Ltd. Sti. <info@numerno.com>
37
+ */
38
+ class Numerno_Euromsg_Block_Adminhtml_Customer_Grid extends Mage_Adminhtml_Block_Customer_Grid
39
+ {
40
+ /*
41
+ * Add export type
42
+ *
43
+ * @return Numerno_Euromsg_Block_Adminhtml_Customer_Grid
44
+ */
45
+ protected function _prepareColumns()
46
+ {
47
+
48
+ $this->addExportType('*/adminhtml_euromsg/export', Mage::helper('euromsg')->__('euro.message'));
49
+ return parent::_prepareColumns();
50
+ }
51
+
52
+ /*
53
+ * Add export type layout
54
+ *
55
+ * @return Numerno_Euromsg_Block_Adminhtml_Customer_Grid
56
+ */
57
+ protected function _prepareLayout()
58
+ {
59
+ parent::_prepareLayout();
60
+
61
+ $this->setChild('export_button',
62
+ $this->getLayout()->createBlock('adminhtml/widget_button')
63
+ ->setData(array(
64
+ 'label' => Mage::helper('adminhtml')->__('Export'),
65
+ 'onclick' => 'doExport()',
66
+ 'class' => 'task',
67
+ 'after_html' => $this->getLayout()->createBlock('euromsg/adminhtml_grid_exportJs')
68
+ ->setData(array('object_name' => $this->getJsObjectName()))
69
+ ->toHtml()
70
+ ))
71
+ );
72
+ return $this;
73
+ }
74
+ }
app/code/local/Numerno/Euromsg/Block/Adminhtml/Form/Field/Attribute.php ADDED
@@ -0,0 +1,99 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Numerno - Euro.message Magento Extension
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the NUMERNO EUROMESSAGE MAGENTO EXTENSION License, which extends the Open Software
8
+ * License (OSL 3.0). The Euro.message Magento Extension License is available at this URL:
9
+ * http://numerno.com/licenses/euromsg-ce.txt The Open Software License is available at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ *
12
+ * DISCLAIMER
13
+ *
14
+ * By adding to, editing, or in any way modifying this code, Numerno is not held liable for any inconsistencies or
15
+ * abnormalities in the behaviour of this code. By adding to, editing, or in any way modifying this code, the Licensee
16
+ * terminates any agreement of support offered by Numerno, outlined in the provided Euro.message Magento Extension
17
+ * License.
18
+ * Upon discovery of modified code in the process of support, the Licensee is still held accountable for any and all
19
+ * billable time Numerno spent during the support process. Numerno does not guarantee compatibility with any other
20
+ * Magento extension. Numerno is not responsbile for any inconsistencies or abnormalities in the behaviour of this
21
+ * code if caused by other Magento extension.
22
+ * If you did not receive a copy of the license, please send an email to info@numerno.com or call +90-212-223-5093,
23
+ * so we can send you a copy immediately.
24
+ *
25
+ * @category [Numerno]
26
+ * @package [Numerno_Euromsg]
27
+ * @copyright Copyright (c) 2015 Numerno Bilisim Hiz. Tic. Ltd. Sti. (http://numerno.com/)
28
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
29
+ */
30
+
31
+ /**
32
+ * Catalog Attribute Form Field
33
+ *
34
+ * @category Numerno
35
+ * @package Numerno_Euromsg
36
+ * @author Numerno Bilisim Hiz. Tic. Ltd. Sti. <info@numerno.com>
37
+ */
38
+ class Numerno_Euromsg_Block_Adminhtml_Form_Field_Attribute extends Mage_Core_Block_Html_Select
39
+ {
40
+ /**
41
+ * Attributes cache
42
+ *
43
+ * @var array
44
+ */
45
+ private $_attributes;
46
+
47
+ /**
48
+ * Retrieve allowed attributes
49
+ *
50
+ * @param int $storeId
51
+ * @return array
52
+ *
53
+ */
54
+ protected function _getAttributes($storeId = null)
55
+ {
56
+ if (is_null($this->_attributes)) {
57
+
58
+ $this->_attributes = Mage::helper('euromsg')->getPresetProductAttributes();
59
+ $collection = Mage::getModel('eav/entity_attribute')->getCollection();
60
+ $collection->setEntityTypeFilter(Mage::getSingleton('eav/config')->getEntityType('catalog_product'));
61
+ foreach ($collection as $item) {
62
+ /* @var $item Mage_Core_Model_Store */
63
+ $this->_attributes[$item->getAttributeCode()] = $item->getFrontendLabel() . ' ('
64
+ . $item->getAttributeCode() . ')';
65
+ }
66
+ }
67
+ if (!is_null($storeId)) {
68
+ return isset($this->_attributes[$storeId]) ? $this->_attributes[$storeId] : null;
69
+ }
70
+ return $this->_attributes;
71
+ }
72
+
73
+ /**
74
+ * Set form element input name
75
+ *
76
+ * @param string $value
77
+ * @return string
78
+ */
79
+ public function setInputName($value)
80
+ {
81
+ return $this->setName($value);
82
+ }
83
+
84
+ /**
85
+ * Render block HTML
86
+ *
87
+ * @return string
88
+ */
89
+ public function _toHtml()
90
+ {
91
+ if (!$this->getOptions()) {
92
+ foreach ($this->_getAttributes() as $id => $label) {
93
+ $this->addOption($id, $label);
94
+ }
95
+ }
96
+
97
+ return parent::_toHtml();
98
+ }
99
+ }
app/code/local/Numerno/Euromsg/Block/Adminhtml/Form/Field/Attributes.php ADDED
@@ -0,0 +1,117 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Numerno - Euro.message Magento Extension
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the NUMERNO EUROMESSAGE MAGENTO EXTENSION License, which extends the Open Software
8
+ * License (OSL 3.0). The Euro.message Magento Extension License is available at this URL:
9
+ * http://numerno.com/licenses/euromsg-ce.txt The Open Software License is available at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ *
12
+ * DISCLAIMER
13
+ *
14
+ * By adding to, editing, or in any way modifying this code, Numerno is not held liable for any inconsistencies or
15
+ * abnormalities in the behaviour of this code. By adding to, editing, or in any way modifying this code, the Licensee
16
+ * terminates any agreement of support offered by Numerno, outlined in the provided Euro.message Magento Extension
17
+ * License.
18
+ * Upon discovery of modified code in the process of support, the Licensee is still held accountable for any and all
19
+ * billable time Numerno spent during the support process. Numerno does not guarantee compatibility with any other
20
+ * Magento extension. Numerno is not responsbile for any inconsistencies or abnormalities in the behaviour of this
21
+ * code if caused by other Magento extension.
22
+ * If you did not receive a copy of the license, please send an email to info@numerno.com or call +90-212-223-5093,
23
+ * so we can send you a copy immediately.
24
+ *
25
+ * @category [Numerno]
26
+ * @package [Numerno_Euromsg]
27
+ * @copyright Copyright (c) 2015 Numerno Bilisim Hiz. Tic. Ltd. Sti. (http://numerno.com/)
28
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
29
+ */
30
+
31
+ /**
32
+ * Catalog Attributes Form Field
33
+ *
34
+ * @category Numerno
35
+ * @package Numerno_Euromsg
36
+ * @author Numerno Bilisim Hiz. Tic. Ltd. Sti. <info@numerno.com>
37
+ */
38
+ class Numerno_Euromsg_Block_Adminhtml_Form_Field_Attributes
39
+ extends Mage_Adminhtml_Block_System_Config_Form_Field_Array_Abstract
40
+ {
41
+
42
+ /**
43
+ * Attribute renderer cache
44
+ */
45
+ protected $_attributeRenderer;
46
+
47
+ /**
48
+ * Retrieve attribute renderer
49
+ */
50
+ protected function _getAttributeRenderer()
51
+ {
52
+ if (!$this->_attributeRenderer) {
53
+ $this->_attributeRenderer = $this->getLayout()->createBlock(
54
+ 'euromsg/adminhtml_form_field_attribute', '',
55
+ array('is_render_to_js_template' => true)
56
+ );
57
+ $this->_attributeRenderer->setClass('attribute_select');
58
+ $this->_attributeRenderer->setExtraParams('style="width:200px"');
59
+ }
60
+ return $this->_attributeRenderer;
61
+ }
62
+
63
+ /**
64
+ * Prepare to render
65
+ */
66
+ protected function _prepareToRender()
67
+ {
68
+ $this->addColumn('attribute', array(
69
+ 'label' => Mage::helper('euromsg')->__('Attribute'),
70
+ 'renderer' => $this->_getAttributeRenderer(),
71
+ ));
72
+ $this->addColumn('col_name', array(
73
+ 'label' => Mage::helper('euromsg')->__('Column Name'),
74
+ 'style' => 'width:100px',
75
+ ));
76
+
77
+ $this->_addAfter = false;
78
+ $this->_addButtonLabel = Mage::helper('euromsg')->__('Add Attribute');
79
+ }
80
+
81
+ /**
82
+ * Prepare existing row data object
83
+ *
84
+ * @param Varien_Object
85
+ */
86
+ protected function _prepareArrayRow(Varien_Object $row)
87
+ {
88
+ $row->setData(
89
+ 'option_extra_attr_' . $this->_getAttributeRenderer()->calcOptionHash($row->getData('attribute')),
90
+ 'selected="selected"'
91
+ );
92
+ }
93
+
94
+ /**
95
+ * Render cell template
96
+ *
97
+ * @param string
98
+ */
99
+ protected function _renderCellTemplate($columnName)
100
+ {
101
+ if (empty($this->_columns[$columnName])) {
102
+ throw new Exception(Mage::helper('euromsg')->__('Wrong column name specified.'));
103
+ }
104
+ $column = $this->_columns[$columnName];
105
+ $inputName = $this->getElement()->getName() . '[#{_id}][' . $columnName . ']';
106
+
107
+ if ($column['renderer']) {
108
+ return $column['renderer']->setInputName($inputName)->setColumnName($columnName)->setColumn($column)
109
+ ->toHtml();
110
+ }
111
+
112
+ return '<input type="text" name="' . $inputName . '" value="#{' . $columnName . '}" ' .
113
+ ($column['size'] ? 'size="' . $column['size'] . '"' : '') . ' class="' .
114
+ (isset($column['class']) ? $column['class'] : 'input-text') . '"'.
115
+ (isset($column['style']) ? ' style="'.$column['style'] . '"' : '') . '/>';
116
+ }
117
+ }
app/code/local/Numerno/Euromsg/Block/Adminhtml/Form/Field/CustomerAttribute.php ADDED
@@ -0,0 +1,105 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Numerno - Euro.message Magento Extension
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the NUMERNO EUROMESSAGE MAGENTO EXTENSION License, which extends the Open Software
8
+ * License (OSL 3.0). The Euro.message Magento Extension License is available at this URL:
9
+ * http://numerno.com/licenses/euromsg-ce.txt The Open Software License is available at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ *
12
+ * DISCLAIMER
13
+ *
14
+ * By adding to, editing, or in any way modifying this code, Numerno is not held liable for any inconsistencies or
15
+ * abnormalities in the behaviour of this code. By adding to, editing, or in any way modifying this code, the Licensee
16
+ * terminates any agreement of support offered by Numerno, outlined in the provided Euro.message Magento Extension
17
+ * License.
18
+ * Upon discovery of modified code in the process of support, the Licensee is still held accountable for any and all
19
+ * billable time Numerno spent during the support process. Numerno does not guarantee compatibility with any other
20
+ * Magento extension. Numerno is not responsbile for any inconsistencies or abnormalities in the behaviour of this
21
+ * code if caused by other Magento extension.
22
+ * If you did not receive a copy of the license, please send an email to info@numerno.com or call +90-212-223-5093,
23
+ * so we can send you a copy immediately.
24
+ *
25
+ * @category [Numerno]
26
+ * @package [Numerno_Euromsg]
27
+ * @copyright Copyright (c) 2015 Numerno Bilisim Hiz. Tic. Ltd. Sti. (http://numerno.com/)
28
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
29
+ */
30
+
31
+ /**
32
+ * Customer Attribute Form Field
33
+ *
34
+ * @category Numerno
35
+ * @package Numerno_Euromsg
36
+ * @author Numerno Bilisim Hiz. Tic. Ltd. Sti. <info@numerno.com>
37
+ */
38
+ class Numerno_Euromsg_Block_Adminhtml_Form_Field_CustomerAttribute extends Mage_Core_Block_Html_Select
39
+ {
40
+ /**
41
+ * Attributes cache
42
+ *
43
+ * @var array
44
+ */
45
+ private $_attributes;
46
+
47
+ /**
48
+ * Retrieve allowed attributes
49
+ *
50
+ * @param int $storeId
51
+ * @return array
52
+ *
53
+ */
54
+ protected function _getAttributes($storeId = null)
55
+ {
56
+ $_helper = Mage::helper('euromsg');
57
+
58
+ if (is_null($this->_attributes)) {
59
+
60
+ $this->_attributes = $_helper->getPresetCustomerAttributes();
61
+ $_hideAttributes = $_helper->getDisabledCustomerAttributes();
62
+
63
+ $collection = Mage::getModel('eav/entity_attribute')->getCollection();
64
+ $collection->setEntityTypeFilter(Mage::getSingleton('eav/config')->getEntityType('customer'));
65
+ $collection->addFieldToFilter('attribute_code', array('neq' => 'email'));
66
+
67
+ foreach ($collection as $item) {
68
+ if(!in_array($item->getAttributeCode(), $_hideAttributes))
69
+ $this->_attributes[$_helper->getCustomerAttributePrefix() . $item->getAttributeCode()] =
70
+ $_helper->__('Customer ') . $item->getFrontendLabel() . ' (' . $item->getAttributeCode() . ')';
71
+ }
72
+ }
73
+ if (!is_null($storeId)) {
74
+ return isset($this->_attributes[$storeId]) ? $this->_attributes[$storeId] : null;
75
+ }
76
+ return $this->_attributes;
77
+ }
78
+
79
+ /**
80
+ * Set form element input name
81
+ *
82
+ * @param string $value
83
+ * @return string
84
+ */
85
+ public function setInputName($value)
86
+ {
87
+ return $this->setName($value);
88
+ }
89
+
90
+ /**
91
+ * Render block HTML
92
+ *
93
+ * @return string
94
+ */
95
+ public function _toHtml()
96
+ {
97
+ if (!$this->getOptions()) {
98
+ foreach ($this->_getAttributes() as $id => $label) {
99
+ $this->addOption($id, $label);
100
+ }
101
+ }
102
+
103
+ return parent::_toHtml();
104
+ }
105
+ }
app/code/local/Numerno/Euromsg/Block/Adminhtml/Form/Field/CustomerAttributes.php ADDED
@@ -0,0 +1,163 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Numerno - Euro.message Magento Extension
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the NUMERNO EUROMESSAGE MAGENTO EXTENSION License, which extends the Open Software
8
+ * License (OSL 3.0). The Euro.message Magento Extension License is available at this URL:
9
+ * http://numerno.com/licenses/euromsg-ce.txt The Open Software License is available at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ *
12
+ * DISCLAIMER
13
+ *
14
+ * By adding to, editing, or in any way modifying this code, Numerno is not held liable for any inconsistencies or
15
+ * abnormalities in the behaviour of this code. By adding to, editing, or in any way modifying this code, the Licensee
16
+ * terminates any agreement of support offered by Numerno, outlined in the provided Euro.message Magento Extension
17
+ * License.
18
+ * Upon discovery of modified code in the process of support, the Licensee is still held accountable for any and all
19
+ * billable time Numerno spent during the support process. Numerno does not guarantee compatibility with any other
20
+ * Magento extension. Numerno is not responsbile for any inconsistencies or abnormalities in the behaviour of this
21
+ * code if caused by other Magento extension.
22
+ * If you did not receive a copy of the license, please send an email to info@numerno.com or call +90-212-223-5093,
23
+ * so we can send you a copy immediately.
24
+ *
25
+ * @category [Numerno]
26
+ * @package [Numerno_Euromsg]
27
+ * @copyright Copyright (c) 2015 Numerno Bilisim Hiz. Tic. Ltd. Sti. (http://numerno.com/)
28
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
29
+ */
30
+
31
+ /**
32
+ * Customer Attributes Form Field
33
+ *
34
+ * @category Numerno
35
+ * @package Numerno_Euromsg
36
+ * @author Numerno Bilisim Hiz. Tic. Ltd. Sti. <info@numerno.com>
37
+ */
38
+ class Numerno_Euromsg_Block_Adminhtml_Form_Field_CustomerAttributes extends Mage_Adminhtml_Block_System_Config_Form_Field_Array_Abstract
39
+ {
40
+
41
+ /**
42
+ * Attribute renderer cache
43
+ */
44
+ protected $_attributeRenderer;
45
+
46
+ /**
47
+ * Retrieve attribute renderer
48
+ */
49
+ protected function _getAttributeRenderer()
50
+ {
51
+ if (!$this->_attributeRenderer) {
52
+ $this->_attributeRenderer = $this->getLayout()->createBlock(
53
+ 'euromsg/adminhtml_form_field_customerAttribute', '',
54
+ array('is_render_to_js_template' => true)
55
+ );
56
+ $this->_attributeRenderer->setClass('attribute_select');
57
+ $this->_attributeRenderer->setExtraParams('style="width:200px"');
58
+ }
59
+ return $this->_attributeRenderer;
60
+ }
61
+
62
+ /**
63
+ * Prepare to render
64
+ */
65
+ protected function _prepareToRender()
66
+ {
67
+ $this->addColumn('attribute', array(
68
+ 'label' => Mage::helper('euromsg')->__('Attribute'),
69
+ 'renderer' => $this->_getAttributeRenderer(),
70
+ ));
71
+ $this->addColumn('col_name', array(
72
+ 'label' => Mage::helper('euromsg')->__('Column Name'),
73
+ 'style' => 'width:100px',
74
+ ));
75
+
76
+ $this->_addAfter = true;
77
+ $this->_addButtonLabel = Mage::helper('euromsg')->__('Add Attribute');
78
+ }
79
+
80
+ /**
81
+ * Prepare existing row data object
82
+ *
83
+ * @param Varien_Object
84
+ */
85
+ protected function _prepareArrayRow(Varien_Object $row)
86
+ {
87
+ $row->setData(
88
+ 'option_extra_attr_' . $this->_getAttributeRenderer()->calcOptionHash($row->getData('attribute')),
89
+ 'selected="selected"'
90
+ );
91
+ }
92
+
93
+ /**
94
+ * Render cell template
95
+ *
96
+ * @param string
97
+ */
98
+ protected function _renderCellTemplate($columnName)
99
+ {
100
+ if (empty($this->_columns[$columnName])) {
101
+ throw new Exception('Wrong column name specified.');
102
+ }
103
+ $column = $this->_columns[$columnName];
104
+ $inputName = $this->getElement()->getName() . '[#{_id}][' . $columnName . ']';
105
+
106
+ if ($column['renderer']) {
107
+ return $column['renderer']->setInputName($inputName)->setColumnName($columnName)->setColumn($column)
108
+ ->toHtml();
109
+ }
110
+
111
+ return '<input type="text" name="' . $inputName . '" value="#{' . $columnName . '}" ' .
112
+ ($column['size'] ? 'size="' . $column['size'] . '"' : '') . ' class="' .
113
+ (isset($column['class']) ? $column['class'] : 'input-text') . '"'.
114
+ (isset($column['style']) ? ' style="'.$column['style'] . '"' : '') . '/>';
115
+ }
116
+
117
+ /**
118
+ * Retrieve Html Form ID
119
+ *
120
+ * @return string
121
+ */
122
+ public function getHtmlId()
123
+ {
124
+ return '_emCustomerAttributes';
125
+ }
126
+
127
+ /**
128
+ * Render Block Template
129
+ *
130
+ * @return string
131
+ */
132
+ public function _toHtml()
133
+ {
134
+ $reservedColumns = Mage::helper('euromsg')->getReservedColumns();
135
+ $html = parent::_toHtml();
136
+ $html = $html . '
137
+ <script type="text/javascript">
138
+ /*var emLockedAttributes = ["'.implode('","', array_keys($reservedColumns)).'"];
139
+ var emLockedValues = '.json_encode($reservedColumns).';
140
+
141
+ $$(".attribute_select").invoke(\'observe\', \'change\', function() {
142
+ em_input = $(this).up(\'td\').next(\'td\').down(\'input[type=text]\');
143
+ if(emLockedAttributes.indexOf(this.value) >= 0){
144
+ em_input.value = emLockedValues[this.value];
145
+ em_input.disable();
146
+ } else {
147
+ em_input.enable();
148
+ }
149
+ });
150
+
151
+ document.observe(\'dom:loaded\', function() {
152
+ $$(".attribute_select").each(function(select) {
153
+ em_input = $(select).up(\'td\').next(\'td\').down(\'input[type=text]\');
154
+ if(emLockedAttributes.indexOf(select.value) >= 0){
155
+ em_input.value = emLockedValues[select.value];
156
+ em_input.disable();
157
+ }
158
+ });
159
+ });*/
160
+ </script>';
161
+ return $html;
162
+ }
163
+ }
app/code/local/Numerno/Euromsg/Block/Adminhtml/Form/Field/SyncNow.php ADDED
@@ -0,0 +1,90 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Numerno - Euro.message Magento Extension
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the NUMERNO EUROMESSAGE MAGENTO EXTENSION License, which extends the Open Software
8
+ * License (OSL 3.0). The Euro.message Magento Extension License is available at this URL:
9
+ * http://numerno.com/licenses/euromsg-ce.txt The Open Software License is available at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ *
12
+ * DISCLAIMER
13
+ *
14
+ * By adding to, editing, or in any way modifying this code, Numerno is not held liable for any inconsistencies or
15
+ * abnormalities in the behaviour of this code. By adding to, editing, or in any way modifying this code, the Licensee
16
+ * terminates any agreement of support offered by Numerno, outlined in the provided Euro.message Magento Extension
17
+ * License.
18
+ * Upon discovery of modified code in the process of support, the Licensee is still held accountable for any and all
19
+ * billable time Numerno spent during the support process. Numerno does not guarantee compatibility with any other
20
+ * Magento extension. Numerno is not responsbile for any inconsistencies or abnormalities in the behaviour of this
21
+ * code if caused by other Magento extension.
22
+ * If you did not receive a copy of the license, please send an email to info@numerno.com or call +90-212-223-5093,
23
+ * so we can send you a copy immediately.
24
+ *
25
+ * @category [Numerno]
26
+ * @package [Numerno_Euromsg]
27
+ * @copyright Copyright (c) 2015 Numerno Bilisim Hiz. Tic. Ltd. Sti. (http://numerno.com/)
28
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
29
+ */
30
+
31
+ /**
32
+ * Synchronize Now Button
33
+ *
34
+ * @category Numerno
35
+ * @package Numerno_Euromsg
36
+ * @author Numerno Bilisim Hiz. Tic. Ltd. Sti. <info@numerno.com>
37
+ */
38
+ class Numerno_Euromsg_Block_Adminhtml_Form_Field_SyncNow extends Mage_Adminhtml_Block_System_Config_Form_Field
39
+ {
40
+ /*
41
+ * Set template
42
+ */
43
+ protected function _construct()
44
+ {
45
+ parent::_construct();
46
+ $this->setTemplate('euromsg/form/field/sync_now.phtml');
47
+ }
48
+
49
+ /**
50
+ * Return element html
51
+ *
52
+ * @param Varien_Data_Form_Element_Abstract $element
53
+ * @return string
54
+ */
55
+ protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
56
+ {
57
+ $originalData = $element->getOriginalData();
58
+ $this->addData(array(
59
+ 'synchronize' => $originalData['synchronize']
60
+ ));
61
+ return $this->_toHtml();
62
+ }
63
+
64
+ /**
65
+ * Return ajax url for button
66
+ *
67
+ * @return string
68
+ */
69
+ public function getAjaxCheckUrl()
70
+ {
71
+ return Mage::helper('adminhtml')->getUrl('adminhtml/adminhtml_euromsg/syncNow');
72
+ }
73
+
74
+ /**
75
+ * Generate button html
76
+ *
77
+ * @return string
78
+ */
79
+ public function getButtonHtml()
80
+ {
81
+ $button = $this->getLayout()->createBlock('adminhtml/widget_button')
82
+ ->addData(array(
83
+ 'id' => 'syncNow_button',
84
+ 'label' => $this->helper('euromsg')->__('Synchronize Now'),
85
+ 'onclick' => 'javascript:check(); return false;'
86
+ ));
87
+
88
+ return $button->toHtml();
89
+ }
90
+ }
app/code/local/Numerno/Euromsg/Block/Adminhtml/Grid/ExportJs.php ADDED
@@ -0,0 +1,53 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Numerno - Euro.message Magento Extension
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the NUMERNO EUROMESSAGE MAGENTO EXTENSION License, which extends the Open Software
8
+ * License (OSL 3.0). The Euro.message Magento Extension License is available at this URL:
9
+ * http://numerno.com/licenses/euromsg-ce.txt The Open Software License is available at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ *
12
+ * DISCLAIMER
13
+ *
14
+ * By adding to, editing, or in any way modifying this code, Numerno is not held liable for any inconsistencies or
15
+ * abnormalities in the behaviour of this code. By adding to, editing, or in any way modifying this code, the Licensee
16
+ * terminates any agreement of support offered by Numerno, outlined in the provided Euro.message Magento Extension
17
+ * License.
18
+ * Upon discovery of modified code in the process of support, the Licensee is still held accountable for any and all
19
+ * billable time Numerno spent during the support process. Numerno does not guarantee compatibility with any other
20
+ * Magento extension. Numerno is not responsbile for any inconsistencies or abnormalities in the behaviour of this
21
+ * code if caused by other Magento extension.
22
+ * If you did not receive a copy of the license, please send an email to info@numerno.com or call +90-212-223-5093,
23
+ * so we can send you a copy immediately.
24
+ *
25
+ * @category [Numerno]
26
+ * @package [Numerno_Euromsg]
27
+ * @copyright Copyright (c) 2015 Numerno Bilisim Hiz. Tic. Ltd. Sti. (http://numerno.com/)
28
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
29
+ */
30
+
31
+ /**
32
+ * Grid Export Action JavaScript
33
+ *
34
+ * @category Numerno
35
+ * @package Numerno_Euromsg
36
+ * @author Numerno Bilisim Hiz. Tic. Ltd. Sti. <info@numerno.com>
37
+ */
38
+ class Numerno_Euromsg_Block_Adminhtml_Grid_ExportJs extends Mage_Adminhtml_Block_Template
39
+ {
40
+ /**
41
+ * Set template to itself
42
+ *
43
+ * @return Numerno_Euromsg_Block_Adminhtml_Grid_ExportJs
44
+ */
45
+ protected function _prepareLayout()
46
+ {
47
+ parent::_prepareLayout();
48
+ if (!$this->getTemplate()) {
49
+ $this->setTemplate('euromsg/grid/export_js.phtml');
50
+ }
51
+ return $this;
52
+ }
53
+ }
app/code/local/Numerno/Euromsg/Block/Adminhtml/Mail/Logs.php ADDED
@@ -0,0 +1,50 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Numerno - Euro.message Magento Extension
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the NUMERNO EUROMESSAGE MAGENTO EXTENSION License, which extends the Open Software
8
+ * License (OSL 3.0). The Euro.message Magento Extension License is available at this URL:
9
+ * http://numerno.com/licenses/euromsg-ce.txt The Open Software License is available at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ *
12
+ * DISCLAIMER
13
+ *
14
+ * By adding to, editing, or in any way modifying this code, Numerno is not held liable for any inconsistencies or
15
+ * abnormalities in the behaviour of this code. By adding to, editing, or in any way modifying this code, the Licensee
16
+ * terminates any agreement of support offered by Numerno, outlined in the provided Euro.message Magento Extension
17
+ * License.
18
+ * Upon discovery of modified code in the process of support, the Licensee is still held accountable for any and all
19
+ * billable time Numerno spent during the support process. Numerno does not guarantee compatibility with any other
20
+ * Magento extension. Numerno is not responsbile for any inconsistencies or abnormalities in the behaviour of this
21
+ * code if caused by other Magento extension.
22
+ * If you did not receive a copy of the license, please send an email to info@numerno.com or call +90-212-223-5093,
23
+ * so we can send you a copy immediately.
24
+ *
25
+ * @category [Numerno]
26
+ * @package [Numerno_Euromsg]
27
+ * @copyright Copyright (c) 2015 Numerno Bilisim Hiz. Tic. Ltd. Sti. (http://numerno.com/)
28
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
29
+ */
30
+
31
+ /**
32
+ * Mail Logs Container
33
+ *
34
+ * @category Numerno
35
+ * @package Numerno_Euromsg
36
+ * @author Numerno Bilisim Hiz. Tic. Ltd. Sti. <info@numerno.com>
37
+ */
38
+ class Numerno_Euromsg_Block_Adminhtml_Mail_Logs extends Mage_Adminhtml_Block_Widget_Grid_Container
39
+ {
40
+ public function __construct()
41
+ {
42
+ $this->_blockGroup = 'euromsg';
43
+ $this->_controller = 'adminhtml_mail_logs';
44
+ $this->_headerText = Mage::helper('euromsg')->__('euro.message Mail Logs');
45
+
46
+ parent::__construct();
47
+ $this->_removeButton('add');
48
+ }
49
+
50
+ }
app/code/local/Numerno/Euromsg/Block/Adminhtml/Mail/Logs/Grid.php ADDED
@@ -0,0 +1,102 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Numerno - Euro.message Magento Extension
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the NUMERNO EUROMESSAGE MAGENTO EXTENSION License, which extends the Open Software
8
+ * License (OSL 3.0). The Euro.message Magento Extension License is available at this URL:
9
+ * http://numerno.com/licenses/euromsg-ce.txt The Open Software License is available at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ *
12
+ * DISCLAIMER
13
+ *
14
+ * By adding to, editing, or in any way modifying this code, Numerno is not held liable for any inconsistencies or
15
+ * abnormalities in the behaviour of this code. By adding to, editing, or in any way modifying this code, the Licensee
16
+ * terminates any agreement of support offered by Numerno, outlined in the provided Euro.message Magento Extension
17
+ * License.
18
+ * Upon discovery of modified code in the process of support, the Licensee is still held accountable for any and all
19
+ * billable time Numerno spent during the support process. Numerno does not guarantee compatibility with any other
20
+ * Magento extension. Numerno is not responsbile for any inconsistencies or abnormalities in the behaviour of this
21
+ * code if caused by other Magento extension.
22
+ * If you did not receive a copy of the license, please send an email to info@numerno.com or call +90-212-223-5093,
23
+ * so we can send you a copy immediately.
24
+ *
25
+ * @category [Numerno]
26
+ * @package [Numerno_Euromsg]
27
+ * @copyright Copyright (c) 2015 Numerno Bilisim Hiz. Tic. Ltd. Sti. (http://numerno.com/)
28
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
29
+ */
30
+
31
+ /**
32
+ * Mail Logs Grid
33
+ *
34
+ * @category Numerno
35
+ * @package Numerno_Euromsg
36
+ * @author Numerno Bilisim Hiz. Tic. Ltd. Sti. <info@numerno.com>
37
+ */
38
+ class Numerno_Euromsg_Block_Adminhtml_Mail_Logs_Grid extends Mage_Adminhtml_Block_Widget_Grid
39
+ {
40
+ public function __construct()
41
+ {
42
+ parent::__construct();
43
+ $this->setId('maillogsGrid');
44
+ $this->setDefaultSort('log_id');
45
+ $this->setDefaultDir('DESC');
46
+ $this->setSaveParametersInSession(true);
47
+ $this->setUseAjax(true);
48
+ }
49
+
50
+ protected function _prepareCollection()
51
+ {
52
+ $collection = Mage::getModel('euromsg/mail_log')->getCollection();
53
+
54
+ $this->setCollection($collection);
55
+
56
+ return parent::_prepareCollection();
57
+ }
58
+
59
+ protected function _prepareColumns()
60
+ {
61
+ $this->addColumn('log_id', array(
62
+ 'header' => Mage::helper('euromsg')->__('ID #'),
63
+ 'index' => 'log_id'
64
+ ));
65
+ $this->addColumn('send_at', array(
66
+ 'header' => Mage::helper('euromsg')->__('Send At'),
67
+ 'index' => 'send_at',
68
+ 'type' => 'datetime'
69
+ ));
70
+ $this->addColumn('mail_to_name', array(
71
+ 'header' => Mage::helper('euromsg')->__('Name'),
72
+ 'index' => 'mail_to_name'
73
+ ));
74
+ $this->addColumn('mail_to_address', array(
75
+ 'header' => Mage::helper('euromsg')->__('E-mail Address'),
76
+ 'index' => 'mail_to_address'
77
+ ));
78
+ $this->addColumn('mail_subject', array(
79
+ 'header' => Mage::helper('euromsg')->__('Subject'),
80
+ 'index' => 'mail_subject'
81
+ ));
82
+ $this->addColumn('marked_spam', array(
83
+ 'header' => Mage::helper('euromsg')->__('Is Marked Spam?'),
84
+ 'index' => 'marked_spam',
85
+ 'type' => 'options',
86
+ 'options' => Mage::getModel('adminhtml/system_config_source_yesno')->toArray()
87
+ ));
88
+
89
+ $delivery = Mage::helper('euromsg/post')->getStoreConfig('log/track_delivery');
90
+ if($delivery) {
91
+ $this->addColumn('delivery_status', array(
92
+ 'header' => Mage::helper('euromsg')->__('Delivery Status'),
93
+ 'index' => 'delivery_status',
94
+ 'type' => 'options',
95
+ 'options' => Mage::helper('euromsg/post')->getDeliveryStatusOptions()
96
+ ));
97
+
98
+ }
99
+
100
+ return parent::_prepareColumns();
101
+ }
102
+ }
app/code/local/Numerno/Euromsg/Block/Adminhtml/Newsletter/Subscriber/Grid.php ADDED
@@ -0,0 +1,74 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Numerno - Euro.message Magento Extension
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the NUMERNO EUROMESSAGE MAGENTO EXTENSION License, which extends the Open Software
8
+ * License (OSL 3.0). The Euro.message Magento Extension License is available at this URL:
9
+ * http://numerno.com/licenses/euromsg-ce.txt The Open Software License is available at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ *
12
+ * DISCLAIMER
13
+ *
14
+ * By adding to, editing, or in any way modifying this code, Numerno is not held liable for any inconsistencies or
15
+ * abnormalities in the behaviour of this code. By adding to, editing, or in any way modifying this code, the Licensee
16
+ * terminates any agreement of support offered by Numerno, outlined in the provided Euro.message Magento Extension
17
+ * License.
18
+ * Upon discovery of modified code in the process of support, the Licensee is still held accountable for any and all
19
+ * billable time Numerno spent during the support process. Numerno does not guarantee compatibility with any other
20
+ * Magento extension. Numerno is not responsbile for any inconsistencies or abnormalities in the behaviour of this
21
+ * code if caused by other Magento extension.
22
+ * If you did not receive a copy of the license, please send an email to info@numerno.com or call +90-212-223-5093,
23
+ * so we can send you a copy immediately.
24
+ *
25
+ * @category [Numerno]
26
+ * @package [Numerno_Euromsg]
27
+ * @copyright Copyright (c) 2015 Numerno Bilisim Hiz. Tic. Ltd. Sti. (http://numerno.com/)
28
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
29
+ */
30
+
31
+ /**
32
+ * Newsletter Subscriber Grid
33
+ *
34
+ * @category Numerno
35
+ * @package Numerno_Euromsg
36
+ * @author Numerno Bilisim Hiz. Tic. Ltd. Sti. <info@numerno.com>
37
+ */
38
+ class Numerno_Euromsg_Block_Adminhtml_Newsletter_Subscriber_Grid extends Mage_Adminhtml_Block_Newsletter_Subscriber_Grid
39
+ {
40
+ /*
41
+ * Add export type
42
+ *
43
+ * @return Numerno_Euromsg_Block_Adminhtml_Newsletter_Subscriber_Grid
44
+ */
45
+ protected function _prepareColumns()
46
+ {
47
+
48
+ $this->addExportType('*/adminhtml_euromsg/export', Mage::helper('euromsg')->__('euro.message'));
49
+ return parent::_prepareColumns();
50
+ }
51
+
52
+ /*
53
+ * Add export type layout
54
+ *
55
+ * @return Numerno_Euromsg_Block_Adminhtml_Newsletter_Subscriber_Grid
56
+ */
57
+ protected function _prepareLayout()
58
+ {
59
+ parent::_prepareLayout();
60
+
61
+ $this->setChild('export_button',
62
+ $this->getLayout()->createBlock('adminhtml/widget_button')
63
+ ->setData(array(
64
+ 'label' => Mage::helper('adminhtml')->__('Export'),
65
+ 'onclick' => 'doExport()',
66
+ 'class' => 'task',
67
+ 'after_html' => $this->getLayout()->createBlock('euromsg/adminhtml_grid_exportJs')
68
+ ->setData(array('object_name' => $this->getJsObjectName()))
69
+ ->toHtml()
70
+ ))
71
+ );
72
+ return $this;
73
+ }
74
+ }
app/code/local/Numerno/Euromsg/Block/Adminhtml/Sales/Order/Comments/View.php ADDED
@@ -0,0 +1,75 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Numerno - Euro.message Magento Extension
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the NUMERNO EUROMESSAGE MAGENTO EXTENSION License, which extends the Open Software
8
+ * License (OSL 3.0). The Euro.message Magento Extension License is available at this URL:
9
+ * http://numerno.com/licenses/euromsg-ce.txt The Open Software License is available at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ *
12
+ * DISCLAIMER
13
+ *
14
+ * By adding to, editing, or in any way modifying this code, Numerno is not held liable for any inconsistencies or
15
+ * abnormalities in the behaviour of this code. By adding to, editing, or in any way modifying this code, the Licensee
16
+ * terminates any agreement of support offered by Numerno, outlined in the provided Euro.message Magento Extension
17
+ * License.
18
+ * Upon discovery of modified code in the process of support, the Licensee is still held accountable for any and all
19
+ * billable time Numerno spent during the support process. Numerno does not guarantee compatibility with any other
20
+ * Magento extension. Numerno is not responsbile for any inconsistencies or abnormalities in the behaviour of this
21
+ * code if caused by other Magento extension.
22
+ * If you did not receive a copy of the license, please send an email to info@numerno.com or call +90-212-223-5093,
23
+ * so we can send you a copy immediately.
24
+ *
25
+ * @category [Numerno]
26
+ * @package [Numerno_Euromsg]
27
+ * @copyright Copyright (c) 2015 Numerno Bilisim Hiz. Tic. Ltd. Sti. (http://numerno.com/)
28
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
29
+ */
30
+
31
+ /**
32
+ * Adminhtml Order Comments View
33
+ *
34
+ * @category Numerno
35
+ * @package Numerno_Euromsg
36
+ * @author Numerno Bilisim Hiz. Tic. Ltd. Sti. <info@numerno.com>
37
+ */
38
+ class Numerno_Euromsg_Block_Adminhtml_Sales_Order_Comments_View extends Mage_Adminhtml_Block_Sales_Order_Comments_View
39
+ {
40
+ /*
41
+ * Check if eligible to send order update sms
42
+ *
43
+ * @return bool
44
+ */
45
+ public function canSendCommentSms()
46
+ {
47
+ $helper = Mage::helper('euromsg/sms');
48
+ try {
49
+ $notify = $helper->getStoreConfig('template/sms_order_update');
50
+
51
+ if($notify) {
52
+ $order = $this->getEntity()->getOrder();
53
+ if (!$order->getCustomerIsGuest() || $order->getCustomerId()) {
54
+ $customer = Mage::getModel('customer/customer')->load($order->getCustomerId());
55
+ $smsPermit = $customer->getData(Numerno_Euromsg_Model_Sms::SMS_PERMIT_ATTRIBUTE_CODE);
56
+ if($smsPermit) {
57
+ $smsAttribute = $helper->getGsmAttribute();
58
+ if($smsAttribute) {
59
+ $gsmNumber = $customer->getData($smsAttribute);
60
+ if($helper->validateGsmNumber($gsmNumber))
61
+ {
62
+ return true;
63
+ }
64
+ }
65
+ }
66
+ }
67
+ }
68
+
69
+ }
70
+ catch(Exception $e) { Mage::logException($e); }
71
+
72
+ return false;
73
+ }
74
+
75
+ }
app/code/local/Numerno/Euromsg/Block/Adminhtml/Sales/Order/View/History.php ADDED
@@ -0,0 +1,73 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Numerno - Euro.message Magento Extension
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the NUMERNO EUROMESSAGE MAGENTO EXTENSION License, which extends the Open Software
8
+ * License (OSL 3.0). The Euro.message Magento Extension License is available at this URL:
9
+ * http://numerno.com/licenses/euromsg-ce.txt The Open Software License is available at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ *
12
+ * DISCLAIMER
13
+ *
14
+ * By adding to, editing, or in any way modifying this code, Numerno is not held liable for any inconsistencies or
15
+ * abnormalities in the behaviour of this code. By adding to, editing, or in any way modifying this code, the Licensee
16
+ * terminates any agreement of support offered by Numerno, outlined in the provided Euro.message Magento Extension
17
+ * License.
18
+ * Upon discovery of modified code in the process of support, the Licensee is still held accountable for any and all
19
+ * billable time Numerno spent during the support process. Numerno does not guarantee compatibility with any other
20
+ * Magento extension. Numerno is not responsbile for any inconsistencies or abnormalities in the behaviour of this
21
+ * code if caused by other Magento extension.
22
+ * If you did not receive a copy of the license, please send an email to info@numerno.com or call +90-212-223-5093,
23
+ * so we can send you a copy immediately.
24
+ *
25
+ * @category [Numerno]
26
+ * @package [Numerno_Euromsg]
27
+ * @copyright Copyright (c) 2015 Numerno Bilisim Hiz. Tic. Ltd. Sti. (http://numerno.com/)
28
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
29
+ */
30
+
31
+ /**
32
+ * Adminhtml Order Comment History Block
33
+ *
34
+ * @category Numerno
35
+ * @package Numerno_Euromsg
36
+ * @author Numerno Bilisim Hiz. Tic. Ltd. Sti. <info@numerno.com>
37
+ */
38
+ class Numerno_Euromsg_Block_Adminhtml_Sales_Order_View_History extends Mage_Adminhtml_Block_Sales_Order_View_History
39
+ {
40
+ /*
41
+ * Check if eligible to send order update sms
42
+ *
43
+ * @return bool
44
+ */
45
+ public function canSendCommentSms()
46
+ {
47
+ $helper = Mage::helper('euromsg/sms');
48
+
49
+ try {
50
+ $notify = $helper->getStoreConfig('template/sms_order_update');
51
+ if($notify) {
52
+ $order = $this->getOrder();
53
+ if (!$order->getCustomerIsGuest() || $order->getCustomerId()) {
54
+ $customer = Mage::getModel('customer/customer')->load($order->getCustomerId());
55
+ $smsPermit = $customer->getData(Numerno_Euromsg_Model_Sms::SMS_PERMIT_ATTRIBUTE_CODE);
56
+ if($smsPermit) {
57
+ $smsAttribute = $helper->getGsmAttribute();
58
+ if($smsAttribute) {
59
+ $gsmNumber = $customer->getData($smsAttribute);
60
+ if($helper->validateGsmNumber($gsmNumber))
61
+ return true;
62
+ }
63
+ }
64
+ }
65
+ }
66
+
67
+ }
68
+ catch(Exception $e) { }
69
+
70
+ return false;
71
+ }
72
+
73
+ }
app/code/local/Numerno/Euromsg/Block/Adminhtml/Sms/Logs.php ADDED
@@ -0,0 +1,50 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Numerno - Euro.message Magento Extension
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the NUMERNO EUROMESSAGE MAGENTO EXTENSION License, which extends the Open Software
8
+ * License (OSL 3.0). The Euro.message Magento Extension License is available at this URL:
9
+ * http://numerno.com/licenses/euromsg-ce.txt The Open Software License is available at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ *
12
+ * DISCLAIMER
13
+ *
14
+ * By adding to, editing, or in any way modifying this code, Numerno is not held liable for any inconsistencies or
15
+ * abnormalities in the behaviour of this code. By adding to, editing, or in any way modifying this code, the Licensee
16
+ * terminates any agreement of support offered by Numerno, outlined in the provided Euro.message Magento Extension
17
+ * License.
18
+ * Upon discovery of modified code in the process of support, the Licensee is still held accountable for any and all
19
+ * billable time Numerno spent during the support process. Numerno does not guarantee compatibility with any other
20
+ * Magento extension. Numerno is not responsbile for any inconsistencies or abnormalities in the behaviour of this
21
+ * code if caused by other Magento extension.
22
+ * If you did not receive a copy of the license, please send an email to info@numerno.com or call +90-212-223-5093,
23
+ * so we can send you a copy immediately.
24
+ *
25
+ * @category [Numerno]
26
+ * @package [Numerno_Euromsg]
27
+ * @copyright Copyright (c) 2015 Numerno Bilisim Hiz. Tic. Ltd. Sti. (http://numerno.com/)
28
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
29
+ */
30
+
31
+ /**
32
+ * SMS Logs Container
33
+ *
34
+ * @category Numerno
35
+ * @package Numerno_Euromsg
36
+ * @author Numerno Bilisim Hiz. Tic. Ltd. Sti. <info@numerno.com>
37
+ */
38
+ class Numerno_Euromsg_Block_Adminhtml_Sms_Logs extends Mage_Adminhtml_Block_Widget_Grid_Container
39
+ {
40
+ public function __construct()
41
+ {
42
+ $this->_blockGroup = 'euromsg';
43
+ $this->_controller = 'adminhtml_sms_logs';
44
+ $this->_headerText = Mage::helper('euromsg')->__('euro.message SMS Logs');
45
+
46
+ parent::__construct();
47
+ $this->_removeButton('add');
48
+ }
49
+
50
+ }
app/code/local/Numerno/Euromsg/Block/Adminhtml/Sms/Logs/Grid.php ADDED
@@ -0,0 +1,121 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Numerno - Euro.message Magento Extension
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the NUMERNO EUROMESSAGE MAGENTO EXTENSION License, which extends the Open Software
8
+ * License (OSL 3.0). The Euro.message Magento Extension License is available at this URL:
9
+ * http://numerno.com/licenses/euromsg-ce.txt The Open Software License is available at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ *
12
+ * DISCLAIMER
13
+ *
14
+ * By adding to, editing, or in any way modifying this code, Numerno is not held liable for any inconsistencies or
15
+ * abnormalities in the behaviour of this code. By adding to, editing, or in any way modifying this code, the Licensee
16
+ * terminates any agreement of support offered by Numerno, outlined in the provided Euro.message Magento Extension
17
+ * License.
18
+ * Upon discovery of modified code in the process of support, the Licensee is still held accountable for any and all
19
+ * billable time Numerno spent during the support process. Numerno does not guarantee compatibility with any other
20
+ * Magento extension. Numerno is not responsbile for any inconsistencies or abnormalities in the behaviour of this
21
+ * code if caused by other Magento extension.
22
+ * If you did not receive a copy of the license, please send an email to info@numerno.com or call +90-212-223-5093,
23
+ * so we can send you a copy immediately.
24
+ *
25
+ * @category [Numerno]
26
+ * @package [Numerno_Euromsg]
27
+ * @copyright Copyright (c) 2015 Numerno Bilisim Hiz. Tic. Ltd. Sti. (http://numerno.com/)
28
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
29
+ */
30
+
31
+ /**
32
+ * Sms Logs Grid
33
+ *
34
+ * @category Numerno
35
+ * @package Numerno_Euromsg
36
+ * @author Numerno Bilisim Hiz. Tic. Ltd. Sti. <info@numerno.com>
37
+ */
38
+ class Numerno_Euromsg_Block_Adminhtml_Sms_Logs_Grid extends Mage_Adminhtml_Block_Widget_Grid
39
+ {
40
+ public function __construct()
41
+ {
42
+ parent::__construct();
43
+ $this->setId('smslogsGrid');
44
+ $this->setDefaultSort('sms_id');
45
+ $this->setDefaultDir('DESC');
46
+ $this->setSaveParametersInSession(true);
47
+ $this->setUseAjax(true);
48
+ }
49
+
50
+ protected function _prepareCollection()
51
+ {
52
+ $_config = Mage::getSingleton('eav/config');
53
+ $collection = Mage::getModel('euromsg/sms')->getCollection();
54
+ $firstname = $_config->getAttribute('customer', 'firstname');
55
+ $lastname = $_config->getAttribute('customer', 'lastname');
56
+ $collection->getSelect()
57
+ ->joinLeft(
58
+ array('customer_' . $firstname->getAttributeCode() . '_table' => $firstname->getBackendTable()),
59
+ 'customer_' . $firstname->getAttributeCode() . '_table.entity_id = main_table.customer_id'
60
+ . ' AND customer_' . $firstname->getAttributeCode() . '_table.attribute_id = '
61
+ . ((int) $firstname->getAttributeId()),
62
+ array('firstname' => 'value')
63
+ )
64
+ ->joinLeft(
65
+ array('customer_' . $lastname->getAttributeCode() . '_table' => $lastname->getBackendTable()),
66
+ 'customer_' . $lastname->getAttributeCode() . '_table.entity_id = main_table.customer_id'
67
+ . ' AND customer_' . $lastname->getAttributeCode() . '_table.attribute_id = '
68
+ . ((int) $lastname->getAttributeId()),
69
+ array('lastname' => 'value')
70
+ )
71
+ ->columns(new Zend_Db_Expr("CONCAT(`customer_" . $firstname->getAttributeCode()
72
+ . "_table`.`value`, ' ', `customer_" . $lastname->getAttributeCode()
73
+ . "_table`.`value`) AS customer_name"));
74
+
75
+ $this->setCollection($collection);
76
+
77
+ return parent::_prepareCollection();
78
+ }
79
+
80
+ protected function _prepareColumns()
81
+ {
82
+ $this->addColumn('sms_id', array(
83
+ 'header' => Mage::helper('euromsg')->__('ID #'),
84
+ 'index' => 'sms_id'
85
+ ));
86
+ $this->addColumn('begin_time', array(
87
+ 'header' => Mage::helper('euromsg')->__('Send At'),
88
+ 'index' => 'begin_time',
89
+ 'type' => 'datetime'
90
+ ));
91
+ $this->addColumn('type', array(
92
+ 'header' => Mage::helper('euromsg')->__('Type'),
93
+ 'index' => 'type'
94
+ ));
95
+ $this->addColumn('customer_name', array(
96
+ 'header' => Mage::helper('euromsg')->__('Customer'),
97
+ 'index' => 'customer_name',
98
+ 'renderer' => 'Numerno_Euromsg_Block_Adminhtml_Sms_Renderer_Customer'
99
+ ));
100
+ $this->addColumn('gsm_number', array(
101
+ 'header' => Mage::helper('euromsg')->__('GSM Number'),
102
+ 'index' => 'gsm_number'
103
+ ));
104
+ $this->addColumn('message', array(
105
+ 'header' => Mage::helper('euromsg')->__('Message'),
106
+ 'index' => 'message'
107
+ ));
108
+
109
+ $delivery = Mage::helper('euromsg/sms')->getStoreConfig('log/track_delivery');
110
+ if($delivery) {
111
+ $this->addColumn('delivery_status', array(
112
+ 'header' => Mage::helper('euromsg')->__('Delivery Status'),
113
+ 'index' => 'delivery_status',
114
+ 'type' => 'options',
115
+ 'options' => Mage::helper('euromsg/post')->getDeliveryStatusOptions()
116
+ ));
117
+ }
118
+
119
+ return parent::_prepareColumns();
120
+ }
121
+ }
app/code/local/Numerno/Euromsg/Block/Adminhtml/Sms/Renderer/Customer.php ADDED
@@ -0,0 +1,55 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Numerno - Euro.message Magento Extension
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the NUMERNO EUROMESSAGE MAGENTO EXTENSION License, which extends the Open Software
8
+ * License (OSL 3.0). The Euro.message Magento Extension License is available at this URL:
9
+ * http://numerno.com/licenses/euromsg-ce.txt The Open Software License is available at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ *
12
+ * DISCLAIMER
13
+ *
14
+ * By adding to, editing, or in any way modifying this code, Numerno is not held liable for any inconsistencies or
15
+ * abnormalities in the behaviour of this code. By adding to, editing, or in any way modifying this code, the Licensee
16
+ * terminates any agreement of support offered by Numerno, outlined in the provided Euro.message Magento Extension
17
+ * License.
18
+ * Upon discovery of modified code in the process of support, the Licensee is still held accountable for any and all
19
+ * billable time Numerno spent during the support process. Numerno does not guarantee compatibility with any other
20
+ * Magento extension. Numerno is not responsbile for any inconsistencies or abnormalities in the behaviour of this
21
+ * code if caused by other Magento extension.
22
+ * If you did not receive a copy of the license, please send an email to info@numerno.com or call +90-212-223-5093,
23
+ * so we can send you a copy immediately.
24
+ *
25
+ * @category [Numerno]
26
+ * @package [Numerno_Euromsg]
27
+ * @copyright Copyright (c) 2015 Numerno Bilisim Hiz. Tic. Ltd. Sti. (http://numerno.com/)
28
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
29
+ */
30
+
31
+ /**
32
+ * SMS Logs Grid Customer Column Renderer
33
+ *
34
+ * @category Numerno
35
+ * @package Numerno_Euromsg
36
+ * @author Numerno Bilisim Hiz. Tic. Ltd. Sti. <info@numerno.com>
37
+ */
38
+ class Numerno_Euromsg_Block_Adminhtml_Sms_Renderer_Customer
39
+ extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract
40
+ {
41
+ /*
42
+ * Render Cell Template
43
+ *
44
+ * @param Varien_Object $row
45
+ * @return string
46
+ */
47
+ public function render(Varien_Object $row)
48
+ {
49
+ $customerName = $row->getData('customer_name');
50
+ $customerId = $row->getData('customer_id');
51
+ $link = Mage::helper('adminhtml')->getUrl('adminhtml/customer/edit/', array('id' => $customerId));
52
+
53
+ return "<a href=\"$link\">$customerName</a>";
54
+ }
55
+ }
app/code/local/Numerno/Euromsg/Block/Adminhtml/Sms/Subscribers.php ADDED
@@ -0,0 +1,50 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Numerno - Euro.message Magento Extension
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the NUMERNO EUROMESSAGE MAGENTO EXTENSION License, which extends the Open Software
8
+ * License (OSL 3.0). The Euro.message Magento Extension License is available at this URL:
9
+ * http://numerno.com/licenses/euromsg-ce.txt The Open Software License is available at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ *
12
+ * DISCLAIMER
13
+ *
14
+ * By adding to, editing, or in any way modifying this code, Numerno is not held liable for any inconsistencies or
15
+ * abnormalities in the behaviour of this code. By adding to, editing, or in any way modifying this code, the Licensee
16
+ * terminates any agreement of support offered by Numerno, outlined in the provided Euro.message Magento Extension
17
+ * License.
18
+ * Upon discovery of modified code in the process of support, the Licensee is still held accountable for any and all
19
+ * billable time Numerno spent during the support process. Numerno does not guarantee compatibility with any other
20
+ * Magento extension. Numerno is not responsbile for any inconsistencies or abnormalities in the behaviour of this
21
+ * code if caused by other Magento extension.
22
+ * If you did not receive a copy of the license, please send an email to info@numerno.com or call +90-212-223-5093,
23
+ * so we can send you a copy immediately.
24
+ *
25
+ * @category [Numerno]
26
+ * @package [Numerno_Euromsg]
27
+ * @copyright Copyright (c) 2015 Numerno Bilisim Hiz. Tic. Ltd. Sti. (http://numerno.com/)
28
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
29
+ */
30
+
31
+ /**
32
+ * SMS Subscribers Container
33
+ *
34
+ * @category Numerno
35
+ * @package Numerno_Euromsg
36
+ * @author Numerno Bilisim Hiz. Tic. Ltd. Sti. <info@numerno.com>
37
+ */
38
+ class Numerno_Euromsg_Block_Adminhtml_Sms_Subscribers extends Mage_Adminhtml_Block_Widget_Grid_Container
39
+ {
40
+ public function __construct()
41
+ {
42
+ $this->_blockGroup = 'euromsg';
43
+ $this->_controller = 'adminhtml_sms_subscribers';
44
+ $this->_headerText = Mage::helper('euromsg')->__('euro.message SMS Subscribers');
45
+
46
+ parent::__construct();
47
+ $this->_removeButton('add');
48
+ }
49
+
50
+ }
app/code/local/Numerno/Euromsg/Block/Adminhtml/Sms/Subscribers/Grid.php ADDED
@@ -0,0 +1,121 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Numerno - Euro.message Magento Extension
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the NUMERNO EUROMESSAGE MAGENTO EXTENSION License, which extends the Open Software
8
+ * License (OSL 3.0). The Euro.message Magento Extension License is available at this URL:
9
+ * http://numerno.com/licenses/euromsg-ce.txt The Open Software License is available at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ *
12
+ * DISCLAIMER
13
+ *
14
+ * By adding to, editing, or in any way modifying this code, Numerno is not held liable for any inconsistencies or
15
+ * abnormalities in the behaviour of this code. By adding to, editing, or in any way modifying this code, the Licensee
16
+ * terminates any agreement of support offered by Numerno, outlined in the provided Euro.message Magento Extension
17
+ * License.
18
+ * Upon discovery of modified code in the process of support, the Licensee is still held accountable for any and all
19
+ * billable time Numerno spent during the support process. Numerno does not guarantee compatibility with any other
20
+ * Magento extension. Numerno is not responsbile for any inconsistencies or abnormalities in the behaviour of this
21
+ * code if caused by other Magento extension.
22
+ * If you did not receive a copy of the license, please send an email to info@numerno.com or call +90-212-223-5093,
23
+ * so we can send you a copy immediately.
24
+ *
25
+ * @category [Numerno]
26
+ * @package [Numerno_Euromsg]
27
+ * @copyright Copyright (c) 2015 Numerno Bilisim Hiz. Tic. Ltd. Sti. (http://numerno.com/)
28
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
29
+ */
30
+
31
+ /**
32
+ * Sms Subscribers Grid
33
+ *
34
+ * @category Numerno
35
+ * @package Numerno_Euromsg
36
+ * @author Numerno Bilisim Hiz. Tic. Ltd. Sti. <info@numerno.com>
37
+ */
38
+ class Numerno_Euromsg_Block_Adminhtml_Sms_Subscribers_Grid extends Mage_Adminhtml_Block_Widget_Grid
39
+ {
40
+ public function __construct()
41
+ {
42
+ parent::__construct();
43
+ $this->setId('smssubscribersGrid');
44
+ $this->setDefaultSort('customer_id');
45
+ $this->setDefaultDir('DESC');
46
+ $this->setSaveParametersInSession(true);
47
+ }
48
+
49
+ protected function _prepareCollection()
50
+ {
51
+ $helper = Mage::helper('euromsg/sms');
52
+ $collection = Mage::getResourceModel('customer/customer_collection')
53
+ ->addNameToSelect()
54
+ ->addAttributeToSelect('email')
55
+ ->addAttributeToSelect((string) Numerno_Euromsg_Model_Sms::SMS_PERMIT_ATTRIBUTE_CODE);
56
+
57
+ if($helper->getGsmAttribute())
58
+ $collection->addAttributeToSelect((string) $helper->getGsmAttribute());
59
+
60
+ $this->setCollection($collection);
61
+
62
+ return parent::_prepareCollection();
63
+ }
64
+
65
+ protected function _prepareColumns()
66
+ {
67
+ $helper = Mage::helper('euromsg/sms');
68
+
69
+ $this->addColumn('entity_id', array(
70
+ 'header' => Mage::helper('customer')->__('ID'),
71
+ 'width' => '50px',
72
+ 'index' => 'entity_id',
73
+ 'type' => 'number',
74
+ ));
75
+ if($helper->getGsmAttribute())
76
+ $this->addColumn((string) $helper->getGsmAttribute(), array(
77
+ 'header' => Mage::helper('euromsg')->__('GSM Number'),
78
+ 'index' => (string) $helper->getGsmAttribute()
79
+ ));
80
+ $this->addColumn('name', array(
81
+ 'header' => Mage::helper('customer')->__('Name'),
82
+ 'index' => 'name'
83
+ ));
84
+ $this->addColumn('email', array(
85
+ 'header' => Mage::helper('customer')->__('Email'),
86
+ 'width' => '150',
87
+ 'index' => 'email'
88
+ ));
89
+ $this->addColumn((string) Numerno_Euromsg_Model_Sms::SMS_PERMIT_ATTRIBUTE_CODE, array(
90
+ 'header' => Mage::helper('euromsg')->__('Is Subscribed?'),
91
+ 'index' => (string) Numerno_Euromsg_Model_Sms::SMS_PERMIT_ATTRIBUTE_CODE,
92
+ 'type' => 'options',
93
+ 'options' => Mage::getModel('euromsg/system_config_source_sms_permit')->toArray()
94
+ ));
95
+
96
+ return parent::_prepareColumns();
97
+ }
98
+
99
+ public function getRowUrl($row)
100
+ {
101
+ return Mage::helper('adminhtml')->getUrl('adminhtml/customer/edit/', array('id'=>$row->getId()));
102
+ }
103
+
104
+ protected function _prepareMassaction()
105
+ {
106
+ $this->setMassactionIdField('entity_id');
107
+ $this->getMassactionBlock()->setFormFieldName('customer');
108
+
109
+ $this->getMassactionBlock()->addItem('sms_subscribe', array(
110
+ 'label' => Mage::helper('customer')->__('Subscribe'),
111
+ 'url' => $this->getUrl('*/*/massSubscribe')
112
+ ));
113
+
114
+ $this->getMassactionBlock()->addItem('sms_unsubscribe', array(
115
+ 'label' => Mage::helper('customer')->__('Unsubscribe'),
116
+ 'url' => $this->getUrl('*/*/massUnsubscribe')
117
+ ));
118
+
119
+ return $this;
120
+ }
121
+ }
app/code/local/Numerno/Euromsg/Helper/Data.php ADDED
@@ -0,0 +1,273 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Numerno - Euro.message Magento Extension
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the NUMERNO EUROMESSAGE MAGENTO EXTENSION License, which extends the Open Software
8
+ * License (OSL 3.0). The Euro.message Magento Extension License is available at this URL:
9
+ * http://numerno.com/licenses/euromsg-ce.txt The Open Software License is available at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ *
12
+ * DISCLAIMER
13
+ *
14
+ * By adding to, editing, or in any way modifying this code, Numerno is not held liable for any inconsistencies or
15
+ * abnormalities in the behaviour of this code. By adding to, editing, or in any way modifying this code, the Licensee
16
+ * terminates any agreement of support offered by Numerno, outlined in the provided Euro.message Magento Extension
17
+ * License.
18
+ * Upon discovery of modified code in the process of support, the Licensee is still held accountable for any and all
19
+ * billable time Numerno spent during the support process. Numerno does not guarantee compatibility with any other
20
+ * Magento extension. Numerno is not responsbile for any inconsistencies or abnormalities in the behaviour of this
21
+ * code if caused by other Magento extension.
22
+ * If you did not receive a copy of the license, please send an email to info@numerno.com or call +90-212-223-5093,
23
+ * so we can send you a copy immediately.
24
+ *
25
+ * @category [Numerno]
26
+ * @package [Numerno_Euromsg]
27
+ * @copyright Copyright (c) 2015 Numerno Bilisim Hiz. Tic. Ltd. Sti. (http://numerno.com/)
28
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
29
+ */
30
+
31
+ /**
32
+ * Helper
33
+ *
34
+ * @category Numerno
35
+ * @package Numerno_Euromsg
36
+ * @author Numerno Bilisim Hiz. Tic. Ltd. Sti. <info@numerno.com>
37
+ */
38
+ class Numerno_Euromsg_Helper_Data extends Mage_Core_Helper_Abstract
39
+ {
40
+
41
+ /**
42
+ * Customer Attribute Prefix
43
+ */
44
+ const CUSTOMER_ATTR_PREFIX = 'customer_';
45
+
46
+ /**
47
+ * Retrieve store config
48
+ *
49
+ * @param string
50
+ *
51
+ * @return string
52
+ */
53
+ public function getStoreConfig($path)
54
+ {
55
+ return Mage::getStoreConfig('euromsg' . $path);
56
+ }
57
+
58
+ /**
59
+ * Retrieve euro.message Web Service Full URL
60
+ *
61
+ * @param string
62
+ *
63
+ * @return string
64
+ */
65
+ public function getWsUri()
66
+ {
67
+ return $this->getStoreConfig('/general/platform');
68
+ }
69
+
70
+ /**
71
+ * Retrieve euro.message Web Service Login Credentials
72
+ *
73
+ * @return array
74
+ */
75
+ public function getWsCredentials()
76
+ {
77
+ $credentials = array(
78
+ 'Username' => $this->getStoreConfig('/general/ws_user'),
79
+ 'Password' => $this->getStoreConfig('/general/ws_pass')
80
+ );
81
+
82
+ return $credentials;
83
+ }
84
+
85
+ /**
86
+ * Retrieve sFTP Credentials
87
+ *
88
+ * @return array
89
+ */
90
+ public function getSftpCredentials($target)
91
+ {
92
+ $credentials = array(
93
+ 'host' => $this->getStoreConfig("/$target/sftp_host"),
94
+ 'username' => $this->getStoreConfig("/$target/sftp_user"),
95
+ 'password' => $this->getStoreConfig("/$target/sftp_pass")
96
+ );
97
+
98
+ return $credentials;
99
+ }
100
+
101
+ /**
102
+ * Prepare sFTP Connection
103
+ *
104
+ * @return Numerno_Euromsg_Model_Io_Sftp
105
+ */
106
+ public function getSftpConnection($target = 'dwh')
107
+ {
108
+ $connection = Mage::getModel('euromsg/io_sftp');
109
+ $connection->open($this->getSftpCredentials($target));
110
+
111
+ return $connection;
112
+ }
113
+
114
+
115
+ /**
116
+ * Process Feedback ZIP File
117
+ *
118
+ * @param string $file
119
+ * @return void
120
+ */
121
+ public function processFeedbackZip($file)
122
+ {
123
+ $zip = new ZipArchive();
124
+ $zip->open($file);
125
+ for( $i = 0; $i < $zip->numFiles; $i++ ){
126
+ $stat = $zip->statIndex( $i );
127
+ if($stat['size']!=0){
128
+ if(strpos($stat['name'], '.csv')) {
129
+ $tmpDir = sys_get_temp_dir();
130
+ $file = $tmpDir . DS . $stat['name'];
131
+ $zip->extractTo($tmpDir, $stat['name']);
132
+
133
+ if (($handle = fopen($file, "r")) !== FALSE) {
134
+ $header = fgets($handle);
135
+ if(strpos($header, 'UNSUBCRIBE') || strpos($header, 'UNSUBSCRIBE')) {
136
+ $headers = explode(';', $header);
137
+ while (($row = fgetcsv($handle, false, ";")) !== FALSE) {
138
+ $data = array_combine($headers, $row);
139
+ if(isset($data['EMAIL_ADDRESS'])) {
140
+ $subscriber = Mage::getModel('newsletter/subscriber')->loadByEmail($data['EMAIL_ADDRESS']);
141
+ if($subscriber->getId())
142
+ $subscriber->unsubscribe();
143
+ }
144
+ }
145
+ }
146
+ fclose($handle);
147
+ }
148
+ }
149
+ }
150
+ }
151
+ $zip->close();
152
+ }
153
+
154
+ public function getReservedColumns() {
155
+
156
+ $columns = array(
157
+ 'subscriber_email' => Numerno_Euromsg_Model_Export_Entity_Member::COL_EMAIL,
158
+ 'subscriber_id' => Numerno_Euromsg_Model_Export_Entity_Member::COL_KEY_ID,
159
+ );
160
+
161
+ $sms = Mage::helper('euromsg/sms');
162
+ if($sms->isEnabled() && $sms->getGsmAttribute()){
163
+ $columns[self::CUSTOMER_ATTR_PREFIX . $sms->getGsmAttribute()] = Numerno_Euromsg_Model_Sms::COL_GSM_NO;
164
+ }
165
+
166
+ if(Mage::getStoreConfig('euromsg_customer/general/source') == 'newsletter_subscribers_customers') {
167
+ $columns[self::CUSTOMER_ATTR_PREFIX . 'entity_id'] = Numerno_Euromsg_Model_Export_Entity_Member::COL_KEY_ID;
168
+ }
169
+
170
+ return $columns;
171
+ }
172
+
173
+ /**
174
+ * Retrieve Customer Attribute Prefix
175
+ *
176
+ * @return string
177
+ */
178
+ public function getCustomerAttributePrefix()
179
+ {
180
+ return self::CUSTOMER_ATTR_PREFIX;
181
+ }
182
+
183
+ /**
184
+ * Retrieve Preset Customer Attribute option array
185
+ *
186
+ * @return array
187
+ */
188
+ public function getPresetCustomerAttributes()
189
+ {
190
+ $_prefix = $this->getCustomerAttributePrefix();
191
+
192
+ $attributes = array(
193
+ '__empty' => Mage::helper('euromsg')->__('Select an attribute...'),
194
+ 'subscriber_id' => Mage::helper('euromsg')->__('Subscriber ID'),
195
+ 'subscriber_email' => Mage::helper('euromsg')->__('Subscriber Email'),
196
+ $_prefix . 'entity_id' => Mage::helper('euromsg')->__('Customer ID'),
197
+ $_prefix . 'last_login' => Mage::helper('euromsg')->__('Customer Last Web Login At'),
198
+ $_prefix . 'last_order' => Mage::helper('euromsg')->__('Customer Last Order Created At'),
199
+ $_prefix . 'orders_total' => Mage::helper('euromsg')->__('Customer Total Amount of Orders'),
200
+ $_prefix . 'fav_category' => Mage::helper('euromsg')->__('Customer Most Ordered Category'),
201
+ $_prefix . 'group' => Mage::helper('euromsg')->__('Customer Group (group name)')
202
+ );
203
+
204
+ return $attributes;
205
+ }
206
+
207
+ /**
208
+ * Retrieve Disabled Customer Attributes
209
+ *
210
+ * @return array
211
+ */
212
+ public function getDisabledCustomerAttributes()
213
+ {
214
+ return array('confirmation', 'default_billing', 'default_shipping', 'disable_auto_group_change',
215
+ 'password_hash', 'reward_update_notification', 'reward_warning_notification', 'rp_token',
216
+ 'rp_token_created_at', 'store_id', 'website_id');
217
+
218
+ }
219
+
220
+ /**
221
+ * Retrieve Preset Product Attributes option array
222
+ *
223
+ * @return array
224
+ */
225
+ public function getPresetProductAttributes()
226
+ {
227
+ return array(
228
+ 'entity_id' => Mage::helper('euromsg')->__('Product ID (entity_id)'),
229
+ '_url' => Mage::helper('euromsg')->__('Product URL'),
230
+ '_attribute_set'=> Mage::helper('euromsg')->__('Attribute Set'),
231
+ '_type' => Mage::helper('euromsg')->__('Product Type'),
232
+ 'qty' => Mage::helper('euromsg')->__('Qty'),
233
+ 'is_in_stock' => Mage::helper('euromsg')->__('Stock Status'),
234
+ '_root_category'=> Mage::helper('euromsg')->__('Root Category'),
235
+ '_category' => Mage::helper('euromsg')->__('Category (first, with tree)')
236
+ );
237
+ }
238
+
239
+ /**
240
+ * Zip and upload files to euro.message Data Warehouse
241
+ *
242
+ * @param string $filename
243
+ * @param array $files
244
+ * @return bool
245
+ */
246
+ public function wrapFiles($filename, $files)
247
+ {
248
+ if(!is_array($files))
249
+ return false;
250
+
251
+ $destination = tempnam(sys_get_temp_dir(), $filename . '.zip');
252
+
253
+ $zip = new ZipArchive();
254
+ $zip->open($destination, ZipArchive::CREATE);
255
+ foreach ($files as $name => $file) {
256
+ $zip->addFile($file, $name);
257
+ }
258
+ $zip->close();
259
+ foreach ($files as $file) {
260
+ //unlink($file);
261
+ }
262
+ if(file_exists($destination)) {
263
+ $connection = $this->getSftpConnection();
264
+ $connection->write($filename . '.zip', file_get_contents($destination));
265
+ $connection->close();
266
+ //unlink($destination);
267
+ }
268
+
269
+ return true;
270
+ }
271
+
272
+
273
+ }
app/code/local/Numerno/Euromsg/Helper/Post.php ADDED
@@ -0,0 +1,72 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Numerno - Euro.message Magento Extension
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the NUMERNO EUROMESSAGE MAGENTO EXTENSION License, which extends the Open Software
8
+ * License (OSL 3.0). The Euro.message Magento Extension License is available at this URL:
9
+ * http://numerno.com/licenses/euromsg-ce.txt The Open Software License is available at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ *
12
+ * DISCLAIMER
13
+ *
14
+ * By adding to, editing, or in any way modifying this code, Numerno is not held liable for any inconsistencies or
15
+ * abnormalities in the behaviour of this code. By adding to, editing, or in any way modifying this code, the Licensee
16
+ * terminates any agreement of support offered by Numerno, outlined in the provided Euro.message Magento Extension
17
+ * License.
18
+ * Upon discovery of modified code in the process of support, the Licensee is still held accountable for any and all
19
+ * billable time Numerno spent during the support process. Numerno does not guarantee compatibility with any other
20
+ * Magento extension. Numerno is not responsbile for any inconsistencies or abnormalities in the behaviour of this
21
+ * code if caused by other Magento extension.
22
+ * If you did not receive a copy of the license, please send an email to info@numerno.com or call +90-212-223-5093,
23
+ * so we can send you a copy immediately.
24
+ *
25
+ * @category [Numerno]
26
+ * @package [Numerno_Euromsg]
27
+ * @copyright Copyright (c) 2015 Numerno Bilisim Hiz. Tic. Ltd. Sti. (http://numerno.com/)
28
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
29
+ */
30
+
31
+ /**
32
+ * Post Service Helper
33
+ *
34
+ * @category Numerno
35
+ * @package Numerno_Euromsg
36
+ * @author Numerno Bilisim Hiz. Tic. Ltd. Sti. <info@numerno.com>
37
+ */
38
+ class Numerno_Euromsg_Helper_Post extends Mage_Core_Helper_Abstract
39
+ {
40
+
41
+ public function getStoreConfig($path){
42
+
43
+ return Mage::getStoreConfig('euromsg_trx/' . $path);
44
+ }
45
+
46
+ public function getPostParams(){
47
+
48
+ $params = array(
49
+ 'FromName' => $this->getStoreConfig('general/from_name'),
50
+ 'FromAddress' => $this->getStoreConfig('general/from_addr'),
51
+ 'ReplyAddress' => $this->getStoreConfig('general/reply_addr')
52
+ );
53
+
54
+ return $params;
55
+ }
56
+
57
+ public function isEnabled(){
58
+
59
+ return $this->getStoreConfig('general/enabled');
60
+ }
61
+
62
+ public function getDeliveryStatusOptions()
63
+ {
64
+
65
+ return array(
66
+ 'RE' => Mage::helper('euromsg')->__('Relayed'),
67
+ 'HU' => Mage::helper('euromsg')->__('Undelivered (HARD)'),
68
+ 'SU' => Mage::helper('euromsg')->__('Undelivered (SOFT)'),
69
+ 'RD' => Mage::helper('euromsg')->__('Read')
70
+ );
71
+ }
72
+ }
app/code/local/Numerno/Euromsg/Helper/Sms.php ADDED
@@ -0,0 +1,96 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Numerno - Euro.message Magento Extension
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the NUMERNO EUROMESSAGE MAGENTO EXTENSION License, which extends the Open Software
8
+ * License (OSL 3.0). The Euro.message Magento Extension License is available at this URL:
9
+ * http://numerno.com/licenses/euromsg-ce.txt The Open Software License is available at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ *
12
+ * DISCLAIMER
13
+ *
14
+ * By adding to, editing, or in any way modifying this code, Numerno is not held liable for any inconsistencies or
15
+ * abnormalities in the behaviour of this code. By adding to, editing, or in any way modifying this code, the Licensee
16
+ * terminates any agreement of support offered by Numerno, outlined in the provided Euro.message Magento Extension
17
+ * License.
18
+ * Upon discovery of modified code in the process of support, the Licensee is still held accountable for any and all
19
+ * billable time Numerno spent during the support process. Numerno does not guarantee compatibility with any other
20
+ * Magento extension. Numerno is not responsbile for any inconsistencies or abnormalities in the behaviour of this
21
+ * code if caused by other Magento extension.
22
+ * If you did not receive a copy of the license, please send an email to info@numerno.com or call +90-212-223-5093,
23
+ * so we can send you a copy immediately.
24
+ *
25
+ * @category [Numerno]
26
+ * @package [Numerno_Euromsg]
27
+ * @copyright Copyright (c) 2015 Numerno Bilisim Hiz. Tic. Ltd. Sti. (http://numerno.com/)
28
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
29
+ */
30
+
31
+ /**
32
+ * PostSms Service Helper
33
+ *
34
+ * @category Numerno
35
+ * @package Numerno_Euromsg
36
+ * @author Numerno Bilisim Hiz. Tic. Ltd. Sti. <info@numerno.com>
37
+ */
38
+ class Numerno_Euromsg_Helper_Sms extends Mage_Core_Helper_Abstract
39
+ {
40
+
41
+ public function getStoreConfig($path)
42
+ {
43
+
44
+ return Mage::getStoreConfig('euromsg_sms/' . $path);
45
+ }
46
+
47
+ public function getOriginator()
48
+ {
49
+
50
+ return $this->getStoreConfig('general/originator');
51
+ }
52
+
53
+ public function isEnabled()
54
+ {
55
+
56
+ return $this->getStoreConfig('general/enabled');
57
+ }
58
+
59
+ public function getGsmAttribute()
60
+ {
61
+ $attributeCode = $this->getStoreConfig('general/attribute');
62
+
63
+ if(strlen($attributeCode)) {
64
+ $attribute = Mage::getSingleton('eav/config')->getAttribute('customer', $attributeCode);
65
+
66
+ if($attribute->getAttributeId())
67
+ return $attributeCode;
68
+ }
69
+
70
+ return false;
71
+ }
72
+
73
+ public function validateGsmNumber($string)
74
+ {
75
+ $numbersOnly = preg_replace("[^0-9]", "", $string) / 1;
76
+ $numberOfDigits = strlen($numbersOnly);
77
+ if( ($numberOfDigits == 10 && substr($numbersOnly, 0, 1) == '5') ||
78
+ ($numberOfDigits == 12 && in_array(substr($numbersOnly, 0, 4), array('9050', '9053', '9054', '9055'))) ){
79
+
80
+ return true;
81
+ }
82
+ return false;
83
+ }
84
+
85
+ public function filterGsmNumber($string)
86
+ {
87
+ $numbersOnly = preg_replace("[^0-9]", "", $string) / 1;
88
+ if(strlen($numbersOnly) == 10 && substr($numbersOnly, 0, 1) == '5')
89
+ $numbersOnly = '90' . $numbersOnly;
90
+
91
+ if(strlen($numbersOnly) == 12 && in_array(substr($numbersOnly, 0, 4), array('9050', '9053', '9054', '9055')))
92
+ return (string) $numbersOnly;
93
+
94
+ return false;
95
+ }
96
+ }
app/code/local/Numerno/Euromsg/Model/Core/Email.php ADDED
@@ -0,0 +1,75 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Numerno - Euro.message Magento Extension
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the NUMERNO EUROMESSAGE MAGENTO EXTENSION License, which extends the Open Software
8
+ * License (OSL 3.0). The Euro.message Magento Extension License is available at this URL:
9
+ * http://numerno.com/licenses/euromsg-ce.txt The Open Software License is available at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ *
12
+ * DISCLAIMER
13
+ *
14
+ * By adding to, editing, or in any way modifying this code, Numerno is not held liable for any inconsistencies or
15
+ * abnormalities in the behaviour of this code. By adding to, editing, or in any way modifying this code, the Licensee
16
+ * terminates any agreement of support offered by Numerno, outlined in the provided Euro.message Magento Extension
17
+ * License.
18
+ * Upon discovery of modified code in the process of support, the Licensee is still held accountable for any and all
19
+ * billable time Numerno spent during the support process. Numerno does not guarantee compatibility with any other
20
+ * Magento extension. Numerno is not responsbile for any inconsistencies or abnormalities in the behaviour of this
21
+ * code if caused by other Magento extension.
22
+ * If you did not receive a copy of the license, please send an email to info@numerno.com or call +90-212-223-5093,
23
+ * so we can send you a copy immediately.
24
+ *
25
+ * @category [Numerno]
26
+ * @package [Numerno_Euromsg]
27
+ * @copyright Copyright (c) 2015 Numerno Bilisim Hiz. Tic. Ltd. Sti. (http://numerno.com/)
28
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
29
+ */
30
+
31
+ /**
32
+ * Email
33
+ *
34
+ * @category Numerno
35
+ * @package Numerno_Euromsg
36
+ * @author Numerno Bilisim Hiz. Tic. Ltd. Sti. <info@numerno.com>
37
+ */
38
+ class Numerno_Euromsg_Model_Core_Email extends Mage_Core_Model_Email
39
+ {
40
+
41
+ public function send() {
42
+
43
+ $_helper = Mage::helper('euromsg/post');
44
+
45
+ // If it's not enabled, just return the parent result.
46
+ if (!$_helper->isEnabled()) {
47
+ return parent::send();
48
+ }
49
+
50
+ if (Mage::getStoreConfigFlag('system/smtp/disable')) {
51
+ return $this;
52
+ }
53
+
54
+ $mail = Mage::getModel('euromsg/mail');
55
+
56
+ $mail->setBody($this->getBody())
57
+ ->addTo($this->getToEmail(), $this->getToName())
58
+ ->setSubject($this->getSubject());
59
+
60
+ Mage::dispatchEvent('numerno_euromsg_send_before', array(
61
+ 'mailer' => $mail,
62
+ 'email' => $this
63
+ ));
64
+
65
+ //try catch return parent or queue
66
+ $mail->send();
67
+
68
+ Mage::dispatchEvent('numerno_euromsg_send_after', array(
69
+ 'to' => $this->getToName(),
70
+ 'subject' => $this->getSubject(),
71
+ 'template' => "n/a",
72
+ 'body' => $this->getBody()));
73
+ return $this;
74
+ }
75
+ }
app/code/local/Numerno/Euromsg/Model/Core/Email/Queue.php ADDED
@@ -0,0 +1,110 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Numerno - Euro.message Magento Extension
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the NUMERNO EUROMESSAGE MAGENTO EXTENSION License, which extends the Open Software
8
+ * License (OSL 3.0). The Euro.message Magento Extension License is available at this URL:
9
+ * http://numerno.com/licenses/euromsg-ce.txt The Open Software License is available at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ *
12
+ * DISCLAIMER
13
+ *
14
+ * By adding to, editing, or in any way modifying this code, Numerno is not held liable for any inconsistencies or
15
+ * abnormalities in the behaviour of this code. By adding to, editing, or in any way modifying this code, the Licensee
16
+ * terminates any agreement of support offered by Numerno, outlined in the provided Euro.message Magento Extension
17
+ * License.
18
+ * Upon discovery of modified code in the process of support, the Licensee is still held accountable for any and all
19
+ * billable time Numerno spent during the support process. Numerno does not guarantee compatibility with any other
20
+ * Magento extension. Numerno is not responsbile for any inconsistencies or abnormalities in the behaviour of this
21
+ * code if caused by other Magento extension.
22
+ * If you did not receive a copy of the license, please send an email to info@numerno.com or call +90-212-223-5093,
23
+ * so we can send you a copy immediately.
24
+ *
25
+ * @category [Numerno]
26
+ * @package [Numerno_Euromsg]
27
+ * @copyright Copyright (c) 2015 Numerno Bilisim Hiz. Tic. Ltd. Sti. (http://numerno.com/)
28
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
29
+ */
30
+
31
+ /**
32
+ * Email Queue
33
+ *
34
+ * @category Numerno
35
+ * @package Numerno_Euromsg
36
+ * @author Numerno Bilisim Hiz. Tic. Ltd. Sti. <info@numerno.com>
37
+ */
38
+ class Numerno_Euromsg_Model_Core_Email_Queue extends Mage_Core_Model_Email_Queue {
39
+
40
+ public function send()
41
+ {
42
+ $_helper = Mage::helper('euromsg/post');
43
+
44
+ // If it's not enabled, just return the parent result.
45
+ if (!$_helper->isEnabled()) {
46
+ return parent::send();
47
+ }
48
+
49
+ /** @var $collection Mage_Core_Model_Resource_Email_Queue_Collection */
50
+ $collection = Mage::getModel('core/email_queue')->getCollection()
51
+ ->addOnlyForSendingFilter()
52
+ ->setPageSize(self::MESSAGES_LIMIT_PER_CRON_RUN)
53
+ ->setCurPage(1)
54
+ ->load();
55
+
56
+ /** @var $message Mage_Core_Model_Email_Queue */
57
+ foreach ($collection as $message) {
58
+ if ($message->getId()) {
59
+ $parameters = new Varien_Object($message->getMessageParameters());
60
+
61
+ $mailer = Mage::getModel('euromsg/mail');
62
+ if($message->getEventType())
63
+ $mailer->template = $message->getEventType();
64
+
65
+ foreach ($message->getRecipients() as $recipient) {
66
+ list($email, $name, $type) = $recipient;
67
+ switch ($type) {
68
+ case self::EMAIL_TYPE_BCC:
69
+ $mailer->addBcc($email, '=?utf-8?B?' . base64_encode($name) . '?=');
70
+ break;
71
+ case self::EMAIL_TYPE_TO:
72
+ case self::EMAIL_TYPE_CC:
73
+ default:
74
+ $mailer->addTo($email, '=?utf-8?B?' . base64_encode($name) . '?=');
75
+ break;
76
+ }
77
+ }
78
+
79
+ if ($parameters->getIsPlain()) {
80
+ $mailer->setBodyText($message->getMessageBody());
81
+ } else {
82
+ $mailer->setBodyHTML($message->getMessageBody());
83
+ }
84
+
85
+ $mailer->setSubject('=?utf-8?B?' . base64_encode($parameters->getSubject()) . '?=');
86
+
87
+ try {
88
+ $mailer->send();
89
+ unset($mailer);
90
+ $message->setProcessedAt(Varien_Date::formatDate(true));
91
+ $message->save();
92
+ }
93
+ catch (Exception $e) {
94
+
95
+ //TODO add system notification if this goes for over x minutes
96
+ unset($mailer);
97
+ $oldDevMode = Mage::getIsDeveloperMode();
98
+ Mage::setIsDeveloperMode(true);
99
+ Mage::logException($e);
100
+ Mage::setIsDeveloperMode($oldDevMode);
101
+
102
+ return false;
103
+ }
104
+ }
105
+ }
106
+
107
+ return $this;
108
+ }
109
+
110
+ }
app/code/local/Numerno/Euromsg/Model/Core/Email/Template.php ADDED
@@ -0,0 +1,58 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Numerno - Euro.message Magento Extension
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the NUMERNO EUROMESSAGE MAGENTO EXTENSION License, which extends the Open Software
8
+ * License (OSL 3.0). The Euro.message Magento Extension License is available at this URL:
9
+ * http://numerno.com/licenses/euromsg-ce.txt The Open Software License is available at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ *
12
+ * DISCLAIMER
13
+ *
14
+ * By adding to, editing, or in any way modifying this code, Numerno is not held liable for any inconsistencies or
15
+ * abnormalities in the behaviour of this code. By adding to, editing, or in any way modifying this code, the Licensee
16
+ * terminates any agreement of support offered by Numerno, outlined in the provided Euro.message Magento Extension
17
+ * License.
18
+ * Upon discovery of modified code in the process of support, the Licensee is still held accountable for any and all
19
+ * billable time Numerno spent during the support process. Numerno does not guarantee compatibility with any other
20
+ * Magento extension. Numerno is not responsbile for any inconsistencies or abnormalities in the behaviour of this
21
+ * code if caused by other Magento extension.
22
+ * If you did not receive a copy of the license, please send an email to info@numerno.com or call +90-212-223-5093,
23
+ * so we can send you a copy immediately.
24
+ *
25
+ * @category [Numerno]
26
+ * @package [Numerno_Euromsg]
27
+ * @copyright Copyright (c) 2015 Numerno Bilisim Hiz. Tic. Ltd. Sti. (http://numerno.com/)
28
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
29
+ */
30
+
31
+ /**
32
+ * Email Template
33
+ *
34
+ * @category Numerno
35
+ * @package Numerno_Euromsg
36
+ * @author Numerno Bilisim Hiz. Tic. Ltd. Sti. <info@numerno.com>
37
+ */
38
+ class Numerno_Euromsg_Model_Core_Email_Template extends Mage_Core_Model_Email_Template
39
+ {
40
+
41
+ public function getMail()
42
+ {
43
+
44
+ $_helper = Mage::helper('euromsg/post');
45
+
46
+ // If it's not enabled, just return the parent result.
47
+ if (!$_helper->isEnabled()) {
48
+ return parent::getMail();
49
+ }
50
+
51
+ $_mail = Mage::getModel('euromsg/mail');
52
+
53
+ if($this->getTemplateId())
54
+ $_mail->template = $this->getTemplateId();
55
+
56
+ return $_mail;
57
+ }
58
+ }
app/code/local/Numerno/Euromsg/Model/Cron.php ADDED
@@ -0,0 +1,265 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Numerno - Euro.message Magento Extension
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the NUMERNO EUROMESSAGE MAGENTO EXTENSION License, which extends the Open Software
8
+ * License (OSL 3.0). The Euro.message Magento Extension License is available at this URL:
9
+ * http://numerno.com/licenses/euromsg-ce.txt The Open Software License is available at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ *
12
+ * DISCLAIMER
13
+ *
14
+ * By adding to, editing, or in any way modifying this code, Numerno is not held liable for any inconsistencies or
15
+ * abnormalities in the behaviour of this code. By adding to, editing, or in any way modifying this code, the Licensee
16
+ * terminates any agreement of support offered by Numerno, outlined in the provided Euro.message Magento Extension
17
+ * License.
18
+ * Upon discovery of modified code in the process of support, the Licensee is still held accountable for any and all
19
+ * billable time Numerno spent during the support process. Numerno does not guarantee compatibility with any other
20
+ * Magento extension. Numerno is not responsbile for any inconsistencies or abnormalities in the behaviour of this
21
+ * code if caused by other Magento extension.
22
+ * If you did not receive a copy of the license, please send an email to info@numerno.com or call +90-212-223-5093,
23
+ * so we can send you a copy immediately.
24
+ *
25
+ * @category [Numerno]
26
+ * @package [Numerno_Euromsg]
27
+ * @copyright Copyright (c) 2015 Numerno Bilisim Hiz. Tic. Ltd. Sti. (http://numerno.com/)
28
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
29
+ */
30
+
31
+ /**
32
+ * Cron Jobs
33
+ *
34
+ * @category Numerno
35
+ * @package Numerno_Euromsg
36
+ * @author Numerno Bilisim Hiz. Tic. Ltd. Sti. <info@numerno.com>
37
+ */
38
+ class Numerno_Euromsg_Model_Cron
39
+ {
40
+ /**
41
+ * Send Customer Data to euro.message Data Warehouse
42
+ *
43
+ * @return bool
44
+ */
45
+ public function syncCustomerData()
46
+ {
47
+ $session = Mage::getSingleton('adminhtml/session');
48
+ $tableName = Mage::getStoreConfig('euromsg_customer/general/filename');
49
+
50
+ $validatorTableName = new Zend_Validate_Regex(array('pattern' => '/^[A-Za-z][A-Za-z_0-9]{1,254}$/'));
51
+ if (!$validatorTableName->isValid($tableName)) {
52
+ $session->addError(
53
+ Mage::helper('euromsg')->__('Default data warehouse table name is invalid. Please use only '
54
+ . 'letters (a-z), numbers (0-9) or underscore(_) in this field, first character should be a'
55
+ . ' letter.')
56
+ );
57
+ }
58
+ $process = Mage::getModel('euromsg/process')
59
+ ->setTableName($tableName)
60
+ ->setType('member');
61
+ try {
62
+ //export process
63
+ $process->export(true);
64
+
65
+ $session->addSuccess(
66
+ Mage::helper('euromsg')->__('All member data successfully exported to euro.message platform.')
67
+ );
68
+ }catch(Exception $e) {
69
+ $session->addError(
70
+ $e->getMessage()
71
+ );
72
+ }
73
+
74
+ return true;
75
+ }
76
+
77
+ /**
78
+ * Send Catalog Data to euro.message Data Warehouse
79
+ *
80
+ * @return bool
81
+ */
82
+ public function syncCatalogData()
83
+ {
84
+ $session = Mage::getSingleton('adminhtml/session');
85
+ $current = Mage::app()->getStore()->getId();
86
+
87
+ foreach(Mage::app()->getStores() as $store) {
88
+
89
+ Mage::app()->setCurrentStore($store->getId());
90
+
91
+ $tableName = Mage::getStoreConfig('euromsg_catalog/general/filename');
92
+ $validatorTableName = new Zend_Validate_Regex(array('pattern' => '/^[A-Za-z][A-Za-z_0-9]{1,254}$/'));
93
+ if (!$validatorTableName->isValid($tableName)) {
94
+ $session->addError(
95
+ Mage::helper('euromsg')->__('Default data warehouse table name is invalid. Please use only '
96
+ . 'letters (a-z), numbers (0-9) or underscore(_) in this field, first character should be a'
97
+ . ' letter.')
98
+ );
99
+ }
100
+ $process = Mage::getModel('euromsg/process')
101
+ ->setTableName($tableName)
102
+ ->setType('product');
103
+ try {
104
+ //export process
105
+ $process->export(true);
106
+
107
+ $session->addSuccess(
108
+ Mage::helper('euromsg')->__('All product data successfully exported to euro.message platform.')
109
+ );
110
+ }catch(Exception $e) {
111
+ $session->addError(
112
+ $e->getMessage()
113
+ );
114
+ }
115
+
116
+ }
117
+ Mage::app()->setCurrentStore($current);
118
+
119
+ return true;
120
+ }
121
+
122
+ /**
123
+ * Send Catalog Data to euro.message Data Warehouse
124
+ *
125
+ * @return bool
126
+ */
127
+ public function runAllProcesses()
128
+ {
129
+ if(Mage::helper('euromsg')->getStoreConfig('/dwh/policy') == Numerno_Euromsg_Model_Process::POLICY_ASYNC) {
130
+ $collection = Mage::getResourceModel('euromsg/process_collection')
131
+ ->addFieldToFilter('status', 'pending');
132
+
133
+ foreach($collection as $process){
134
+ $process->export(true);
135
+ }
136
+ }
137
+
138
+ return true;
139
+ }
140
+
141
+ /**
142
+ * Check Data Warehouse Report files
143
+ *
144
+ * @return bool
145
+ */
146
+ public function checkDwhReports()
147
+ {
148
+ $helper = Mage::helper('euromsg');
149
+
150
+ if($helper->getStoreConfig('/feedback/autosync')) {
151
+ if($helper->getStoreConfig('/feedback/destination') == 'sftp') {
152
+ $con = $helper->getSftpConnection('feedback');
153
+ $dir = $helper->getStoreConfig('/feedback/sftp_dir');
154
+ $con->cd($dir);
155
+ foreach($con->ls() as $file) {
156
+ $extension = pathinfo($file['id'], PATHINFO_EXTENSION);
157
+ if ($extension == 'zip') {
158
+ $zipFile = sys_get_temp_dir() . DS . $file['text'];
159
+ file_put_contents($zipFile, $con->read($file['id']));
160
+ $helper->processFeedbackZip($zipFile);
161
+
162
+ if($helper->getStoreConfig('/feedback/delete_after'))
163
+ $con->rm($file['id']);
164
+ }
165
+ }
166
+ } elseif($helper->getStoreConfig('/feedback/destination') == 'local') {
167
+ $dir = Mage::getBaseDir() . Mage::helper('euromsg')->getStoreConfig('/feedback/local_dir');
168
+ $dircontents = scandir($dir);
169
+ foreach ($dircontents as $file) {
170
+ $extension = pathinfo($file, PATHINFO_EXTENSION);
171
+ if ($extension == 'zip') {
172
+ $helper->processFeedbackZip($dir . DS . $file);
173
+ if($helper->getStoreConfig('/feedback/delete_after'))
174
+ unlink($dir . DS . $file);
175
+ }
176
+ }
177
+ }
178
+ }
179
+ }
180
+
181
+ /**
182
+ * Clean Mail Logs
183
+ *
184
+ * @return bool
185
+ */
186
+ public function cleanMailLogs()
187
+ {
188
+ $helper = Mage::helper('euromsg/post');
189
+ $clean = $helper->getStoreConfig('log/autosync');
190
+
191
+ if($clean) {
192
+ $logs = Mage::getModel('euromsg/mail_log')->getCollection();
193
+
194
+ $keep = $helper->getStoreConfig('log/keeplogs');
195
+ if($keep) {
196
+ $date = date('Y-m-d H:i:s', strtotime("-$keep days"));
197
+ } else {
198
+ $date = date('Y-m-d H:i:s');
199
+ }
200
+
201
+ $logs->addFieldToFilter('send_at', array('lt' => $date));
202
+
203
+ foreach($logs as $log)
204
+ $log->delete();
205
+
206
+ }
207
+ }
208
+
209
+ /**
210
+ * Track Mail Delivery
211
+ *
212
+ * @return bool
213
+ */
214
+ public function trackMailDelivery()
215
+ {
216
+ $helper = Mage::helper('euromsg/post');
217
+ $tracking = $helper->getStoreConfig('log/track_delivery');
218
+
219
+ if($tracking) {
220
+
221
+ $client = Mage::getModel('euromsg/platform');
222
+ $client->_login();
223
+
224
+ $service = $client->getPostService();
225
+ $logs = Mage::getModel('euromsg/mail_log')->getCollection()
226
+ ->addFieldToFilter('post_id', array('notnull' => true))
227
+ ->addFieldToFilter('delivery_relay_status', array(array('neq' => 'D'), array('null' => true)));
228
+
229
+ foreach($logs as $post) {
230
+
231
+ $status = $service->check($post->getPostId());
232
+ if($post->getDeliveryRelayStatus() != $status->RelayStatus) {
233
+
234
+ $post->setDeliveryRelayStatus($status->RelayStatus);
235
+
236
+ if($status->RelayStatus == 'D') {
237
+ $post->setDeliveryStatus($status->DeliveryStatus)
238
+ ->setUndeliveryReason($status->UndeliveryReason);
239
+ }
240
+
241
+ $post->save();
242
+ }
243
+ }
244
+
245
+ $client->_logout();
246
+ }
247
+ }
248
+
249
+ /**
250
+ * Send SMS Queue
251
+ *
252
+ * @return bool
253
+ */
254
+ public function sendAllSms()
255
+ {
256
+ if(Mage::helper('euromsg/sms')->isEnabled()) {
257
+ $collection = Mage::getResourceModel('euromsg/sms_collection')
258
+ ->addFieldToFilter('delivery_status', 'P');
259
+
260
+ foreach($collection as $sms){
261
+ $sms->_send();
262
+ }
263
+ }
264
+ }
265
+ }
app/code/local/Numerno/Euromsg/Model/Export/Adapter/Csv.php ADDED
@@ -0,0 +1,123 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Numerno - Euro.message Magento Extension
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the NUMERNO EUROMESSAGE MAGENTO EXTENSION License, which extends the Open Software
8
+ * License (OSL 3.0). The Euro.message Magento Extension License is available at this URL:
9
+ * http://numerno.com/licenses/euromsg-ce.txt The Open Software License is available at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ *
12
+ * DISCLAIMER
13
+ *
14
+ * By adding to, editing, or in any way modifying this code, Numerno is not held liable for any inconsistencies or
15
+ * abnormalities in the behaviour of this code. By adding to, editing, or in any way modifying this code, the Licensee
16
+ * terminates any agreement of support offered by Numerno, outlined in the provided Euro.message Magento Extension
17
+ * License.
18
+ * Upon discovery of modified code in the process of support, the Licensee is still held accountable for any and all
19
+ * billable time Numerno spent during the support process. Numerno does not guarantee compatibility with any other
20
+ * Magento extension. Numerno is not responsbile for any inconsistencies or abnormalities in the behaviour of this
21
+ * code if caused by other Magento extension.
22
+ * If you did not receive a copy of the license, please send an email to info@numerno.com or call +90-212-223-5093,
23
+ * so we can send you a copy immediately.
24
+ *
25
+ * @category [Numerno]
26
+ * @package [Numerno_Euromsg]
27
+ * @copyright Copyright (c) 2015 Numerno Bilisim Hiz. Tic. Ltd. Sti. (http://numerno.com/)
28
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
29
+ */
30
+
31
+ /**
32
+ * CSV Adapter
33
+ *
34
+ * @category Numerno
35
+ * @package Numerno_Euromsg
36
+ * @author Numerno Bilisim Hiz. Tic. Ltd. Sti. <info@numerno.com>
37
+ */
38
+ class Numerno_Euromsg_Model_Export_Adapter_Csv extends Mage_ImportExport_Model_Export_Adapter_Csv
39
+ {
40
+ /**
41
+ * Field delimiter.
42
+ *
43
+ * @var string
44
+ */
45
+ protected $_delimiter = '|';
46
+
47
+ /**
48
+ * Get field delimiter.
49
+ *
50
+ * @var string
51
+ */
52
+ public function getDelimiter(){
53
+
54
+ return $this->_delimiter;
55
+ }
56
+
57
+ /**
58
+ * Set Destionation
59
+ *
60
+ * @param string
61
+ *
62
+ * @return Numerno_Euromsg_Model_Export_Adapter_Csv
63
+ */
64
+ public function setDestination($destination){
65
+
66
+ if (!is_string($destination)) {
67
+ Mage::throwException(Mage::helper('euromsg')->__('Destination file path must be a string'));
68
+ }
69
+ $pathinfo = pathinfo($destination);
70
+
71
+ if (empty($pathinfo['dirname']) || !is_writable($pathinfo['dirname'])) {
72
+ Mage::throwException(Mage::helper('euromsg')->__('Destination directory is not writable'));
73
+ }
74
+ if (is_file($destination) && !is_writable($destination)) {
75
+ Mage::throwException(Mage::helper('euromsg')->__('Destination file is not writable'));
76
+ }
77
+ $this->_destination = $destination;
78
+
79
+ $this->_init();
80
+
81
+ return $this;
82
+ }
83
+
84
+ /**
85
+ * Return file extension for export.
86
+ *
87
+ * @return string
88
+ */
89
+ public function getFileExtension()
90
+ {
91
+ return 'txt';
92
+ }
93
+
94
+ /**
95
+ * Write row data to source file.
96
+ *
97
+ * @param array $rowData
98
+ * @throws Exception
99
+ * @return Mage_ImportExport_Model_Export_Adapter_Abstract
100
+ */
101
+ public function writeRow(array $rowData)
102
+ {
103
+ if (null === $this->_headerCols) {
104
+ $this->setHeaderCols(array_keys($rowData));
105
+ }
106
+
107
+ /**
108
+ * Security enchancement for CSV data processing by Excel-like applications.
109
+ * @see https://bugzilla.mozilla.org/show_bug.cgi?id=1054702
110
+ */
111
+ $data = array_merge($this->_headerCols, array_intersect_key($rowData, $this->_headerCols));
112
+ foreach ($data as $key => $value) {
113
+ if (substr($value, 0, 1) === '=') {
114
+ $data[$key] = ' ' . $value;
115
+ }
116
+ }
117
+
118
+ fputs($this->_fileHandler, implode($data, $this->_delimiter)."\r\n");
119
+
120
+ return $this;
121
+ }
122
+
123
+ }
app/code/local/Numerno/Euromsg/Model/Export/Entity/Member.php ADDED
@@ -0,0 +1,587 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Numerno - Euro.message Magento Extension
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the NUMERNO EUROMESSAGE MAGENTO EXTENSION License, which extends the Open Software
8
+ * License (OSL 3.0). The Euro.message Magento Extension License is available at this URL:
9
+ * http://numerno.com/licenses/euromsg-ce.txt The Open Software License is available at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ *
12
+ * DISCLAIMER
13
+ *
14
+ * By adding to, editing, or in any way modifying this code, Numerno is not held liable for any inconsistencies or
15
+ * abnormalities in the behaviour of this code. By adding to, editing, or in any way modifying this code, the Licensee
16
+ * terminates any agreement of support offered by Numerno, outlined in the provided Euro.message Magento Extension
17
+ * License.
18
+ * Upon discovery of modified code in the process of support, the Licensee is still held accountable for any and all
19
+ * billable time Numerno spent during the support process. Numerno does not guarantee compatibility with any other
20
+ * Magento extension. Numerno is not responsbile for any inconsistencies or abnormalities in the behaviour of this
21
+ * code if caused by other Magento extension.
22
+ * If you did not receive a copy of the license, please send an email to info@numerno.com or call +90-212-223-5093,
23
+ * so we can send you a copy immediately.
24
+ *
25
+ * @category [Numerno]
26
+ * @package [Numerno_Euromsg]
27
+ * @copyright Copyright (c) 2015 Numerno Bilisim Hiz. Tic. Ltd. Sti. (http://numerno.com/)
28
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
29
+ */
30
+
31
+ /**
32
+ * Member Export Entity
33
+ *
34
+ * @category Numerno
35
+ * @package Numerno_Euromsg
36
+ * @author Numerno Bilisim Hiz. Tic. Ltd. Sti. <info@numerno.com>
37
+ */
38
+ class Numerno_Euromsg_Model_Export_Entity_Member extends Mage_Core_Model_Abstract
39
+ {
40
+ /**
41
+ * Permanent column names.
42
+ */
43
+ const COL_EMAIL_PERMIT = 'EMAIL_PERMIT_STATUS';
44
+ const COL_GSM_PERMIT = 'GSM_PERMIT_STATUS';
45
+ const COL_EMAIL = 'EMAIL';
46
+ const COL_KEY_ID = 'KEY_ID';
47
+
48
+ /**
49
+ * Customer ID or Subscriber ID filter cache
50
+ *
51
+ * @var array
52
+ */
53
+ protected $_filter = array();
54
+
55
+ /**
56
+ * Attribute codes cache.
57
+ *
58
+ * @var array
59
+ */
60
+ protected $_attrCodes = array();
61
+
62
+ /**
63
+ * Attribute code to its column names.
64
+ *
65
+ * @var array
66
+ */
67
+ protected $_attributeColumnNames = array();
68
+
69
+ /**
70
+ * Customer attributes codes cache.
71
+ *
72
+ * @var array
73
+ */
74
+ protected $_customerAttrCodes = array();
75
+
76
+ /**
77
+ * Category Id and Name pairs
78
+ *
79
+ * @var array
80
+ */
81
+ protected $_categoryIdToName = array();
82
+
83
+ /**
84
+ * Resource model.
85
+ *
86
+ * @var Mage_Core_Model_Resource
87
+ */
88
+ protected $_resource;
89
+
90
+ /**
91
+ * DB connection.
92
+ *
93
+ * @var Varien_Db_Adapter_Pdo_Mysql
94
+ */
95
+ protected $_connection;
96
+
97
+ /**
98
+ * Helper
99
+ *
100
+ * @var Numerno_Euromsg_Helper_Data
101
+ */
102
+ protected $_helper;
103
+
104
+ /**
105
+ * Csv Adapter
106
+ *
107
+ * @var Numerno_Euromsg_Model_Export_Adapter_Csv
108
+ */
109
+ protected $_writer;
110
+
111
+ /**
112
+ * Export Filename
113
+ *
114
+ * @var string
115
+ */
116
+ protected $_filename;
117
+
118
+ /**
119
+ * File list to zip
120
+ *
121
+ * @var array
122
+ */
123
+ protected $_wrap = array();
124
+
125
+ /**
126
+ * Constructor.
127
+ *
128
+ * @return void
129
+ */
130
+ public function __construct()
131
+ {
132
+ parent::__construct();
133
+
134
+ $this->_helper = Mage::helper('euromsg');
135
+ $this->_resource = Mage::getSingleton('core/resource');
136
+ $this->_connection = $this->_resource->getConnection('read');
137
+ $this->_writer = Mage::getSingleton('euromsg/export_adapter_csv');
138
+ $this->_initAttributes();
139
+ }
140
+
141
+ /**
142
+ * Initialize attribute option values and types.
143
+ *
144
+ * @return Numerno_Euromsg_Model_Export_Entity_Member
145
+ */
146
+ protected function _initAttributes()
147
+ {
148
+ $_prefix = $this->_helper->getCustomerAttributePrefix();
149
+
150
+ foreach ($this->getAttributeCollection() as $attribute) {
151
+ $this->_attributeColumnNames[$attribute['attribute']] = $attribute['col_name']
152
+ . (isset($attribute['datatype']) ? '[' . $attribute['datatype'] . ']' : '');
153
+ $this->_attrCodes[] = $attribute['attribute'];
154
+
155
+ if(!in_array($attribute['attribute'], $this->getPresetAttributes()) ) {
156
+ if (substr($attribute['attribute'], 0, strlen($_prefix)) == $_prefix) {
157
+ $this->_customerAttrCodes[] = substr($attribute['attribute'], strlen($_prefix));
158
+ }
159
+ }
160
+ }
161
+
162
+ return $this;
163
+ }
164
+
165
+ /**
166
+ * Retrieve attribute collection to export
167
+ *
168
+ * @return array
169
+ */
170
+ protected function getAttributeCollection()
171
+ {
172
+ $exportAttributes = Mage::getStoreConfig('euromsg_customer/general/attributes');
173
+ if (!is_array($exportAttributes)) {
174
+ $exportAttributes = empty($exportAttributes) ? array() : unserialize($exportAttributes);
175
+ }
176
+
177
+ $_prefix = $this->_helper->getCustomerAttributePrefix();
178
+ $exportAttributes['email_permit'] = array(
179
+ 'attribute' => 'email_permit',
180
+ 'col_name' => self::COL_EMAIL_PERMIT
181
+ );
182
+
183
+ $codes = array();
184
+ foreach($exportAttributes as $exportAttribute) {
185
+ if(isset($exportAttribute['attribute']))
186
+ if (substr($exportAttribute['attribute'], 0, strlen($_prefix)) == $_prefix) {
187
+ $codes[] = substr($exportAttribute['attribute'], strlen($_prefix));
188
+ }
189
+ $codes[] = $exportAttribute['attribute'];
190
+ }
191
+
192
+ $dataTypes = array(
193
+ 'entity_id' => 'int',
194
+ 'subscriber_id' => 'int',
195
+ 'subscriber_email' => null,
196
+ $_prefix . 'last_login' => 'datetime',
197
+ $_prefix . 'last_order' => 'datetime',
198
+ $_prefix . 'orders_total' => 'float',
199
+ $_prefix . 'fav_category' => 'string(255)',
200
+ $_prefix . 'group' => 'string(32)'
201
+ );
202
+
203
+ $staticColumns = $this->_connection->describeTable($this->_resource->getTableName('customer/entity'));
204
+ foreach($staticColumns as $columnName => $column) {
205
+ $dataType = $column['DATA_TYPE'];
206
+ if(in_array($dataType, array('char', 'text')) || strpos($dataType, 'char')
207
+ || strpos($dataType, 'text')){
208
+ $length = $column['LENGTH'];
209
+ if(is_null($length) || $length > 255) {
210
+ $dataTypes[$_prefix . $columnName] = 'string(1024)';
211
+ }else{
212
+ $dataTypes[$_prefix . $columnName] = "string($length)";
213
+ }
214
+ }elseif(in_array($dataType, array('int', 'bit', 'blob', 'binary')) || strpos($dataType, 'int')
215
+ || strpos($dataType, 'binary') || strpos($dataType, 'blob'))
216
+ $dataTypes[$_prefix . $columnName] = 'int';
217
+ elseif(in_array($dataType, array('float', 'double', 'decimal')) )
218
+ $dataTypes[$_prefix . $columnName] = 'float';
219
+ elseif(in_array($dataType, array('date', 'time', 'year', 'datetime', 'timestamp')) )
220
+ $dataTypes[$_prefix . $columnName] = 'datetime';
221
+ }
222
+
223
+ $attributes = Mage::getModel('customer/entity_attribute_collection')
224
+ ->setCodeFilter($codes);
225
+ foreach($attributes as $attribute) {
226
+ $backendType = $attribute->getBackendType();
227
+
228
+ switch($backendType) {
229
+ case 'varchar':
230
+ $dataTypes[$_prefix . $attribute->getAttributeCode()] = 'string(255)';
231
+ break;
232
+ case 'text':
233
+ $dataTypes[$_prefix . $attribute->getAttributeCode()] = 'string(1024)';
234
+ break;
235
+ case 'int':
236
+ if($attribute->getFrontendInput() == 'select' || $attribute->getFrontendInput() == 'multiselect')
237
+ $dataTypes[$_prefix . $attribute->getAttributeCode()] = 'string(255)';
238
+ else
239
+ $dataTypes[$_prefix . $attribute->getAttributeCode()] = 'int';
240
+ break;
241
+ case 'decimal':
242
+ $dataTypes[$_prefix . $attribute->getAttributeCode()] = 'float';
243
+ break;
244
+ case 'datetime':
245
+ $dataTypes[$_prefix . $attribute->getAttributeCode()] = 'datetime';
246
+ break;
247
+ }
248
+ }
249
+
250
+ foreach($exportAttributes as $key => $exportAttribute) {
251
+ if(isset($dataTypes[$exportAttribute['attribute']])) {
252
+ $exportAttributes[$key]['datatype'] = $dataTypes[$exportAttribute['attribute']];
253
+ }
254
+ }
255
+
256
+ $sms = Mage::helper('euromsg/sms');
257
+ if($sms->isEnabled() && in_array($sms->getGsmAttribute(), $codes) ){
258
+ $gsmPermitAttributeCode = $_prefix . Numerno_Euromsg_Model_Sms::SMS_PERMIT_ATTRIBUTE_CODE;
259
+ $exportAttributes[$gsmPermitAttributeCode] = array(
260
+ 'attribute' => $gsmPermitAttributeCode,
261
+ 'col_name' => self::COL_GSM_PERMIT
262
+ );
263
+ }
264
+
265
+ return $exportAttributes;
266
+ }
267
+
268
+ /**
269
+ * Retrieve preset attributes
270
+ *
271
+ * @return array
272
+ */
273
+ protected function getPresetAttributes()
274
+ {
275
+ $presetAttributes = $this->_helper->getPresetCustomerAttributes();
276
+ unset($presetAttributes['NULL']);
277
+
278
+ return array_keys($presetAttributes);
279
+ }
280
+
281
+ protected function _prepareCollection(){
282
+
283
+ $_subscriberCollection = Mage::getResourceModel('newsletter/subscriber_collection')
284
+ ->showCustomerInfo($this->_customerAttrCodes);
285
+
286
+ if(!$this->useUnsubscribed())
287
+ $_subscriberCollection->useOnlySubscribed();
288
+
289
+ if(Mage::getStoreConfig('euromsg_customer/general/source') == 'newsletter_subscribers_customers')
290
+ $_subscriberCollection->useOnlyCustomers();
291
+
292
+ foreach($this->_filter as $column => $ids) {
293
+ $_subscriberCollection->addFieldToFilter('main_table.' . $column, array('in' => $ids));
294
+ }
295
+
296
+ return $_subscriberCollection;
297
+ }
298
+
299
+ /**
300
+ * Prepare customer last login dates
301
+ *
302
+ * @param array $productIds
303
+ * @return array
304
+ */
305
+ protected function _prepareLastLogins($customerIds)
306
+ {
307
+ if (empty($customerIds) || !in_array('customer_last_login', $this->_attrCodes)) {
308
+ return array();
309
+ }
310
+
311
+ $query = $this->_connection->select()
312
+ ->from($this->_resource->getTableName('log/customer'), array('customer_id, MAX(login_at) as last_login'))
313
+ ->where('customer_id IN (?)', $customerIds)
314
+ ->group('customer_id');
315
+
316
+ return $this->_connection->fetchPairs($query);
317
+ }
318
+
319
+ /**
320
+ * Prepare customer last order dates
321
+ *
322
+ * @param array $productIds
323
+ * @return array
324
+ */
325
+ protected function _prepareLastOrders($customerIds)
326
+ {
327
+ if (empty($customerIds) || !in_array('customer_last_order', $this->_attrCodes)) {
328
+ return array();
329
+ }
330
+
331
+ $query = $select = $this->_connection->select()
332
+ ->from($this->_resource->getTableName('sales/order'), array('customer_id, MAX(created_at) as last_order'))
333
+ ->where('customer_id IN (?)', $customerIds)
334
+ ->group('customer_id');
335
+
336
+ return $this->_connection->fetchPairs($query);
337
+ }
338
+
339
+ /**
340
+ * Prepare customer orders totals
341
+ *
342
+ * @param array $productIds
343
+ * @return array
344
+ */
345
+ protected function _prepareOrdersTotal($customerIds)
346
+ {
347
+ if (empty($customerIds) || !in_array('customer_orders_total', $this->_attrCodes)) {
348
+ return array();
349
+ }
350
+
351
+ $query = $this->_connection->select()
352
+ ->from($this->_resource->getTableName('sales/order'), array('customer_id, SUM(grand_total) as orders_total'))
353
+ ->where('customer_id IN (?)', $customerIds)
354
+ ->where('state = ?', Mage_Sales_Model_Order::STATE_COMPLETE)
355
+ ->group('customer_id');
356
+
357
+ return $this->_connection->fetchPairs($query);
358
+ }
359
+
360
+ /**
361
+ * Prepare customer most ordered categories
362
+ *
363
+ * @param array $productIds
364
+ * @return array
365
+ */
366
+ protected function _prepareMostOrderedCategories($customerIds)
367
+ {
368
+ if (empty($customerIds) || !in_array('customer_fav_category', $this->_attrCodes)) {
369
+ return array();
370
+ }
371
+
372
+ $countsQuery = $this->_connection->select()
373
+ ->from(array('e' => $this->_resource->getTableName('sales/order')), array('e.customer_id'))
374
+ ->joinLeft(array('f' => $this->_resource->getTableName('sales/order_item')), 'e.entity_id = f.order_id',
375
+ array())
376
+ ->joinRight(array('g' => $this->_resource->getTableName('catalog/category_product')),
377
+ 'f.product_id = g.product_id', array('g.category_id', 'count' => 'COUNT(g.category_id)'))
378
+ ->where('e.state = ?', Mage_Sales_Model_Order::STATE_COMPLETE)
379
+ ->where('e.customer_id IN (?)', $customerIds)
380
+ ->group(array('e.customer_id', 'g.category_id'))
381
+ ->order(array('e.customer_id ASC', 'count DESC'));
382
+
383
+ $query = $this->_connection->select()
384
+ ->from(array('counts' => $countsQuery), array('customer_id', 'category_id'))
385
+ ->group('customer_id');
386
+
387
+ $mostOrderedCategories = $this->_connection->fetchPairs($query);
388
+
389
+ $this->_categoryIdToName = Mage::getSingleton('catalog/category')->getCollection()
390
+ ->addNameToResult()
391
+ ->addIdFilter($mostOrderedCategories)
392
+ ->exportToArray();
393
+
394
+ return $mostOrderedCategories;
395
+ }
396
+
397
+ /**
398
+ * Prepare preset attributes data
399
+ *
400
+ * @param array $productIds
401
+ * @return array
402
+ */
403
+ protected function _preparePresetAttributesData($_customerIds)
404
+ {
405
+ if (empty($_customerIds)) {
406
+ return array();
407
+ }
408
+
409
+ $presetData = array();
410
+
411
+ try {
412
+ $presetData['customer_last_login'] = $this->_prepareLastLogins($_customerIds);
413
+ } catch (Exception $e) {
414
+ $presetData['customer_last_login'] = array();
415
+ Mage::logException($e);
416
+ }
417
+
418
+ try {
419
+ $presetData['customer_last_order'] = $this->_prepareLastOrders($_customerIds);
420
+ } catch (Exception $e) {
421
+ $presetData['customer_last_order'] = array();
422
+ Mage::logException($e);
423
+ }
424
+
425
+ try {
426
+ $presetData['customer_orders_total'] = $this->_prepareOrdersTotal($_customerIds);
427
+ } catch (Exception $e) {
428
+ $presetData['customer_orders_total'] = array();
429
+ Mage::logException($e);
430
+ }
431
+
432
+ try {
433
+ $presetData['customer_fav_category'] = $this->_prepareMostOrderedCategories($_customerIds);
434
+ } catch (Exception $e) {
435
+ $presetData['customer_fav_category'] = array();
436
+ Mage::logException($e);
437
+ }
438
+
439
+ return $presetData;
440
+ }
441
+
442
+ /**
443
+ * Set Export Filter
444
+ *
445
+ * @param array
446
+ * @return Numerno_Euromsg_Model_Export_Entity_Member
447
+ */
448
+ public function filter($filter)
449
+ {
450
+ $this->_filter += $filter;
451
+
452
+ return $this;
453
+ }
454
+
455
+ /**
456
+ * Set Export Filename
457
+ *
458
+ * @param string
459
+ * @return Numerno_Euromsg_Model_Export_Entity_Member
460
+ */
461
+ public function setFilename($filename)
462
+ {
463
+
464
+ $destination = tempnam(sys_get_temp_dir(), $filename . '.' . $this->_writer->getFileExtension());
465
+
466
+ $this->_wrap[$filename . '.' . $this->_writer->getFileExtension()] = $destination;
467
+ $this->_filename = $filename;
468
+ $this->_writer->setDestination($destination);
469
+
470
+ return $this;
471
+ }
472
+
473
+ /**
474
+ * Retrieve export filename
475
+ *
476
+ * @return string
477
+ */
478
+ public function getFilename()
479
+ {
480
+ return $this->_filename;
481
+ }
482
+
483
+ /**
484
+ * Use unsubscribed data
485
+ *
486
+ * @return bool
487
+ */
488
+ public function useUnsubscribed(){
489
+
490
+ return Mage::getStoreConfig('euromsg_customer/general/use_unsubscribed');
491
+ }
492
+
493
+ /**
494
+ * Export process.
495
+ *
496
+ * @return string
497
+ */
498
+ public function export()
499
+ {
500
+ $colNames = $this->_attributeColumnNames;
501
+ $collection = $this->_prepareCollection();
502
+
503
+ if($collection->count()) {
504
+ $customerIds = $collection->getColumnValues('customer_id');
505
+ $presetAttributeData = $this->_preparePresetAttributesData($customerIds);
506
+ $categoryNames = $this->_categoryIdToName;
507
+
508
+ //Set header column names
509
+ $this->_writer->setHeaderCols($colNames);
510
+
511
+ //Write data rows
512
+ foreach ($collection as $row) {
513
+
514
+ $row->addData(
515
+ array('email_permit' => $row->isSubscribed() ? 'Y' : 'N')
516
+ );
517
+
518
+ if(in_array($this->_helper->getCustomerAttributePrefix() . 'entity_id', $this->_attrCodes) )
519
+ $row->addData(
520
+ array($this->_helper->getCustomerAttributePrefix() . 'entity_id' => $row->getCustomerId())
521
+ );
522
+
523
+ if($row->getCustomerId()) {
524
+ $presetAttributes = array_intersect_key(array_flip($this->_attrCodes), $presetAttributeData);
525
+ foreach($presetAttributes as $presetAttribute => $null) {
526
+
527
+ $value = $presetAttributeData[$presetAttribute][$row->getCustomerId()];
528
+ if($presetAttribute == 'customer_fav_category') {
529
+ $row->addData(
530
+ array($presetAttribute => $categoryNames[$value]['name'])
531
+ );
532
+ } else {
533
+ $row->addData(
534
+ array($presetAttribute => $value)
535
+ );
536
+ }
537
+ }
538
+ }
539
+
540
+ $rowData = array_intersect_key($row->getData(), array_flip($this->_attrCodes));
541
+ foreach($rowData as $attrCode => $value) {
542
+ $value = str_ireplace($this->_writer->getDelimiter(), '', $value);
543
+
544
+ if(is_numeric($value)) {
545
+ $value = round($value, 2);
546
+ }
547
+
548
+ if(Zend_Date::isDate($value, Zend_Date::ISO_8601)) {
549
+ $value = date("Y-m-d", strtotime($value));
550
+ }
551
+
552
+ if($attrCode == $this->_helper->getCustomerAttributePrefix() .
553
+ Numerno_Euromsg_Model_Sms::SMS_PERMIT_ATTRIBUTE_CODE) {
554
+ $value = $value ? 'Y' : 'N';
555
+ }
556
+
557
+ $rowData[$colNames[$attrCode]] = is_null($value) ? '' : $value;
558
+ unset($rowData[$attrCode]);
559
+ }
560
+
561
+ try{
562
+ $this->_writer->writeRow($rowData);
563
+ }
564
+ catch(Exception $e) {
565
+ Mage::logException($e);
566
+ }
567
+
568
+ }
569
+
570
+ $notification = Mage::getStoreConfig('euromsg_customer/general/notify');
571
+
572
+ if($notification) {
573
+ $destination = tempnam(sys_get_temp_dir(),$this->getFilename() . '.xml');
574
+ $this->_wrap[$this->getFilename() . '.xml'] = $destination;
575
+ $xml = Mage::helper('core')->assocToXml(array('NOTIFICATION_EMAIL' => $notification), 'euro.message');
576
+ file_put_contents($destination, explode("\n", $xml->asXML(), 2)[1]);
577
+ }
578
+
579
+ $this->_helper->wrapFiles($this->getFilename(), $this->_wrap);
580
+
581
+ } else {
582
+ Mage::throwException($this->_helper->__('There is no member data to export.'));
583
+ }
584
+
585
+
586
+ }
587
+ }
app/code/local/Numerno/Euromsg/Model/Export/Entity/Product.php ADDED
@@ -0,0 +1,510 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Numerno - Euro.message Magento Extension
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the NUMERNO EUROMESSAGE MAGENTO EXTENSION License, which extends the Open Software
8
+ * License (OSL 3.0). The Euro.message Magento Extension License is available at this URL:
9
+ * http://numerno.com/licenses/euromsg-ce.txt The Open Software License is available at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ *
12
+ * DISCLAIMER
13
+ *
14
+ * By adding to, editing, or in any way modifying this code, Numerno is not held liable for any inconsistencies or
15
+ * abnormalities in the behaviour of this code. By adding to, editing, or in any way modifying this code, the Licensee
16
+ * terminates any agreement of support offered by Numerno, outlined in the provided Euro.message Magento Extension
17
+ * License.
18
+ * Upon discovery of modified code in the process of support, the Licensee is still held accountable for any and all
19
+ * billable time Numerno spent during the support process. Numerno does not guarantee compatibility with any other
20
+ * Magento extension. Numerno is not responsbile for any inconsistencies or abnormalities in the behaviour of this
21
+ * code if caused by other Magento extension.
22
+ * If you did not receive a copy of the license, please send an email to info@numerno.com or call +90-212-223-5093,
23
+ * so we can send you a copy immediately.
24
+ *
25
+ * @category [Numerno]
26
+ * @package [Numerno_Euromsg]
27
+ * @copyright Copyright (c) 2015 Numerno Bilisim Hiz. Tic. Ltd. Sti. (http://numerno.com/)
28
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
29
+ */
30
+
31
+ /**
32
+ * Product Export Entity
33
+ *
34
+ * @category Numerno
35
+ * @package Numerno_Euromsg
36
+ * @author Numerno Bilisim Hiz. Tic. Ltd. Sti. <info@numerno.com>
37
+ */
38
+ class Numerno_Euromsg_Model_Export_Entity_Product extends Mage_ImportExport_Model_Export_Entity_Product
39
+ {
40
+ /**
41
+ * Permanent column names.
42
+ */
43
+ const COL_PRODUCT_ID = 'PRODUCT_ID';
44
+
45
+ /**
46
+ * Export Filename
47
+ *
48
+ * @var string
49
+ */
50
+ protected $_filename;
51
+
52
+ /**
53
+ * File list to zip
54
+ *
55
+ * @var array
56
+ */
57
+ protected $_wrap = array();
58
+
59
+ /**
60
+ * Constructor.
61
+ *
62
+ * @return void
63
+ */
64
+ public function __construct()
65
+ {
66
+ parent::__construct();
67
+
68
+ $this->_writer = Mage::getSingleton('euromsg/export_adapter_csv');
69
+ }
70
+
71
+ /**
72
+ * Get attributes array which are appropriate for export.
73
+ *
74
+ * @return array
75
+ */
76
+ protected function _getExportAttributes()
77
+ {
78
+
79
+ $exportAttributes = Mage::getStoreConfig('euromsg_catalog/general/attributes');
80
+ if (!is_array($exportAttributes)) {
81
+ $exportAttributes = empty($exportAttributes) ? array() : unserialize($exportAttributes);
82
+ }
83
+
84
+
85
+ $dataTypes = array(
86
+ 'entity_id' => 'int',
87
+ '_url' => 'string(1024)',
88
+ '_attribute_set'=> 'string(255)',
89
+ '_type' => 'string(255)',
90
+ 'qty' => 'float',
91
+ 'is_in_stock' => 'int',
92
+ '_root_category'=> 'string(255)',
93
+ '_category' => 'string(1024)'
94
+ );
95
+
96
+ $staticColumns = $this->_connection->describeTable(
97
+ Mage::getSingleton('core/resource')->getTableName('catalog/product')
98
+ );
99
+ foreach($staticColumns as $columnName => $column) {
100
+ $dataType = $column['DATA_TYPE'];
101
+ if(in_array($dataType, array('char', 'text')) || strpos($dataType, 'char')
102
+ || strpos($dataType, 'text')){
103
+ $length = $column['LENGTH'];
104
+ if(is_null($length) || $length > 255) {
105
+ $dataTypes[$columnName] = 'string(1024)';
106
+ }else{
107
+ $dataTypes[$columnName] = "string($length)";
108
+ }
109
+ }elseif(in_array($dataType, array('int', 'bit', 'blob', 'binary')) || strpos($dataType, 'int')
110
+ || strpos($dataType, 'binary') || strpos($dataType, 'blob'))
111
+ $dataTypes[$columnName] = 'int';
112
+ elseif(in_array($dataType, array('float', 'double', 'decimal')) )
113
+ $dataTypes[$columnName] = 'float';
114
+ elseif(in_array($dataType, array('date', 'time', 'year', 'datetime', 'timestamp')) )
115
+ $dataTypes[$columnName] = 'datetime';
116
+ }
117
+
118
+ $codes = array();
119
+ foreach($exportAttributes as $exportAttribute) {
120
+ $codes[] = $exportAttribute['attribute'];
121
+ }
122
+
123
+ $attributes = Mage::getModel('eav/entity_attribute')->getCollection();
124
+ $attributes
125
+ ->setEntityTypeFilter(Mage::getSingleton('eav/config')->getEntityType('catalog_product'))
126
+ ->setCodeFilter($codes);
127
+ foreach($attributes as $attribute) {
128
+ $backendType = $attribute->getBackendType();
129
+
130
+ switch($backendType) {
131
+ case 'varchar':
132
+ $dataTypes[$attribute->getAttributeCode()] = 'string(255)';
133
+ break;
134
+ case 'text':
135
+ $dataTypes[$attribute->getAttributeCode()] = 'string(1024)';
136
+ break;
137
+ case 'int':
138
+ if($attribute->getFrontendInput() == 'select' || $attribute->getFrontendInput() == 'multiselect')
139
+ $dataTypes[$attribute->getAttributeCode()] = 'string(255)';
140
+ else
141
+ $dataTypes[$attribute->getAttributeCode()] = 'int';
142
+ break;
143
+ case 'decimal':
144
+ $dataTypes[$attribute->getAttributeCode()] = 'float';
145
+ break;
146
+ case 'datetime':
147
+ $dataTypes[$attribute->getAttributeCode()] = 'datetime';
148
+ break;
149
+ }
150
+ }
151
+ $dataTypes['image'] = 'string(1024)';
152
+ $dataTypes['smallimage'] = 'string(1024)';
153
+ $dataTypes['thumbnail'] = 'string(1024)';
154
+
155
+ foreach($exportAttributes as $key => $exportAttribute) {
156
+ if(isset($dataTypes[$exportAttribute['attribute']])) {
157
+ $exportAttributes[$key]['col_name'] = $exportAttribute['col_name'] . '[' .
158
+ $dataTypes[$exportAttribute['attribute']] . ']';
159
+ }
160
+ }
161
+
162
+ return $exportAttributes;
163
+ }
164
+
165
+ /**
166
+ * Get attributes codes which are appropriate for export.
167
+ *
168
+ * @return array
169
+ */
170
+ protected function _getExportAttrCodes()
171
+ {
172
+ if (null === self::$attrCodes) {
173
+ $attributes = $this->_getExportAttributes();
174
+ self::$attrCodes = array_keys($attributes);
175
+ }
176
+ return self::$attrCodes;
177
+
178
+ }
179
+
180
+ /**
181
+ * Prepare catalog inventory
182
+ *
183
+ * @param array $productIds
184
+ * @return array
185
+ */
186
+ protected function _prepareCatalogInventory(array $productIds)
187
+ {
188
+ if (empty($productIds)) {
189
+ return array();
190
+ }
191
+
192
+ $attributes = $this->_getExportAttributes();
193
+
194
+ $selectColumns = array('product_id');
195
+ if(isset($attributes['qty'])){
196
+ $selectColumns[] = 'qty AS ' . $attributes['qty']['col_name'];
197
+ }
198
+ if(isset($attributes['is_in_stock'])){
199
+ $selectColumns[] = 'is_in_stock AS ' . $attributes['is_in_stock']['col_name'];
200
+ }
201
+
202
+ $select = $this->_connection->select()
203
+ ->from(Mage::getResourceModel('cataloginventory/stock_item')->getMainTable(), $selectColumns)
204
+ ->where('product_id IN (?)', $productIds);
205
+
206
+ $stmt = $this->_connection->query($select);
207
+ $stockItemRows = array();
208
+ while ($stockItemRow = $stmt->fetch()) {
209
+ $productId = $stockItemRow['product_id'];
210
+ unset($stockItemRow['product_id']);
211
+
212
+ if(isset($attributes['qty'])) {
213
+ if ($stockItemRow[$attributes['qty']['col_name']] < 0)
214
+ $stockItemRow[$attributes['qty']['col_name']] = 0;
215
+
216
+ $stockItemRow[$attributes['qty']['col_name']] *= 1;
217
+ }
218
+
219
+ $stockItemRows[$productId] = $stockItemRow;
220
+ }
221
+ return $stockItemRows;
222
+ }
223
+
224
+ /**
225
+ * Update data row with information about categories. Return true, if data row was updated
226
+ *
227
+ * @param array $dataRow
228
+ * @param array $rowCategories
229
+ * @param int $productId
230
+ * @return bool
231
+ */
232
+ protected function _updateDataWithCategoryColumns(&$dataRow, &$rowCategories, $productId)
233
+ {
234
+
235
+ if (!isset($rowCategories[$productId])) {
236
+ return false;
237
+ }
238
+
239
+ $attributes = $this->_getExportAttributes();
240
+
241
+ $categoryId = array_shift($rowCategories[$productId]);
242
+
243
+ if (isset($attributes[self::COL_ROOT_CATEGORY])) {
244
+ if (isset($this->_rootCategories[$categoryId])) {
245
+ $dataRow[$attributes[self::COL_ROOT_CATEGORY]['col_name']] = $this->_rootCategories[$categoryId];
246
+ }else{
247
+ $dataRow[$attributes[self::COL_ROOT_CATEGORY]['col_name']] = '';
248
+ }
249
+ }
250
+ if (isset($attributes[self::COL_CATEGORY])) {
251
+ if (isset($this->_categories[$categoryId])) {
252
+
253
+ $dataRow[$attributes[self::COL_CATEGORY]['col_name']] = $this->_categories[$categoryId];
254
+ }else{
255
+ $dataRow[$attributes[self::COL_CATEGORY]['col_name']] = '';
256
+ }
257
+ }
258
+
259
+ return true;
260
+ }
261
+
262
+ /**
263
+ * Calculate product limit per export process
264
+ *
265
+ * @return int
266
+ */
267
+ public function _getLimitProducts(){
268
+
269
+ $defaultMemoryLimit = Mage::getStoreConfig('euromsg_catalog/advanced/memory_limit');
270
+ if(!$defaultMemoryLimit)
271
+ $defaultMemoryLimit = 250000000;
272
+
273
+ $memoryLimit = trim(ini_get('memory_limit'));
274
+ $lastMemoryLimitLetter = strtolower($memoryLimit[strlen($memoryLimit)-1]);
275
+ switch($lastMemoryLimitLetter) {
276
+ case 'g':
277
+ $memoryLimit *= 1024;
278
+ case 'm':
279
+ $memoryLimit *= 1024;
280
+ case 'k':
281
+ $memoryLimit *= 1024;
282
+ break;
283
+ default:
284
+ // minimum memory required by Magento
285
+ $memoryLimit = $defaultMemoryLimit;
286
+ }
287
+
288
+ // Tested one product to have up to such size
289
+ $memoryPerProduct = Mage::getStoreConfig('euromsg_catalog/advanced/memory_pp');
290
+ if(!$memoryPerProduct)
291
+ $memoryPerProduct = 100000;
292
+
293
+ // Decrease memory limit to have supply
294
+ $memoryUsagePercent = Mage::getStoreConfig('euromsg_catalog/advanced/memory_percent') / 100;
295
+ if(!$memoryUsagePercent || $memoryUsagePercent > 0.9)
296
+ $memoryUsagePercent = 0.8;
297
+
298
+ // Minimum Products limit
299
+ $minProductsLimit = Mage::getStoreConfig('euromsg_catalog/advanced/minimum_products');
300
+ if(!$minProductsLimit)
301
+ $minProductsLimit = 500;
302
+
303
+ $limitProducts = intval(($memoryLimit * $memoryUsagePercent - memory_get_usage(true)) / $memoryPerProduct);
304
+ if ($limitProducts < $minProductsLimit)
305
+ $limitProducts = $minProductsLimit;
306
+
307
+ return $limitProducts;
308
+ }
309
+
310
+ /**
311
+ * Apply filter to collection and add not skipped attributes to select.
312
+ *
313
+ * @param Mage_Eav_Model_Entity_Collection_Abstract $collection
314
+ * @return Mage_Eav_Model_Entity_Collection_Abstract
315
+ */
316
+ protected function _prepareEntityCollection(Mage_Eav_Model_Entity_Collection_Abstract $collection)
317
+ {
318
+
319
+ $exportOnlyVisible = Mage::getStoreConfig('euromsg_catalog/general/export');
320
+
321
+ $collection = parent::_prepareEntityCollection($collection);
322
+ $collection->joinAttribute('visibility', 'catalog_product/visibility', 'entity_id', null, 'inner');
323
+
324
+ if($exportOnlyVisible) {
325
+ Mage::getSingleton('catalog/product_status')->addVisibleFilterToCollection($collection);
326
+ Mage::getSingleton('catalog/product_visibility')->addVisibleInCatalogFilterToCollection($collection);
327
+ }
328
+
329
+ return $collection;
330
+
331
+ }
332
+
333
+ /**
334
+ * Set Export Filename
335
+ *
336
+ * @param string
337
+ * @return Numerno_Euromsg_Model_Export_Entity_Product
338
+ */
339
+ public function setFilename($filename)
340
+ {
341
+ $writer = $this->getWriter();
342
+ $destination = tempnam(sys_get_temp_dir(), $filename . '.' . $writer->getFileExtension());
343
+
344
+ $this->_wrap[$filename . '.' . $this->_writer->getFileExtension()] = $destination;
345
+ $this->_filename = $filename;
346
+ $writer->setDestination($destination);
347
+
348
+ $this->setWriter($writer);
349
+
350
+ return $this;
351
+ }
352
+
353
+ /**
354
+ * Retrieve export filename
355
+ *
356
+ * @return string
357
+ */
358
+ public function getFilename()
359
+ {
360
+ return $this->_filename;
361
+ }
362
+
363
+ /**
364
+ * Export process.
365
+ *
366
+ * @return Numerno_Euromsg_Model_Export_Entity_Product
367
+ */
368
+ public function export()
369
+ {
370
+ //Execution time may be very long
371
+ set_time_limit(0);
372
+
373
+ $attributes = $this->_getExportAttributes();
374
+ $validAttrCodes = $this->_getExportAttrCodes();
375
+ $writer = $this->getWriter();
376
+
377
+ $limitProducts = $this->_getLimitProducts();
378
+ $offsetProducts = 0;
379
+
380
+ while (true) {
381
+
382
+ ++$offsetProducts;
383
+
384
+ $dataRows = array();
385
+ $rowCategories = array();
386
+ $rowMultiselects = array();
387
+
388
+ /** @var $collection Mage_Catalog_Model_Resource_Eav_Mysql4_Product_Collection */
389
+ $collection = Mage::getResourceModel('catalog/product_collection');
390
+ $collection->addAttributeToSelect(array_merge($validAttrCodes, array('url_key', 'url_path')));
391
+ $collection
392
+ ->setPage($offsetProducts, $limitProducts);
393
+
394
+ if ($collection->getCurPage() < $offsetProducts)
395
+ break;
396
+
397
+ $collection->load();
398
+
399
+ if ($collection->count() == 0)
400
+ break;
401
+
402
+ foreach ($collection as $itemId => $item) { // go through all products
403
+ var_dump($item->getData());
404
+ foreach ($validAttrCodes as &$attrCode) { // go through all valid attribute codes
405
+ $attrValue = $item->getData($attrCode);
406
+
407
+ if(Zend_Date::isDate($attrValue, Zend_Date::ISO_8601)) {
408
+ $attrValue = date("Y-m-d", strtotime($attrValue));
409
+ }
410
+
411
+ if (!empty($this->_attributeValues[$attrCode])) {
412
+ if ($this->_attributeTypes[$attrCode] == 'multiselect') {
413
+ $attrValue = explode(',', $attrValue);
414
+ $attrValue = array_intersect_key(
415
+ $this->_attributeValues[$attrCode],
416
+ array_flip($attrValue)
417
+ );
418
+ $rowMultiselects[$itemId][$attrCode] = $attrValue;
419
+ } else if (isset($this->_attributeValues[$attrCode][$attrValue])) {
420
+ $attrValue = $this->_attributeValues[$attrCode][$attrValue];
421
+ } else {
422
+ $attrValue = null;
423
+ }
424
+ }
425
+ if(in_array($attrCode, array('image', 'small_image', 'thumbnail'))){}
426
+ $attrValue = (($attrValue == 'no_selection' || $attrValue == '') ?
427
+ '' : Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA) . 'catalog/product'
428
+ . $attrValue);
429
+
430
+ if (is_scalar($attrValue) && isset($attributes[$attrCode])) {
431
+ $dataRows[$itemId][$attributes[$attrCode]['col_name']] = $attrValue;
432
+ }
433
+
434
+ }
435
+
436
+ $attrSetId = $item->getAttributeSetId();
437
+ if(isset($attributes[self::COL_ATTR_SET]))
438
+ $dataRows[$itemId][$attributes[self::COL_ATTR_SET]['col_name']]
439
+ = $this->_attrSetIdToName[$attrSetId];
440
+
441
+ if(isset($attributes[self::COL_TYPE]))
442
+ $dataRows[$itemId][$attributes[self::COL_TYPE]['col_name']] = $item->getTypeId();
443
+
444
+ if(isset($attributes['_url'])) {
445
+ if($item->isVisibleInCatalog() && $item->isVisibleInSiteVisibility()) {
446
+ $url = Zend_Uri::factory($item->getProductUrl());
447
+ $url->removeQueryParameters();
448
+ $dataRows[$itemId][$attributes['_url']['col_name']] = $url->getUri();
449
+ }else{
450
+ $dataRows[$itemId][$attributes['_url']['col_name']] = '';
451
+ }
452
+ }
453
+
454
+ if(isset($attributes['_category']) || isset($attributes['_root_category']))
455
+ $rowCategories[$itemId] = $item->getCategoryIds();
456
+
457
+ $item = null;
458
+ }
459
+ $collection->clear();
460
+
461
+ if ($collection->getCurPage() < $offsetProducts) {
462
+ break;
463
+ }
464
+
465
+ // remove unused categories
466
+ $allCategoriesIds = array_merge(array_keys($this->_categories), array_keys($this->_rootCategories));
467
+ foreach ($rowCategories as &$categories) {
468
+ $categories = array_intersect($categories, $allCategoriesIds);
469
+ }
470
+
471
+ // prepare catalog inventory information
472
+ if(isset($attributes['qty']) || isset($attributes['is_in_stock'])) {
473
+ $productIds = array_keys($dataRows);
474
+ $stockItemRows = $this->_prepareCatalogInventory($productIds);
475
+ }
476
+
477
+ foreach ($dataRows as $productId => &$dataRow) {
478
+
479
+ if(isset($stockItemRows[$productId]))
480
+ $dataRow += $stockItemRows[$productId];
481
+
482
+ if(isset($rowCategories[$productId]))
483
+ $this->_updateDataWithCategoryColumns($dataRow, $rowCategories, $productId);
484
+
485
+ if(!empty($rowMultiselects[$productId])) {
486
+ foreach ($rowMultiselects[$productId] as $attrKey => $attrVal) {
487
+ if (!empty($rowMultiselects[$productId][$attrKey])) {
488
+ $dataRow[$attrKey] = implode(",", $attrVal);
489
+ }
490
+ }
491
+ }
492
+ $writer->writeRow($dataRow);
493
+ }
494
+ }
495
+
496
+ $notification = Mage::getStoreConfig('euromsg_catalog/general/notify');
497
+
498
+ if($notification) {
499
+ $destination = tempnam(sys_get_temp_dir(), $this->getFilename() . '.xml');
500
+ $this->_wrap[$this->getFilename() . '.xml'] = $destination;
501
+ $xml = Mage::helper('core')->assocToXml(array('NOTIFICATION_EMAIL' => $notification), 'euro.message');
502
+ file_put_contents($destination, explode("\n", $xml->asXML(), 2)[1]);
503
+ }
504
+
505
+ Mage::helper('euromsg')->wrapFiles($this->getFilename(), $this->_wrap);
506
+
507
+ return $this;
508
+ }
509
+
510
+ }
app/code/local/Numerno/Euromsg/Model/Io/Sftp.php ADDED
@@ -0,0 +1,50 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Numerno - Euro.message Magento Extension
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the NUMERNO EUROMESSAGE MAGENTO EXTENSION License, which extends the Open Software
8
+ * License (OSL 3.0). The Euro.message Magento Extension License is available at this URL:
9
+ * http://numerno.com/licenses/euromsg-ce.txt The Open Software License is available at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ *
12
+ * DISCLAIMER
13
+ *
14
+ * By adding to, editing, or in any way modifying this code, Numerno is not held liable for any inconsistencies or
15
+ * abnormalities in the behaviour of this code. By adding to, editing, or in any way modifying this code, the Licensee
16
+ * terminates any agreement of support offered by Numerno, outlined in the provided Euro.message Magento Extension
17
+ * License.
18
+ * Upon discovery of modified code in the process of support, the Licensee is still held accountable for any and all
19
+ * billable time Numerno spent during the support process. Numerno does not guarantee compatibility with any other
20
+ * Magento extension. Numerno is not responsbile for any inconsistencies or abnormalities in the behaviour of this
21
+ * code if caused by other Magento extension.
22
+ * If you did not receive a copy of the license, please send an email to info@numerno.com or call +90-212-223-5093,
23
+ * so we can send you a copy immediately.
24
+ *
25
+ * @category [Numerno]
26
+ * @package [Numerno_Euromsg]
27
+ * @copyright Copyright (c) 2015 Numerno Bilisim Hiz. Tic. Ltd. Sti. (http://numerno.com/)
28
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
29
+ */
30
+
31
+ /**
32
+ * SFTP I/O
33
+ *
34
+ * @category Numerno
35
+ * @package Numerno_Euromsg
36
+ * @author Numerno Bilisim Hiz. Tic. Ltd. Sti. <info@numerno.com>
37
+ */
38
+ class Numerno_Euromsg_Model_Io_Sftp extends Varien_Io_Sftp
39
+ {
40
+
41
+ /**
42
+ * Write a file
43
+ * @param $src Must be a local file name
44
+ */
45
+ public function write($filename, $src, $mode=null)
46
+ {
47
+ return $this->_connection->put($filename, $src, $mode);
48
+ }
49
+
50
+ }
app/code/local/Numerno/Euromsg/Model/Mail.php ADDED
@@ -0,0 +1,70 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Numerno - Euro.message Magento Extension
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the NUMERNO EUROMESSAGE MAGENTO EXTENSION License, which extends the Open Software
8
+ * License (OSL 3.0). The Euro.message Magento Extension License is available at this URL:
9
+ * http://numerno.com/licenses/euromsg-ce.txt The Open Software License is available at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ *
12
+ * DISCLAIMER
13
+ *
14
+ * By adding to, editing, or in any way modifying this code, Numerno is not held liable for any inconsistencies or
15
+ * abnormalities in the behaviour of this code. By adding to, editing, or in any way modifying this code, the Licensee
16
+ * terminates any agreement of support offered by Numerno, outlined in the provided Euro.message Magento Extension
17
+ * License.
18
+ * Upon discovery of modified code in the process of support, the Licensee is still held accountable for any and all
19
+ * billable time Numerno spent during the support process. Numerno does not guarantee compatibility with any other
20
+ * Magento extension. Numerno is not responsbile for any inconsistencies or abnormalities in the behaviour of this
21
+ * code if caused by other Magento extension.
22
+ * If you did not receive a copy of the license, please send an email to info@numerno.com or call +90-212-223-5093,
23
+ * so we can send you a copy immediately.
24
+ *
25
+ * @category [Numerno]
26
+ * @package [Numerno_Euromsg]
27
+ * @copyright Copyright (c) 2015 Numerno Bilisim Hiz. Tic. Ltd. Sti. (http://numerno.com/)
28
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
29
+ */
30
+
31
+ /**
32
+ * Mail
33
+ *
34
+ * @category Numerno
35
+ * @package Numerno_Euromsg
36
+ * @author Numerno Bilisim Hiz. Tic. Ltd. Sti. <info@numerno.com>
37
+ */
38
+ class Numerno_Euromsg_Model_Mail extends Zend_Mail
39
+ {
40
+
41
+ /**
42
+ * Public constructor
43
+ *
44
+ * @param string $charset
45
+ * @return void
46
+ */
47
+ public function __construct($charset = null)
48
+ {
49
+ parent::__construct($charset);
50
+
51
+ $transport = Mage::getModel('euromsg/mail_transport_euroMessage');
52
+ $this->setDefaultTransport($transport);
53
+ }
54
+
55
+ /**
56
+ * Helper function for adding a recipient and the corresponding header
57
+ *
58
+ * @param string $headerName
59
+ * @param string $email
60
+ * @param string $name
61
+ */
62
+ protected function _addRecipientAndHeader($headerName, $email, $name)
63
+ {
64
+ $email = $this->_filterEmail($email);
65
+ $name = $this->_filterName($name);
66
+ // prevent duplicates
67
+ $this->_recipients[$email] = 1;
68
+ $this->_storeHeader($headerName, array('email' => $email, 'name' => $name), true);
69
+ }
70
+ }
app/code/local/Numerno/Euromsg/Model/Mail/Log.php ADDED
@@ -0,0 +1,53 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Numerno - Euro.message Magento Extension
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the NUMERNO EUROMESSAGE MAGENTO EXTENSION License, which extends the Open Software
8
+ * License (OSL 3.0). The Euro.message Magento Extension License is available at this URL:
9
+ * http://numerno.com/licenses/euromsg-ce.txt The Open Software License is available at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ *
12
+ * DISCLAIMER
13
+ *
14
+ * By adding to, editing, or in any way modifying this code, Numerno is not held liable for any inconsistencies or
15
+ * abnormalities in the behaviour of this code. By adding to, editing, or in any way modifying this code, the Licensee
16
+ * terminates any agreement of support offered by Numerno, outlined in the provided Euro.message Magento Extension
17
+ * License.
18
+ * Upon discovery of modified code in the process of support, the Licensee is still held accountable for any and all
19
+ * billable time Numerno spent during the support process. Numerno does not guarantee compatibility with any other
20
+ * Magento extension. Numerno is not responsbile for any inconsistencies or abnormalities in the behaviour of this
21
+ * code if caused by other Magento extension.
22
+ * If you did not receive a copy of the license, please send an email to info@numerno.com or call +90-212-223-5093,
23
+ * so we can send you a copy immediately.
24
+ *
25
+ * @category [Numerno]
26
+ * @package [Numerno_Euromsg]
27
+ * @copyright Copyright (c) 2015 Numerno Bilisim Hiz. Tic. Ltd. Sti. (http://numerno.com/)
28
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
29
+ */
30
+
31
+ /**
32
+ * Mail Logs
33
+ *
34
+ * @category Numerno
35
+ * @package Numerno_Euromsg
36
+ * @author Numerno Bilisim Hiz. Tic. Ltd. Sti. <info@numerno.com>
37
+ */
38
+ class Numerno_Euromsg_Model_Mail_Log extends Mage_Core_Model_Abstract
39
+ {
40
+
41
+ protected $_eventPrefix = 'euromsg_mail_log';
42
+ protected $_eventObject = 'log';
43
+
44
+ /**
45
+ * Initialize model
46
+ *
47
+ */
48
+ protected function _construct()
49
+ {
50
+ $this->_init('euromsg/mail_log');
51
+ }
52
+
53
+ }
app/code/local/Numerno/Euromsg/Model/Mail/Transport/EuroMessage.php ADDED
@@ -0,0 +1,123 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Numerno - Euro.message Magento Extension
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the NUMERNO EUROMESSAGE MAGENTO EXTENSION License, which extends the Open Software
8
+ * License (OSL 3.0). The Euro.message Magento Extension License is available at this URL:
9
+ * http://numerno.com/licenses/euromsg-ce.txt The Open Software License is available at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ *
12
+ * DISCLAIMER
13
+ *
14
+ * By adding to, editing, or in any way modifying this code, Numerno is not held liable for any inconsistencies or
15
+ * abnormalities in the behaviour of this code. By adding to, editing, or in any way modifying this code, the Licensee
16
+ * terminates any agreement of support offered by Numerno, outlined in the provided Euro.message Magento Extension
17
+ * License.
18
+ * Upon discovery of modified code in the process of support, the Licensee is still held accountable for any and all
19
+ * billable time Numerno spent during the support process. Numerno does not guarantee compatibility with any other
20
+ * Magento extension. Numerno is not responsbile for any inconsistencies or abnormalities in the behaviour of this
21
+ * code if caused by other Magento extension.
22
+ * If you did not receive a copy of the license, please send an email to info@numerno.com or call +90-212-223-5093,
23
+ * so we can send you a copy immediately.
24
+ *
25
+ * @category [Numerno]
26
+ * @package [Numerno_Euromsg]
27
+ * @copyright Copyright (c) 2015 Numerno Bilisim Hiz. Tic. Ltd. Sti. (http://numerno.com/)
28
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
29
+ */
30
+
31
+ /**
32
+ * Class for sending eMails via Euro.Message Web Service
33
+ *
34
+ * @category Numerno
35
+ * @package Numerno_Euromsg
36
+ * @author Numerno Bilisim Hiz. Tic. Ltd. Sti. <info@numerno.com>
37
+ */
38
+ class Numerno_Euromsg_Model_Mail_Transport_EuroMessage extends Zend_Mail_Transport_Sendmail
39
+ {
40
+
41
+ /**
42
+ * Send a mail using this transport
43
+ *
44
+ * @param Zend_Mail $mail
45
+ * @access public
46
+ * @return void
47
+ * @throws Zend_Mail_Transport_Exception if mail is empty
48
+ */
49
+ public function send(Zend_Mail $mail)
50
+ {
51
+
52
+ try{
53
+ $client = Mage::getModel('euromsg/platform');
54
+ $client->_login();
55
+
56
+ $service = $client->getPostService();
57
+ $helper = Mage::helper('euromsg/post');
58
+ $logging = $helper->getStoreConfig('log/enabled');
59
+
60
+ if($mail->getCharset())
61
+ $service->setCharset($mail->getCharset());
62
+
63
+ $mailType = isset($mail->template) ? $mail->template : 'general';
64
+
65
+ $headers = $mail->getHeaders();
66
+ $headersToCheck = array('To');
67
+
68
+ foreach($headersToCheck as $header) {
69
+ if(isset($headers[$header])) {
70
+ unset($headers[$header]['append']);
71
+ $recipients = $headers[$header];
72
+ foreach($recipients as $key => $recipient) {
73
+ $result = $service->post(
74
+ $recipient,
75
+ $headers['Subject'][0],
76
+ $mail->getBodyHtml()->getRawContent(),
77
+ $mailType
78
+ );
79
+
80
+ $log = Mage::getModel('euromsg/mail_log')
81
+ ->setPostId($result->PostID)
82
+ ->setSendAt(Mage::getModel('core/date')->date('Y-m-d H:i:s'))
83
+ ->setResponseCode($result->Code)
84
+ ->setResponseMessage($result->Message)
85
+ ->setResponseMessageDetailed($result->DetailedMessage)
86
+ ->setMarkedSpam($result->MarkedSpam);
87
+ if($logging)
88
+ $log->setMailSubject(mb_decode_mimeheader($headers['Subject'][0]))
89
+ ->setMailBody($mail->getBodyHtml()->getRawContent())
90
+ ->setMailCharset($service->getCharset())
91
+ ->setMailToName(mb_decode_mimeheader($recipient['name']))
92
+ ->setMailToAddress($recipient['email'])
93
+ ->setMailType($mailType);
94
+ $log->save();
95
+ }
96
+ }
97
+ }
98
+ $client->_logout();
99
+
100
+ }catch(Exception $e){
101
+ Mage::logException($e);
102
+ }
103
+
104
+
105
+ }
106
+
107
+ /**
108
+ * Temporary error handler for PHP native mail().
109
+ *
110
+ * @param int $errno
111
+ * @param string $errstr
112
+ * @param string $errfile
113
+ * @param string $errline
114
+ * @param array $errcontext
115
+ * @return true
116
+ */
117
+ public function _handleMailErrors($errno, $errstr, $errfile = null, $errline = null, array $errcontext = null)
118
+ {
119
+ $this->_errstr = $errstr;
120
+ return true;
121
+ }
122
+
123
+ }
app/code/local/Numerno/Euromsg/Model/Newsletter/Subscriber/Collection.php ADDED
@@ -0,0 +1,98 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Numerno - Euro.message Magento Extension
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the NUMERNO EUROMESSAGE MAGENTO EXTENSION License, which extends the Open Software
8
+ * License (OSL 3.0). The Euro.message Magento Extension License is available at this URL:
9
+ * http://numerno.com/licenses/euromsg-ce.txt The Open Software License is available at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ *
12
+ * DISCLAIMER
13
+ *
14
+ * By adding to, editing, or in any way modifying this code, Numerno is not held liable for any inconsistencies or
15
+ * abnormalities in the behaviour of this code. By adding to, editing, or in any way modifying this code, the Licensee
16
+ * terminates any agreement of support offered by Numerno, outlined in the provided Euro.message Magento Extension
17
+ * License.
18
+ * Upon discovery of modified code in the process of support, the Licensee is still held accountable for any and all
19
+ * billable time Numerno spent during the support process. Numerno does not guarantee compatibility with any other
20
+ * Magento extension. Numerno is not responsbile for any inconsistencies or abnormalities in the behaviour of this
21
+ * code if caused by other Magento extension.
22
+ * If you did not receive a copy of the license, please send an email to info@numerno.com or call +90-212-223-5093,
23
+ * so we can send you a copy immediately.
24
+ *
25
+ * @category [Numerno]
26
+ * @package [Numerno_Euromsg]
27
+ * @copyright Copyright (c) 2015 Numerno Bilisim Hiz. Tic. Ltd. Sti. (http://numerno.com/)
28
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
29
+ */
30
+
31
+ /**
32
+ * Newsletter Subscriber Collection
33
+ *
34
+ * @category Numerno
35
+ * @package Numerno_Euromsg
36
+ * @author Numerno Bilisim Hiz. Tic. Ltd. Sti. <info@numerno.com>
37
+ */
38
+ class Numerno_Euromsg_Model_Newsletter_Subscriber_Collection
39
+ extends Mage_Newsletter_Model_Resource_Subscriber_Collection
40
+ {
41
+
42
+ /**
43
+ * Adds customer info to select
44
+ *
45
+ * @return Numerno_Euromsg_Model_Newsletter_Subscriber_Collection
46
+ */
47
+ public function showCustomerInfo($attributes = array('firstname', 'lastname', 'middlename'))
48
+ {
49
+ $adapter = $this->getConnection();
50
+ $customer = Mage::getModel('customer/customer');
51
+ $resource = Mage::getSingleton('core/resource');
52
+
53
+ foreach($attributes as $attribute_code) {
54
+
55
+ $attribute = $customer->getAttribute($attribute_code);
56
+
57
+ if ($attribute->getBackend()->isStatic()) {
58
+ $this->getSelect()
59
+ ->joinLeft(
60
+ array('customer_' . $attribute_code . '_table' => $attribute->getBackendTable()),
61
+ $adapter->quoteInto('customer_' . $attribute_code . '_table.entity_id=main_table.customer_id'),
62
+ array('customer_' . $attribute_code => $attribute_code)
63
+ );
64
+ } elseif ($attribute->usesSource()) {
65
+ $this->getSelect()
66
+ ->joinLeft(
67
+ array('customer_' . $attribute_code . '_table' => $attribute->getBackendTable()),
68
+ $adapter->quoteInto('customer_' . $attribute_code . '_table.entity_id=main_table.customer_id
69
+ AND customer_' . $attribute_code . '_table.attribute_id = ?', (int)$attribute->getAttributeId()
70
+ ),
71
+ array('customer_' . $attribute_code . '_option_id' => 'value')
72
+ )->joinLeft(
73
+ array(
74
+ 'customer_' . $attribute_code
75
+ . '_value_table' => $resource->getTableName('eav/attribute_option_value')),
76
+ $adapter->quoteInto('customer_' . $attribute_code . '_value_table.option_id=customer_'
77
+ . $attribute_code . '_table.value AND customer_' . $attribute_code
78
+ . '_value_table.store_id = ?',
79
+ (int)$customer->getStoreId()
80
+ ),
81
+ array('customer_' . $attribute_code => 'value')
82
+ );
83
+ } else {
84
+ $this->getSelect()
85
+ ->joinLeft(
86
+ array('customer_' . $attribute_code . '_table' => $attribute->getBackendTable()),
87
+ $adapter->quoteInto('customer_' . $attribute_code . '_table.entity_id=main_table.customer_id
88
+ AND customer_' . $attribute_code . '_table.attribute_id = ?', (int)$attribute->getAttributeId()
89
+ ),
90
+ array('customer_' . $attribute_code => 'value')
91
+ );
92
+ }
93
+ }
94
+
95
+ return $this;
96
+ }
97
+
98
+ }
app/code/local/Numerno/Euromsg/Model/Observer.php ADDED
@@ -0,0 +1,390 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Numerno - Euro.message Magento Extension
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the NUMERNO EUROMESSAGE MAGENTO EXTENSION License, which extends the Open Software
8
+ * License (OSL 3.0). The Euro.message Magento Extension License is available at this URL:
9
+ * http://numerno.com/licenses/euromsg-ce.txt The Open Software License is available at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ *
12
+ * DISCLAIMER
13
+ *
14
+ * By adding to, editing, or in any way modifying this code, Numerno is not held liable for any inconsistencies or
15
+ * abnormalities in the behaviour of this code. By adding to, editing, or in any way modifying this code, the Licensee
16
+ * terminates any agreement of support offered by Numerno, outlined in the provided Euro.message Magento Extension
17
+ * License.
18
+ * Upon discovery of modified code in the process of support, the Licensee is still held accountable for any and all
19
+ * billable time Numerno spent during the support process. Numerno does not guarantee compatibility with any other
20
+ * Magento extension. Numerno is not responsbile for any inconsistencies or abnormalities in the behaviour of this
21
+ * code if caused by other Magento extension.
22
+ * If you did not receive a copy of the license, please send an email to info@numerno.com or call +90-212-223-5093,
23
+ * so we can send you a copy immediately.
24
+ *
25
+ * @category [Numerno]
26
+ * @package [Numerno_Euromsg]
27
+ * @copyright Copyright (c) 2015 Numerno Bilisim Hiz. Tic. Ltd. Sti. (http://numerno.com/)
28
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
29
+ */
30
+
31
+ /**
32
+ * Observer
33
+ *
34
+ * @category Numerno
35
+ * @package Numerno_Euromsg
36
+ * @author Numerno Bilisim Hiz. Tic. Ltd. Sti. <info@numerno.com>
37
+ */
38
+ class Numerno_Euromsg_Model_Observer
39
+ {
40
+
41
+ /**
42
+ * Send Order Update SMS
43
+ */
44
+ public function sendOrderUpdateSms(Varien_Event_Observer $observer)
45
+ {
46
+ $event = $observer->getEvent();
47
+ $controller = $event->getControllerAction();
48
+ $order = Mage::registry('current_order');
49
+
50
+ if ($order->getId() && $order->getCustomerId()) {
51
+ try {
52
+ $customer = Mage::getModel('customer/customer')->load($order->getCustomerId());
53
+ if($customer->getId()) {
54
+ $data = $controller->getRequest()->getPost('history');
55
+ $notifySms = isset($data['is_customer_notified_by_sms'])
56
+ ? $data['is_customer_notified_by_sms'] : false;
57
+ $template = Mage::helper('euromsg/sms')->getStoreConfig('template/sms_order_update_template');
58
+ $suffix = Mage::helper('euromsg/sms')->getStoreConfig('template/footer');
59
+
60
+ if($notifySms) {
61
+
62
+ $processor = new Varien_Filter_Template();
63
+ $processor->setVariables(array(
64
+ 'order' => $order,
65
+ 'customer' => $customer,
66
+ 'comment' => $data['comment'],
67
+ 'suffix' => $suffix
68
+ ));
69
+ $message = trim($processor->filter($template));
70
+
71
+ Mage::getModel('euromsg/sms')->send($customer, $message);
72
+ }
73
+ }
74
+ }
75
+ catch (Mage_Core_Exception $e) {
76
+ Mage::logException($e);
77
+ }
78
+ }
79
+
80
+ return true;
81
+ }
82
+
83
+ /**
84
+ * Send Invoice Update SMS
85
+ */
86
+ public function sendInvoiceUpdateSms(Varien_Event_Observer $observer)
87
+ {
88
+ $event = $observer->getEvent();
89
+ $controller = $event->getControllerAction();
90
+ $invoice = Mage::registry('current_invoice');
91
+ $order = $invoice->getOrder();
92
+
93
+ if ($order->getId() && $order->getCustomerId()) {
94
+ try {
95
+ $customer = Mage::getModel('customer/customer')->load($order->getCustomerId());
96
+ if($customer->getId()) {
97
+ $data = $controller->getRequest()->getPost('comment');
98
+ $notifySms = isset($data['is_customer_notified_by_sms'])
99
+ ? $data['is_customer_notified_by_sms'] : false;
100
+ $template = Mage::helper('euromsg/sms')->getStoreConfig('template/sms_order_update_template');
101
+ $suffix = Mage::helper('euromsg/sms')->getStoreConfig('template/footer');
102
+
103
+ if($notifySms) {
104
+ $processor = new Varien_Filter_Template();
105
+ $processor->setVariables(array(
106
+ 'order' => $order,
107
+ 'customer' => $customer,
108
+ 'comment' => $data['comment'],
109
+ 'suffix' => $suffix
110
+ ));
111
+ $message = trim($processor->filter($template));
112
+
113
+ Mage::getModel('euromsg/sms')->send($customer, $message);
114
+ }
115
+ }
116
+ }
117
+ catch (Mage_Core_Exception $e) {
118
+ Mage::logException($e);
119
+ }
120
+ }
121
+
122
+ }
123
+
124
+ /**
125
+ * Send Shipment Update SMS
126
+ */
127
+ public function sendShipmentUpdateSms(Varien_Event_Observer $observer)
128
+ {
129
+ $event = $observer->getEvent();
130
+ $controller = $event->getControllerAction();
131
+ $shipment = Mage::registry('current_shipment');
132
+ $order = $shipment->getOrder();
133
+
134
+ if ($order->getId() && $order->getCustomerId()) {
135
+ try {
136
+ $customer = Mage::getModel('customer/customer')->load($order->getCustomerId());
137
+ if($customer->getId()) {
138
+ $data = $controller->getRequest()->getPost('comment');
139
+ $notifySms = isset($data['is_customer_notified_by_sms'])
140
+ ? $data['is_customer_notified_by_sms'] : false;
141
+ $template = Mage::helper('euromsg/sms')->getStoreConfig('template/sms_order_update_template');
142
+ $suffix = Mage::helper('euromsg/sms')->getStoreConfig('template/footer');
143
+
144
+ if($notifySms) {
145
+ $processor = new Varien_Filter_Template();
146
+ $processor->setVariables(array(
147
+ 'order' => $order,
148
+ 'customer' => $customer,
149
+ 'comment' => $data['comment'],
150
+ 'suffix' => $suffix
151
+ ));
152
+ $message = trim($processor->filter($template));
153
+
154
+ Mage::getModel('euromsg/sms')->send($customer, $message);
155
+ }
156
+ }
157
+ }
158
+ catch (Mage_Core_Exception $e) {
159
+ Mage::logException($e);
160
+ }
161
+ }
162
+
163
+ }
164
+
165
+ /**
166
+ * Send Creditmemo Update SMS
167
+ */
168
+ public function sendCreditmemoUpdateSms(Varien_Event_Observer $observer)
169
+ {
170
+ $event = $observer->getEvent();
171
+ $controller = $event->getControllerAction();
172
+ $creditMemo = Mage::registry('current_creditmemo');
173
+ $order = $creditMemo->getOrder();
174
+
175
+ if ($order->getId() && $order->getCustomerId()) {
176
+ try {
177
+ $customer = Mage::getModel('customer/customer')->load($order->getCustomerId());
178
+ if($customer->getId()) {
179
+ $data = $controller->getRequest()->getPost('comment');
180
+ $notifySms = isset($data['is_customer_notified_by_sms'])
181
+ ? $data['is_customer_notified_by_sms'] : false;
182
+ $template = Mage::helper('euromsg/sms')->getStoreConfig('template/sms_order_update_template');
183
+ $suffix = Mage::helper('euromsg/sms')->getStoreConfig('template/footer');
184
+
185
+ if($notifySms) {
186
+ $processor = new Varien_Filter_Template();
187
+ $processor->setVariables(array(
188
+ 'order' => $order,
189
+ 'customer' => $customer,
190
+ 'comment' => $data['comment'],
191
+ 'suffix' => $suffix
192
+ ));
193
+ $message = trim($processor->filter($template));
194
+
195
+ Mage::getModel('euromsg/sms')->send($customer, $message);
196
+ }
197
+ }
198
+ }
199
+ catch (Mage_Core_Exception $e) {
200
+ Mage::logException($e);
201
+ }
202
+ }
203
+
204
+ }
205
+
206
+ /**
207
+ * Send New Order SMS
208
+ */
209
+ public function sendNewOrderSms(Varien_Event_Observer $observer)
210
+ {
211
+ $event = $observer->getEvent();
212
+ $order = $event->getOrder();
213
+ $enabled = Mage::helper('euromsg/sms')->isEnabled();
214
+ $notifySms = Mage::helper('euromsg/sms')->getStoreConfig('template/sms_new_order');
215
+
216
+ if ($enabled && $notifySms && $order->getId() && $order->getCustomerId()) {
217
+ try {
218
+ $customer = Mage::getModel('customer/customer')->load($order->getCustomerId());
219
+ if($customer->getId()) {
220
+ $template = Mage::helper('euromsg/sms')->getStoreConfig('template/sms_new_order_template');
221
+ $suffix = Mage::helper('euromsg/sms')->getStoreConfig('template/footer');
222
+ $processor = new Varien_Filter_Template();
223
+ $processor->setVariables(array(
224
+ 'order' => $order,
225
+ 'customer' => $customer,
226
+ 'suffix' => $suffix
227
+ ));
228
+ $message = trim($processor->filter($template));
229
+
230
+ Mage::getModel('euromsg/sms')->send($customer, $message);
231
+ }
232
+ }
233
+ catch (Mage_Core_Exception $e) {
234
+ Mage::logException($e);
235
+ }
236
+ }
237
+
238
+ }
239
+
240
+ /**
241
+ * Send New Invoice SMS
242
+ */
243
+ public function sendNewInvoiceSms(Varien_Event_Observer $observer)
244
+ {
245
+ $event = $observer->getEvent();
246
+ $invoice = $event->getInvoice();
247
+ $order = $invoice->getOrder();
248
+ $enabled = Mage::helper('euromsg/sms')->isEnabled();
249
+ $notifySms = Mage::helper('euromsg/sms')->getStoreConfig('template/sms_new_invoice');
250
+
251
+ if ($enabled && $notifySms && $order->getId() && $order->getCustomerId()) {
252
+ try {
253
+ $customer = Mage::getModel('customer/customer')->load($order->getCustomerId());
254
+ if($customer->getId()) {
255
+ $template = Mage::helper('euromsg/sms')->getStoreConfig('template/sms_new_invoice_template');
256
+ $suffix = Mage::helper('euromsg/sms')->getStoreConfig('template/footer');
257
+ $processor = new Varien_Filter_Template();
258
+ $processor->setVariables(array(
259
+ 'order' => $order,
260
+ 'invoice' => $invoice,
261
+ 'customer' => $customer,
262
+ 'suffix' => $suffix
263
+ ));
264
+ $message = trim($processor->filter($template));
265
+
266
+ Mage::getModel('euromsg/sms')->send($customer, $message);
267
+ }
268
+ }
269
+ catch (Mage_Core_Exception $e) {
270
+ Mage::logException($e);
271
+ }
272
+ }
273
+
274
+ }
275
+
276
+ /**
277
+ * Send New Shipment SMS
278
+ */
279
+ public function sendNewShipmentSms(Varien_Event_Observer $observer)
280
+ {
281
+ $event = $observer->getEvent();
282
+ $shipment = $event->getShipment();
283
+ $order = $shipment->getOrder();
284
+ $enabled = Mage::helper('euromsg/sms')->isEnabled();
285
+ $notifySms = Mage::helper('euromsg/sms')->getStoreConfig('template/sms_new_shipment');
286
+
287
+ if ($enabled && $notifySms && $order->getId() && $order->getCustomerId()) {
288
+ try {
289
+ $customer = Mage::getModel('customer/customer')->load($order->getCustomerId());
290
+ if($customer->getId()) {
291
+ $template = Mage::helper('euromsg/sms')->getStoreConfig('template/sms_new_shipment_template');
292
+ $suffix = Mage::helper('euromsg/sms')->getStoreConfig('template/footer');
293
+
294
+ $processor = new Varien_Filter_Template();
295
+ $processor->setVariables(array(
296
+ 'order' => $order,
297
+ 'shipment' => $shipment,
298
+ 'customer' => $customer,
299
+ 'suffix' => $suffix
300
+ ));
301
+ $message = trim($processor->filter($template));
302
+
303
+ Mage::getModel('euromsg/sms')->send($customer, $message);
304
+ }
305
+ }
306
+ catch (Mage_Core_Exception $e) {
307
+ Mage::logException($e);
308
+ }
309
+ }
310
+
311
+ }
312
+
313
+ /**
314
+ * Send New Shipment Tracking Number SMS
315
+ */
316
+ public function sendNewTrackSms(Varien_Event_Observer $observer)
317
+ {
318
+ $event = $observer->getEvent();
319
+ $track = $event->getTrack();
320
+ $shipment = $track->getShipment();
321
+ $order = $shipment->getOrder();
322
+ $enabled = Mage::helper('euromsg/sms')->isEnabled();
323
+ $notifySms = Mage::helper('euromsg/sms')->getStoreConfig('template/sms_new_track');
324
+
325
+ if ($enabled && $notifySms && $order->getId() && $order->getCustomerId()) {
326
+ try {
327
+ $customer = Mage::getModel('customer/customer')->load($order->getCustomerId());
328
+ if($customer->getId()) {
329
+ $notifySms = Mage::helper('euromsg/sms')->getStoreConfig('template/sms_new_track');
330
+ $template = Mage::helper('euromsg/sms')->getStoreConfig('template/sms_new_track_template');
331
+ $suffix = Mage::helper('euromsg/sms')->getStoreConfig('template/footer');
332
+
333
+ $processor = new Varien_Filter_Template();
334
+ $processor->setVariables(array(
335
+ 'order' => $order,
336
+ 'shipment' => $shipment,
337
+ 'track' => $track,
338
+ 'customer' => $customer,
339
+ 'suffix' => $suffix
340
+ ));
341
+ $message = trim($processor->filter($template));
342
+
343
+ Mage::getModel('euromsg/sms')->send($customer, $message);
344
+ }
345
+ }
346
+ catch (Mage_Core_Exception $e) {
347
+ Mage::logException($e);
348
+ }
349
+ }
350
+
351
+ }
352
+
353
+ /**
354
+ * Send New Credit Memo Number SMS
355
+ */
356
+ public function sendNewCreditmemoSms(Varien_Event_Observer $observer)
357
+ {
358
+ $event = $observer->getEvent();
359
+ $creditmemo = $event->getCreditmemo();
360
+ $order = $creditmemo->getOrder();
361
+ $enabled = Mage::helper('euromsg/sms')->isEnabled();
362
+ $notifySms = Mage::helper('euromsg/sms')->getStoreConfig('template/sms_new_creditmemo');
363
+
364
+ if ($enabled && $notifySms && $order->getId() && $order->getCustomerId()) {
365
+ try {
366
+ $customer = Mage::getModel('customer/customer')->load($order->getCustomerId());
367
+ if($customer->getId()) {
368
+ $template = Mage::helper('euromsg/sms')->getStoreConfig('template/sms_new_creditmemo_template');
369
+ $suffix = Mage::helper('euromsg/sms')->getStoreConfig('template/footer');
370
+ $processor = new Varien_Filter_Template();
371
+ $processor->setVariables(array(
372
+ 'order' => $order,
373
+ 'creditmemo' => $creditmemo,
374
+ 'customer' => $customer,
375
+ 'suffix' => $suffix
376
+ ));
377
+ $message = trim($processor->filter($template));
378
+
379
+ Mage::getModel('euromsg/sms')->send($customer, $message);
380
+ }
381
+ }
382
+ catch (Mage_Core_Exception $e) {
383
+ Mage::logException($e);
384
+ }
385
+ }
386
+
387
+ }
388
+
389
+
390
+ }
app/code/local/Numerno/Euromsg/Model/Platform.php ADDED
@@ -0,0 +1,184 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Numerno - Euro.message Magento Extension
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the NUMERNO EUROMESSAGE MAGENTO EXTENSION License, which extends the Open Software
8
+ * License (OSL 3.0). The Euro.message Magento Extension License is available at this URL:
9
+ * http://numerno.com/licenses/euromsg-ce.txt The Open Software License is available at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ *
12
+ * DISCLAIMER
13
+ *
14
+ * By adding to, editing, or in any way modifying this code, Numerno is not held liable for any inconsistencies or
15
+ * abnormalities in the behaviour of this code. By adding to, editing, or in any way modifying this code, the Licensee
16
+ * terminates any agreement of support offered by Numerno, outlined in the provided Euro.message Magento Extension
17
+ * License.
18
+ * Upon discovery of modified code in the process of support, the Licensee is still held accountable for any and all
19
+ * billable time Numerno spent during the support process. Numerno does not guarantee compatibility with any other
20
+ * Magento extension. Numerno is not responsbile for any inconsistencies or abnormalities in the behaviour of this
21
+ * code if caused by other Magento extension.
22
+ * If you did not receive a copy of the license, please send an email to info@numerno.com or call +90-212-223-5093,
23
+ * so we can send you a copy immediately.
24
+ *
25
+ * @category [Numerno]
26
+ * @package [Numerno_Euromsg]
27
+ * @copyright Copyright (c) 2015 Numerno Bilisim Hiz. Tic. Ltd. Sti. (http://numerno.com/)
28
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
29
+ */
30
+
31
+ /**
32
+ * Platform
33
+ *
34
+ * @category Numerno
35
+ * @package Numerno_Euromsg
36
+ * @author Numerno Bilisim Hiz. Tic. Ltd. Sti. <info@numerno.com>
37
+ */
38
+ class Numerno_Euromsg_Model_Platform extends Numerno_Euromsg_Model_Platform_Abstract
39
+ {
40
+
41
+ /**
42
+ * Constructor
43
+ *
44
+ * @param string $wsdl
45
+ * @param array $options
46
+ */
47
+ public function __construct($wsdl = null, $options = null)
48
+ {
49
+
50
+ try {
51
+ $_wsUri = $this->getHelper()->getWsUri();
52
+ $_uri = Zend_Uri::factory($_wsUri . 'auth.asmx?WSDL');
53
+
54
+ $wsdl = $_uri->getUri();
55
+
56
+ }catch(Exception $e){
57
+ Mage::throwException($this->getHelper()->__('Invalid euro.message web service URL: %s', $_wsUri));
58
+ }
59
+
60
+ parent::__construct($wsdl, $options);
61
+ }
62
+
63
+ /**
64
+ * Login to euro.message Web Service
65
+ */
66
+ public function _login(){
67
+
68
+ $_response = $this->Login($this->getHelper()->getWsCredentials());
69
+ if($_response->Code == '00')
70
+ $this->setServiceTicket($_response->ServiceTicket);
71
+ else
72
+ Mage::throwException($this->getHelper()->__('Cannot login to euro.message web service: %s', $_response->Message));
73
+
74
+ return $this;
75
+ }
76
+
77
+ /**
78
+ * Logout from euro.message Web Service
79
+ */
80
+ public function _logout(){
81
+
82
+ if($this->isLoggedIn()) {
83
+ $this->Logout(array('ServiceTicket' => $this->getServiceTicket()));
84
+ $this->setServiceTicket(null);
85
+ }
86
+
87
+ return $this;
88
+ }
89
+
90
+ /**
91
+ * Check if logged in
92
+ */
93
+ public function isLoggedIn(){
94
+
95
+ if($this->getServiceTicket())
96
+ return true;
97
+
98
+ return false;
99
+ }
100
+
101
+ /**
102
+ * Call post web services
103
+ */
104
+ public function getPostService(){
105
+
106
+ if($this->isLoggedIn())
107
+ return $this->_getPostService();
108
+ else
109
+ Mage::throwException($this->getHelper()->__('Call login() first to use Post Web Service.'));
110
+
111
+ return false;
112
+ }
113
+
114
+ protected function _getPostService(){
115
+
116
+ $_service = Mage::getModel('euromsg/platform_post')
117
+ ->setServiceTicket($this->getServiceTicket());
118
+
119
+ return $_service;
120
+ }
121
+
122
+ /**
123
+ * Call sms web services
124
+ */
125
+ public function getSmsService(){
126
+
127
+ if($this->isLoggedIn())
128
+ return $this->_getSmsService();
129
+ else
130
+ Mage::throwException($this->getHelper()->__('Call login() first to use Sms Web Service.'));
131
+
132
+ return false;
133
+ }
134
+
135
+ protected function _getSmsService(){
136
+
137
+ $_service = Mage::getModel('euromsg/platform_postSms')
138
+ ->setServiceTicket($this->getServiceTicket());
139
+
140
+ return $_service;
141
+ }
142
+
143
+ /**
144
+ * Call sms web services
145
+ */
146
+ public function getReportService(){
147
+
148
+ if($this->isLoggedIn())
149
+ return $this->_getReportService();
150
+ else
151
+ Mage::throwException($this->getHelper()->__('Call login() first to use Report Web Service.'));
152
+
153
+ return false;
154
+ }
155
+
156
+ protected function _getReportService(){
157
+
158
+ $_service = Mage::getModel('euromsg/platform_report')
159
+ ->setServiceTicket($this->getServiceTicket());
160
+
161
+ return $_service;
162
+ }
163
+
164
+ /**
165
+ * Call sms web services
166
+ */
167
+ public function getMemberService(){
168
+
169
+ if($this->isLoggedIn())
170
+ return $this->_getMemberService();
171
+ else
172
+ Mage::throwException($this->getHelper()->__('Call login() first to use Member Web Service.'));
173
+
174
+ return false;
175
+ }
176
+
177
+ protected function _getMemberService(){
178
+
179
+ $_service = Mage::getModel('euromsg/platform_member')
180
+ ->setServiceTicket($this->getServiceTicket());
181
+
182
+ return $_service;
183
+ }
184
+ }
app/code/local/Numerno/Euromsg/Model/Platform/Abstract.php ADDED
@@ -0,0 +1,103 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Numerno - Euro.message Magento Extension
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the NUMERNO EUROMESSAGE MAGENTO EXTENSION License, which extends the Open Software
8
+ * License (OSL 3.0). The Euro.message Magento Extension License is available at this URL:
9
+ * http://numerno.com/licenses/euromsg-ce.txt The Open Software License is available at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ *
12
+ * DISCLAIMER
13
+ *
14
+ * By adding to, editing, or in any way modifying this code, Numerno is not held liable for any inconsistencies or
15
+ * abnormalities in the behaviour of this code. By adding to, editing, or in any way modifying this code, the Licensee
16
+ * terminates any agreement of support offered by Numerno, outlined in the provided Euro.message Magento Extension
17
+ * License.
18
+ * Upon discovery of modified code in the process of support, the Licensee is still held accountable for any and all
19
+ * billable time Numerno spent during the support process. Numerno does not guarantee compatibility with any other
20
+ * Magento extension. Numerno is not responsbile for any inconsistencies or abnormalities in the behaviour of this
21
+ * code if caused by other Magento extension.
22
+ * If you did not receive a copy of the license, please send an email to info@numerno.com or call +90-212-223-5093,
23
+ * so we can send you a copy immediately.
24
+ *
25
+ * @category [Numerno]
26
+ * @package [Numerno_Euromsg]
27
+ * @copyright Copyright (c) 2015 Numerno Bilisim Hiz. Tic. Ltd. Sti. (http://numerno.com/)
28
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
29
+ */
30
+
31
+ /**
32
+ * Platform Abstract Class
33
+ *
34
+ * @category Numerno
35
+ * @package Numerno_Euromsg
36
+ * @author Numerno Bilisim Hiz. Tic. Ltd. Sti. <info@numerno.com>
37
+ */
38
+ class Numerno_Euromsg_Model_Platform_Abstract extends Zend_Soap_Client_DotNet
39
+ {
40
+
41
+ protected $_serviceTicket = null;
42
+ protected $_charset = 'UTF-8';
43
+
44
+ /**
45
+ * Constructor
46
+ *
47
+ * @param string $wsdl
48
+ * @param array $options
49
+ */
50
+ public function __construct($wsdl = null, $options = null)
51
+ {
52
+ if(!is_array($options))
53
+ $options = array();
54
+
55
+ $options['encoding'] = $this->_charset;
56
+ $options['soap_version'] = SOAP_1_2;
57
+
58
+ parent::__construct($wsdl, $options);
59
+ }
60
+
61
+ public function getHelper()
62
+ {
63
+
64
+ return Mage::helper('euromsg');
65
+ }
66
+
67
+ public function setServiceTicket($token)
68
+ {
69
+
70
+ $this->_serviceTicket = $token;
71
+
72
+ return $this;
73
+ }
74
+
75
+ public function getServiceTicket()
76
+ {
77
+
78
+ return $this->_serviceTicket;
79
+ }
80
+
81
+ public function setCharset($charset)
82
+ {
83
+
84
+ return $this->_charset = $charset;
85
+ }
86
+
87
+ public function getCharset()
88
+ {
89
+
90
+ return $this->_charset;
91
+ }
92
+
93
+ public function getResponseXml()
94
+ {
95
+ $response = str_ireplace('soap:', '', $this->getLastResponse()); //make readable for SoapXML
96
+ $responseXml = simplexml_load_string($response);
97
+
98
+ if(isset($responseXml->Body))
99
+ return $responseXml->Body;
100
+
101
+ return $responseXml;
102
+ }
103
+ }
app/code/local/Numerno/Euromsg/Model/Platform/Member.php ADDED
@@ -0,0 +1,146 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Numerno - Euro.message Magento Extension
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the NUMERNO EUROMESSAGE MAGENTO EXTENSION License, which extends the Open Software
8
+ * License (OSL 3.0). The Euro.message Magento Extension License is available at this URL:
9
+ * http://numerno.com/licenses/euromsg-ce.txt The Open Software License is available at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ *
12
+ * DISCLAIMER
13
+ *
14
+ * By adding to, editing, or in any way modifying this code, Numerno is not held liable for any inconsistencies or
15
+ * abnormalities in the behaviour of this code. By adding to, editing, or in any way modifying this code, the Licensee
16
+ * terminates any agreement of support offered by Numerno, outlined in the provided Euro.message Magento Extension
17
+ * License.
18
+ * Upon discovery of modified code in the process of support, the Licensee is still held accountable for any and all
19
+ * billable time Numerno spent during the support process. Numerno does not guarantee compatibility with any other
20
+ * Magento extension. Numerno is not responsbile for any inconsistencies or abnormalities in the behaviour of this
21
+ * code if caused by other Magento extension.
22
+ * If you did not receive a copy of the license, please send an email to info@numerno.com or call +90-212-223-5093,
23
+ * so we can send you a copy immediately.
24
+ *
25
+ * @category [Numerno]
26
+ * @package [Numerno_Euromsg]
27
+ * @copyright Copyright (c) 2015 Numerno Bilisim Hiz. Tic. Ltd. Sti. (http://numerno.com/)
28
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
29
+ */
30
+
31
+ /**
32
+ * Member Service
33
+ *
34
+ * @category Numerno
35
+ * @package Numerno_Euromsg
36
+ * @author Numerno Bilisim Hiz. Tic. Ltd. Sti. <info@numerno.com>
37
+ */
38
+ class Numerno_Euromsg_Model_Platform_Member extends Numerno_Euromsg_Model_Platform_Abstract
39
+ {
40
+
41
+ /**
42
+ * Constructor
43
+ *
44
+ * @param string $wsdl
45
+ * @param array $options
46
+ */
47
+ public function __construct($wsdl = null, $options = null)
48
+ {
49
+ try {
50
+ $_wsUri = $this->getHelper()->getWsUri();
51
+ $_uri = Zend_Uri::factory($_wsUri . 'member.asmx?WSDL');
52
+
53
+ $wsdl = $_uri->getUri();
54
+
55
+ }catch(Exception $e){
56
+ Mage::throwException($this->getHelper()->__('Invalid euro.message web service URL: %s', $_wsUri));
57
+ }
58
+
59
+ parent::__construct($wsdl, $options);
60
+ }
61
+
62
+ public function updateMember($email) {
63
+
64
+ $subscriber = Mage::getModel('newsletter/subscriber')
65
+ ->loadByEmail($email);
66
+
67
+ if($subscriber->getId()){
68
+ $data = array(
69
+ array(
70
+ 'Key' => Numerno_Euromsg_Model_Export_Entity_Member::COL_EMAIL_PERMIT,
71
+ 'Value' => $subscriber->isSubscribed() ? 'Y' : 'N'
72
+ )
73
+ );
74
+
75
+ if($subscriber->getCustomerId()){
76
+ $helper = Mage::helper('euromsg');
77
+ $_prefix = $helper->getCustomerAttributePrefix();
78
+ $_preset = array_keys($helper->getPresetCustomerAttributes());
79
+ $customer = Mage::getModel('customer/customer')->load($subscriber->getCustomerId());
80
+
81
+ $attributes = Mage::getStoreConfig('euromsg_customer/general/attributes');
82
+ if (!is_array($attributes)) {
83
+ $attributes = empty($attributes) ? array() : unserialize($attributes);
84
+ }
85
+
86
+ foreach ($attributes as $key => $attribute) {
87
+
88
+ if (strlen($attribute['attribute']) > strlen($_prefix) &&
89
+ substr($attribute['attribute'], 0, strlen($_prefix)) == $_prefix) {
90
+ $attributes[$key]['attribute'] = substr($attribute['attribute'], strlen($_prefix));
91
+ }
92
+
93
+ if($attribute['attribute'] == 'entity_id' || !in_array($key, $_preset) ) {
94
+ $attribute = $customer->getResource()->getAttribute($attributes[$key]['attribute']);
95
+ if($attribute->usesSource())
96
+ $value = $attribute->getFrontend()->getValue($customer);
97
+ else
98
+ $value = $customer->getData($attributes[$key]['attribute']);
99
+
100
+ if(Zend_Date::isDate($value, Zend_Date::ISO_8601)) {
101
+ $value = date("Ymd", strtotime($value));
102
+ }
103
+ $data[] = array(
104
+ 'Key' => $attributes[$key]['col_name'],
105
+ 'Value' => $value
106
+ );
107
+ }
108
+ }
109
+ }
110
+
111
+ $_params = array(
112
+ 'ServiceTicket' => $this->getServiceTicket(),
113
+ 'Key' => Numerno_Euromsg_Model_Export_Entity_Member::COL_EMAIL,
114
+ 'Value' => $subscriber->getEmail(),
115
+ 'DemograficData'=> $data,
116
+ 'ForceInsert' => true
117
+ );
118
+
119
+ $this->UpdateMemberDemography($_params);
120
+ $response = $this->getResponseXml();
121
+
122
+ if(isset($response->UpdateMemberDemographyResponse))
123
+ return true;
124
+ }
125
+
126
+ return false;
127
+ }
128
+
129
+ public function getMember($email)
130
+ {
131
+ $_params = array(
132
+ 'ServiceTicket' => $this->getServiceTicket(),
133
+ 'Key' => Numerno_Euromsg_Model_Export_Entity_Member::COL_EMAIL,
134
+ 'Value' => $email,
135
+ );
136
+
137
+ $this->QueryMemberDemography($_params);
138
+
139
+ $response = $this->getResponseXml();
140
+
141
+ if(isset($response->QueryMemberDemographyResponse))
142
+ return $response->QueryMemberDemographyResponse;
143
+
144
+ return false;
145
+ }
146
+ }
app/code/local/Numerno/Euromsg/Model/Platform/Post.php ADDED
@@ -0,0 +1,98 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Numerno - Euro.message Magento Extension
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the NUMERNO EUROMESSAGE MAGENTO EXTENSION License, which extends the Open Software
8
+ * License (OSL 3.0). The Euro.message Magento Extension License is available at this URL:
9
+ * http://numerno.com/licenses/euromsg-ce.txt The Open Software License is available at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ *
12
+ * DISCLAIMER
13
+ *
14
+ * By adding to, editing, or in any way modifying this code, Numerno is not held liable for any inconsistencies or
15
+ * abnormalities in the behaviour of this code. By adding to, editing, or in any way modifying this code, the Licensee
16
+ * terminates any agreement of support offered by Numerno, outlined in the provided Euro.message Magento Extension
17
+ * License.
18
+ * Upon discovery of modified code in the process of support, the Licensee is still held accountable for any and all
19
+ * billable time Numerno spent during the support process. Numerno does not guarantee compatibility with any other
20
+ * Magento extension. Numerno is not responsbile for any inconsistencies or abnormalities in the behaviour of this
21
+ * code if caused by other Magento extension.
22
+ * If you did not receive a copy of the license, please send an email to info@numerno.com or call +90-212-223-5093,
23
+ * so we can send you a copy immediately.
24
+ *
25
+ * @category [Numerno]
26
+ * @package [Numerno_Euromsg]
27
+ * @copyright Copyright (c) 2015 Numerno Bilisim Hiz. Tic. Ltd. Sti. (http://numerno.com/)
28
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
29
+ */
30
+
31
+ /**
32
+ * Post Service
33
+ *
34
+ * @category Numerno
35
+ * @package Numerno_Euromsg
36
+ * @author Numerno Bilisim Hiz. Tic. Ltd. Sti. <info@numerno.com>
37
+ */
38
+ class Numerno_Euromsg_Model_Platform_Post extends Numerno_Euromsg_Model_Platform_Abstract
39
+ {
40
+
41
+ /**
42
+ * Constructor
43
+ *
44
+ * @param string $wsdl
45
+ * @param array $options
46
+ */
47
+ public function __construct($wsdl = null, $options = null)
48
+ {
49
+
50
+ try {
51
+ $_wsUri = $this->getHelper()->getWsUri();
52
+ $_uri = Zend_Uri::factory($_wsUri . 'post.asmx?WSDL');
53
+
54
+ $wsdl = $_uri->getUri();
55
+
56
+ }catch(Exception $e){
57
+ Mage::throwException($this->getHelper()->__('Invalid euro.message web service URL: %s', $_wsUri));
58
+ }
59
+
60
+ parent::__construct($wsdl, $options);
61
+ }
62
+
63
+ public function getPostHelper(){
64
+
65
+ return Mage::helper('euromsg/post');
66
+ }
67
+
68
+ public function post($recipient, $subject, $body, $type = 'general'){
69
+
70
+ $_params = array(
71
+ 'ServiceTicket' => $this->getServiceTicket(),
72
+ 'Subject' => $subject,
73
+ 'HtmlBody' => $body,
74
+ 'Charset' => $this->_charset,
75
+ 'ToName' => $recipient['name'],
76
+ 'ToEmailAddress' => $recipient['email'],
77
+ 'PostType' => $type
78
+ );
79
+ $postParams = $this->getPostHelper()->getPostParams();
80
+
81
+ $params = array_merge($_params, $postParams);
82
+
83
+ return $this->PostHtmlWithType($params);
84
+
85
+ }
86
+
87
+ public function check($postId){
88
+
89
+ $params = array(
90
+ 'ServiceTicket' => $this->getServiceTicket(),
91
+ 'PostID' => $postId
92
+ );
93
+
94
+ return $this->GetPostResult($params);
95
+
96
+ }
97
+
98
+ }
app/code/local/Numerno/Euromsg/Model/Platform/PostSms.php ADDED
@@ -0,0 +1,156 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Numerno - Euro.message Magento Extension
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the NUMERNO EUROMESSAGE MAGENTO EXTENSION License, which extends the Open Software
8
+ * License (OSL 3.0). The Euro.message Magento Extension License is available at this URL:
9
+ * http://numerno.com/licenses/euromsg-ce.txt The Open Software License is available at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ *
12
+ * DISCLAIMER
13
+ *
14
+ * By adding to, editing, or in any way modifying this code, Numerno is not held liable for any inconsistencies or
15
+ * abnormalities in the behaviour of this code. By adding to, editing, or in any way modifying this code, the Licensee
16
+ * terminates any agreement of support offered by Numerno, outlined in the provided Euro.message Magento Extension
17
+ * License.
18
+ * Upon discovery of modified code in the process of support, the Licensee is still held accountable for any and all
19
+ * billable time Numerno spent during the support process. Numerno does not guarantee compatibility with any other
20
+ * Magento extension. Numerno is not responsbile for any inconsistencies or abnormalities in the behaviour of this
21
+ * code if caused by other Magento extension.
22
+ * If you did not receive a copy of the license, please send an email to info@numerno.com or call +90-212-223-5093,
23
+ * so we can send you a copy immediately.
24
+ *
25
+ * @category [Numerno]
26
+ * @package [Numerno_Euromsg]
27
+ * @copyright Copyright (c) 2015 Numerno Bilisim Hiz. Tic. Ltd. Sti. (http://numerno.com/)
28
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
29
+ */
30
+
31
+ /**
32
+ * PostSms Service
33
+ *
34
+ * @category Numerno
35
+ * @package Numerno_Euromsg
36
+ * @author Numerno Bilisim Hiz. Tic. Ltd. Sti. <info@numerno.com>
37
+ */
38
+ class Numerno_Euromsg_Model_Platform_PostSms extends Numerno_Euromsg_Model_Platform_Abstract
39
+ {
40
+
41
+ /**
42
+ * Constructor
43
+ *
44
+ * @param string $wsdl
45
+ * @param array $options
46
+ */
47
+ public function __construct($wsdl = null, $options = null)
48
+ {
49
+ try {
50
+ $_wsUri = $this->getHelper()->getWsUri();
51
+ $_uri = Zend_Uri::factory($_wsUri . 'postsms.asmx?WSDL');
52
+
53
+ $wsdl = $_uri->getUri();
54
+
55
+ }catch(Exception $e){
56
+ Mage::throwException($this->getHelper()->__('Invalid euro.message web service URL: %s', $_wsUri));
57
+ }
58
+
59
+ parent::__construct($wsdl, $options);
60
+ }
61
+
62
+ public function getSmsHelper()
63
+ {
64
+ return Mage::helper('euromsg/sms');
65
+ }
66
+
67
+ protected function _sendPersonal($message, $recipient, $begin)
68
+ {
69
+ $_params = array(
70
+ 'ServiceTicket' => $this->getServiceTicket(),
71
+ 'Originator' => $this->getSmsHelper()->getOriginator(),
72
+ 'NumberMessagePair' => array(
73
+ 'Key' => $message,
74
+ 'Value' => $recipient
75
+ ),
76
+ 'BeginTime' => $begin
77
+ );
78
+
79
+ $this->SendPersonalSms($_params);
80
+ $response = $this->getResponseXml();
81
+
82
+ if(isset($response->SendPersonalSmsResponse)) {
83
+ $result = $response->SendPersonalSmsResponse->SendPersonalSmsResult;
84
+ $result->Type = 'standart';
85
+
86
+ return $result;
87
+ }
88
+ return false;
89
+
90
+ }
91
+
92
+ protected function _sendSingleShot($message, $recipient, $begin)
93
+ {
94
+ $_params = array(
95
+ 'ServiceTicket' => $this->getServiceTicket(),
96
+ 'Originator' => $this->getSmsHelper()->getOriginator(),
97
+ 'NumberMessagePair' => array(
98
+ 'Key' => $message,
99
+ 'Value' => $recipient
100
+ ),
101
+ 'BeginTime' => $begin
102
+ );
103
+
104
+ $this->SingleShotSms($_params);
105
+ $response = $this->getResponseXml();
106
+
107
+ if(isset($response->SingleShotSmsResponse)) {
108
+ $result = $response->SingleShotSmsResponse->SendPersonalSmsResult;
109
+ $result->Type = 'singleshot';
110
+
111
+ return $result;
112
+ }
113
+ return false;
114
+
115
+ }
116
+
117
+ public function report($packetId)
118
+ {
119
+ $_params = array(
120
+ 'ServiceTicket' => $this->getServiceTicket(),
121
+ 'MessageId' => $packetId
122
+ );
123
+
124
+ $_response = $this->ReportSmsWithPacketId($_params);
125
+
126
+ return $_response;
127
+
128
+ }
129
+
130
+ public function send($message, $recipient, $begin)
131
+ {
132
+ if(!$this->getSmsHelper()->validateGsmNumber($recipient))
133
+ return false;
134
+
135
+ if(!strlen($message))
136
+ return false;
137
+
138
+ $method = $this->getSmsHelper()->getStoreConfig('general/method');
139
+
140
+ switch($method){
141
+ case 'single-shot':
142
+
143
+ $response = $this->_sendSingleShot($message, $recipient, $begin);
144
+ return $response;
145
+ break;
146
+
147
+ default:
148
+
149
+ $response = $this->_sendPersonal($message, $recipient, $begin);
150
+ return $response;
151
+ break;
152
+ }
153
+ return $response;
154
+ }
155
+
156
+ }
app/code/local/Numerno/Euromsg/Model/Platform/Report.php ADDED
@@ -0,0 +1,62 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Numerno - Euro.message Magento Extension
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the NUMERNO EUROMESSAGE MAGENTO EXTENSION License, which extends the Open Software
8
+ * License (OSL 3.0). The Euro.message Magento Extension License is available at this URL:
9
+ * http://numerno.com/licenses/euromsg-ce.txt The Open Software License is available at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ *
12
+ * DISCLAIMER
13
+ *
14
+ * By adding to, editing, or in any way modifying this code, Numerno is not held liable for any inconsistencies or
15
+ * abnormalities in the behaviour of this code. By adding to, editing, or in any way modifying this code, the Licensee
16
+ * terminates any agreement of support offered by Numerno, outlined in the provided Euro.message Magento Extension
17
+ * License.
18
+ * Upon discovery of modified code in the process of support, the Licensee is still held accountable for any and all
19
+ * billable time Numerno spent during the support process. Numerno does not guarantee compatibility with any other
20
+ * Magento extension. Numerno is not responsbile for any inconsistencies or abnormalities in the behaviour of this
21
+ * code if caused by other Magento extension.
22
+ * If you did not receive a copy of the license, please send an email to info@numerno.com or call +90-212-223-5093,
23
+ * so we can send you a copy immediately.
24
+ *
25
+ * @category [Numerno]
26
+ * @package [Numerno_Euromsg]
27
+ * @copyright Copyright (c) 2015 Numerno Bilisim Hiz. Tic. Ltd. Sti. (http://numerno.com/)
28
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
29
+ */
30
+
31
+ /**
32
+ * PostSms Service
33
+ *
34
+ * @category Numerno
35
+ * @package Numerno_Euromsg
36
+ * @author Numerno Bilisim Hiz. Tic. Ltd. Sti. <info@numerno.com>
37
+ */
38
+ class Numerno_Euromsg_Model_Platform_Report extends Numerno_Euromsg_Model_Platform_Abstract
39
+ {
40
+
41
+ /**
42
+ * Constructor
43
+ *
44
+ * @param string $wsdl
45
+ * @param array $options
46
+ */
47
+ public function __construct($wsdl = null, $options = null)
48
+ {
49
+ try {
50
+ $_wsUri = $this->getHelper()->getWsUri();
51
+ $_uri = Zend_Uri::factory($_wsUri . 'report.asmx?WSDL');
52
+
53
+ $wsdl = $_uri->getUri();
54
+
55
+ }catch(Exception $e){
56
+ Mage::throwException($this->getHelper()->__('Invalid euro.message web service URL: %s', $_wsUri));
57
+ }
58
+
59
+ parent::__construct($wsdl, $options);
60
+ }
61
+
62
+ }
app/code/local/Numerno/Euromsg/Model/Process.php ADDED
@@ -0,0 +1,214 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Numerno - Euro.message Magento Extension
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the NUMERNO EUROMESSAGE MAGENTO EXTENSION License, which extends the Open Software
8
+ * License (OSL 3.0). The Euro.message Magento Extension License is available at this URL:
9
+ * http://numerno.com/licenses/euromsg-ce.txt The Open Software License is available at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ *
12
+ * DISCLAIMER
13
+ *
14
+ * By adding to, editing, or in any way modifying this code, Numerno is not held liable for any inconsistencies or
15
+ * abnormalities in the behaviour of this code. By adding to, editing, or in any way modifying this code, the Licensee
16
+ * terminates any agreement of support offered by Numerno, outlined in the provided Euro.message Magento Extension
17
+ * License.
18
+ * Upon discovery of modified code in the process of support, the Licensee is still held accountable for any and all
19
+ * billable time Numerno spent during the support process. Numerno does not guarantee compatibility with any other
20
+ * Magento extension. Numerno is not responsbile for any inconsistencies or abnormalities in the behaviour of this
21
+ * code if caused by other Magento extension.
22
+ * If you did not receive a copy of the license, please send an email to info@numerno.com or call +90-212-223-5093,
23
+ * so we can send you a copy immediately.
24
+ *
25
+ * @category [Numerno]
26
+ * @package [Numerno_Euromsg]
27
+ * @copyright Copyright (c) 2015 Numerno Bilisim Hiz. Tic. Ltd. Sti. (http://numerno.com/)
28
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
29
+ */
30
+
31
+ /**
32
+ * Process
33
+ *
34
+ * @category Numerno
35
+ * @package Numerno_Euromsg
36
+ * @author Numerno Bilisim Hiz. Tic. Ltd. Sti. <info@numerno.com>
37
+ */
38
+ class Numerno_Euromsg_Model_Process extends Mage_Core_Model_Abstract
39
+ {
40
+
41
+ const POLICY_SYNC = 'sync';
42
+ const POLICY_ASYNC = 'async';
43
+
44
+ protected $_eventPrefix = 'euromsg_process';
45
+ protected $_eventObject = 'process';
46
+
47
+ /**
48
+ * Entity filters cache
49
+ * @var array $_filters
50
+ */
51
+ protected $_filters = array();
52
+
53
+ /**
54
+ * Initialize model
55
+ *
56
+ * @return void
57
+ */
58
+ protected function _construct()
59
+ {
60
+ $this->_init('euromsg/process');
61
+ }
62
+
63
+ /**
64
+ * Prepare table version for process
65
+ *
66
+ * @return void
67
+ */
68
+ protected function _prepareVersion()
69
+ {
70
+ $tableName = $this->getTableName();
71
+ $versionInc = 0;
72
+
73
+ do {
74
+ $versionInc++;
75
+ $version = date("Ymd") . str_pad($versionInc, 3, '0', STR_PAD_LEFT);
76
+ } while(!$this->_getResource()->isVersionUnique($tableName, $version));
77
+
78
+ $this->setVersion($version);
79
+ }
80
+
81
+ /*
82
+ * Check if process is incremental
83
+ *
84
+ * @return bool
85
+ */
86
+ public function isIncremental()
87
+ {
88
+ if($this->getVersion())
89
+ return true;
90
+
91
+ return !$this->_getResource()->isTableNameUnique($this->getTableName());
92
+
93
+ }
94
+
95
+ /*
96
+ * Add filter to entity collection
97
+ *
98
+ * @param string $attribute
99
+ * @param array $value
100
+ * @return Numerno_Euromsg_Model_Process
101
+ */
102
+ public function addFilter($attribute, $value)
103
+ {
104
+ $filters = array();
105
+ if($this->getFilter()) {
106
+ $filters = unserialize($this->getFilter());
107
+ }
108
+ $filters[] = array($attribute => $value);
109
+ $this->setFilter(serialize($filters));
110
+
111
+ return $this;
112
+ }
113
+
114
+ /*
115
+ * Create a filename
116
+ *
117
+ * @return string
118
+ */
119
+ public function getFilename()
120
+ {
121
+ if($this->getVersion())
122
+ return $this->getTableName() . '_' . $this->getVersion() . '_inc';
123
+ else
124
+ return $this->getTableName();
125
+
126
+ }
127
+
128
+ /*
129
+ * Export
130
+ *
131
+ * @return Numerno_Euromsg_Model_Process
132
+ */
133
+ protected function _export()
134
+ {
135
+ if(!$this->getType()) {
136
+ Mage::throwException('Export type need to be set before export process.');
137
+ }
138
+
139
+ if(!($entity = Mage::getModel('euromsg/export_entity_' . $this->getType()))){
140
+ Mage::throwException('Unknown entity type.');
141
+ }
142
+
143
+ $_date = Mage::getModel('core/date');
144
+ if($this->getScheduledAt() > $_date->date('Y-m-d H:i:s')) {
145
+ return $this;
146
+ }
147
+
148
+ try {
149
+
150
+ $entity->setFilename($this->getFilename());
151
+
152
+ if($this->getFilter()) {
153
+ $filters = unserialize(($this->getFilter()));
154
+
155
+ foreach($filters as $filter) {
156
+ $entity->filter($filter);
157
+ }
158
+ }
159
+
160
+ $this
161
+ ->setStatus('processing')
162
+ ->setStartedAt($_date->date('Y-m-d H:i:s'))
163
+ ->save();
164
+
165
+ $entity->export();
166
+
167
+ $this
168
+ ->setStatus('success')
169
+ ->setEndedAt($_date->date('Y-m-d H:i:s'))
170
+ ->save();
171
+
172
+ }catch(Exception $e){
173
+
174
+ $this
175
+ ->setStatus('error')
176
+ ->setError($e->getMessage())
177
+ ->save();
178
+
179
+ Mage::throwException($e->getMessage());
180
+ }
181
+
182
+ return $this;
183
+
184
+ }
185
+
186
+ /*
187
+ * Process export action
188
+ */
189
+ public function export($overridePolicy = false)
190
+ {
191
+ $_date = Mage::getModel('core/date');
192
+ $policy = Mage::helper('euromsg')->getStoreConfig('/dwh/policy');
193
+
194
+ if(!$this->getTableName()) {
195
+ Mage::throwException('Table name can not be null.');
196
+ }
197
+
198
+ if($this->getType() != 'product' && $this->isIncremental()) {
199
+ $this->_prepareVersion();
200
+ }
201
+
202
+ if($policy == self::POLICY_SYNC || $overridePolicy) {
203
+
204
+ return $this->_export();
205
+ } else {
206
+ $this->setStatus('pending')
207
+ ->setScheduledAt($_date->date('Y-m-d H:i:s'))
208
+ ->save();
209
+ }
210
+
211
+ return $this;
212
+
213
+ }
214
+ }
app/code/local/Numerno/Euromsg/Model/Resource/Mail/Log.php ADDED
@@ -0,0 +1,48 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Numerno - Euro.message Magento Extension
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the NUMERNO EUROMESSAGE MAGENTO EXTENSION License, which extends the Open Software
8
+ * License (OSL 3.0). The Euro.message Magento Extension License is available at this URL:
9
+ * http://numerno.com/licenses/euromsg-ce.txt The Open Software License is available at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ *
12
+ * DISCLAIMER
13
+ *
14
+ * By adding to, editing, or in any way modifying this code, Numerno is not held liable for any inconsistencies or
15
+ * abnormalities in the behaviour of this code. By adding to, editing, or in any way modifying this code, the Licensee
16
+ * terminates any agreement of support offered by Numerno, outlined in the provided Euro.message Magento Extension
17
+ * License.
18
+ * Upon discovery of modified code in the process of support, the Licensee is still held accountable for any and all
19
+ * billable time Numerno spent during the support process. Numerno does not guarantee compatibility with any other
20
+ * Magento extension. Numerno is not responsbile for any inconsistencies or abnormalities in the behaviour of this
21
+ * code if caused by other Magento extension.
22
+ * If you did not receive a copy of the license, please send an email to info@numerno.com or call +90-212-223-5093,
23
+ * so we can send you a copy immediately.
24
+ *
25
+ * @category [Numerno]
26
+ * @package [Numerno_Euromsg]
27
+ * @copyright Copyright (c) 2015 Numerno Bilisim Hiz. Tic. Ltd. Sti. (http://numerno.com/)
28
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
29
+ */
30
+
31
+ /**
32
+ * Mail Log Entity
33
+ *
34
+ * @category Numerno
35
+ * @package Numerno_Euromsg
36
+ * @author Numerno Bilisim Hiz. Tic. Ltd. Sti. <info@numerno.com>
37
+ */
38
+ class Numerno_Euromsg_Model_Resource_Mail_Log extends Mage_Core_Model_Resource_Db_Abstract
39
+ {
40
+ /**
41
+ * Initialize resource
42
+ *
43
+ */
44
+ protected function _construct()
45
+ {
46
+ $this->_init('euromsg/mail_log', 'log_id');
47
+ }
48
+ }
app/code/local/Numerno/Euromsg/Model/Resource/Mail/Log/Collection.php ADDED
@@ -0,0 +1,48 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Numerno - Euro.message Magento Extension
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the NUMERNO EUROMESSAGE MAGENTO EXTENSION License, which extends the Open Software
8
+ * License (OSL 3.0). The Euro.message Magento Extension License is available at this URL:
9
+ * http://numerno.com/licenses/euromsg-ce.txt The Open Software License is available at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ *
12
+ * DISCLAIMER
13
+ *
14
+ * By adding to, editing, or in any way modifying this code, Numerno is not held liable for any inconsistencies or
15
+ * abnormalities in the behaviour of this code. By adding to, editing, or in any way modifying this code, the Licensee
16
+ * terminates any agreement of support offered by Numerno, outlined in the provided Euro.message Magento Extension
17
+ * License.
18
+ * Upon discovery of modified code in the process of support, the Licensee is still held accountable for any and all
19
+ * billable time Numerno spent during the support process. Numerno does not guarantee compatibility with any other
20
+ * Magento extension. Numerno is not responsbile for any inconsistencies or abnormalities in the behaviour of this
21
+ * code if caused by other Magento extension.
22
+ * If you did not receive a copy of the license, please send an email to info@numerno.com or call +90-212-223-5093,
23
+ * so we can send you a copy immediately.
24
+ *
25
+ * @category [Numerno]
26
+ * @package [Numerno_Euromsg]
27
+ * @copyright Copyright (c) 2015 Numerno Bilisim Hiz. Tic. Ltd. Sti. (http://numerno.com/)
28
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
29
+ */
30
+
31
+ /**
32
+ * Mail Log Collection
33
+ *
34
+ * @category Numerno
35
+ * @package Numerno_Euromsg
36
+ * @author Numerno Bilisim Hiz. Tic. Ltd. Sti. <info@numerno.com>
37
+ */
38
+ class Numerno_Euromsg_Model_Resource_Mail_Log_Collection extends Mage_Core_Model_Resource_Db_Collection_Abstract
39
+ {
40
+ /**
41
+ * Initialize collection
42
+ *
43
+ */
44
+ public function _construct()
45
+ {
46
+ $this->_init('euromsg/mail_log');
47
+ }
48
+ }
app/code/local/Numerno/Euromsg/Model/Resource/Process.php ADDED
@@ -0,0 +1,77 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Numerno - Euro.message Magento Extension
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the NUMERNO EUROMESSAGE MAGENTO EXTENSION License, which extends the Open Software
8
+ * License (OSL 3.0). The Euro.message Magento Extension License is available at this URL:
9
+ * http://numerno.com/licenses/euromsg-ce.txt The Open Software License is available at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ *
12
+ * DISCLAIMER
13
+ *
14
+ * By adding to, editing, or in any way modifying this code, Numerno is not held liable for any inconsistencies or
15
+ * abnormalities in the behaviour of this code. By adding to, editing, or in any way modifying this code, the Licensee
16
+ * terminates any agreement of support offered by Numerno, outlined in the provided Euro.message Magento Extension
17
+ * License.
18
+ * Upon discovery of modified code in the process of support, the Licensee is still held accountable for any and all
19
+ * billable time Numerno spent during the support process. Numerno does not guarantee compatibility with any other
20
+ * Magento extension. Numerno is not responsbile for any inconsistencies or abnormalities in the behaviour of this
21
+ * code if caused by other Magento extension.
22
+ * If you did not receive a copy of the license, please send an email to info@numerno.com or call +90-212-223-5093,
23
+ * so we can send you a copy immediately.
24
+ *
25
+ * @category [Numerno]
26
+ * @package [Numerno_Euromsg]
27
+ * @copyright Copyright (c) 2015 Numerno Bilisim Hiz. Tic. Ltd. Sti. (http://numerno.com/)
28
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
29
+ */
30
+
31
+ /**
32
+ * Process Entity
33
+ *
34
+ * @category Numerno
35
+ * @package Numerno_Euromsg
36
+ * @author Numerno Bilisim Hiz. Tic. Ltd. Sti. <info@numerno.com>
37
+ */
38
+ class Numerno_Euromsg_Model_Resource_Process extends Mage_Core_Model_Resource_Db_Abstract
39
+ {
40
+ /**
41
+ * Initialize resource
42
+ *
43
+ */
44
+ protected function _construct()
45
+ {
46
+ $this->_init('euromsg/process', 'process_id');
47
+ }
48
+
49
+ public function isVersionUnique($tableName, $version)
50
+ {
51
+ $read = $this->_getReadAdapter();
52
+ $query = $read->select()
53
+ ->from(array('main_table'=>$this->getMainTable()), $this->getIdFieldName())
54
+ ->where('table_name = ?', $tableName)
55
+ ->where('version = ?', $version);
56
+
57
+ $count = count($read->fetchAll($query));
58
+
59
+ return $count ? false : true;
60
+ }
61
+
62
+ public function isTableNameUnique($tableName)
63
+ {
64
+ $read = $this->_getReadAdapter();
65
+ $query = $read->select()
66
+ ->from(array('main_table'=>$this->getMainTable()), $this->getIdFieldName())
67
+ ->where('table_name = ?', $tableName);
68
+
69
+ $count = count($read->fetchAll($query));
70
+
71
+ return $count ? false : true;
72
+ }
73
+
74
+
75
+
76
+
77
+ }
app/code/local/Numerno/Euromsg/Model/Resource/Process/Collection.php ADDED
@@ -0,0 +1,48 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Numerno - Euro.message Magento Extension
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the NUMERNO EUROMESSAGE MAGENTO EXTENSION License, which extends the Open Software
8
+ * License (OSL 3.0). The Euro.message Magento Extension License is available at this URL:
9
+ * http://numerno.com/licenses/euromsg-ce.txt The Open Software License is available at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ *
12
+ * DISCLAIMER
13
+ *
14
+ * By adding to, editing, or in any way modifying this code, Numerno is not held liable for any inconsistencies or
15
+ * abnormalities in the behaviour of this code. By adding to, editing, or in any way modifying this code, the Licensee
16
+ * terminates any agreement of support offered by Numerno, outlined in the provided Euro.message Magento Extension
17
+ * License.
18
+ * Upon discovery of modified code in the process of support, the Licensee is still held accountable for any and all
19
+ * billable time Numerno spent during the support process. Numerno does not guarantee compatibility with any other
20
+ * Magento extension. Numerno is not responsbile for any inconsistencies or abnormalities in the behaviour of this
21
+ * code if caused by other Magento extension.
22
+ * If you did not receive a copy of the license, please send an email to info@numerno.com or call +90-212-223-5093,
23
+ * so we can send you a copy immediately.
24
+ *
25
+ * @category [Numerno]
26
+ * @package [Numerno_Euromsg]
27
+ * @copyright Copyright (c) 2015 Numerno Bilisim Hiz. Tic. Ltd. Sti. (http://numerno.com/)
28
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
29
+ */
30
+
31
+ /**
32
+ * Process Collection
33
+ *
34
+ * @category Numerno
35
+ * @package Numerno_Euromsg
36
+ * @author Numerno Bilisim Hiz. Tic. Ltd. Sti. <info@numerno.com>
37
+ */
38
+ class Numerno_Euromsg_Model_Resource_Process_Collection extends Mage_Core_Model_Resource_Db_Collection_Abstract
39
+ {
40
+ /**
41
+ * Initialize collection
42
+ *
43
+ */
44
+ public function _construct()
45
+ {
46
+ $this->_init('euromsg/process');
47
+ }
48
+ }
app/code/local/Numerno/Euromsg/Model/Resource/Sms.php ADDED
@@ -0,0 +1,48 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Numerno - Euro.message Magento Extension
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the NUMERNO EUROMESSAGE MAGENTO EXTENSION License, which extends the Open Software
8
+ * License (OSL 3.0). The Euro.message Magento Extension License is available at this URL:
9
+ * http://numerno.com/licenses/euromsg-ce.txt The Open Software License is available at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ *
12
+ * DISCLAIMER
13
+ *
14
+ * By adding to, editing, or in any way modifying this code, Numerno is not held liable for any inconsistencies or
15
+ * abnormalities in the behaviour of this code. By adding to, editing, or in any way modifying this code, the Licensee
16
+ * terminates any agreement of support offered by Numerno, outlined in the provided Euro.message Magento Extension
17
+ * License.
18
+ * Upon discovery of modified code in the process of support, the Licensee is still held accountable for any and all
19
+ * billable time Numerno spent during the support process. Numerno does not guarantee compatibility with any other
20
+ * Magento extension. Numerno is not responsbile for any inconsistencies or abnormalities in the behaviour of this
21
+ * code if caused by other Magento extension.
22
+ * If you did not receive a copy of the license, please send an email to info@numerno.com or call +90-212-223-5093,
23
+ * so we can send you a copy immediately.
24
+ *
25
+ * @category [Numerno]
26
+ * @package [Numerno_Euromsg]
27
+ * @copyright Copyright (c) 2015 Numerno Bilisim Hiz. Tic. Ltd. Sti. (http://numerno.com/)
28
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
29
+ */
30
+
31
+ /**
32
+ * SMS Resource
33
+ *
34
+ * @category Numerno
35
+ * @package Numerno_Euromsg
36
+ * @author Numerno Bilisim Hiz. Tic. Ltd. Sti. <info@numerno.com>
37
+ */
38
+ class Numerno_Euromsg_Model_Resource_Sms extends Mage_Core_Model_Resource_Db_Abstract
39
+ {
40
+ /**
41
+ * Initialize resource
42
+ *
43
+ */
44
+ protected function _construct()
45
+ {
46
+ $this->_init('euromsg/sms', 'sms_id');
47
+ }
48
+ }
app/code/local/Numerno/Euromsg/Model/Resource/Sms/Collection.php ADDED
@@ -0,0 +1,48 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Numerno - Euro.message Magento Extension
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the NUMERNO EUROMESSAGE MAGENTO EXTENSION License, which extends the Open Software
8
+ * License (OSL 3.0). The Euro.message Magento Extension License is available at this URL:
9
+ * http://numerno.com/licenses/euromsg-ce.txt The Open Software License is available at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ *
12
+ * DISCLAIMER
13
+ *
14
+ * By adding to, editing, or in any way modifying this code, Numerno is not held liable for any inconsistencies or
15
+ * abnormalities in the behaviour of this code. By adding to, editing, or in any way modifying this code, the Licensee
16
+ * terminates any agreement of support offered by Numerno, outlined in the provided Euro.message Magento Extension
17
+ * License.
18
+ * Upon discovery of modified code in the process of support, the Licensee is still held accountable for any and all
19
+ * billable time Numerno spent during the support process. Numerno does not guarantee compatibility with any other
20
+ * Magento extension. Numerno is not responsbile for any inconsistencies or abnormalities in the behaviour of this
21
+ * code if caused by other Magento extension.
22
+ * If you did not receive a copy of the license, please send an email to info@numerno.com or call +90-212-223-5093,
23
+ * so we can send you a copy immediately.
24
+ *
25
+ * @category [Numerno]
26
+ * @package [Numerno_Euromsg]
27
+ * @copyright Copyright (c) 2015 Numerno Bilisim Hiz. Tic. Ltd. Sti. (http://numerno.com/)
28
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
29
+ */
30
+
31
+ /**
32
+ * SMS Collection
33
+ *
34
+ * @category Numerno
35
+ * @package Numerno_Euromsg
36
+ * @author Numerno Bilisim Hiz. Tic. Ltd. Sti. <info@numerno.com>
37
+ */
38
+ class Numerno_Euromsg_Model_Resource_Sms_Collection extends Mage_Core_Model_Resource_Db_Collection_Abstract
39
+ {
40
+ /**
41
+ * Initialize collection
42
+ *
43
+ */
44
+ public function _construct()
45
+ {
46
+ $this->_init('euromsg/sms');
47
+ }
48
+ }
app/code/local/Numerno/Euromsg/Model/Sms.php ADDED
@@ -0,0 +1,124 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Numerno - Euro.message Magento Extension
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the NUMERNO EUROMESSAGE MAGENTO EXTENSION License, which extends the Open Software
8
+ * License (OSL 3.0). The Euro.message Magento Extension License is available at this URL:
9
+ * http://numerno.com/licenses/euromsg-ce.txt The Open Software License is available at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ *
12
+ * DISCLAIMER
13
+ *
14
+ * By adding to, editing, or in any way modifying this code, Numerno is not held liable for any inconsistencies or
15
+ * abnormalities in the behaviour of this code. By adding to, editing, or in any way modifying this code, the Licensee
16
+ * terminates any agreement of support offered by Numerno, outlined in the provided Euro.message Magento Extension
17
+ * License.
18
+ * Upon discovery of modified code in the process of support, the Licensee is still held accountable for any and all
19
+ * billable time Numerno spent during the support process. Numerno does not guarantee compatibility with any other
20
+ * Magento extension. Numerno is not responsbile for any inconsistencies or abnormalities in the behaviour of this
21
+ * code if caused by other Magento extension.
22
+ * If you did not receive a copy of the license, please send an email to info@numerno.com or call +90-212-223-5093,
23
+ * so we can send you a copy immediately.
24
+ *
25
+ * @category [Numerno]
26
+ * @package [Numerno_Euromsg]
27
+ * @copyright Copyright (c) 2015 Numerno Bilisim Hiz. Tic. Ltd. Sti. (http://numerno.com/)
28
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
29
+ */
30
+
31
+ /**
32
+ * Sms
33
+ *
34
+ * @category Numerno
35
+ * @package Numerno_Euromsg
36
+ * @author Numerno Bilisim Hiz. Tic. Ltd. Sti. <info@numerno.com>
37
+ */
38
+ class Numerno_Euromsg_Model_Sms extends Mage_Core_Model_Abstract
39
+ {
40
+ const SMS_PERMIT_ATTRIBUTE_CODE = 'em_gsm_permit';
41
+ const COL_GSM_PERMIT = 'GSM_PERMIT';
42
+ const COL_GSM_NO = 'GSM_NO';
43
+
44
+ protected $_eventPrefix = 'euromsg_sms';
45
+ protected $_eventObject = 'sms';
46
+
47
+ /**
48
+ * Initialize model
49
+ *
50
+ */
51
+ protected function _construct()
52
+ {
53
+ $this->_init('euromsg/sms');
54
+ }
55
+
56
+ public function getHelper()
57
+ {
58
+ return Mage::helper('euromsg/sms');
59
+ }
60
+
61
+ public function _send()
62
+ {
63
+ try {
64
+ $client = Mage::getModel('euromsg/platform');
65
+ $client->_login();
66
+
67
+ $sms = $client->getSmsService()->send($this->getMessage(), $this->getGsmNumber(),
68
+ $this->getBeginTime());
69
+
70
+ if($sms) {
71
+ $this
72
+ ->setPacketId($sms->PacketID)
73
+ ->setResponseCode('00')
74
+ ->setType($sms->Type);
75
+ foreach($sms->DeliveryResults as $delivery) {
76
+ $this
77
+ ->setDeliveryStatus($delivery->DeliveryResult)
78
+ ->setDeliveryMessage($delivery->DeliveryDetail)
79
+ ->setDeliveryTime(date('Y-m-d H:i:s', strtotime($delivery->DeliveryTime)));
80
+ break;
81
+ }
82
+ } else {
83
+ $this->setResponseCode('99');
84
+ }
85
+
86
+ $client->_logout();
87
+
88
+ }
89
+ catch(Exception $e)
90
+ {
91
+ $this
92
+ ->setResponseCode('99')
93
+ ->setResponseMessage($e->getMessage())
94
+ ->setResponseMessageDetailed((string) $e);
95
+ }
96
+
97
+ $this->save();
98
+ }
99
+
100
+ public function send($customer, $message, $sendNow = false){
101
+
102
+ $attributeCode = $this->getHelper()->getGsmAttribute();
103
+
104
+ if($attributeCode && $customer->getId() && strlen($message)) {
105
+
106
+ $gsmNumber = $customer->getData($attributeCode);
107
+ if($this->getHelper()->validateGsmNumber($gsmNumber)) {
108
+
109
+ $this
110
+ ->setBeginTime(Mage::getModel('core/date')->date('Y-m-d H:i:s'))
111
+ ->setCustomerId($customer->getId())
112
+ ->setGsmNumber($this->getHelper()->filterGsmNumber($gsmNumber))
113
+ ->setMessage($message);
114
+
115
+ if($sendNow)
116
+ $this->_send();
117
+ else
118
+ $this
119
+ ->setDeliveryStatus('P')
120
+ ->save();
121
+ }
122
+ }
123
+ }
124
+ }
app/code/local/Numerno/Euromsg/Model/System/Config/Backend/Attributes.php ADDED
@@ -0,0 +1,57 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Numerno - Euro.message Magento Extension
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the NUMERNO EUROMESSAGE MAGENTO EXTENSION License, which extends the Open Software
8
+ * License (OSL 3.0). The Euro.message Magento Extension License is available at this URL:
9
+ * http://numerno.com/licenses/euromsg-ce.txt The Open Software License is available at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ *
12
+ * DISCLAIMER
13
+ *
14
+ * By adding to, editing, or in any way modifying this code, Numerno is not held liable for any inconsistencies or
15
+ * abnormalities in the behaviour of this code. By adding to, editing, or in any way modifying this code, the Licensee
16
+ * terminates any agreement of support offered by Numerno, outlined in the provided Euro.message Magento Extension
17
+ * License.
18
+ * Upon discovery of modified code in the process of support, the Licensee is still held accountable for any and all
19
+ * billable time Numerno spent during the support process. Numerno does not guarantee compatibility with any other
20
+ * Magento extension. Numerno is not responsbile for any inconsistencies or abnormalities in the behaviour of this
21
+ * code if caused by other Magento extension.
22
+ * If you did not receive a copy of the license, please send an email to info@numerno.com or call +90-212-223-5093,
23
+ * so we can send you a copy immediately.
24
+ *
25
+ * @category [Numerno]
26
+ * @package [Numerno_Euromsg]
27
+ * @copyright Copyright (c) 2015 Numerno Bilisim Hiz. Tic. Ltd. Sti. (http://numerno.com/)
28
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
29
+ */
30
+
31
+ /**
32
+ * Attributes Backend Model
33
+ *
34
+ * @category Numerno
35
+ * @package Numerno_Euromsg
36
+ * @author Numerno Bilisim Hiz. Tic. Ltd. Sti. <info@numerno.com>
37
+ */
38
+ class Numerno_Euromsg_Model_System_Config_Backend_Attributes
39
+ extends Mage_Adminhtml_Model_System_Config_Backend_Serialized_Array
40
+ {
41
+
42
+ /**
43
+ * Prepare data before save
44
+ */
45
+ protected function _beforeSave()
46
+ {
47
+ $value = $this->getValue();
48
+ if(is_array($value))
49
+ foreach($value as $key => $attribute) {
50
+ $value[$key]['col_name'] = trim(preg_replace('/[^A-Za-z0-9_]+/i', '_',
51
+ $attribute['col_name']), '_');
52
+ }
53
+ $this->setValue($value);
54
+
55
+ parent::_beforeSave();
56
+ }
57
+ }
app/code/local/Numerno/Euromsg/Model/System/Config/Backend/Cron.php ADDED
@@ -0,0 +1,101 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Numerno - Euro.message Magento Extension
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the NUMERNO EUROMESSAGE MAGENTO EXTENSION License, which extends the Open Software
8
+ * License (OSL 3.0). The Euro.message Magento Extension License is available at this URL:
9
+ * http://numerno.com/licenses/euromsg-ce.txt The Open Software License is available at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ *
12
+ * DISCLAIMER
13
+ *
14
+ * By adding to, editing, or in any way modifying this code, Numerno is not held liable for any inconsistencies or
15
+ * abnormalities in the behaviour of this code. By adding to, editing, or in any way modifying this code, the Licensee
16
+ * terminates any agreement of support offered by Numerno, outlined in the provided Euro.message Magento Extension
17
+ * License.
18
+ * Upon discovery of modified code in the process of support, the Licensee is still held accountable for any and all
19
+ * billable time Numerno spent during the support process. Numerno does not guarantee compatibility with any other
20
+ * Magento extension. Numerno is not responsbile for any inconsistencies or abnormalities in the behaviour of this
21
+ * code if caused by other Magento extension.
22
+ * If you did not receive a copy of the license, please send an email to info@numerno.com or call +90-212-223-5093,
23
+ * so we can send you a copy immediately.
24
+ *
25
+ * @category [Numerno]
26
+ * @package [Numerno_Euromsg]
27
+ * @copyright Copyright (c) 2015 Numerno Bilisim Hiz. Tic. Ltd. Sti. (http://numerno.com/)
28
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
29
+ */
30
+
31
+ /**
32
+ * Cron Schedule Backend Model
33
+ *
34
+ * @category Numerno
35
+ * @package Numerno_Euromsg
36
+ * @author Numerno Bilisim Hiz. Tic. Ltd. Sti. <info@numerno.com>
37
+ */
38
+ class Numerno_Euromsg_Model_System_Config_Backend_Cron extends Mage_Core_Model_Config_Data
39
+ {
40
+ /**
41
+ * Cron settings after save
42
+ *
43
+ * @return Mage_Adminhtml_Model_System_Config_Backend_Log_Cron
44
+ */
45
+ protected function _afterSave()
46
+ {
47
+ $autoSync = $this->getFieldsetDataValue('autosync');
48
+ $frequency = $this->getFieldsetDataValue('frequency');
49
+
50
+ $frequencyHourly = Numerno_Euromsg_Model_System_Config_Source_Cron_Frequency::CRON_MONTHLY;
51
+
52
+ if($autoSync) {
53
+ if($frequency == $frequencyHourly) {
54
+
55
+ $hour = $this->getFieldsetDataValue('hour');
56
+
57
+ if($hour && is_int(24/$hour) ){
58
+ $cronExprString = "0 */$hour * * *";
59
+ }
60
+ } else {
61
+
62
+ $time = $this->getFieldsetDataValue('time');
63
+ $frequencyWeekly = Numerno_Euromsg_Model_System_Config_Source_Cron_Frequency::CRON_WEEKLY;
64
+ $frequencyMonthly = Numerno_Euromsg_Model_System_Config_Source_Cron_Frequency::CRON_MONTHLY;
65
+
66
+ $cronExprArray = array(
67
+ intval($time[1]), # Minute
68
+ intval($time[0]), # Hour
69
+ ($frequency == $frequencyMonthly) ? '1' : '*', # Day of the Month
70
+ '*', # Month of the Year
71
+ ($frequency == $frequencyWeekly) ? '1' : '*', # Day of the Week
72
+ );
73
+ $cronExprString = join(' ', $cronExprArray);
74
+ }
75
+ }
76
+
77
+ $fieldConfig = $this->getData('field_config');
78
+ $jobName = $fieldConfig->job;
79
+ $cronSchedule = "crontab/jobs/$jobName/schedule/cron_expr";
80
+ $cronModel = "crontab/jobs/$jobName/run/model";
81
+
82
+ try {
83
+ Mage::getModel('core/config_data')
84
+ ->load($cronSchedule, 'path')
85
+ ->setValue($cronExprString)
86
+ ->setPath($cronSchedule)
87
+ ->save();
88
+
89
+ Mage::getModel('core/config_data')
90
+ ->load($cronModel, 'path')
91
+ ->setValue((string) Mage::getConfig()->getNode($cronModel))
92
+ ->setPath($cronModel)
93
+ ->save();
94
+ }
95
+ catch (Exception $e) {
96
+ Mage::throwException(Mage::helper('euromsg')->__('Unable to save the cron expression.'));
97
+ }
98
+
99
+ }
100
+ }
101
+
app/code/local/Numerno/Euromsg/Model/System/Config/Source/Cron/Frequency.php ADDED
@@ -0,0 +1,65 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Numerno - Euro.message Magento Extension
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the NUMERNO EUROMESSAGE MAGENTO EXTENSION License, which extends the Open Software
8
+ * License (OSL 3.0). The Euro.message Magento Extension License is available at this URL:
9
+ * http://numerno.com/licenses/euromsg-ce.txt The Open Software License is available at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ *
12
+ * DISCLAIMER
13
+ *
14
+ * By adding to, editing, or in any way modifying this code, Numerno is not held liable for any inconsistencies or
15
+ * abnormalities in the behaviour of this code. By adding to, editing, or in any way modifying this code, the Licensee
16
+ * terminates any agreement of support offered by Numerno, outlined in the provided Euro.message Magento Extension
17
+ * License.
18
+ * Upon discovery of modified code in the process of support, the Licensee is still held accountable for any and all
19
+ * billable time Numerno spent during the support process. Numerno does not guarantee compatibility with any other
20
+ * Magento extension. Numerno is not responsbile for any inconsistencies or abnormalities in the behaviour of this
21
+ * code if caused by other Magento extension.
22
+ * If you did not receive a copy of the license, please send an email to info@numerno.com or call +90-212-223-5093,
23
+ * so we can send you a copy immediately.
24
+ *
25
+ * @category [Numerno]
26
+ * @package [Numerno_Euromsg]
27
+ * @copyright Copyright (c) 2015 Numerno Bilisim Hiz. Tic. Ltd. Sti. (http://numerno.com/)
28
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
29
+ */
30
+
31
+ /**
32
+ * Cron Frequency
33
+ *
34
+ * @category Numerno
35
+ * @package Numerno_Euromsg
36
+ * @author Numerno Bilisim Hiz. Tic. Ltd. Sti. <info@numerno.com>
37
+ */
38
+ class Numerno_Euromsg_Model_System_Config_Source_Cron_Frequency
39
+ extends Mage_Adminhtml_Model_System_Config_Source_Cron_Frequency
40
+ {
41
+ /**
42
+ * @var string
43
+ */
44
+ const CRON_HOURLY = 'H';
45
+
46
+ /**
47
+ * Retrieve Cron Frequency Option array
48
+ *
49
+ * @return array
50
+ */
51
+ public function toOptionArray()
52
+ {
53
+ $_options = parent::toOptionArray();
54
+ array_unshift(
55
+ $_options,
56
+ array(
57
+ 'label' => Mage::helper('euromsg')->__('Hourly'),
58
+ 'value' => self::CRON_HOURLY
59
+ )
60
+ );
61
+ self::$_options = $_options;
62
+
63
+ return $_options;
64
+ }
65
+ }
app/code/local/Numerno/Euromsg/Model/System/Config/Source/Cron/Hours.php ADDED
@@ -0,0 +1,65 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Numerno - Euro.message Magento Extension
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the NUMERNO EUROMESSAGE MAGENTO EXTENSION License, which extends the Open Software
8
+ * License (OSL 3.0). The Euro.message Magento Extension License is available at this URL:
9
+ * http://numerno.com/licenses/euromsg-ce.txt The Open Software License is available at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ *
12
+ * DISCLAIMER
13
+ *
14
+ * By adding to, editing, or in any way modifying this code, Numerno is not held liable for any inconsistencies or
15
+ * abnormalities in the behaviour of this code. By adding to, editing, or in any way modifying this code, the Licensee
16
+ * terminates any agreement of support offered by Numerno, outlined in the provided Euro.message Magento Extension
17
+ * License.
18
+ * Upon discovery of modified code in the process of support, the Licensee is still held accountable for any and all
19
+ * billable time Numerno spent during the support process. Numerno does not guarantee compatibility with any other
20
+ * Magento extension. Numerno is not responsbile for any inconsistencies or abnormalities in the behaviour of this
21
+ * code if caused by other Magento extension.
22
+ * If you did not receive a copy of the license, please send an email to info@numerno.com or call +90-212-223-5093,
23
+ * so we can send you a copy immediately.
24
+ *
25
+ * @category [Numerno]
26
+ * @package [Numerno_Euromsg]
27
+ * @copyright Copyright (c) 2015 Numerno Bilisim Hiz. Tic. Ltd. Sti. (http://numerno.com/)
28
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
29
+ */
30
+
31
+ /**
32
+ * Cron Frequency Hours
33
+ *
34
+ * @category Numerno
35
+ * @package Numerno_Euromsg
36
+ * @author Numerno Bilisim Hiz. Tic. Ltd. Sti. <info@numerno.com>
37
+ */
38
+ class Numerno_Euromsg_Model_System_Config_Source_Cron_Hours
39
+ {
40
+ /**
41
+ * Retrieve Cron Frequency Hours Option array
42
+ *
43
+ * @return array
44
+ */
45
+ public function toOptionArray()
46
+ {
47
+ $options = array();
48
+ for($i = 1; $i <= 12; $i ++) {
49
+ if (24 % $i == 0) {
50
+ if($i == 1)
51
+ $options[] = array(
52
+ 'value' => $i,
53
+ 'label' => Mage::helper('euromsg')->__('Every hour')
54
+ );
55
+ else
56
+ $options[] = array(
57
+ 'value' => $i,
58
+ 'label' => Mage::helper('euromsg')->__('Every %s hours', $i)
59
+ );
60
+ }
61
+ }
62
+
63
+ return $options;
64
+ }
65
+ }
app/code/local/Numerno/Euromsg/Model/System/Config/Source/Customer/Attributes.php ADDED
@@ -0,0 +1,58 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Numerno - Euro.message Magento Extension
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the NUMERNO EUROMESSAGE MAGENTO EXTENSION License, which extends the Open Software
8
+ * License (OSL 3.0). The Euro.message Magento Extension License is available at this URL:
9
+ * http://numerno.com/licenses/euromsg-ce.txt The Open Software License is available at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ *
12
+ * DISCLAIMER
13
+ *
14
+ * By adding to, editing, or in any way modifying this code, Numerno is not held liable for any inconsistencies or
15
+ * abnormalities in the behaviour of this code. By adding to, editing, or in any way modifying this code, the Licensee
16
+ * terminates any agreement of support offered by Numerno, outlined in the provided Euro.message Magento Extension
17
+ * License.
18
+ * Upon discovery of modified code in the process of support, the Licensee is still held accountable for any and all
19
+ * billable time Numerno spent during the support process. Numerno does not guarantee compatibility with any other
20
+ * Magento extension. Numerno is not responsbile for any inconsistencies or abnormalities in the behaviour of this
21
+ * code if caused by other Magento extension.
22
+ * If you did not receive a copy of the license, please send an email to info@numerno.com or call +90-212-223-5093,
23
+ * so we can send you a copy immediately.
24
+ *
25
+ * @category [Numerno]
26
+ * @package [Numerno_Euromsg]
27
+ * @copyright Copyright (c) 2015 Numerno Bilisim Hiz. Tic. Ltd. Sti. (http://numerno.com/)
28
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
29
+ */
30
+
31
+ /**
32
+ * Customer Attributes Option
33
+ *
34
+ * @category Numerno
35
+ * @package Numerno_Euromsg
36
+ * @author Numerno Bilisim Hiz. Tic. Ltd. Sti. <info@numerno.com>
37
+ */
38
+ class Numerno_Euromsg_Model_System_Config_Source_Customer_Attributes
39
+ {
40
+ /**
41
+ * Retrieve Customer Attributes to Option array
42
+ *
43
+ * @return array
44
+ */
45
+ public function toOptionArray()
46
+ {
47
+ $attributes = Mage::getModel('customer/entity_attribute_collection')
48
+ ->addFieldToFilter('is_system', false)
49
+ ->addVisibleFilter();
50
+ $result = array();
51
+ foreach ($attributes as $attribute) {
52
+ if (($label = $attribute->getFrontendLabel()))
53
+ $result[$attribute->getAttributeCode()] = $label;
54
+ }
55
+ return $result;
56
+ }
57
+
58
+ }
app/code/local/Numerno/Euromsg/Model/System/Config/Source/Customer/DataSource.php ADDED
@@ -0,0 +1,59 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Numerno - Euro.message Magento Extension
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the NUMERNO EUROMESSAGE MAGENTO EXTENSION License, which extends the Open Software
8
+ * License (OSL 3.0). The Euro.message Magento Extension License is available at this URL:
9
+ * http://numerno.com/licenses/euromsg-ce.txt The Open Software License is available at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ *
12
+ * DISCLAIMER
13
+ *
14
+ * By adding to, editing, or in any way modifying this code, Numerno is not held liable for any inconsistencies or
15
+ * abnormalities in the behaviour of this code. By adding to, editing, or in any way modifying this code, the Licensee
16
+ * terminates any agreement of support offered by Numerno, outlined in the provided Euro.message Magento Extension
17
+ * License.
18
+ * Upon discovery of modified code in the process of support, the Licensee is still held accountable for any and all
19
+ * billable time Numerno spent during the support process. Numerno does not guarantee compatibility with any other
20
+ * Magento extension. Numerno is not responsbile for any inconsistencies or abnormalities in the behaviour of this
21
+ * code if caused by other Magento extension.
22
+ * If you did not receive a copy of the license, please send an email to info@numerno.com or call +90-212-223-5093,
23
+ * so we can send you a copy immediately.
24
+ *
25
+ * @category [Numerno]
26
+ * @package [Numerno_Euromsg]
27
+ * @copyright Copyright (c) 2015 Numerno Bilisim Hiz. Tic. Ltd. Sti. (http://numerno.com/)
28
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
29
+ */
30
+
31
+ /**
32
+ * Customer Data Source
33
+ *
34
+ * @category Numerno
35
+ * @package Numerno_Euromsg
36
+ * @author Numerno Bilisim Hiz. Tic. Ltd. Sti. <info@numerno.com>
37
+ */
38
+ class Numerno_Euromsg_Model_System_Config_Source_Customer_DataSource
39
+ {
40
+ /**
41
+ * Retrieve Customer Data Source To Export Option array
42
+ *
43
+ * @return array
44
+ */
45
+ public function toOptionArray()
46
+ {
47
+ return array(
48
+ array(
49
+ 'value' => 'newsletter_subscribers',
50
+ 'label' => Mage::helper('euromsg')->__('Newsletter Subscribers')
51
+ ),
52
+ array(
53
+ 'value' => 'newsletter_subscribers_customers',
54
+ 'label' => Mage::helper('euromsg')->__('Newsletter Subscribers - Customers Only')
55
+ )
56
+ );
57
+ }
58
+
59
+ }
app/code/local/Numerno/Euromsg/Model/System/Config/Source/Dwh/LangId.php ADDED
@@ -0,0 +1,66 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Numerno - Euro.message Magento Extension
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the NUMERNO EUROMESSAGE MAGENTO EXTENSION License, which extends the Open Software
8
+ * License (OSL 3.0). The Euro.message Magento Extension License is available at this URL:
9
+ * http://numerno.com/licenses/euromsg-ce.txt The Open Software License is available at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ *
12
+ * DISCLAIMER
13
+ *
14
+ * By adding to, editing, or in any way modifying this code, Numerno is not held liable for any inconsistencies or
15
+ * abnormalities in the behaviour of this code. By adding to, editing, or in any way modifying this code, the Licensee
16
+ * terminates any agreement of support offered by Numerno, outlined in the provided Euro.message Magento Extension
17
+ * License.
18
+ * Upon discovery of modified code in the process of support, the Licensee is still held accountable for any and all
19
+ * billable time Numerno spent during the support process. Numerno does not guarantee compatibility with any other
20
+ * Magento extension. Numerno is not responsbile for any inconsistencies or abnormalities in the behaviour of this
21
+ * code if caused by other Magento extension.
22
+ * If you did not receive a copy of the license, please send an email to info@numerno.com or call +90-212-223-5093,
23
+ * so we can send you a copy immediately.
24
+ *
25
+ * @category [Numerno]
26
+ * @package [Numerno_Euromsg]
27
+ * @copyright Copyright (c) 2015 Numerno Bilisim Hiz. Tic. Ltd. Sti. (http://numerno.com/)
28
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
29
+ */
30
+
31
+ /**
32
+ * Data Warehouse Language ID
33
+ *
34
+ * @category Numerno
35
+ * @package Numerno_Euromsg
36
+ * @author Numerno Bilisim Hiz. Tic. Ltd. Sti. <info@numerno.com>
37
+ */
38
+ class Numerno_Euromsg_Model_System_Config_Source_Dwh_LangId extends Varien_Object
39
+ {
40
+ /**
41
+ * Retrieve euro.message Data Warehouse Language ID Option array
42
+ *
43
+ * @return array
44
+ */
45
+ public function toOptionArray()
46
+ {
47
+ return array(
48
+ array(
49
+ 'value' => 'TR',
50
+ 'label' => Mage::helper('euromsg')->__('Turkish')
51
+ ),
52
+ array(
53
+ 'value' => 'EN',
54
+ 'label' => Mage::helper('euromsg')->__('English')
55
+ ),
56
+ array(
57
+ 'value' => 'DE',
58
+ 'label' => Mage::helper('euromsg')->__('German')
59
+ ),
60
+ array(
61
+ 'value' => 'AR',
62
+ 'label' => Mage::helper('euromsg')->__('Arabic')
63
+ )
64
+ );
65
+ }
66
+ }
app/code/local/Numerno/Euromsg/Model/System/Config/Source/Dwh/Policy.php ADDED
@@ -0,0 +1,58 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Numerno - Euro.message Magento Extension
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the NUMERNO EUROMESSAGE MAGENTO EXTENSION License, which extends the Open Software
8
+ * License (OSL 3.0). The Euro.message Magento Extension License is available at this URL:
9
+ * http://numerno.com/licenses/euromsg-ce.txt The Open Software License is available at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ *
12
+ * DISCLAIMER
13
+ *
14
+ * By adding to, editing, or in any way modifying this code, Numerno is not held liable for any inconsistencies or
15
+ * abnormalities in the behaviour of this code. By adding to, editing, or in any way modifying this code, the Licensee
16
+ * terminates any agreement of support offered by Numerno, outlined in the provided Euro.message Magento Extension
17
+ * License.
18
+ * Upon discovery of modified code in the process of support, the Licensee is still held accountable for any and all
19
+ * billable time Numerno spent during the support process. Numerno does not guarantee compatibility with any other
20
+ * Magento extension. Numerno is not responsbile for any inconsistencies or abnormalities in the behaviour of this
21
+ * code if caused by other Magento extension.
22
+ * If you did not receive a copy of the license, please send an email to info@numerno.com or call +90-212-223-5093,
23
+ * so we can send you a copy immediately.
24
+ *
25
+ * @category [Numerno]
26
+ * @package [Numerno_Euromsg]
27
+ * @copyright Copyright (c) 2015 Numerno Bilisim Hiz. Tic. Ltd. Sti. (http://numerno.com/)
28
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
29
+ */
30
+
31
+ /**
32
+ * Data Warehouse Connection Policy
33
+ *
34
+ * @category Numerno
35
+ * @package Numerno_Euromsg
36
+ * @author Numerno Bilisim Hiz. Tic. Ltd. Sti. <info@numerno.com>
37
+ */
38
+ class Numerno_Euromsg_Model_System_Config_Source_Dwh_Policy extends Varien_Object
39
+ {
40
+ /**
41
+ * Retrieve euro.message Data Warehouse Connection Policy Option array
42
+ *
43
+ * @return array
44
+ */
45
+ public function toOptionArray()
46
+ {
47
+ return array(
48
+ array(
49
+ 'value' => Numerno_Euromsg_Model_Process::POLICY_SYNC,
50
+ 'label' => Mage::helper('euromsg')->__('Sync')
51
+ ),
52
+ array(
53
+ 'value' => Numerno_Euromsg_Model_Process::POLICY_ASYNC,
54
+ 'label' => Mage::helper('euromsg')->__('Async')
55
+ )
56
+ );
57
+ }
58
+ }
app/code/local/Numerno/Euromsg/Model/System/Config/Source/Dwh/Report.php ADDED
@@ -0,0 +1,58 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Numerno - Euro.message Magento Extension
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the NUMERNO EUROMESSAGE MAGENTO EXTENSION License, which extends the Open Software
8
+ * License (OSL 3.0). The Euro.message Magento Extension License is available at this URL:
9
+ * http://numerno.com/licenses/euromsg-ce.txt The Open Software License is available at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ *
12
+ * DISCLAIMER
13
+ *
14
+ * By adding to, editing, or in any way modifying this code, Numerno is not held liable for any inconsistencies or
15
+ * abnormalities in the behaviour of this code. By adding to, editing, or in any way modifying this code, the Licensee
16
+ * terminates any agreement of support offered by Numerno, outlined in the provided Euro.message Magento Extension
17
+ * License.
18
+ * Upon discovery of modified code in the process of support, the Licensee is still held accountable for any and all
19
+ * billable time Numerno spent during the support process. Numerno does not guarantee compatibility with any other
20
+ * Magento extension. Numerno is not responsbile for any inconsistencies or abnormalities in the behaviour of this
21
+ * code if caused by other Magento extension.
22
+ * If you did not receive a copy of the license, please send an email to info@numerno.com or call +90-212-223-5093,
23
+ * so we can send you a copy immediately.
24
+ *
25
+ * @category [Numerno]
26
+ * @package [Numerno_Euromsg]
27
+ * @copyright Copyright (c) 2015 Numerno Bilisim Hiz. Tic. Ltd. Sti. (http://numerno.com/)
28
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
29
+ */
30
+
31
+ /**
32
+ * Data Warehouse Reporting Destination
33
+ *
34
+ * @category Numerno
35
+ * @package Numerno_Euromsg
36
+ * @author Numerno Bilisim Hiz. Tic. Ltd. Sti. <info@numerno.com>
37
+ */
38
+ class Numerno_Euromsg_Model_System_Config_Source_Dwh_Report extends Varien_Object
39
+ {
40
+ /**
41
+ * Retrieve euro.message Data Warehouse Reporting Destination Option array
42
+ *
43
+ * @return array
44
+ */
45
+ public function toOptionArray()
46
+ {
47
+ return array(
48
+ array(
49
+ 'value' => 'sftp',
50
+ 'label' => Mage::helper('euromsg')->__('SFTP Account')
51
+ ),
52
+ array(
53
+ 'value' => 'local',
54
+ 'label' => Mage::helper('euromsg')->__('Local Directory')
55
+ )
56
+ );
57
+ }
58
+ }
app/code/local/Numerno/Euromsg/Model/System/Config/Source/Platform.php ADDED
@@ -0,0 +1,70 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Numerno - Euro.message Magento Extension
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the NUMERNO EUROMESSAGE MAGENTO EXTENSION License, which extends the Open Software
8
+ * License (OSL 3.0). The Euro.message Magento Extension License is available at this URL:
9
+ * http://numerno.com/licenses/euromsg-ce.txt The Open Software License is available at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ *
12
+ * DISCLAIMER
13
+ *
14
+ * By adding to, editing, or in any way modifying this code, Numerno is not held liable for any inconsistencies or
15
+ * abnormalities in the behaviour of this code. By adding to, editing, or in any way modifying this code, the Licensee
16
+ * terminates any agreement of support offered by Numerno, outlined in the provided Euro.message Magento Extension
17
+ * License.
18
+ * Upon discovery of modified code in the process of support, the Licensee is still held accountable for any and all
19
+ * billable time Numerno spent during the support process. Numerno does not guarantee compatibility with any other
20
+ * Magento extension. Numerno is not responsbile for any inconsistencies or abnormalities in the behaviour of this
21
+ * code if caused by other Magento extension.
22
+ * If you did not receive a copy of the license, please send an email to info@numerno.com or call +90-212-223-5093,
23
+ * so we can send you a copy immediately.
24
+ *
25
+ * @category [Numerno]
26
+ * @package [Numerno_Euromsg]
27
+ * @copyright Copyright (c) 2015 Numerno Bilisim Hiz. Tic. Ltd. Sti. (http://numerno.com/)
28
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
29
+ */
30
+
31
+ /**
32
+ * Euro.message Platforms
33
+ *
34
+ * @category Numerno
35
+ * @package Numerno_Euromsg
36
+ * @author Numerno Bilisim Hiz. Tic. Ltd. Sti. <info@numerno.com>
37
+ */
38
+ class Numerno_Euromsg_Model_System_Config_Source_Platform
39
+ {
40
+ /**
41
+ * Retrieve euro.message Platform Type Option array
42
+ *
43
+ * @return array
44
+ */
45
+ public function toOptionArray()
46
+ {
47
+ return array(
48
+ array(
49
+ 'value' => 'http://ws.euromsg.com/ecomm/',
50
+ 'label' => Mage::helper('euromsg')->__('E-Commerce')
51
+ ),
52
+ array(
53
+ 'value' => 'http://ws.euromsg.com/max/',
54
+ 'label' => Mage::helper('euromsg')->__('MAX')
55
+ ),
56
+ array(
57
+ 'value' => 'http://ws.euromsg.com/live/',
58
+ 'label' => Mage::helper('euromsg')->__('System A')
59
+ ),
60
+ array(
61
+ 'value' => 'http://ws.euromsg.com/liveb/',
62
+ 'label' => Mage::helper('euromsg')->__('System B')
63
+ ),
64
+ array(
65
+ 'value' => 'http://test.euromsg.com/emws/',
66
+ 'label' => Mage::helper('euromsg')->__('Test')
67
+ )
68
+ );
69
+ }
70
+ }
app/code/local/Numerno/Euromsg/Model/System/Config/Source/Sms/Method.php ADDED
@@ -0,0 +1,58 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Numerno - Euro.message Magento Extension
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the NUMERNO EUROMESSAGE MAGENTO EXTENSION License, which extends the Open Software
8
+ * License (OSL 3.0). The Euro.message Magento Extension License is available at this URL:
9
+ * http://numerno.com/licenses/euromsg-ce.txt The Open Software License is available at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ *
12
+ * DISCLAIMER
13
+ *
14
+ * By adding to, editing, or in any way modifying this code, Numerno is not held liable for any inconsistencies or
15
+ * abnormalities in the behaviour of this code. By adding to, editing, or in any way modifying this code, the Licensee
16
+ * terminates any agreement of support offered by Numerno, outlined in the provided Euro.message Magento Extension
17
+ * License.
18
+ * Upon discovery of modified code in the process of support, the Licensee is still held accountable for any and all
19
+ * billable time Numerno spent during the support process. Numerno does not guarantee compatibility with any other
20
+ * Magento extension. Numerno is not responsbile for any inconsistencies or abnormalities in the behaviour of this
21
+ * code if caused by other Magento extension.
22
+ * If you did not receive a copy of the license, please send an email to info@numerno.com or call +90-212-223-5093,
23
+ * so we can send you a copy immediately.
24
+ *
25
+ * @category [Numerno]
26
+ * @package [Numerno_Euromsg]
27
+ * @copyright Copyright (c) 2015 Numerno Bilisim Hiz. Tic. Ltd. Sti. (http://numerno.com/)
28
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
29
+ */
30
+
31
+ /**
32
+ * SMS Method
33
+ *
34
+ * @category Numerno
35
+ * @package Numerno_Euromsg
36
+ * @author Numerno Bilisim Hiz. Tic. Ltd. Sti. <info@numerno.com>
37
+ */
38
+ class Numerno_Euromsg_Model_System_Config_Source_Sms_Method extends Varien_Object
39
+ {
40
+ /**
41
+ * Retrieve euro.message SMS Sending Methods Option array
42
+ *
43
+ * @return array
44
+ */
45
+ public function toOptionArray()
46
+ {
47
+ return array(
48
+ array(
49
+ 'value' => 'standart',
50
+ 'label' => Mage::helper('euromsg')->__('Standard')
51
+ ),
52
+ array(
53
+ 'value' => 'single-shot',
54
+ 'label' => Mage::helper('euromsg')->__('Single-Shot (OTP)')
55
+ )
56
+ );
57
+ }
58
+ }
app/code/local/Numerno/Euromsg/Model/System/Config/Source/Sms/Permit.php ADDED
@@ -0,0 +1,53 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Numerno - Euro.message Magento Extension
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the NUMERNO EUROMESSAGE MAGENTO EXTENSION License, which extends the Open Software
8
+ * License (OSL 3.0). The Euro.message Magento Extension License is available at this URL:
9
+ * http://numerno.com/licenses/euromsg-ce.txt The Open Software License is available at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ *
12
+ * DISCLAIMER
13
+ *
14
+ * By adding to, editing, or in any way modifying this code, Numerno is not held liable for any inconsistencies or
15
+ * abnormalities in the behaviour of this code. By adding to, editing, or in any way modifying this code, the Licensee
16
+ * terminates any agreement of support offered by Numerno, outlined in the provided Euro.message Magento Extension
17
+ * License.
18
+ * Upon discovery of modified code in the process of support, the Licensee is still held accountable for any and all
19
+ * billable time Numerno spent during the support process. Numerno does not guarantee compatibility with any other
20
+ * Magento extension. Numerno is not responsbile for any inconsistencies or abnormalities in the behaviour of this
21
+ * code if caused by other Magento extension.
22
+ * If you did not receive a copy of the license, please send an email to info@numerno.com or call +90-212-223-5093,
23
+ * so we can send you a copy immediately.
24
+ *
25
+ * @category [Numerno]
26
+ * @package [Numerno_Euromsg]
27
+ * @copyright Copyright (c) 2015 Numerno Bilisim Hiz. Tic. Ltd. Sti. (http://numerno.com/)
28
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
29
+ */
30
+
31
+ /**
32
+ * SMS Permit
33
+ *
34
+ * @category Numerno
35
+ * @package Numerno_Euromsg
36
+ * @author Numerno Bilisim Hiz. Tic. Ltd. Sti. <info@numerno.com>
37
+ */
38
+ class Numerno_Euromsg_Model_System_Config_Source_Sms_Permit extends Varien_Object
39
+ {
40
+ /**
41
+ * Retrieve euro.message SMS Permit array
42
+ *
43
+ * @return array
44
+ */
45
+ public function toArray()
46
+ {
47
+ return array(
48
+ 1 => Mage::helper('euromsg')->__('Yes'),
49
+ 0 => Mage::helper('euromsg')->__('No'),
50
+ null=> Mage::helper('euromsg')->__('Not Active')
51
+ );
52
+ }
53
+ }
app/code/local/Numerno/Euromsg/controllers/Adminhtml/EuromsgController.php ADDED
@@ -0,0 +1,152 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Numerno - Euro.message Magento Extension
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the NUMERNO EUROMESSAGE MAGENTO EXTENSION License, which extends the Open Software
8
+ * License (OSL 3.0). The Euro.message Magento Extension License is available at this URL:
9
+ * http://numerno.com/licenses/euromsg-ce.txt The Open Software License is available at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ *
12
+ * DISCLAIMER
13
+ *
14
+ * By adding to, editing, or in any way modifying this code, Numerno is not held liable for any inconsistencies or
15
+ * abnormalities in the behaviour of this code. By adding to, editing, or in any way modifying this code, the Licensee
16
+ * terminates any agreement of support offered by Numerno, outlined in the provided Euro.message Magento Extension
17
+ * License.
18
+ * Upon discovery of modified code in the process of support, the Licensee is still held accountable for any and all
19
+ * billable time Numerno spent during the support process. Numerno does not guarantee compatibility with any other
20
+ * Magento extension. Numerno is not responsbile for any inconsistencies or abnormalities in the behaviour of this
21
+ * code if caused by other Magento extension.
22
+ * If you did not receive a copy of the license, please send an email to info@numerno.com or call +90-212-223-5093,
23
+ * so we can send you a copy immediately.
24
+ *
25
+ * @category [Numerno]
26
+ * @package [Numerno_Euromsg]
27
+ * @copyright Copyright (c) 2015 Numerno Bilisim Hiz. Tic. Ltd. Sti. (http://numerno.com/)
28
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
29
+ */
30
+
31
+ /**
32
+ * Euromsg Controller
33
+ *
34
+ * @category Numerno
35
+ * @package Numerno_Euromsg
36
+ * @author Numerno Bilisim Hiz. Tic. Ltd. Sti. <info@numerno.com>
37
+ */
38
+ class Numerno_Euromsg_Adminhtml_EuromsgController extends Mage_Adminhtml_Controller_Action
39
+ {
40
+ public function syncNowAction()
41
+ {
42
+ $session = Mage::getSingleton('adminhtml/session');
43
+ $sync = $this->getRequest()->getPost('sync');
44
+
45
+ switch($sync) {
46
+ case 'member':
47
+ $tableName = Mage::getStoreConfig('euromsg_customer/general/filename');
48
+
49
+ $validatorTableName = new Zend_Validate_Regex(array('pattern' => '/^[A-Za-z][A-Za-z_0-9]{1,254}$/'));
50
+ if (!$validatorTableName->isValid($tableName)) {
51
+ $session->addError(
52
+ Mage::helper('euromsg')->__('Default data warehouse table name is invalid. Please use only '
53
+ . 'letters (a-z), numbers (0-9) or underscore(_) in this field, first character should be a'
54
+ . ' letter.')
55
+ );
56
+ }
57
+ $process = Mage::getModel('euromsg/process')
58
+ ->setTableName($tableName)
59
+ ->setType('member');
60
+ try {
61
+ //export process
62
+ $process->export();
63
+
64
+ $session->addSuccess(
65
+ Mage::helper('euromsg')->__('All member data successfully exported to euro.message platform.')
66
+ );
67
+ }catch(Exception $e) {
68
+ $session->addError(
69
+ $e->getMessage()
70
+ );
71
+ }
72
+ break;
73
+ case 'product':
74
+ $tableName = Mage::getStoreConfig('euromsg_catalog/general/filename');
75
+ $validatorTableName = new Zend_Validate_Regex(array('pattern' => '/^[A-Za-z][A-Za-z_0-9]{1,254}$/'));
76
+ if (!$validatorTableName->isValid($tableName)) {
77
+ $session->addError(
78
+ Mage::helper('euromsg')->__('Default data warehouse table name is invalid. Please use only '
79
+ . 'letters (a-z), numbers (0-9) or underscore(_) in this field, first character should be a'
80
+ . ' letter.')
81
+ );
82
+ }
83
+ $process = Mage::getModel('euromsg/process')
84
+ ->setTableName($tableName)
85
+ ->setType('product');
86
+ try {
87
+ //export process
88
+ $process->export();
89
+
90
+ $session->addSuccess(
91
+ Mage::helper('euromsg')->__('All product data successfully exported to euro.message platform.')
92
+ );
93
+ }catch(Exception $e) {
94
+ $session->addError(
95
+ $e->getMessage()
96
+ );
97
+ }
98
+ break;
99
+ default:
100
+ $session->addError(
101
+ Mage::helper('euromsg')->__('Cannot process the request.')
102
+ );
103
+ break;
104
+ }
105
+ }
106
+
107
+ public function exportAction()
108
+ {
109
+ $session = Mage::getSingleton('adminhtml/session');
110
+ $params = $this->getRequest()->getParams();
111
+
112
+ //validate dwh table name
113
+ if (isset($params['dwhname'])) {
114
+ $validatorTableName = new Zend_Validate_Regex(array('pattern' => '/^[A-Za-z][A-Za-z_0-9]{1,254}$/'));
115
+ if (!$validatorTableName->isValid($params['dwhname'])) {
116
+ $session->addError(
117
+ Mage::helper('euromsg')->__('Data warehouse table name is invalid. Please use only letters (a-z), '
118
+ . 'numbers (0-9) or underscore(_) in this field, first character should be a letter.')
119
+ );
120
+ return;
121
+ }
122
+ }
123
+
124
+ $process = Mage::getModel('euromsg/process')
125
+ ->setTableName($params['dwhname'])
126
+ ->setType('member');
127
+
128
+ if(isset($params['internal_customer'])) {
129
+ $process->addFilter('customer_id', explode(',', $params['internal_customer']));
130
+ }
131
+
132
+ if(isset($params['internal_subscriber'])) {
133
+ $process->addFilter('subscriber_id', explode(',', $params['internal_subscriber']));
134
+ }
135
+
136
+ try {
137
+ //export process
138
+ $process->export();
139
+ $session->addSuccess(
140
+ Mage::helper('euromsg')->__('%s table successfully exported to euro.message platform.',
141
+ $params['dwhname'])
142
+ );
143
+ }catch(Exception $e) {
144
+ $session->addError(
145
+ $e->getMessage()
146
+ );
147
+ }
148
+
149
+
150
+ }
151
+
152
+ }
app/code/local/Numerno/Euromsg/controllers/Adminhtml/NewsletterController.php ADDED
@@ -0,0 +1,49 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Numerno - Euro.message Magento Extension
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the NUMERNO EUROMESSAGE MAGENTO EXTENSION License, which extends the Open Software
8
+ * License (OSL 3.0). The Euro.message Magento Extension License is available at this URL:
9
+ * http://numerno.com/licenses/euromsg-ce.txt The Open Software License is available at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ *
12
+ * DISCLAIMER
13
+ *
14
+ * By adding to, editing, or in any way modifying this code, Numerno is not held liable for any inconsistencies or
15
+ * abnormalities in the behaviour of this code. By adding to, editing, or in any way modifying this code, the Licensee
16
+ * terminates any agreement of support offered by Numerno, outlined in the provided Euro.message Magento Extension
17
+ * License.
18
+ * Upon discovery of modified code in the process of support, the Licensee is still held accountable for any and all
19
+ * billable time Numerno spent during the support process. Numerno does not guarantee compatibility with any other
20
+ * Magento extension. Numerno is not responsbile for any inconsistencies or abnormalities in the behaviour of this
21
+ * code if caused by other Magento extension.
22
+ * If you did not receive a copy of the license, please send an email to info@numerno.com or call +90-212-223-5093,
23
+ * so we can send you a copy immediately.
24
+ *
25
+ * @category [Numerno]
26
+ * @package [Numerno_Euromsg]
27
+ * @copyright Copyright (c) 2015 Numerno Bilisim Hiz. Tic. Ltd. Sti. (http://numerno.com/)
28
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
29
+ */
30
+
31
+ /**
32
+ * Newsletter Controller
33
+ *
34
+ * @category Numerno
35
+ * @package Numerno_Euromsg
36
+ * @author Numerno Bilisim Hiz. Tic. Ltd. Sti. <info@numerno.com>
37
+ */
38
+ class Numerno_Euromsg_Adminhtml_NewsletterController extends Mage_Adminhtml_Controller_Action
39
+ {
40
+ public function logsAction()
41
+ {
42
+ $this->_title($this->__('euro.message'))->_title($this->__('Mail Logs'));
43
+ $this->loadLayout();
44
+ $this->_setActiveMenu('euromessage/trx');
45
+ $this->_addContent($this->getLayout()->createBlock('euromsg/adminhtml_mail_logs'));
46
+ $this->renderLayout();
47
+ }
48
+
49
+ }
app/code/local/Numerno/Euromsg/controllers/Adminhtml/SmsController.php ADDED
@@ -0,0 +1,104 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Numerno - Euro.message Magento Extension
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the NUMERNO EUROMESSAGE MAGENTO EXTENSION License, which extends the Open Software
8
+ * License (OSL 3.0). The Euro.message Magento Extension License is available at this URL:
9
+ * http://numerno.com/licenses/euromsg-ce.txt The Open Software License is available at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ *
12
+ * DISCLAIMER
13
+ *
14
+ * By adding to, editing, or in any way modifying this code, Numerno is not held liable for any inconsistencies or
15
+ * abnormalities in the behaviour of this code. By adding to, editing, or in any way modifying this code, the Licensee
16
+ * terminates any agreement of support offered by Numerno, outlined in the provided Euro.message Magento Extension
17
+ * License.
18
+ * Upon discovery of modified code in the process of support, the Licensee is still held accountable for any and all
19
+ * billable time Numerno spent during the support process. Numerno does not guarantee compatibility with any other
20
+ * Magento extension. Numerno is not responsbile for any inconsistencies or abnormalities in the behaviour of this
21
+ * code if caused by other Magento extension.
22
+ * If you did not receive a copy of the license, please send an email to info@numerno.com or call +90-212-223-5093,
23
+ * so we can send you a copy immediately.
24
+ *
25
+ * @category [Numerno]
26
+ * @package [Numerno_Euromsg]
27
+ * @copyright Copyright (c) 2015 Numerno Bilisim Hiz. Tic. Ltd. Sti. (http://numerno.com/)
28
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
29
+ */
30
+
31
+ /**
32
+ * Sms Controller
33
+ *
34
+ * @category Numerno
35
+ * @package Numerno_Euromsg
36
+ * @author Numerno Bilisim Hiz. Tic. Ltd. Sti. <info@numerno.com>
37
+ */
38
+ class Numerno_Euromsg_Adminhtml_SmsController extends Mage_Adminhtml_Controller_Action
39
+ {
40
+
41
+ public function logsAction()
42
+ {
43
+ $this->_title($this->__('euro.Message'))->_title($this->__('SMS Logs'));
44
+ $this->loadLayout();
45
+ $this->_setActiveMenu('euromessage/sms');
46
+ $this->_addContent($this->getLayout()->createBlock('euromsg/adminhtml_sms_logs'));
47
+ $this->renderLayout();
48
+ }
49
+
50
+ public function subscribersAction()
51
+ {
52
+ $this->_title($this->__('euro.Message'))->_title($this->__('SMS Subscribers'));
53
+ $this->loadLayout();
54
+ $this->_setActiveMenu('euromessage/sms');
55
+ $this->_addContent($this->getLayout()->createBlock('euromsg/adminhtml_sms_subscribers'));
56
+ $this->renderLayout();
57
+ }
58
+
59
+ public function massSubscribeAction()
60
+ {
61
+ $customersIds = $this->getRequest()->getParam('customer');
62
+ if(!is_array($customersIds)) {
63
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('adminhtml')->__('Please select customer(s).'));
64
+
65
+ } else {
66
+ try {
67
+ foreach ($customersIds as $customerId) {
68
+ $customer = Mage::getModel('customer/customer')->load($customerId);
69
+ $customer->setData((string) Numerno_Euromsg_Model_Sms::SMS_PERMIT_ATTRIBUTE_CODE, true);
70
+ $customer->save();
71
+ }
72
+ Mage::getSingleton('adminhtml/session')->addSuccess(
73
+ Mage::helper('adminhtml')->__('Total of %d record(s) were updated.', count($customersIds))
74
+ );
75
+ } catch (Exception $e) {
76
+ Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
77
+ }
78
+ }
79
+ $this->_redirect('*/*/subscribers');
80
+ }
81
+
82
+ public function massUnsubscribeAction()
83
+ {
84
+ $customersIds = $this->getRequest()->getParam('customer');
85
+ if(!is_array($customersIds)) {
86
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('adminhtml')->__('Please select customer(s).'));
87
+ } else {
88
+ try {
89
+ foreach ($customersIds as $customerId) {
90
+ $customer = Mage::getModel('customer/customer')->load($customerId);
91
+ $customer->setData((string) Numerno_Euromsg_Model_Sms::SMS_PERMIT_ATTRIBUTE_CODE, false);
92
+ $customer->save();
93
+ }
94
+ Mage::getSingleton('adminhtml/session')->addSuccess(
95
+ Mage::helper('adminhtml')->__('Total of %d record(s) were updated.', count($customersIds))
96
+ );
97
+ } catch (Exception $e) {
98
+ Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
99
+ }
100
+ }
101
+
102
+ $this->_redirect('*/*/subscribers');
103
+ }
104
+ }
app/code/local/Numerno/Euromsg/etc/adminhtml.xml ADDED
@@ -0,0 +1,114 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * Numerno - Euro.message Magento Extension
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the NUMERNO EUROMESSAGE MAGENTO EXTENSION License, which extends the Open Software
9
+ * License (OSL 3.0). The Euro.message Magento Extension License is available at this URL:
10
+ * http://numerno.com/licenses/euromsg-ce.txt The Open Software License is available at this URL:
11
+ * http://opensource.org/licenses/osl-3.0.php
12
+ *
13
+ * DISCLAIMER
14
+ *
15
+ * By adding to, editing, or in any way modifying this code, Numerno is not held liable for any inconsistencies or
16
+ * abnormalities in the behaviour of this code. By adding to, editing, or in any way modifying this code, the Licensee
17
+ * terminates any agreement of support offered by Numerno, outlined in the provided Euro.message Magento Extension
18
+ * License.
19
+ * Upon discovery of modified code in the process of support, the Licensee is still held accountable for any and all
20
+ * billable time Numerno spent during the support process. Numerno does not guarantee compatibility with any other
21
+ * Magento extension. Numerno is not responsbile for any inconsistencies or abnormalities in the behaviour of this
22
+ * code if caused by other Magento extension.
23
+ * If you did not receive a copy of the license, please send an email to info@numerno.com or call +90-212-223-5093,
24
+ * so we can send you a copy immediately.
25
+ *
26
+ * @category [Numerno]
27
+ * @package [Numerno_Euromsg]
28
+ * @copyright Copyright (c) 2015 Numerno Bilisim Hiz. Tic. Ltd. Sti. (http://numerno.com/)
29
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
30
+ */
31
+ -->
32
+ <config>
33
+ <menu>
34
+ <euromessage translate="title" module="euromsg">
35
+ <title>euro.message</title>
36
+ <sort_order>61</sort_order>
37
+ <action>euromsg/euromsg/index</action>
38
+ <children>
39
+ <trx translate="title" module="euromsg">
40
+ <title>Transactional Emails</title>
41
+ <children>
42
+ <logs translate="title" module="euromsg">
43
+ <title>Email Logs</title>
44
+ <action>euromsg/newsletter/logs</action>
45
+ <sort_order>10</sort_order>
46
+ </logs>
47
+ <settings translate="title" module="euromsg">
48
+ <title>Settings</title>
49
+ <action>adminhtml/system_config/edit/section/euromsg_trx</action>
50
+ <sort_order>20</sort_order>
51
+ </settings>
52
+ </children>
53
+ </trx>
54
+ <sms translate="title" module="euromsg">
55
+ <title>SMS</title>
56
+ <action>euromsg/sms/index</action>
57
+ <children>
58
+ <logs translate="title" module="euromsg">
59
+ <title>SMS Logs</title>
60
+ <action>euromsg/sms/logs</action>
61
+ <sort_order>10</sort_order>
62
+ </logs>
63
+ <subscribers translate="title" module="euromsg">
64
+ <title>SMS Subscribers</title>
65
+ <action>euromsg/sms/subscribers</action>
66
+ <sort_order>20</sort_order>
67
+ </subscribers>
68
+ <settings translate="title" module="euromsg">
69
+ <title>Settings</title>
70
+ <action>adminhtml/system_config/edit/section/euromsg_sms</action>
71
+ <sort_order>30</sort_order>
72
+ </settings>
73
+ </children>
74
+ </sms>
75
+ </children>
76
+ </euromessage>
77
+ </menu>
78
+ <acl>
79
+ <resources>
80
+ <admin>
81
+ <children>
82
+ <system>
83
+ <children>
84
+ <config>
85
+ <children>
86
+ <euromsg translate="title">
87
+ <title>Euromsg General</title>
88
+ <sort_order>100</sort_order>
89
+ </euromsg>
90
+ <euromsg_trx translate="title">
91
+ <title>Euromsg Transactional Emails</title>
92
+ <sort_order>200</sort_order>
93
+ </euromsg_trx>
94
+ <euromsg_sms translate="title">
95
+ <title>Euromsg Transactional SMS</title>
96
+ <sort_order>300</sort_order>
97
+ </euromsg_sms>
98
+ <euromsg_customer translate="title">
99
+ <title>Euromsg Customer Data Integration</title>
100
+ <sort_order>400</sort_order>
101
+ </euromsg_customer>
102
+ <euromsg_catalog translate="title">
103
+ <title>Euromsg Catalog Data Integration</title>
104
+ <sort_order>500</sort_order>
105
+ </euromsg_catalog>
106
+ </children>
107
+ </config>
108
+ </children>
109
+ </system>
110
+ </children>
111
+ </admin>
112
+ </resources>
113
+ </acl>
114
+ </config>
app/code/local/Numerno/Euromsg/etc/config.xml ADDED
@@ -0,0 +1,344 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * Numerno - Euro.message Magento Extension
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the NUMERNO EUROMESSAGE MAGENTO EXTENSION License, which extends the Open Software
9
+ * License (OSL 3.0). The Euro.message Magento Extension License is available at this URL:
10
+ * http://numerno.com/licenses/euromsg-ce.txt The Open Software License is available at this URL:
11
+ * http://opensource.org/licenses/osl-3.0.php
12
+ *
13
+ * DISCLAIMER
14
+ *
15
+ * By adding to, editing, or in any way modifying this code, Numerno is not held liable for any inconsistencies or
16
+ * abnormalities in the behaviour of this code. By adding to, editing, or in any way modifying this code, the Licensee
17
+ * terminates any agreement of support offered by Numerno, outlined in the provided Euro.message Magento Extension
18
+ * License.
19
+ * Upon discovery of modified code in the process of support, the Licensee is still held accountable for any and all
20
+ * billable time Numerno spent during the support process. Numerno does not guarantee compatibility with any other
21
+ * Magento extension. Numerno is not responsbile for any inconsistencies or abnormalities in the behaviour of this
22
+ * code if caused by other Magento extension.
23
+ * If you did not receive a copy of the license, please send an email to info@numerno.com or call +90-212-223-5093,
24
+ * so we can send you a copy immediately.
25
+ *
26
+ * @category [Numerno]
27
+ * @package [Numerno_Euromsg]
28
+ * @copyright Copyright (c) 2015 Numerno Bilisim Hiz. Tic. Ltd. Sti. (http://numerno.com/)
29
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
30
+ */
31
+ -->
32
+ <config>
33
+ <modules>
34
+ <Numerno_Euromsg>
35
+ <version>1.0.0</version>
36
+ </Numerno_Euromsg>
37
+ </modules>
38
+ <admin>
39
+ <routers>
40
+ <adminhtml>
41
+ <args>
42
+ <modules>
43
+ <euromsg after="Mage_Adminhtml">Numerno_Euromsg</euromsg>
44
+ </modules>
45
+ </args>
46
+ </adminhtml>
47
+ <euromsg>
48
+ <use>admin</use>
49
+ <args>
50
+ <module>Numerno_Euromsg_Adminhtml</module>
51
+ <frontName>euromsg</frontName>
52
+ </args>
53
+ </euromsg>
54
+ </routers>
55
+ </admin>
56
+ <global>
57
+ <blocks>
58
+ <adminhtml>
59
+ <rewrite>
60
+ <customer_grid>Numerno_Euromsg_Block_Adminhtml_Customer_Grid</customer_grid>
61
+ <newsletter_subscriber_grid>Numerno_Euromsg_Block_Adminhtml_Newsletter_Subscriber_Grid</newsletter_subscriber_grid>
62
+ <sales_order_view_history>Numerno_Euromsg_Block_Adminhtml_Sales_Order_View_History</sales_order_view_history>
63
+ <sales_order_comments_view>Numerno_Euromsg_Block_Adminhtml_Sales_Order_Comments_View</sales_order_comments_view>
64
+ </rewrite>
65
+ </adminhtml>
66
+ <euromsg>
67
+ <class>Numerno_Euromsg_Block</class>
68
+ </euromsg>
69
+ </blocks>
70
+ <fieldsets>
71
+ <customer_account>
72
+ <em_gsm_permit>
73
+ <create>1</create>
74
+ <update>1</update>
75
+ </em_gsm_permit>
76
+ </customer_account>
77
+ </fieldsets>
78
+ <helpers>
79
+ <euromsg>
80
+ <class>Numerno_Euromsg_Helper</class>
81
+ </euromsg>
82
+ </helpers>
83
+ <models>
84
+ <core>
85
+ <rewrite>
86
+ <email>Numerno_Euromsg_Model_Core_Email</email>
87
+ <email_template>Numerno_Euromsg_Model_Core_Email_Template</email_template>
88
+ <email_queue>Numerno_Euromsg_Model_Core_Email_Queue</email_queue>
89
+ </rewrite>
90
+ </core>
91
+ <euromsg>
92
+ <class>Numerno_Euromsg_Model</class>
93
+ <resourceModel>euromsg_resource</resourceModel>
94
+ </euromsg>
95
+ <euromsg_resource>
96
+ <class>Numerno_Euromsg_Model_Resource</class>
97
+ <entities>
98
+ <process>
99
+ <table>euromsg_process</table>
100
+ </process>
101
+ <mail_log>
102
+ <table>euromsg_mail_log</table>
103
+ </mail_log>
104
+ <sms>
105
+ <table>euromsg_sms_log</table>
106
+ </sms>
107
+ </entities>
108
+ </euromsg_resource>
109
+ <newsletter>
110
+ <resourceModel>newsletter_resource</resourceModel>
111
+ </newsletter>
112
+ <newsletter_resource>
113
+ <rewrite>
114
+ <deprecatedNode>newsletter_mysql4</deprecatedNode>
115
+ <subscriber_collection>Numerno_Euromsg_Model_Newsletter_Subscriber_Collection</subscriber_collection>
116
+ </rewrite>
117
+ </newsletter_resource>
118
+ </models>
119
+ <resources>
120
+ <euromsg_setup>
121
+ <setup>
122
+ <module>Numerno_Euromsg</module>
123
+ <class>Mage_Customer_Model_Entity_Setup</class>
124
+ </setup>
125
+ <connection>
126
+ <use>core_setup</use>
127
+ </connection>
128
+ </euromsg_setup>
129
+ </resources>
130
+ </global>
131
+ <default>
132
+ <euromsg>
133
+ <general>
134
+ <platform>liveb</platform>
135
+ </general>
136
+ <dwh>
137
+ <sftp_host>file.euromsg.com</sftp_host>
138
+ </dwh>
139
+ <feedback>
140
+ <autosync>0</autosync>
141
+ <destination>local</destination>
142
+ <local_dir>/var/euromsg</local_dir>
143
+ </feedback>
144
+ </euromsg>
145
+ <euromsg_trx>
146
+ <general>
147
+ <enabled>0</enabled>
148
+ </general>
149
+ </euromsg_trx>
150
+ <euromsg_customer>
151
+ <general>
152
+ <source>newsletter_subscribers</source>
153
+ <use_unsubscribed>0</use_unsubscribed>
154
+ <autosync>0</autosync>
155
+ <filename>ALL_DATA</filename>
156
+ <attributes>a:10:{s:16:"subscriber_email";a:2:{s:9:"attribute";s:16:"subscriber_email";s:8:"col_name";s:5:"EMAIL";}s:18:"customer_firstname";a:2:{s:9:"attribute";s:18:"customer_firstname";s:8:"col_name";s:4:"NAME";}s:17:"customer_lastname";a:2:{s:9:"attribute";s:17:"customer_lastname";s:8:"col_name";s:7:"SURNAME";}s:15:"customer_gender";a:2:{s:9:"attribute";s:15:"customer_gender";s:8:"col_name";s:6:"GENDER";}s:12:"customer_dob";a:2:{s:9:"attribute";s:12:"customer_dob";s:8:"col_name";s:10:"BIRTH_DATE";}s:19:"customer_created_at";a:2:{s:9:"attribute";s:19:"customer_created_at";s:8:"col_name";s:12:"CREATED_DATE";}s:19:"customer_last_login";a:2:{s:9:"attribute";s:19:"customer_last_login";s:8:"col_name";s:14:"LAST_WEB_LOGIN";}s:19:"customer_last_order";a:2:{s:9:"attribute";s:19:"customer_last_order";s:8:"col_name";s:18:"LAST_PURCHASE_DATE";}s:21:"customer_orders_total";a:2:{s:9:"attribute";s:21:"customer_orders_total";s:8:"col_name";s:16:"LIFETIME_REVENUE";}s:21:"customer_fav_category";a:2:{s:9:"attribute";s:21:"customer_fav_category";s:8:"col_name";s:17:"FAVORITE_CATEGORY";}}</attributes>
157
+ </general>
158
+ </euromsg_customer>
159
+ <euromsg_catalog>
160
+ <general>
161
+ <export>1</export>
162
+ <autosync>0</autosync>
163
+ <attributes>a:6:{s:9:"entity_id";a:2:{s:9:"attribute";s:9:"entity_id";s:8:"col_name";s:10:"PRODUCT_ID";}s:4:"name";a:2:{s:9:"attribute";s:4:"name";s:8:"col_name";s:12:"PRODUCT_NAME";}s:5:"price";a:2:{s:9:"attribute";s:5:"color";s:8:"col_name";s:5:"COLOR";}s:9:"thumbnail";a:2:{s:9:"attribute";s:5:"price";s:8:"col_name";s:13:"PRODUCT_PRICE";}s:4:"_url";a:2:{s:9:"attribute";s:9:"thumbnail";s:8:"col_name";s:7:"IMG_URL";}s:14:"_root_category";a:2:{s:9:"attribute";s:4:"_url";s:8:"col_name";s:10:"TARGET_URL";}}</attributes>
164
+ </general>
165
+ <advanced>
166
+ <filename>PRODUCTS</filename>
167
+ <memory_limit>250000000</memory_limit>
168
+ <memory_pp>100000</memory_pp>
169
+ <memory_percent>80</memory_percent>
170
+ <minimum_products>500</minimum_products>
171
+ </advanced>
172
+ </euromsg_catalog>
173
+ <euromsg_trx>
174
+ <general>
175
+ <enabled>0</enabled>
176
+ </general>
177
+ <log>
178
+ <enabled>0</enabled>
179
+ </log>
180
+ </euromsg_trx>
181
+ <euromsg_sms>
182
+ <general>
183
+ <enabled>0</enabled>
184
+ <method>standart</method>
185
+ </general>
186
+ <log>
187
+ <enabled>0</enabled>
188
+ </log>
189
+ </euromsg_sms>
190
+ </default>
191
+ <crontab>
192
+ <jobs>
193
+ <euromsg_autosync_customers>
194
+ <run>
195
+ <model>euromsg/cron::syncCustomerData</model>
196
+ </run>
197
+ </euromsg_autosync_customers>
198
+ <euromsg_autosync_catalog>
199
+ <run>
200
+ <model>euromsg/cron::syncCatalogData</model>
201
+ </run>
202
+ </euromsg_autosync_catalog>
203
+ <euromsg_process_queue_run_all>
204
+ <run>
205
+ <model>euromsg/cron::runAllProcesses</model>
206
+ </run>
207
+ <schedule>
208
+ <cron_expr>*/5 * * * *</cron_expr>
209
+ </schedule>
210
+ </euromsg_process_queue_run_all>
211
+ <euromsg_datawarehouse_checkreports>
212
+ <run>
213
+ <model>euromsg/cron::checkDwhReports</model>
214
+ </run>
215
+ </euromsg_datawarehouse_checkreports>
216
+ <euromsg_sms_queue_send_all>
217
+ <run>
218
+ <model>euromsg/cron::sendAllSms</model>
219
+ </run>
220
+ <schedule>
221
+ <cron_expr>*/5 * * * *</cron_expr>
222
+ </schedule>
223
+ </euromsg_sms_queue_send_all>
224
+ <euromsg_email_log_cleanup>
225
+ <run>
226
+ <model>euromsg/cron::cleanMailLogs</model>
227
+ </run>
228
+ </euromsg_email_log_cleanup>
229
+ <euromsg_email_track_delivery>
230
+ <schedule>
231
+ <cron_expr>*/5 * * * *</cron_expr>
232
+ </schedule>
233
+ <run>
234
+ <model>euromsg/cron::trackMailDelivery</model>
235
+ </run>
236
+ </euromsg_email_track_delivery>
237
+ </jobs>
238
+ </crontab>
239
+ <adminhtml>
240
+ <translate>
241
+ <modules>
242
+ <Numerno_Euromsg>
243
+ <files>
244
+ <default>Numerno_Euromsg.csv</default>
245
+ </files>
246
+ </Numerno_Euromsg>
247
+ </modules>
248
+ </translate>
249
+ <layout>
250
+ <updates>
251
+ <euromsg>
252
+ <file>euromsg.xml</file>
253
+ </euromsg>
254
+ </updates>
255
+ </layout>
256
+ <events>
257
+ <controller_action_postdispatch_adminhtml_sales_order_addComment>
258
+ <observers>
259
+ <euromsg_send_sms_order_update>
260
+ <class>euromsg/observer</class>
261
+ <method>sendOrderUpdateSms</method>
262
+ </euromsg_send_sms_order_update>
263
+ </observers>
264
+ </controller_action_postdispatch_adminhtml_sales_order_addComment>
265
+ <controller_action_postdispatch_adminhtml_sales_order_invoice_addComment>
266
+ <observers>
267
+ <euromsg_send_sms_invoice_update>
268
+ <class>euromsg/observer</class>
269
+ <method>sendInvoiceUpdateSms</method>
270
+ </euromsg_send_sms_invoice_update>
271
+ </observers>
272
+ </controller_action_postdispatch_adminhtml_sales_order_invoice_addComment>
273
+ <controller_action_postdispatch_adminhtml_sales_order_shipment_addComment>
274
+ <observers>
275
+ <euromsg_send_sms_shipment_update>
276
+ <class>euromsg/observer</class>
277
+ <method>sendShipmentUpdateSms</method>
278
+ </euromsg_send_sms_shipment_update>
279
+ </observers>
280
+ </controller_action_postdispatch_adminhtml_sales_order_shipment_addComment>
281
+ <controller_action_postdispatch_adminhtml_sales_order_creditmemo_addComment>
282
+ <observers>
283
+ <euromsg_send_sms_creditmemo_update>
284
+ <class>euromsg/observer</class>
285
+ <method>sendCreditmemoUpdateSms</method>
286
+ </euromsg_send_sms_creditmemo_update>
287
+ </observers>
288
+ </controller_action_postdispatch_adminhtml_sales_order_creditmemo_addComment>
289
+ </events>
290
+ </adminhtml>
291
+ <frontend>
292
+ <translate>
293
+ <modules>
294
+ <Numerno_Euromsg>
295
+ <files>
296
+ <default>Numerno_Euromsg.csv</default>
297
+ </files>
298
+ </Numerno_Euromsg>
299
+ </modules>
300
+ </translate>
301
+ <events>
302
+ <sales_order_place_after>
303
+ <observers>
304
+ <euromsg_send_sms_new_order>
305
+ <class>euromsg/observer</class>
306
+ <method>sendNewOrderSms</method>
307
+ </euromsg_send_sms_new_order>
308
+ </observers>
309
+ </sales_order_place_after>
310
+ <sales_order_invoice_save_after>
311
+ <observers>
312
+ <euromsg_send_sms_new_invoice>
313
+ <class>euromsg/observer</class>
314
+ <method>sendNewInvoiceSms</method>
315
+ </euromsg_send_sms_new_invoice>
316
+ </observers>
317
+ </sales_order_invoice_save_after>
318
+ <sales_order_shipment_save_after>
319
+ <observers>
320
+ <euromsg_send_sms_new_shipment>
321
+ <class>euromsg/observer</class>
322
+ <method>sendNewShipmentSms</method>
323
+ </euromsg_send_sms_new_shipment>
324
+ </observers>
325
+ </sales_order_shipment_save_after>
326
+ <sales_order_shipment_track_save_after>
327
+ <observers>
328
+ <euromsg_send_sms_new_track>
329
+ <class>euromsg/observer</class>
330
+ <method>sendNewTrackSms</method>
331
+ </euromsg_send_sms_new_track>
332
+ </observers>
333
+ </sales_order_shipment_track_save_after>
334
+ <sales_order_creditmemo_save_after>
335
+ <observers>
336
+ <euromsg_send_sms_new_creditmemo>
337
+ <class>euromsg/observer</class>
338
+ <method>sendNewCreditmemoSms</method>
339
+ </euromsg_send_sms_new_creditmemo>
340
+ </observers>
341
+ </sales_order_creditmemo_save_after>
342
+ </events>
343
+ </frontend>
344
+ </config>
app/code/local/Numerno/Euromsg/etc/system.xml ADDED
@@ -0,0 +1,950 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * Numerno - Euro.message Magento Extension
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the NUMERNO EUROMESSAGE MAGENTO EXTENSION License, which extends the Open Software
9
+ * License (OSL 3.0). The Euro.message Magento Extension License is available at this URL:
10
+ * http://numerno.com/licenses/euromsg-ce.txt The Open Software License is available at this URL:
11
+ * http://opensource.org/licenses/osl-3.0.php
12
+ *
13
+ * DISCLAIMER
14
+ *
15
+ * By adding to, editing, or in any way modifying this code, Numerno is not held liable for any inconsistencies or
16
+ * abnormalities in the behaviour of this code. By adding to, editing, or in any way modifying this code, the Licensee
17
+ * terminates any agreement of support offered by Numerno, outlined in the provided Euro.message Magento Extension
18
+ * License.
19
+ * Upon discovery of modified code in the process of support, the Licensee is still held accountable for any and all
20
+ * billable time Numerno spent during the support process. Numerno does not guarantee compatibility with any other
21
+ * Magento extension. Numerno is not responsbile for any inconsistencies or abnormalities in the behaviour of this
22
+ * code if caused by other Magento extension.
23
+ * If you did not receive a copy of the license, please send an email to info@numerno.com or call +90-212-223-5093,
24
+ * so we can send you a copy immediately.
25
+ *
26
+ * @category [Numerno]
27
+ * @package [Numerno_Euromsg]
28
+ * @copyright Copyright (c) 2015 Numerno Bilisim Hiz. Tic. Ltd. Sti. (http://numerno.com/)
29
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
30
+ */
31
+ -->
32
+ <config>
33
+ <tabs>
34
+ <euromsg_tab translate="label" module="euromsg">
35
+ <label><![CDATA[<div style="position: absolute;"><img id="euromsg-logo" src="" alt="" border="0" /></div>&nbsp;<script>
36
+ var skin_dir_pos = SKIN_URL.indexOf("adminhtml");
37
+ var skin_dir = SKIN_URL.substring(0, skin_dir_pos);
38
+ $('euromsg-logo').src = skin_dir + "adminhtml/default/default/images/euromsg/euromsg_logo.png";
39
+ </script>]]></label>
40
+ <sort_order>400</sort_order>
41
+ </euromsg_tab>
42
+ </tabs>
43
+ <sections>
44
+ <euromsg translate="label" module="euromsg">
45
+ <label>General</label>
46
+ <tab>euromsg_tab</tab>
47
+ <frontend_type>text</frontend_type>
48
+ <sort_order>10</sort_order>
49
+ <show_in_default>1</show_in_default>
50
+ <show_in_website>1</show_in_website>
51
+ <show_in_store>1</show_in_store>
52
+ <groups>
53
+ <general module="euromsg" translate="label comment">
54
+ <label>General Settings</label>
55
+ <expanded>true</expanded>
56
+ <frontend_type>text</frontend_type>
57
+ <sort_order>10</sort_order>
58
+ <show_in_default>1</show_in_default>
59
+ <show_in_website>1</show_in_website>
60
+ <show_in_store>1</show_in_store>
61
+ <comment><![CDATA[<div style='height: 20px;margin-bottom:10px;'> <img style='float:left;' src='http://numerno.com/media/modules/euromsg-logo.png' /></div> Configure your euro.message platform connection below. If you have any questions or would like any help please visit <a href='http://numerno.com' target='_blank'>numerno.com</a>.]]></comment>
62
+ <fields>
63
+ <platform translate="label">
64
+ <label>euro.message Platform</label>
65
+ <frontend_type>select</frontend_type>
66
+ <source_model>euromsg/system_config_source_platform</source_model>
67
+ <sort_order>10</sort_order>
68
+ <comment>Choose your euro.message platform.</comment>
69
+ <show_in_default>1</show_in_default>
70
+ <show_in_website>1</show_in_website>
71
+ <show_in_store>1</show_in_store>
72
+ </platform>
73
+ <lang_id translate="label comment">
74
+ <label>Data Warehouse Language</label>
75
+ <comment><![CDATA[If you are using MAX platform, there must be LANG_ID column in the data files.]]></comment>
76
+ <frontend_type>select</frontend_type>
77
+ <source_model>euromsg/system_config_source_dwh_langId</source_model>
78
+ <sort_order>50</sort_order>
79
+ <show_in_default>1</show_in_default>
80
+ <show_in_website>1</show_in_website>
81
+ <show_in_store>1</show_in_store>
82
+ <depends><platform>max</platform></depends>
83
+ </lang_id>
84
+ <ws_user translate="label">
85
+ <label>Web Service Username</label>
86
+ <frontend_type>text</frontend_type>
87
+ <sort_order>20</sort_order>
88
+ <show_in_default>1</show_in_default>
89
+ <show_in_website>1</show_in_website>
90
+ <show_in_store>1</show_in_store>
91
+ </ws_user>
92
+ <ws_pass translate="label">
93
+ <label>Web Service Password</label>
94
+ <frontend_type>password</frontend_type>
95
+ <sort_order>30</sort_order>
96
+ <show_in_default>1</show_in_default>
97
+ <show_in_website>1</show_in_website>
98
+ <show_in_store>1</show_in_store>
99
+ </ws_pass>
100
+ </fields>
101
+ </general>
102
+
103
+ <dwh module="euromsg" translate="label comment">
104
+ <label>Data Warehouse Connection</label>
105
+ <expanded>true</expanded>
106
+ <frontend_type>text</frontend_type>
107
+ <sort_order>20</sort_order>
108
+ <show_in_default>1</show_in_default>
109
+ <show_in_website>1</show_in_website>
110
+ <show_in_store>1</show_in_store>
111
+ <comment><![CDATA[Configure Data Warehouse connection parameters for Customer and Catalog data integration.<br />]]></comment>
112
+ <fields>
113
+ <policy translate="label">
114
+ <label>Connection Policy</label>
115
+ <frontend_type>select</frontend_type>
116
+ <source_model>euromsg/system_config_source_dwh_policy</source_model>
117
+ <sort_order>30</sort_order>
118
+ <show_in_default>1</show_in_default>
119
+ <show_in_website>0</show_in_website>
120
+ <show_in_store>0</show_in_store>
121
+ </policy>
122
+ <sftp_host translate="label">
123
+ <label>SFTP Host</label>
124
+ <frontend_type>text</frontend_type>
125
+ <sort_order>40</sort_order>
126
+ <show_in_default>1</show_in_default>
127
+ <show_in_website>1</show_in_website>
128
+ <show_in_store>1</show_in_store>
129
+ </sftp_host>
130
+ <sftp_user translate="label">
131
+ <label>SFTP Username</label>
132
+ <frontend_type>text</frontend_type>
133
+ <sort_order>50</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
+ </sftp_user>
138
+ <sftp_pass translate="label">
139
+ <label>SFTP Password</label>
140
+ <frontend_type>password</frontend_type>
141
+ <sort_order>60</sort_order>
142
+ <show_in_default>1</show_in_default>
143
+ <show_in_website>1</show_in_website>
144
+ <show_in_store>1</show_in_store>
145
+ </sftp_pass>
146
+ </fields>
147
+ </dwh>
148
+ <feedback module="euromsg" translate="label comment">
149
+ <label>Data Warehouse Reporting</label>
150
+ <expanded>true</expanded>
151
+ <frontend_type>text</frontend_type>
152
+ <sort_order>30</sort_order>
153
+ <show_in_default>1</show_in_default>
154
+ <show_in_website>1</show_in_website>
155
+ <show_in_store>1</show_in_store>
156
+ <comment>Configure directory to get feedbacks from euro.message Data Warehouse. These settings are mandatory to get unsubscribe reports.</comment>
157
+ <fields>
158
+ <autosync translate="label">
159
+ <label>Enabled</label>
160
+ <frontend_type>select</frontend_type>
161
+ <source_model>adminhtml/system_config_source_yesno</source_model>
162
+ <sort_order>10</sort_order>
163
+ <show_in_default>1</show_in_default>
164
+ <show_in_website>0</show_in_website>
165
+ <show_in_store>0</show_in_store>
166
+ </autosync>
167
+ <destination translate="label comment">
168
+ <label>Reporting Source</label>
169
+ <frontend_type>select</frontend_type>
170
+ <source_model>euromsg/system_config_source_dwh_report</source_model>
171
+ <comment>You can either provide SFTP account details given to euro.message IT or a local directory under your Magento installation directory.</comment>
172
+ <sort_order>20</sort_order>
173
+ <show_in_default>1</show_in_default>
174
+ <show_in_website>1</show_in_website>
175
+ <show_in_store>1</show_in_store>
176
+ <depends><autosync>1</autosync></depends>
177
+ </destination>
178
+ <sftp_host translate="label">
179
+ <label>SFTP Host</label>
180
+ <frontend_type>text</frontend_type>
181
+ <sort_order>30</sort_order>
182
+ <show_in_default>1</show_in_default>
183
+ <show_in_website>1</show_in_website>
184
+ <show_in_store>1</show_in_store>
185
+ <depends>
186
+ <autosync>1</autosync>
187
+ <destination>sftp</destination>
188
+ </depends>
189
+ </sftp_host>
190
+ <sftp_user translate="label">
191
+ <label>SFTP Username</label>
192
+ <frontend_type>text</frontend_type>
193
+ <sort_order>40</sort_order>
194
+ <show_in_default>1</show_in_default>
195
+ <show_in_website>1</show_in_website>
196
+ <show_in_store>1</show_in_store>
197
+ <depends>
198
+ <autosync>1</autosync>
199
+ <destination>sftp</destination>
200
+ </depends>
201
+ </sftp_user>
202
+ <sftp_pass translate="label">
203
+ <label>SFTP Password</label>
204
+ <frontend_type>password</frontend_type>
205
+ <sort_order>50</sort_order>
206
+ <show_in_default>1</show_in_default>
207
+ <show_in_website>1</show_in_website>
208
+ <show_in_store>1</show_in_store>
209
+ <depends>
210
+ <autosync>1</autosync>
211
+ <destination>sftp</destination>
212
+ </depends>
213
+ </sftp_pass>
214
+ <sftp_dir translate="label">
215
+ <label>SFTP Directory</label>
216
+ <frontend_type>text</frontend_type>
217
+ <sort_order>60</sort_order>
218
+ <show_in_default>1</show_in_default>
219
+ <show_in_website>1</show_in_website>
220
+ <show_in_store>1</show_in_store>
221
+ <depends>
222
+ <autosync>1</autosync>
223
+ <destination>sftp</destination>
224
+ </depends>
225
+ </sftp_dir>
226
+ <local_dir translate="label">
227
+ <label>Local Directory</label>
228
+ <frontend_type>text</frontend_type>
229
+ <sort_order>70</sort_order>
230
+ <show_in_default>1</show_in_default>
231
+ <show_in_website>1</show_in_website>
232
+ <show_in_store>1</show_in_store>
233
+ <depends>
234
+ <autosync>1</autosync>
235
+ <destination>local</destination>
236
+ </depends>
237
+ </local_dir>
238
+ <time translate="label">
239
+ <label>Synchronization Time (Daily)</label>
240
+ <frontend_type>time</frontend_type>
241
+ <backend_model>euromsg/system_config_backend_cron</backend_model>
242
+ <job>euromsg_datawarehouse_checkreports</job>
243
+ <sort_order>80</sort_order>
244
+ <show_in_default>1</show_in_default>
245
+ <show_in_website>0</show_in_website>
246
+ <show_in_store>0</show_in_store>
247
+ <depends>
248
+ <autosync>1</autosync>
249
+ </depends>
250
+ </time>
251
+ <delete_after translate="label">
252
+ <label>Delete files after check?</label>
253
+ <frontend_type>select</frontend_type>
254
+ <source_model>adminhtml/system_config_source_yesno</source_model>
255
+ <sort_order>90</sort_order>
256
+ <show_in_default>1</show_in_default>
257
+ <show_in_website>0</show_in_website>
258
+ <show_in_store>0</show_in_store>
259
+ <depends>
260
+ <autosync>1</autosync>
261
+ </depends>
262
+ </delete_after>
263
+ </fields>
264
+ </feedback>
265
+ </groups>
266
+ </euromsg>
267
+ <euromsg_trx translate="label" module="euromsg">
268
+ <label>Transactional Emails</label>
269
+ <tab>euromsg_tab</tab>
270
+ <frontend_type>text</frontend_type>
271
+ <sort_order>40</sort_order>
272
+ <show_in_default>1</show_in_default>
273
+ <show_in_website>1</show_in_website>
274
+ <show_in_store>1</show_in_store>
275
+ <groups>
276
+ <general module="euromsg" translate="label comment">
277
+ <label>General Settings</label>
278
+ <expanded>true</expanded>
279
+ <frontend_type>text</frontend_type>
280
+ <sort_order>10</sort_order>
281
+ <show_in_default>1</show_in_default>
282
+ <show_in_website>1</show_in_website>
283
+ <show_in_store>1</show_in_store>
284
+ <comment><![CDATA[<div style='height: 20px;margin-bottom:10px;'> <img style='float:left;' src='http://numerno.com/media/modules/euromsg-logo.png' /></div> Configure your euro.message platform connection below. If you have any questions or would like any help please visit <a href='http://numerno.com' target='_blank'>numerno.com</a>.]]></comment>
285
+ <fields>
286
+ <enabled translate="label comment">
287
+ <label>Enable euro.message transactional emails</label>
288
+ <comment><![CDATA[If yes, transactional emails will be pushed trough euro.message platform.]]></comment>
289
+ <frontend_type>select</frontend_type>
290
+ <source_model>adminhtml/system_config_source_yesno</source_model>
291
+ <sort_order>10</sort_order>
292
+ <show_in_default>1</show_in_default>
293
+ <show_in_website>1</show_in_website>
294
+ <show_in_store>1</show_in_store>
295
+ </enabled>
296
+ <from_name translate="label">
297
+ <label>From Name</label>
298
+ <frontend_type>text</frontend_type>
299
+ <backend_model>adminhtml/system_config_backend_email_sender</backend_model>
300
+ <sort_order>20</sort_order>
301
+ <show_in_default>1</show_in_default>
302
+ <show_in_website>1</show_in_website>
303
+ <show_in_store>0</show_in_store>
304
+ <depends><enabled>1</enabled></depends>
305
+ </from_name>
306
+ <from_addr translate="label">
307
+ <label>From Address</label>
308
+ <frontend_type>text</frontend_type>
309
+ <backend_model>adminhtml/system_config_backend_email_address</backend_model>
310
+ <sort_order>30</sort_order>
311
+ <show_in_default>1</show_in_default>
312
+ <show_in_website>1</show_in_website>
313
+ <show_in_store>0</show_in_store>
314
+ <depends><enabled>1</enabled></depends>
315
+ </from_addr>
316
+ <reply_addr translate="label">
317
+ <label>Reply Address</label>
318
+ <frontend_type>text</frontend_type>
319
+ <backend_model>adminhtml/system_config_backend_email_address</backend_model>
320
+ <sort_order>40</sort_order>
321
+ <show_in_default>1</show_in_default>
322
+ <show_in_website>1</show_in_website>
323
+ <show_in_store>0</show_in_store>
324
+ <depends><enabled>1</enabled></depends>
325
+ </reply_addr>
326
+ </fields>
327
+ </general>
328
+ <log module="euromsg" translate="label comment">
329
+ <label>Email Logs</label>
330
+ <expanded>true</expanded>
331
+ <frontend_type>text</frontend_type>
332
+ <sort_order>20</sort_order>
333
+ <show_in_default>1</show_in_default>
334
+ <show_in_website>1</show_in_website>
335
+ <show_in_store>1</show_in_store>
336
+ <fields>
337
+ <enabled translate="label">
338
+ <label>Enable Logging</label>
339
+ <frontend_type>select</frontend_type>
340
+ <source_model>adminhtml/system_config_source_yesno</source_model>
341
+ <sort_order>10</sort_order>
342
+ <show_in_default>1</show_in_default>
343
+ <show_in_website>1</show_in_website>
344
+ <show_in_store>1</show_in_store>
345
+ </enabled>
346
+ <autosync translate="label">
347
+ <label>Clean Logs</label>
348
+ <frontend_type>select</frontend_type>
349
+ <source_model>adminhtml/system_config_source_yesno</source_model>
350
+ <sort_order>20</sort_order>
351
+ <show_in_default>1</show_in_default>
352
+ <show_in_website>0</show_in_website>
353
+ <show_in_store>0</show_in_store>
354
+ <depends>
355
+ <enabled>1</enabled>
356
+ </depends>
357
+ </autosync>
358
+ <keeplogs>
359
+ <label>Keep Logs For, Days</label>
360
+ <frontend_type>text</frontend_type>
361
+ <sort_order>25</sort_order>
362
+ <show_in_default>1</show_in_default>
363
+ <show_in_website>0</show_in_website>
364
+ <show_in_store>0</show_in_store>
365
+ <depends>
366
+ <enabled>1</enabled>
367
+ <autosync>1</autosync>
368
+ </depends>
369
+ </keeplogs>
370
+ <frequency translate="label">
371
+ <label>Log Cleaning Frequency</label>
372
+ <frontend_type>select</frontend_type>
373
+ <source_model>euromsg/system_config_source_cron_frequency</source_model>
374
+ <backend_model>euromsg/system_config_backend_cron</backend_model>
375
+ <job>euromsg_email_log_cleanup</job>
376
+ <sort_order>30</sort_order>
377
+ <show_in_default>1</show_in_default>
378
+ <show_in_website>0</show_in_website>
379
+ <show_in_store>0</show_in_store>
380
+ <depends>
381
+ <enabled>1</enabled>
382
+ <autosync>1</autosync>
383
+ </depends>
384
+ </frequency>
385
+ <time translate="label">
386
+ <label>Log Cleaning Start Time</label>
387
+ <frontend_type>time</frontend_type>
388
+ <sort_order>40</sort_order>
389
+ <show_in_default>1</show_in_default>
390
+ <show_in_website>0</show_in_website>
391
+ <show_in_store>0</show_in_store>
392
+ <depends>
393
+ <enabled>1</enabled>
394
+ <autosync>1</autosync>
395
+ <frequency separator=",">D,W,M</frequency>
396
+ </depends>
397
+ </time>
398
+ <hour translate="label">
399
+ <label>Log Cleaning Interval</label>
400
+ <frontend_type>select</frontend_type>
401
+ <source_model>euromsg/system_config_source_cron_hours</source_model>
402
+ <sort_order>50</sort_order>
403
+ <show_in_default>1</show_in_default>
404
+ <show_in_website>0</show_in_website>
405
+ <show_in_store>0</show_in_store>
406
+ <depends>
407
+ <enabled>1</enabled>
408
+ <autosync>1</autosync>
409
+ <frequency>H</frequency>
410
+ </depends>
411
+ </hour>
412
+ <track_delivery translate="label">
413
+ <label>Track Delivery Reports</label>
414
+ <frontend_type>select</frontend_type>
415
+ <source_model>adminhtml/system_config_source_yesno</source_model>
416
+ <sort_order>60</sort_order>
417
+ <show_in_default>1</show_in_default>
418
+ <show_in_website>1</show_in_website>
419
+ <show_in_store>1</show_in_store>
420
+ <depends>
421
+ <enabled>1</enabled>
422
+ </depends>
423
+ </track_delivery>
424
+ </fields>
425
+ </log>
426
+ </groups>
427
+ </euromsg_trx>
428
+ <euromsg_sms translate="label" module="euromsg">
429
+ <label><![CDATA[Transactional SMS]]></label>
430
+ <tab>euromsg_tab</tab>
431
+ <frontend_type>text</frontend_type>
432
+ <sort_order>50</sort_order>
433
+ <show_in_default>1</show_in_default>
434
+ <show_in_website>1</show_in_website>
435
+ <show_in_store>1</show_in_store>
436
+ <groups>
437
+ <general module="euromsg" translate="label comment">
438
+ <label>General Settings</label>
439
+ <frontend_type>text</frontend_type>
440
+ <sort_order>10</sort_order>
441
+ <show_in_default>1</show_in_default>
442
+ <show_in_website>1</show_in_website>
443
+ <show_in_store>1</show_in_store>
444
+ <fields>
445
+ <enabled translate="label">
446
+ <label>Enabled</label>
447
+ <frontend_type>select</frontend_type>
448
+ <source_model>adminhtml/system_config_source_yesno</source_model>
449
+ <sort_order>10</sort_order>
450
+ <show_in_default>1</show_in_default>
451
+ <show_in_website>1</show_in_website>
452
+ <show_in_store>1</show_in_store>
453
+ </enabled>
454
+ <originator translate="label">
455
+ <label>Sender Name (Originator)</label>
456
+ <frontend_type>text</frontend_type>
457
+ <sort_order>20</sort_order>
458
+ <show_in_default>1</show_in_default>
459
+ <show_in_website>1</show_in_website>
460
+ <show_in_store>1</show_in_store>
461
+ <depends><enabled>1</enabled></depends>
462
+ </originator>
463
+ <method translate="label comment">
464
+ <label>Method</label>
465
+ <frontend_type>select</frontend_type>
466
+ <source_model>euromsg/system_config_source_sms_method</source_model>
467
+ <comment>WARNING: Consult with euro.message staff before changing sending method.</comment>
468
+ <sort_order>30</sort_order>
469
+ <show_in_default>1</show_in_default>
470
+ <show_in_website>1</show_in_website>
471
+ <show_in_store>1</show_in_store>
472
+ <depends><enabled>1</enabled></depends>
473
+ </method>
474
+ <attribute translate="label comment">
475
+ <label>Customer Attribute</label>
476
+ <frontend_type>select</frontend_type>
477
+ <source_model>euromsg/system_config_source_customer_attributes</source_model>
478
+ <backend_model>euromsg/system_config_backend_attributes</backend_model>
479
+ <comment>Customer attribute that includes gsm number.</comment>
480
+ <sort_order>40</sort_order>
481
+ <show_in_default>1</show_in_default>
482
+ <show_in_website>1</show_in_website>
483
+ <show_in_store>1</show_in_store>
484
+ <depends><enabled>1</enabled></depends>
485
+ </attribute>
486
+ </fields>
487
+ </general>
488
+ <log module="euromsg" translate="label comment">
489
+ <label>Logging and Reports</label>
490
+ <frontend_type>text</frontend_type>
491
+ <sort_order>20</sort_order>
492
+ <show_in_default>1</show_in_default>
493
+ <show_in_website>1</show_in_website>
494
+ <show_in_store>1</show_in_store>
495
+ <fields>
496
+ <enabled translate="label">
497
+ <label>Enable SMS Log</label>
498
+ <frontend_type>select</frontend_type>
499
+ <source_model>adminhtml/system_config_source_yesno</source_model>
500
+ <sort_order>10</sort_order>
501
+ <show_in_default>1</show_in_default>
502
+ <show_in_website>1</show_in_website>
503
+ <show_in_store>1</show_in_store>
504
+ </enabled>
505
+ <log_days translate="label">
506
+ <label>Save Log, Days</label>
507
+ <frontend_type>text</frontend_type>
508
+ <sort_order>20</sort_order>
509
+ <show_in_default>1</show_in_default>
510
+ <show_in_website>1</show_in_website>
511
+ <show_in_store>1</show_in_store>
512
+ <depends><enabled>1</enabled></depends>
513
+ </log_days>
514
+ <track_delivery translate="label">
515
+ <label>Track Delivery Reports</label>
516
+ <frontend_type>select</frontend_type>
517
+ <source_model>adminhtml/system_config_source_yesno</source_model>
518
+ <sort_order>30</sort_order>
519
+ <show_in_default>1</show_in_default>
520
+ <show_in_website>1</show_in_website>
521
+ <show_in_store>1</show_in_store>
522
+ <depends><enabled>1</enabled></depends>
523
+ </track_delivery>
524
+ </fields>
525
+ </log>
526
+ <template module="euromsg" translate="label comment">
527
+ <label>SMS Templates</label>
528
+ <frontend_type>text</frontend_type>
529
+ <sort_order>30</sort_order>
530
+ <show_in_default>1</show_in_default>
531
+ <show_in_website>1</show_in_website>
532
+ <show_in_store>1</show_in_store>
533
+ <comment>You can edit SMS templates using variables commented for each template.</comment>
534
+ <fields>
535
+ <footer translate="label">
536
+ <label>SMS Suffix</label>
537
+ <frontend_type>text</frontend_type>
538
+ <sort_order>10</sort_order>
539
+ <show_in_default>1</show_in_default>
540
+ <show_in_website>1</show_in_website>
541
+ <show_in_store>1</show_in_store>
542
+ </footer>
543
+ <sms_new_order>
544
+ <label>Notify on New Order</label>
545
+ <frontend_type>select</frontend_type>
546
+ <source_model>adminhtml/system_config_source_yesno</source_model>
547
+ <sort_order>20</sort_order>
548
+ <show_in_default>1</show_in_default>
549
+ <show_in_website>1</show_in_website>
550
+ <show_in_store>1</show_in_store>
551
+ </sms_new_order>
552
+ <sms_new_order_template>
553
+ <label>New Order Template</label>
554
+ <frontend_type>textarea</frontend_type>
555
+ <comment>{{var order.increment_id}} {{var order.customer_firstname}} {{var order.customer_lastname}} {{var order.customer_email}} {{var order.grand_total}} {{var customer.email}} {{var suffix}}</comment>
556
+ <sort_order>25</sort_order>
557
+ <show_in_default>1</show_in_default>
558
+ <show_in_website>1</show_in_website>
559
+ <show_in_store>1</show_in_store>
560
+ <depends><sms_new_order>1</sms_new_order></depends>
561
+ </sms_new_order_template>
562
+ <sms_order_update>
563
+ <label>Notify on Order Update</label>
564
+ <frontend_type>select</frontend_type>
565
+ <source_model>adminhtml/system_config_source_yesno</source_model>
566
+ <sort_order>30</sort_order>
567
+ <show_in_default>1</show_in_default>
568
+ <show_in_website>1</show_in_website>
569
+ <show_in_store>1</show_in_store>
570
+ </sms_order_update>
571
+ <sms_order_update_template>
572
+ <label>Order Udpate Template</label>
573
+ <frontend_type>textarea</frontend_type>
574
+ <comment>{{var comment}} {{var order.increment_id}} {{var order.customer_firstname}} {{var order.customer_lastname}} {{var order.customer_email}} {{var order.grand_total}} {{var customer.email}} {{var suffix}</comment>
575
+ <sort_order>35</sort_order>
576
+ <show_in_default>1</show_in_default>
577
+ <show_in_website>1</show_in_website>
578
+ <show_in_store>1</show_in_store>
579
+ <depends><sms_order_update>1</sms_order_update></depends>
580
+ </sms_order_update_template>
581
+ <sms_new_invoice>
582
+ <label>Notify on New Invoice</label>
583
+ <frontend_type>select</frontend_type>
584
+ <source_model>adminhtml/system_config_source_yesno</source_model>
585
+ <sort_order>40</sort_order>
586
+ <show_in_default>1</show_in_default>
587
+ <show_in_website>1</show_in_website>
588
+ <show_in_store>1</show_in_store>
589
+ </sms_new_invoice>
590
+ <sms_new_invoice_template>
591
+ <label>New Invoice Template</label>
592
+ <frontend_type>textarea</frontend_type>
593
+ <comment>{{var invoice.increment_id}} {{var order.increment_id}} {{var order.customer_firstname}} {{var order.customer_lastname}} {{var order.customer_email}} {{var order.grand_total}} {{var customer.email}} {{var suffix}}</comment>
594
+ <sort_order>45</sort_order>
595
+ <show_in_default>1</show_in_default>
596
+ <show_in_website>1</show_in_website>
597
+ <show_in_store>1</show_in_store>
598
+ <depends><sms_new_invoice>1</sms_new_invoice></depends>
599
+ </sms_new_invoice_template>
600
+ <sms_new_shipment>
601
+ <label>Notify on New Shipment</label>
602
+ <frontend_type>select</frontend_type>
603
+ <source_model>adminhtml/system_config_source_yesno</source_model>
604
+ <sort_order>50</sort_order>
605
+ <show_in_default>1</show_in_default>
606
+ <show_in_website>1</show_in_website>
607
+ <show_in_store>1</show_in_store>
608
+ </sms_new_shipment>
609
+ <sms_new_shipment_template>
610
+ <label>New Shipment Template</label>
611
+ <frontend_type>textarea</frontend_type>
612
+ <comment>{{var shipment.increment_id}} {{var order.increment_id}} {{var order.customer_firstname}} {{var order.customer_lastname}} {{var order.customer_email}} {{var order.grand_total}} {{var customer.email}} {{var suffix}}</comment>
613
+ <sort_order>55</sort_order>
614
+ <show_in_default>1</show_in_default>
615
+ <show_in_website>1</show_in_website>
616
+ <show_in_store>1</show_in_store>
617
+ <depends><sms_new_shipment>1</sms_new_shipment></depends>
618
+ </sms_new_shipment_template>
619
+ <sms_new_track>
620
+ <label>Notify on New Shipment Tracking Number</label>
621
+ <frontend_type>select</frontend_type>
622
+ <source_model>adminhtml/system_config_source_yesno</source_model>
623
+ <sort_order>60</sort_order>
624
+ <show_in_default>1</show_in_default>
625
+ <show_in_website>1</show_in_website>
626
+ <show_in_store>1</show_in_store>
627
+ </sms_new_track>
628
+ <sms_new_track_template>
629
+ <label>New Shipment Tracking Number Template</label>
630
+ <frontend_type>textarea</frontend_type>
631
+ <comment>{{var track.track_number}} {{var shipment.increment_id}} {{var order.increment_id}} {{var order.customer_firstname}} {{var order.customer_lastname}} {{var order.customer_email}} {{var order.grand_total}} {{var customer.email}} {{var suffix}}</comment>
632
+ <sort_order>65</sort_order>
633
+ <show_in_default>1</show_in_default>
634
+ <show_in_website>1</show_in_website>
635
+ <show_in_store>1</show_in_store>
636
+ <depends><sms_new_track>1</sms_new_track></depends>
637
+ </sms_new_track_template>
638
+ <sms_new_creditmemo>
639
+ <label>Notify on New Credit Memo</label>
640
+ <frontend_type>select</frontend_type>
641
+ <source_model>adminhtml/system_config_source_yesno</source_model>
642
+ <sort_order>70</sort_order>
643
+ <show_in_default>1</show_in_default>
644
+ <show_in_website>1</show_in_website>
645
+ <show_in_store>1</show_in_store>
646
+ </sms_new_creditmemo>
647
+ <sms_new_creditmemo_template>
648
+ <label>New Credit Memo Template</label>
649
+ <frontend_type>textarea</frontend_type>
650
+ <comment>{{var creditmemo.increment_id}} {{var order.increment_id}} {{var order.customer_firstname}} {{var order.customer_lastname}} {{var order.customer_email}} {{var order.grand_total}} {{var customer.email}} {{var suffix}}</comment>
651
+ <sort_order>75</sort_order>
652
+ <show_in_default>1</show_in_default>
653
+ <show_in_website>1</show_in_website>
654
+ <show_in_store>1</show_in_store>
655
+ <depends><sms_new_creditmemo>1</sms_new_creditmemo></depends>
656
+ </sms_new_creditmemo_template>
657
+ </fields>
658
+ </template>
659
+ </groups>
660
+ </euromsg_sms>
661
+ <euromsg_customer translate="label" module="euromsg">
662
+ <label>Customer Data Integration</label>
663
+ <tab>euromsg_tab</tab>
664
+ <frontend_type>text</frontend_type>
665
+ <sort_order>20</sort_order>
666
+ <show_in_default>1</show_in_default>
667
+ <show_in_website>1</show_in_website>
668
+ <show_in_store>1</show_in_store>
669
+ <groups>
670
+ <general module="euromsg" translate="label comment">
671
+ <label>General Settings</label>
672
+ <expanded>true</expanded>
673
+ <sort_order>10</sort_order>
674
+ <show_in_default>1</show_in_default>
675
+ <show_in_website>1</show_in_website>
676
+ <show_in_store>1</show_in_store>
677
+ <comment><![CDATA[<div style='height: 20px;margin-bottom:10px;'> <img style='float:left;' src='http://numerno.com/media/modules/euromsg-logo.png' /></div> Configure your customer data synchronization preferences below. If you have any questions or would like any help please visit <a href='http://numerno.com' target='_blank'>numerno.com</a>.]]></comment>
678
+ <fields>
679
+ <source translate="label">
680
+ <label>Use Data From</label>
681
+ <frontend_type>select</frontend_type>
682
+ <source_model>euromsg/system_config_source_customer_dataSource</source_model>
683
+ <sort_order>10</sort_order>
684
+ <show_in_default>1</show_in_default>
685
+ <show_in_website>0</show_in_website>
686
+ <show_in_store>0</show_in_store>
687
+ </source>
688
+ <use_unsubscribed translate="label">
689
+ <label>Use Unsubscribed Data</label>
690
+ <frontend_type>select</frontend_type>
691
+ <source_model>adminhtml/system_config_source_yesno</source_model>
692
+ <sort_order>20</sort_order>
693
+ <show_in_default>1</show_in_default>
694
+ <show_in_website>0</show_in_website>
695
+ <show_in_store>0</show_in_store>
696
+ </use_unsubscribed>
697
+ <notify translate="label">
698
+ <label>Send Notification Emails to</label>
699
+ <frontend_type>text</frontend_type>
700
+ <backend_model>adminhtml/system_config_backend_email_address</backend_model>
701
+ <sort_order>30</sort_order>
702
+ <show_in_default>1</show_in_default>
703
+ <show_in_website>0</show_in_website>
704
+ <show_in_store>0</show_in_store>
705
+ </notify>
706
+ <filename translate="label comment">
707
+ <label>Data Warehouse Table Name</label>
708
+ <comment>Default euro.message Data Warehouse Table Name for synchronization.</comment>
709
+ <sort_order>40</sort_order>
710
+ <show_in_default>1</show_in_default>
711
+ <show_in_website>0</show_in_website>
712
+ <show_in_store>0</show_in_store>
713
+ </filename>
714
+ <sync_now translate="label comment">
715
+ <label>Synchronize Now</label>
716
+ <comment>Form will be saved after synchronization.</comment>
717
+ <frontend_type>button</frontend_type>
718
+ <frontend_model>euromsg/adminhtml_form_field_syncNow</frontend_model>
719
+ <synchronize>member</synchronize>
720
+ <sort_order>50</sort_order>
721
+ <show_in_default>1</show_in_default>
722
+ <show_in_website>0</show_in_website>
723
+ <show_in_store>0</show_in_store>
724
+ </sync_now>
725
+ <autosync translate="label">
726
+ <label>Synchronization Enabled</label>
727
+ <frontend_type>select</frontend_type>
728
+ <source_model>adminhtml/system_config_source_yesno</source_model>
729
+ <sort_order>60</sort_order>
730
+ <show_in_default>1</show_in_default>
731
+ <show_in_website>0</show_in_website>
732
+ <show_in_store>0</show_in_store>
733
+ </autosync>
734
+ <frequency translate="label">
735
+ <label>Synchronization Frequency</label>
736
+ <frontend_type>select</frontend_type>
737
+ <source_model>euromsg/system_config_source_cron_frequency</source_model>
738
+ <backend_model>euromsg/system_config_backend_cron</backend_model>
739
+ <job>euromsg_autosync_customers</job>
740
+ <sort_order>70</sort_order>
741
+ <show_in_default>1</show_in_default>
742
+ <show_in_website>0</show_in_website>
743
+ <show_in_store>0</show_in_store>
744
+ <depends>
745
+ <autosync>1</autosync>
746
+ </depends>
747
+ </frequency>
748
+ <time translate="label">
749
+ <label>Synchronization Start Time</label>
750
+ <frontend_type>time</frontend_type>
751
+ <sort_order>80</sort_order>
752
+ <show_in_default>1</show_in_default>
753
+ <show_in_website>0</show_in_website>
754
+ <show_in_store>0</show_in_store>
755
+ <depends>
756
+ <autosync>1</autosync>
757
+ <frequency separator=",">D,W,M</frequency>
758
+ </depends>
759
+ </time>
760
+ <hour translate="label">
761
+ <label>Synchronization Interval</label>
762
+ <frontend_type>select</frontend_type>
763
+ <source_model>euromsg/system_config_source_cron_hours</source_model>
764
+ <sort_order>90</sort_order>
765
+ <show_in_default>1</show_in_default>
766
+ <show_in_website>0</show_in_website>
767
+ <show_in_store>0</show_in_store>
768
+ <depends>
769
+ <autosync>1</autosync>
770
+ <frequency>H</frequency>
771
+ </depends>
772
+ </hour>
773
+ <attributes translate="label">
774
+ <label>Attributes</label>
775
+ <frontend_model>euromsg/adminhtml_form_field_customerAttributes</frontend_model>
776
+ <backend_model>euromsg/system_config_backend_attributes</backend_model>
777
+ <sort_order>100</sort_order>
778
+ <show_in_default>1</show_in_default>
779
+ <show_in_website>0</show_in_website>
780
+ <show_in_store>0</show_in_store>
781
+ </attributes>
782
+ </fields>
783
+ </general>
784
+ </groups>
785
+ </euromsg_customer>
786
+ <euromsg_catalog translate="label" module="euromsg">
787
+ <label>Catalog Data Integration</label>
788
+ <tab>euromsg_tab</tab>
789
+ <sort_order>30</sort_order>
790
+ <show_in_default>1</show_in_default>
791
+ <show_in_website>1</show_in_website>
792
+ <show_in_store>1</show_in_store>
793
+ <groups>
794
+ <general module="euromsg" translate="label comment">
795
+ <label>General Settings</label>
796
+ <expanded>true</expanded>
797
+ <sort_order>10</sort_order>
798
+ <show_in_default>1</show_in_default>
799
+ <show_in_website>1</show_in_website>
800
+ <show_in_store>1</show_in_store>
801
+ <comment><![CDATA[<div style='height: 20px;margin-bottom:10px;'> <img style='float:left;' src='http://numerno.com/media/modules/euromsg-logo.png' /></div> Configure your catalog data synchronization preferences below. If you have any questions or would like any help please visit <a href='http://numerno.com' target='_blank'>numerno.com</a>.]]></comment>
802
+ <fields>
803
+ <export translate="label">
804
+ <label>Export Only Visible Products</label>
805
+ <frontend_type>select</frontend_type>
806
+ <source_model>adminhtml/system_config_source_yesno</source_model>
807
+ <sort_order>10</sort_order>
808
+ <show_in_default>1</show_in_default>
809
+ <show_in_website>1</show_in_website>
810
+ <show_in_store>1</show_in_store>
811
+ </export>
812
+ <notify translate="label">
813
+ <label>Send Notification Emails to</label>
814
+ <frontend_type>text</frontend_type>
815
+ <backend_model>adminhtml/system_config_backend_email_address</backend_model>
816
+ <sort_order>20</sort_order>
817
+ <show_in_default>1</show_in_default>
818
+ <show_in_website>1</show_in_website>
819
+ <show_in_store>1</show_in_store>
820
+ </notify>
821
+ <filename translate="label comment">
822
+ <label>Data Warehouse Table Name</label>
823
+ <comment>euro.message default is PRODUCTS. Change only if requested by euro.message</comment>
824
+ <sort_order>30</sort_order>
825
+ <show_in_default>1</show_in_default>
826
+ <show_in_website>1</show_in_website>
827
+ <show_in_store>1</show_in_store>
828
+ </filename>
829
+ <sync_now translate="label comment">
830
+ <label>Synchronize Now</label>
831
+ <comment>Form will be saved after synchronization.</comment>
832
+ <frontend_type>button</frontend_type>
833
+ <frontend_model>euromsg/adminhtml_form_field_syncNow</frontend_model>
834
+ <synchronize>product</synchronize>
835
+ <sort_order>40</sort_order>
836
+ <show_in_default>1</show_in_default>
837
+ <show_in_website>1</show_in_website>
838
+ <show_in_store>1</show_in_store>
839
+ </sync_now>
840
+ <autosync translate="label">
841
+ <label>Synchronization Enabled</label>
842
+ <frontend_type>select</frontend_type>
843
+ <source_model>adminhtml/system_config_source_yesno</source_model>
844
+ <sort_order>50</sort_order>
845
+ <show_in_default>1</show_in_default>
846
+ <show_in_website>0</show_in_website>
847
+ <show_in_store>0</show_in_store>
848
+ </autosync>
849
+ <frequency translate="label">
850
+ <label>Synchronization Frequency</label>
851
+ <frontend_type>select</frontend_type>
852
+ <source_model>euromsg/system_config_source_cron_frequency</source_model>
853
+ <backend_model>euromsg/system_config_backend_cron</backend_model>
854
+ <job>euromsg_autosync_catalog</job>
855
+ <sort_order>60</sort_order>
856
+ <show_in_default>1</show_in_default>
857
+ <show_in_website>0</show_in_website>
858
+ <show_in_store>0</show_in_store>
859
+ <depends>
860
+ <autosync>1</autosync>
861
+ </depends>
862
+ </frequency>
863
+ <time translate="label">
864
+ <label>Synchronization Start Time</label>
865
+ <frontend_type>time</frontend_type>
866
+ <sort_order>70</sort_order>
867
+ <show_in_default>1</show_in_default>
868
+ <show_in_website>0</show_in_website>
869
+ <show_in_store>0</show_in_store>
870
+ <depends>
871
+ <autosync>1</autosync>
872
+ <frequency separator=",">D,W,M</frequency>
873
+ </depends>
874
+ </time>
875
+ <hour translate="label">
876
+ <label>Synchronization Interval</label>
877
+ <frontend_type>select</frontend_type>
878
+ <source_model>euromsg/system_config_source_cron_hours</source_model>
879
+ <sort_order>80</sort_order>
880
+ <show_in_default>1</show_in_default>
881
+ <show_in_website>0</show_in_website>
882
+ <show_in_store>0</show_in_store>
883
+ <depends>
884
+ <autosync>1</autosync>
885
+ <frequency>H</frequency>
886
+ </depends>
887
+ </hour>
888
+ <attributes translate="label">
889
+ <label>Attributes</label>
890
+ <frontend_model>euromsg/adminhtml_form_field_attributes</frontend_model>
891
+ <backend_model>euromsg/system_config_backend_attributes</backend_model>
892
+ <sort_order>90</sort_order>
893
+ <show_in_default>1</show_in_default>
894
+ <show_in_website>1</show_in_website>
895
+ <show_in_store>1</show_in_store>
896
+ </attributes>
897
+ </fields>
898
+ </general>
899
+ <advanced module="euromsg" translate="label comment">
900
+ <label>Advanced Settings</label>
901
+ <expanded>false</expanded>
902
+ <frontend_type>text</frontend_type>
903
+ <sort_order>30</sort_order>
904
+ <show_in_default>1</show_in_default>
905
+ <show_in_website>0</show_in_website>
906
+ <show_in_store>0</show_in_store>
907
+ <comment>These values will be used to calculate how many products to load per export iteration.</comment>
908
+ <fields>
909
+ <memory_limit translate="label comment">
910
+ <label>Default Memory Limit</label>
911
+ <frontend_type>text</frontend_type>
912
+ <comment><![CDATA[If <i>ini_get('memory_limit')</i> doesn't retrieve memory limit, this will be used as default]]></comment>
913
+ <sort_order>5</sort_order>
914
+ <show_in_default>1</show_in_default>
915
+ <show_in_website>0</show_in_website>
916
+ <show_in_store>0</show_in_store>
917
+ </memory_limit>
918
+ <memory_pp translate="label comment">
919
+ <label>Memory Per Product</label>
920
+ <frontend_type>text</frontend_type>
921
+ <comment>One product to have up to such size of memory</comment>
922
+ <sort_order>10</sort_order>
923
+ <show_in_default>1</show_in_default>
924
+ <show_in_website>0</show_in_website>
925
+ <show_in_store>0</show_in_store>
926
+ </memory_pp>
927
+ <memory_percent translate="label comment">
928
+ <label>Memory Usage Percent (%)</label>
929
+ <frontend_type>text</frontend_type>
930
+ <comment>Calculated memory usage percent to be used per export iteration. Any value higher than 80 will be ignored to have supply</comment>
931
+ <sort_order>20</sort_order>
932
+ <show_in_default>1</show_in_default>
933
+ <show_in_website>0</show_in_website>
934
+ <show_in_store>0</show_in_store>
935
+ </memory_percent>
936
+ <minimum_products translate="label comment">
937
+ <label>Minimum Products Limit</label>
938
+ <frontend_type>text</frontend_type>
939
+ <comment>Minimum product count limit will be overriden with this value if a lower value calculated</comment>
940
+ <sort_order>30</sort_order>
941
+ <show_in_default>1</show_in_default>
942
+ <show_in_website>0</show_in_website>
943
+ <show_in_store>0</show_in_store>
944
+ </minimum_products>
945
+ </fields>
946
+ </advanced>
947
+ </groups>
948
+ </euromsg_catalog>
949
+ </sections>
950
+ </config>
app/code/local/Numerno/Euromsg/sql/euromsg_setup/install-1.0.0.php ADDED
@@ -0,0 +1,262 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Numerno - Euro.message Magento Extension
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the NUMERNO EUROMESSAGE MAGENTO EXTENSION License, which extends the Open Software
8
+ * License (OSL 3.0). The Euro.message Magento Extension License is available at this URL:
9
+ * http://numerno.com/licenses/euromsg-ce.txt The Open Software License is available at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ *
12
+ * DISCLAIMER
13
+ *
14
+ * By adding to, editing, or in any way modifying this code, Numerno is not held liable for any inconsistencies or
15
+ * abnormalities in the behaviour of this code. By adding to, editing, or in any way modifying this code, the Licensee
16
+ * terminates any agreement of support offered by Numerno, outlined in the provided Euro.message Magento Extension
17
+ * License.
18
+ * Upon discovery of modified code in the process of support, the Licensee is still held accountable for any and all
19
+ * billable time Numerno spent during the support process. Numerno does not guarantee compatibility with any other
20
+ * Magento extension. Numerno is not responsbile for any inconsistencies or abnormalities in the behaviour of this
21
+ * code if caused by other Magento extension.
22
+ * If you did not receive a copy of the license, please send an email to info@numerno.com or call +90-212-223-5093,
23
+ * so we can send you a copy immediately.
24
+ *
25
+ * @category [Numerno]
26
+ * @package [Numerno_Euromsg]
27
+ * @copyright Copyright (c) 2015 Numerno Bilisim Hiz. Tic. Ltd. Sti. (http://numerno.com/)
28
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
29
+ */
30
+
31
+ /* @var $installer Mage_Core_Model_Resource_Setup */
32
+ $installer = $this;
33
+
34
+ $installer->startSetup();
35
+
36
+ /**
37
+ * Add Customer Attribute
38
+ */
39
+ $attributeCode = Numerno_Euromsg_Model_Sms::SMS_PERMIT_ATTRIBUTE_CODE;
40
+ $installer->addAttribute('customer', $attributeCode, array(
41
+ 'type' => 'int',
42
+ 'backend' => 'customer/attribute_backend_data_boolean',
43
+ 'label' => 'SMS Permit',
44
+ 'input' => 'boolean',
45
+ 'visible' => true,
46
+ 'required' => false,
47
+ 'default' => 0,
48
+ 'unique' => false
49
+ ));
50
+
51
+ /**
52
+ * Add Customer Attribute to Default Attribute Set and Attribute Group
53
+ */
54
+ $setup = new Mage_Eav_Model_Entity_Setup('core_setup');
55
+ $entityTypeId = $setup->getEntityTypeId('customer');
56
+ $attributeSetId = $setup->getDefaultAttributeSetId($entityTypeId);
57
+ $attributeGroupId = $setup->getDefaultAttributeGroupId($entityTypeId, $attributeSetId);
58
+ $attribute = Mage::getSingleton('eav/config')->getAttribute('customer', $attributeCode);
59
+
60
+ $setup->addAttributeToGroup(
61
+ $entityTypeId,
62
+ $attributeSetId,
63
+ $attributeGroupId,
64
+ $attributeCode,
65
+ '100'
66
+ );
67
+ $attribute
68
+ ->setData('used_in_forms', array(
69
+ 'adminhtml_customer',
70
+ 'checkout_register',
71
+ 'customer_account_create',
72
+ 'customer_account_edit'
73
+ ))
74
+ ->setData('is_used_for_customer_segment', true)
75
+ ->setData('is_system', 0)
76
+ ->setData('is_user_defined', 1)
77
+ ->setData('is_visible', 1)
78
+ ->setData('sort_order', 100)
79
+ ->save();
80
+
81
+ /**
82
+ * Create table 'euromsg/process'
83
+ */
84
+ $table = $installer->getConnection()
85
+ ->newTable($installer->getTable('euromsg/process'))
86
+ ->addColumn('process_id', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array(
87
+ 'identity' => true,
88
+ 'unsigned' => true,
89
+ 'nullable' => false,
90
+ 'primary' => true,
91
+ ), 'Process Id')
92
+ ->addColumn('table_name', Varien_Db_Ddl_Table::TYPE_TEXT, 150, array(
93
+ 'nullable' => false,
94
+ 'default' => null,
95
+ ), 'Data Warehouse Table Name')
96
+ ->addColumn('type', Varien_Db_Ddl_Table::TYPE_TEXT, 150, array(
97
+ 'nullable' => false,
98
+ 'default' => null,
99
+ ), 'Source Type')
100
+ ->addColumn('filter', Varien_Db_Ddl_Table::TYPE_TEXT, null, array(
101
+ 'nullable' => true,
102
+ 'default' => null,
103
+ ), 'Filter')
104
+ ->addColumn('version', Varien_Db_Ddl_Table::TYPE_TEXT, 150, array(
105
+ 'nullable' => true,
106
+ 'default' => null,
107
+ ), 'Table Version')
108
+ ->addColumn('status', Varien_Db_Ddl_Table::TYPE_TEXT, 150, array(
109
+ 'nullable' => false,
110
+ 'default' => 'pending',
111
+ ), 'Process Status')
112
+ ->addColumn('error', Varien_Db_Ddl_Table::TYPE_TEXT, null, array(
113
+ 'nullable' => true,
114
+ 'default' => null,
115
+ ), 'Process Error')
116
+ ->addColumn('scheduled_at', Varien_Db_Ddl_Table::TYPE_TIMESTAMP, null, array(
117
+ 'nullable' => true,
118
+ ), 'Scheduled At')
119
+ ->addColumn('started_at', Varien_Db_Ddl_Table::TYPE_TIMESTAMP, null, array(
120
+ 'nullable' => false,
121
+ ), 'Started At')
122
+ ->addColumn('ended_at', Varien_Db_Ddl_Table::TYPE_TIMESTAMP, null, array(
123
+ ), 'Ended At')
124
+ ->setComment('euro.message Processes');
125
+ $installer->getConnection()->createTable($table);
126
+
127
+ /**
128
+ * Create table 'euromsg/mail_log'
129
+ */
130
+ $table = $installer->getConnection()
131
+ ->newTable($installer->getTable('euromsg/mail_log'))
132
+ ->addColumn('log_id', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array(
133
+ 'identity' => true,
134
+ 'unsigned' => true,
135
+ 'nullable' => false,
136
+ 'primary' => true,
137
+ ), 'Process Id')
138
+ ->addColumn('post_id', Varien_Db_Ddl_Table::TYPE_TEXT, 50, array(
139
+ 'nullable' => true,
140
+ 'default' => null,
141
+ ), 'Post Web Service ID')
142
+ ->addColumn('send_at', Varien_Db_Ddl_Table::TYPE_TIMESTAMP, null, array(
143
+ ), 'Scheduled At')
144
+ ->addColumn('response_code', Varien_Db_Ddl_Table::TYPE_TEXT, 10, array(
145
+ 'nullable' => true,
146
+ 'default' => null,
147
+ ), 'Post Web Service Response Code')
148
+ ->addColumn('response_message', Varien_Db_Ddl_Table::TYPE_TEXT, null, array(
149
+ 'nullable' => true,
150
+ 'default' => null,
151
+ ), 'Post Web Service Response Message')
152
+ ->addColumn('response_message_detailed', Varien_Db_Ddl_Table::TYPE_TEXT, null, array(
153
+ 'nullable' => true,
154
+ 'default' => null,
155
+ ), 'Post Web Service Response Message Detailed')
156
+ ->addColumn('marked_spam', Varien_Db_Ddl_Table::TYPE_SMALLINT, null, array(
157
+ 'unsigned' => true,
158
+ ), 'Marked Spam')
159
+ ->addColumn('mail_subject', Varien_Db_Ddl_Table::TYPE_TEXT, null, array(
160
+ 'nullable' => true,
161
+ 'default' => null,
162
+ ), 'Email Subject')
163
+ ->addColumn('mail_body', Varien_Db_Ddl_Table::TYPE_TEXT, null, array(
164
+ 'nullable' => true,
165
+ 'default' => null,
166
+ ), 'Email Body')
167
+ ->addColumn('mail_charset', Varien_Db_Ddl_Table::TYPE_TEXT, 50, array(
168
+ 'nullable' => true,
169
+ 'default' => null,
170
+ ), 'Email Character Set')
171
+ ->addColumn('mail_to_name', Varien_Db_Ddl_Table::TYPE_TEXT, 255, array(
172
+ 'nullable' => true,
173
+ 'default' => null,
174
+ ), 'Email To Name')
175
+ ->addColumn('mail_to_address', Varien_Db_Ddl_Table::TYPE_TEXT, 255, array(
176
+ 'nullable' => true,
177
+ 'default' => null,
178
+ ), 'Email To Address')
179
+ ->addColumn('mail_type', Varien_Db_Ddl_Table::TYPE_TEXT, 255, array(
180
+ 'nullable' => true,
181
+ 'default' => null,
182
+ ), 'Email Type')
183
+ ->addColumn('delivery_relay_status', Varien_Db_Ddl_Table::TYPE_TEXT, 10, array(
184
+ 'nullable' => true,
185
+ 'default' => null,
186
+ ), 'Delivery Relay Status')
187
+ ->addColumn('delivery_status', Varien_Db_Ddl_Table::TYPE_TEXT, 10, array(
188
+ 'nullable' => true,
189
+ 'default' => null,
190
+ ), 'Delivery Status')
191
+ ->addColumn('undelivery_reason', Varien_Db_Ddl_Table::TYPE_TEXT, null, array(
192
+ 'nullable' => true,
193
+ 'default' => null,
194
+ ), 'Undelivery Reason')
195
+ ->setComment('euro.message Mail Logs');
196
+ $installer->getConnection()->createTable($table);
197
+
198
+ /**
199
+ * Create table 'euromsg/sms'
200
+ */
201
+ $table = $installer->getConnection()
202
+ ->newTable($installer->getTable('euromsg/sms'))
203
+ ->addColumn('sms_id', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array(
204
+ 'identity' => true,
205
+ 'unsigned' => true,
206
+ 'nullable' => false,
207
+ 'primary' => true,
208
+ ), 'SMS Id')
209
+ ->addColumn('packet_id', Varien_Db_Ddl_Table::TYPE_TEXT, 50, array(
210
+ 'nullable' => true,
211
+ 'default' => null,
212
+ ), 'PostSms Web Service Packet ID')
213
+ ->addColumn('begin_time', Varien_Db_Ddl_Table::TYPE_TIMESTAMP, null, array(
214
+ ), 'Begin Time')
215
+ ->addColumn('response_code', Varien_Db_Ddl_Table::TYPE_TEXT, 10, array(
216
+ 'nullable' => true,
217
+ 'default' => null,
218
+ ), 'PostSms Web Service Response Code')
219
+ ->addColumn('response_message', Varien_Db_Ddl_Table::TYPE_TEXT, null, array(
220
+ 'nullable' => true,
221
+ 'default' => null,
222
+ ), 'PostSms Web Service Response Message')
223
+ ->addColumn('response_message_detailed', Varien_Db_Ddl_Table::TYPE_TEXT, null, array(
224
+ 'nullable' => true,
225
+ 'default' => null,
226
+ ), 'PostSms Web Service Response Message Detailed')
227
+ ->addColumn('type', Varien_Db_Ddl_Table::TYPE_TEXT, 16, array(
228
+ 'nullable' => true,
229
+ 'default' => null,
230
+ ), 'SMS Type')
231
+ ->addColumn('customer_id', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array(
232
+ 'unsigned' => true,
233
+ ), 'Customer Id')
234
+ ->addColumn('gsm_number', Varien_Db_Ddl_Table::TYPE_TEXT, 16, array(
235
+ 'nullable' => true,
236
+ 'default' => null,
237
+ ), 'GSM Number')
238
+ ->addColumn('message', Varien_Db_Ddl_Table::TYPE_TEXT, null, array(
239
+ 'nullable' => true,
240
+ 'default' => null,
241
+ ), 'SMS Message')
242
+ ->addColumn('delivery_status', Varien_Db_Ddl_Table::TYPE_TEXT, 10, array(
243
+ 'nullable' => true,
244
+ 'default' => null,
245
+ ), 'Delivery Status')
246
+ ->addColumn('delivery_time', Varien_Db_Ddl_Table::TYPE_TIMESTAMP, null, array(
247
+ 'nullable' => true,
248
+ 'default' => null,
249
+ ), 'Delivery Time')
250
+ ->addColumn('delivery_message', Varien_Db_Ddl_Table::TYPE_TEXT, null, array(
251
+ 'nullable' => true,
252
+ 'default' => null,
253
+ ), 'Delivery Message')
254
+ ->addIndex($installer->getIdxName('euromsg/sms_log', array('customer_id')),
255
+ array('customer_id'))
256
+ ->addForeignKey($installer->getFkName('euromsg/sms_log', 'customer_id', 'customer/entity', 'entity_id'),
257
+ 'customer_id', $installer->getTable('customer/entity'), 'entity_id',
258
+ Varien_Db_Ddl_Table::ACTION_SET_NULL, Varien_Db_Ddl_Table::ACTION_CASCADE)
259
+ ->setComment('euro.message SMS Logs');
260
+ $installer->getConnection()->createTable($table);
261
+
262
+ $installer->endSetup();
app/design/adminhtml/default/default/layout/euromsg.xml ADDED
@@ -0,0 +1,81 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * Numerno - Euro.message Magento Extension
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the NUMERNO EUROMESSAGE MAGENTO EXTENSION License, which extends the Open Software
9
+ * License (OSL 3.0). The Euro.message Magento Extension License is available at this URL:
10
+ * http://numerno.com/licenses/euromsg-ce.txt The Open Software License is available at this URL:
11
+ * http://opensource.org/licenses/osl-3.0.php
12
+ *
13
+ * DISCLAIMER
14
+ *
15
+ * By adding to, editing, or in any way modifying this code, Numerno is not held liable for any inconsistencies or
16
+ * abnormalities in the behaviour of this code. By adding to, editing, or in any way modifying this code, the Licensee
17
+ * terminates any agreement of support offered by Numerno, outlined in the provided Euro.message Magento Extension
18
+ * License.
19
+ * Upon discovery of modified code in the process of support, the Licensee is still held accountable for any and all
20
+ * billable time Numerno spent during the support process. Numerno does not guarantee compatibility with any other
21
+ * Magento extension. Numerno is not responsbile for any inconsistencies or abnormalities in the behaviour of this
22
+ * code if caused by other Magento extension.
23
+ * If you did not receive a copy of the license, please send an email to info@numerno.com or call +90-212-223-5093,
24
+ * so we can send you a copy immediately.
25
+ *
26
+ * @category [Numerno]
27
+ * @package [Numerno_Euromsg]
28
+ * @copyright Copyright (c) 2015 Numerno Bilisim Hiz. Tic. Ltd. Sti. (http://numerno.com/)
29
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
30
+ */
31
+ -->
32
+
33
+ <layout>
34
+ <adminhtml_sales_order_addcomment>
35
+ <reference name="order_history">
36
+ <action method="setTemplate"><template>euromsg/sales/order/view/history.phtml</template></action>
37
+ </reference>
38
+ </adminhtml_sales_order_addcomment>
39
+
40
+ <adminhtml_sales_order_view>
41
+ <reference name="order_history">
42
+ <action method="setTemplate"><template>euromsg/sales/order/view/history.phtml</template></action>
43
+ </reference>
44
+ </adminhtml_sales_order_view>
45
+
46
+ <adminhtml_sales_order_invoice_addcomment>
47
+ <reference name="order_comments">
48
+ <action method="setTemplate"><template>euromsg/sales/order/comments/view.phtml</template></action>
49
+ </reference>
50
+ </adminhtml_sales_order_invoice_addcomment>
51
+
52
+ <adminhtml_sales_order_invoice_view>
53
+ <reference name="order_comments">
54
+ <action method="setTemplate"><template>euromsg/sales/order/comments/view.phtml</template></action>
55
+ </reference>
56
+ </adminhtml_sales_order_invoice_view>
57
+
58
+ <adminhtml_sales_order_shipment_addcomment>
59
+ <reference name="order_comments">
60
+ <action method="setTemplate"><template>euromsg/sales/order/comments/view.phtml</template></action>
61
+ </reference>
62
+ </adminhtml_sales_order_shipment_addcomment>
63
+
64
+ <adminhtml_sales_order_shipment_view>
65
+ <reference name="order_comments">
66
+ <action method="setTemplate"><template>euromsg/sales/order/comments/view.phtml</template></action>
67
+ </reference>
68
+ </adminhtml_sales_order_shipment_view>
69
+
70
+ <adminhtml_sales_order_creditmemo_addcomment>
71
+ <reference name="order_comments">
72
+ <action method="setTemplate"><template>euromsg/sales/order/comments/view.phtml</template></action>
73
+ </reference>
74
+ </adminhtml_sales_order_creditmemo_addcomment>
75
+
76
+ <adminhtml_sales_order_creditmemo_view>
77
+ <reference name="order_comments">
78
+ <action method="setTemplate"><template>euromsg/sales/order/comments/view.phtml</template></action>
79
+ </reference>
80
+ </adminhtml_sales_order_creditmemo_view>
81
+ </layout>
app/design/adminhtml/default/default/template/euromsg/form/field/sync_now.phtml ADDED
@@ -0,0 +1,54 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Numerno - Euro.message Magento Extension
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the NUMERNO EUROMESSAGE MAGENTO EXTENSION License, which extends the Open Software
8
+ * License (OSL 3.0). The Euro.message Magento Extension License is available at this URL:
9
+ * http://numerno.com/licenses/euromsg-ce.txt The Open Software License is available at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ *
12
+ * DISCLAIMER
13
+ *
14
+ * By adding to, editing, or in any way modifying this code, Numerno is not held liable for any inconsistencies or
15
+ * abnormalities in the behaviour of this code. By adding to, editing, or in any way modifying this code, the Licensee
16
+ * terminates any agreement of support offered by Numerno, outlined in the provided Euro.message Magento Extension
17
+ * License.
18
+ * Upon discovery of modified code in the process of support, the Licensee is still held accountable for any and all
19
+ * billable time Numerno spent during the support process. Numerno does not guarantee compatibility with any other
20
+ * Magento extension. Numerno is not responsbile for any inconsistencies or abnormalities in the behaviour of this
21
+ * code if caused by other Magento extension.
22
+ * If you did not receive a copy of the license, please send an email to info@numerno.com or call +90-212-223-5093,
23
+ * so we can send you a copy immediately.
24
+ *
25
+ * @category [Numerno]
26
+ * @package [Numerno_Euromsg]
27
+ * @copyright Copyright (c) 2015 Numerno Bilisim Hiz. Tic. Ltd. Sti. (http://numerno.com/)
28
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
29
+ */
30
+
31
+ /**
32
+ * Synchronize Now Button
33
+ *
34
+ * @category Numerno
35
+ * @package Numerno_Euromsg
36
+ * @author Numerno Bilisim Hiz. Tic. Ltd. Sti. <info@numerno.com>
37
+ */
38
+ ?>
39
+ <?php /* @var $this Numerno_Euromsg_Block_Adminhtml_Form_Field_SyncNow */ ?>
40
+ <script type="text/javascript">
41
+ //<![CDATA[
42
+ function check() {
43
+ new Ajax.Request('<?php echo $this->getAjaxCheckUrl() ?>', {
44
+ method: 'post',
45
+ parameters: 'sync=<?php echo $this->getSynchronize() ?>',
46
+ onSuccess: function(transport){
47
+ configForm.submit()
48
+ }
49
+ });
50
+ }
51
+ //]]>
52
+ </script>
53
+
54
+ <?php echo $this->getButtonHtml() ?>
app/design/adminhtml/default/default/template/euromsg/grid/export_js.phtml ADDED
@@ -0,0 +1,79 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Numerno - Euro.message Magento Extension
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the NUMERNO EUROMESSAGE MAGENTO EXTENSION License, which extends the Open Software
8
+ * License (OSL 3.0). The Euro.message Magento Extension License is available at this URL:
9
+ * http://numerno.com/licenses/euromsg-ce.txt The Open Software License is available at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ *
12
+ * DISCLAIMER
13
+ *
14
+ * By adding to, editing, or in any way modifying this code, Numerno is not held liable for any inconsistencies or
15
+ * abnormalities in the behaviour of this code. By adding to, editing, or in any way modifying this code, the Licensee
16
+ * terminates any agreement of support offered by Numerno, outlined in the provided Euro.message Magento Extension
17
+ * License.
18
+ * Upon discovery of modified code in the process of support, the Licensee is still held accountable for any and all
19
+ * billable time Numerno spent during the support process. Numerno does not guarantee compatibility with any other
20
+ * Magento extension. Numerno is not responsbile for any inconsistencies or abnormalities in the behaviour of this
21
+ * code if caused by other Magento extension.
22
+ * If you did not receive a copy of the license, please send an email to info@numerno.com or call +90-212-223-5093,
23
+ * so we can send you a copy immediately.
24
+ *
25
+ * @category [Numerno]
26
+ * @package [Numerno_Euromsg]
27
+ * @copyright Copyright (c) 2015 Numerno Bilisim Hiz. Tic. Ltd. Sti. (http://numerno.com/)
28
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
29
+ */
30
+
31
+ /**
32
+ * Grid Export Action JavaScript
33
+ *
34
+ * @category Numerno
35
+ * @package Numerno_Euromsg
36
+ * @author Numerno Bilisim Hiz. Tic. Ltd. Sti. <info@numerno.com>
37
+ */
38
+ ?>
39
+ <?php /* @var $this Numerno_Euromsg_Block_Adminhtml_Customer_Grid_ExportJs */ ?>
40
+ <script type="text/javascript">
41
+ function doExport() {
42
+
43
+ var select = $(<?php echo $this->getObjectName() ?>.containerId + '_export');
44
+ var selectedOption = select.options[select.selectedIndex].innerHTML;
45
+ if(selectedOption == 'euro.message') {
46
+
47
+ var filename = prompt('<?php echo Mage::helper('euromsg')->__('Please enter Data Warehouse Table Name')?>');
48
+
49
+ if(filename.length == 0) {
50
+ alert('<?php echo Mage::helper('euromsg')->__('Data Warehouse name is mandatory.'); ?>');
51
+ } else if(/^[A-Za-z][A-Za-z_0-9]{1,254}$/.test(filename) == false){
52
+ alert('<?php echo Mage::helper('euromsg')->__('Please use only letters (a-z), numbers (0-9) or '
53
+ . 'underscore(_) in this field, first character should be a letter.'); ?>');
54
+ } else if(<?php echo $this->getObjectName() ?>.massaction
55
+ && <?php echo $this->getObjectName() ?>.massaction.checkedString) {
56
+
57
+ new Ajax.Request(select.value, {
58
+ method: 'post',
59
+ parameters: <?php echo $this->getObjectName() ?>.massaction.formFieldNameInternal + '='
60
+ + <?php echo $this->getObjectName() ?>.massaction.checkedString + '&dwhname=' + filename,
61
+ onSuccess: function(transport){
62
+ window.location.reload();
63
+ }
64
+ });
65
+ } else {
66
+ new Ajax.Request(select.value, {
67
+ method: 'post',
68
+ parameters: 'dwhname=' + filename,
69
+ onSuccess: function(transport){
70
+ window.location.reload();
71
+ }
72
+ });
73
+ }
74
+ } else {
75
+ <?php echo $this->getObjectName() ?>.doExport();
76
+ }
77
+
78
+ }
79
+ </script>
app/design/adminhtml/default/default/template/euromsg/sales/order/comments/view.phtml ADDED
@@ -0,0 +1,90 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Numerno - Euro.message Magento Extension
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the NUMERNO EUROMESSAGE MAGENTO EXTENSION License, which extends the Open Software
8
+ * License (OSL 3.0). The Euro.message Magento Extension License is available at this URL:
9
+ * http://numerno.com/licenses/euromsg-ce.txt The Open Software License is available at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ *
12
+ * DISCLAIMER
13
+ *
14
+ * By adding to, editing, or in any way modifying this code, Numerno is not held liable for any inconsistencies or
15
+ * abnormalities in the behaviour of this code. By adding to, editing, or in any way modifying this code, the Licensee
16
+ * terminates any agreement of support offered by Numerno, outlined in the provided Euro.message Magento Extension
17
+ * License.
18
+ * Upon discovery of modified code in the process of support, the Licensee is still held accountable for any and all
19
+ * billable time Numerno spent during the support process. Numerno does not guarantee compatibility with any other
20
+ * Magento extension. Numerno is not responsbile for any inconsistencies or abnormalities in the behaviour of this
21
+ * code if caused by other Magento extension.
22
+ * If you did not receive a copy of the license, please send an email to info@numerno.com or call +90-212-223-5093,
23
+ * so we can send you a copy immediately.
24
+ *
25
+ * @category [Numerno]
26
+ * @package [Numerno_Euromsg]
27
+ * @copyright Copyright (c) 2015 Numerno Bilisim Hiz. Tic. Ltd. Sti. (http://numerno.com/)
28
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
29
+ */
30
+
31
+ /**
32
+ * Order Comments View Block
33
+ *
34
+ * @category Numerno
35
+ * @package Numerno_Euromsg
36
+ * @author Numerno Bilisim Hiz. Tic. Ltd. Sti. <info@numerno.com>
37
+ */
38
+ ?>
39
+ <?php /* @var $this Numerno_Euromsg_Block_Adminhtml_Sales_Order_Comments_View */ ?>
40
+ <?php if ($_entity = $this->getEntity()): ?>
41
+ <div id="comments_block">
42
+ <span class="field-row">
43
+ <label class="normal" for="history_comment"><?php echo Mage::helper('sales')->__('Comment Text') ?></label>
44
+ <textarea name="comment[comment]" rows="3" cols="5" style="height:6em; width:99%;" id="history_comment"></textarea>
45
+ </span>
46
+ <div class="f-left">
47
+ <?php if ($this->canSendCommentEmail()): ?>
48
+ <input name="comment[is_customer_notified]" type="checkbox" id="history_notify" value="1" />
49
+ <label class="normal" for="history_notify"><?php echo Mage::helper('sales')->__('Notify Customer by Email') ?></label><br />
50
+ <?php endif; ?>
51
+
52
+ <?php if ($this->canSendCommentSms()): ?>
53
+ <input name="comment[is_customer_notified_by_sms]" type="checkbox" id="history_notify_by_sms" value="1" />
54
+ <label class="normal" for="history_notify_by_sms"><?php echo Mage::helper('euromsg')->__('Notify Customer by SMS') ?></label><br />
55
+ <?php endif; ?>
56
+ <input name="comment[is_visible_on_front]" type="checkbox" id="history_visible" value="1" /><label class="normal" for="history_visible"> <?php echo Mage::helper('sales')->__('Visible on Frontend') ?></label>
57
+ </div>
58
+ <div class="f-right">
59
+ <?php echo $this->getChildHtml('submit_button') ?>
60
+ </div>
61
+ <div class="clear"></div>
62
+ <ul class="note-list">
63
+ <?php foreach ($_entity->getCommentsCollection(true) as $_comment): ?>
64
+ <li>
65
+ <strong><?php echo $this->helper('core')->formatDate($_comment->getCreatedAtDate(), 'medium') ?></strong>
66
+ <?php echo $this->helper('core')->formatTime($_comment->getCreatedAtDate(), 'medium') ?><span class="separator">|</span><small><?php echo $this->helper('sales')->__('Customer') ?>
67
+ <strong class="subdue">
68
+ <?php if ($_comment->getIsCustomerNotified()): ?>
69
+ <?php echo $this->helper('sales')->__('Notified') ?>
70
+ <img src="<?php echo $this->getSkinUrl('images/ico_success.gif') ?>" width="16" height="16" alt="" />
71
+ <?php else: ?>
72
+ <?php echo $this->helper('sales')->__('Not Notified') ?>
73
+ <?php endif; ?>
74
+ </strong></small>
75
+ <br/>
76
+ <?php echo $this->escapeHtml($_comment->getComment(), array('b', 'br', 'strong', 'i', 'u', 'a')) ?>
77
+ </li>
78
+ <?php endforeach; ?>
79
+ </ul>
80
+ <script type="text/javascript">
81
+ function submitComment() {
82
+ submitAndReloadArea($('comments_block').parentNode, '<?php echo $this->getSubmitUrl() ?>')
83
+ }
84
+
85
+ if ($('submit_comment_button')) {
86
+ $('submit_comment_button').observe('click', submitComment);
87
+ }
88
+ </script>
89
+ </div>
90
+ <?php endif; ?>
app/design/adminhtml/default/default/template/euromsg/sales/order/view/history.phtml ADDED
@@ -0,0 +1,97 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Numerno - Euro.message Magento Extension
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the NUMERNO EUROMESSAGE MAGENTO EXTENSION License, which extends the Open Software
8
+ * License (OSL 3.0). The Euro.message Magento Extension License is available at this URL:
9
+ * http://numerno.com/licenses/euromsg-ce.txt The Open Software License is available at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ *
12
+ * DISCLAIMER
13
+ *
14
+ * By adding to, editing, or in any way modifying this code, Numerno is not held liable for any inconsistencies or
15
+ * abnormalities in the behaviour of this code. By adding to, editing, or in any way modifying this code, the Licensee
16
+ * terminates any agreement of support offered by Numerno, outlined in the provided Euro.message Magento Extension
17
+ * License.
18
+ * Upon discovery of modified code in the process of support, the Licensee is still held accountable for any and all
19
+ * billable time Numerno spent during the support process. Numerno does not guarantee compatibility with any other
20
+ * Magento extension. Numerno is not responsbile for any inconsistencies or abnormalities in the behaviour of this
21
+ * code if caused by other Magento extension.
22
+ * If you did not receive a copy of the license, please send an email to info@numerno.com or call +90-212-223-5093,
23
+ * so we can send you a copy immediately.
24
+ *
25
+ * @category [Numerno]
26
+ * @package [Numerno_Euromsg]
27
+ * @copyright Copyright (c) 2015 Numerno Bilisim Hiz. Tic. Ltd. Sti. (http://numerno.com/)
28
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
29
+ */
30
+
31
+ /**
32
+ * Order History Block
33
+ *
34
+ * @category Numerno
35
+ * @package Numerno_Euromsg
36
+ * @author Numerno Bilisim Hiz. Tic. Ltd. Sti. <info@numerno.com>
37
+ */
38
+ ?>
39
+ <?php /* @var $this Numerno_Euromsg_Block_Adminhtml_Sales_Order_View_History */ ?>
40
+
41
+ <div id="order_history_block">
42
+ <?php if ($this->canAddComment()):?>
43
+ <div id="history_form" class="order-history-form">
44
+ <div><?php echo Mage::helper('sales')->__('Add Order Comments') ?></div>
45
+ <span class="field-row">
46
+ <label class="normal" for="history_status"><?php echo Mage::helper('sales')->__('Status') ?></label><br/>
47
+ <select name="history[status]" class="select" id="history_status">
48
+ <?php foreach ($this->getStatuses() as $_code=>$_label): ?>
49
+ <option value="<?php echo $_code ?>"<?php if($_code==$this->getOrder()->getStatus()): ?> selected="selected"<?php endif; ?>><?php echo $_label ?></option>
50
+ <?php endforeach; ?>
51
+ </select>
52
+ </span>
53
+ <span class="field-row">
54
+ <label class="normal" for="history_comment"><?php echo Mage::helper('sales')->__('Comment') ?></label>
55
+ <textarea name="history[comment]" rows="3" cols="5" style="height:6em; width:99%;" id="history_comment"></textarea>
56
+ </span>
57
+ <div class="f-left">
58
+ <?php if ($this->canSendCommentEmail()): ?>
59
+ <input name="history[is_customer_notified]" type="checkbox" id="history_notify" value="1" /><label class="normal" for="history_notify"> <?php echo Mage::helper('sales')->__('Notify Customer by Email') ?></label><br />
60
+ <?php endif; ?>
61
+ <?php if ($this->canSendCommentSms()): ?>
62
+ <input name="history[is_customer_notified_by_sms]" type="checkbox" id="history_notify_by_sms" value="1" /><label class="normal" for="history_notify_by_sms"> <?php echo Mage::helper('euromsg')->__('Notify Customer by SMS') ?></label><br />
63
+ <?php endif; ?>
64
+ <input name="history[is_visible_on_front]" type="checkbox" id="history_visible" value="1" /><label class="normal" for="history_visible"> <?php echo Mage::helper('sales')->__('Visible on Frontend') ?></label>
65
+ </div>
66
+ <div class="f-right">
67
+ <?php echo $this->getChildHtml('submit_button') ?>
68
+ </div>
69
+ <div class="clear"></div>
70
+ </div>
71
+ <div class="divider"></div>
72
+ <?php endif;?>
73
+ <ul class="note-list">
74
+ <?php foreach ($this->getOrder()->getStatusHistoryCollection(true) as $_item): ?>
75
+ <li>
76
+ <strong><?php echo $this->helper('core')->formatDate($_item->getCreatedAtDate(), 'medium') ?></strong>
77
+ <?php echo $this->helper('core')->formatTime($_item->getCreatedAtDate(), 'medium') ?><span class="separator">|</span><strong><?php echo $_item->getStatusLabel() ?></strong><br/><small><?php echo $this->helper('sales')->__('Customer') ?>
78
+ <strong class="subdue">
79
+ <?php if ($this->isCustomerNotificationNotApplicable($_item)): ?>
80
+ <?php echo $this->helper('sales')->__('Notification Not Applicable') ?>
81
+ <?php elseif ($_item->getIsCustomerNotified()): ?>
82
+ <?php echo $this->helper('sales')->__('Notified') ?>
83
+ <img src="<?php echo $this->getSkinUrl('images/ico_success.gif') ?>" width="16" height="16" alt="" />
84
+ <?php else: ?>
85
+ <?php echo $this->helper('sales')->__('Not Notified') ?>
86
+ <?php endif; ?>
87
+ </strong></small>
88
+ <?php if ($_item->getComment()): ?>
89
+ <br/><?php echo $this->escapeHtml($_item->getComment(), array('b', 'br', 'strong', 'i', 'u', 'a')) ?>
90
+ <?php endif; ?>
91
+ </li>
92
+ <?php endforeach; ?>
93
+ </ul>
94
+ <script type="text/javascript">
95
+ if($('order_status'))$('order_status').update('<?php echo $this->getOrder()->getStatusLabel() ?>');
96
+ </script>
97
+ </div>
app/etc/modules/Numerno_Euromsg.xml ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ <?php
4
+ /**
5
+ * Numerno - Euro.message Magento Extension
6
+ *
7
+ * NOTICE OF LICENSE
8
+ *
9
+ * This source file is subject to the NUMERNO EUROMESSAGE MAGENTO EXTENSION License, which extends the Open Software
10
+ * License (OSL 3.0). The Euro.message Magento Extension License is available at this URL:
11
+ * http://numerno.com/licenses/euromsg-ce.txt The Open Software License is available at this URL:
12
+ * http://opensource.org/licenses/osl-3.0.php
13
+ *
14
+ * DISCLAIMER
15
+ *
16
+ * By adding to, editing, or in any way modifying this code, Numerno is not held liable for any inconsistencies or
17
+ * abnormalities in the behaviour of this code. By adding to, editing, or in any way modifying this code, the Licensee
18
+ * terminates any agreement of support offered by Numerno, outlined in the provided Euro.message Magento Extension
19
+ * License.
20
+ * Upon discovery of modified code in the process of support, the Licensee is still held accountable for any and all
21
+ * billable time Numerno spent during the support process. Numerno does not guarantee compatibility with any other
22
+ * Magento extension. Numerno is not responsbile for any inconsistencies or abnormalities in the behaviour of this
23
+ * code if caused by other Magento extension.
24
+ * If you did not receive a copy of the license, please send an email to info@numerno.com or call +90-212-223-5093,
25
+ * so we can send you a copy immediately.
26
+ *
27
+ * @category [Numerno]
28
+ * @package [Numerno_Euromsg]
29
+ * @copyright Copyright (c) 2015 Numerno Bilisim Hiz. Tic. Ltd. Sti. (http://numerno.com/)
30
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
31
+ */
32
+ -->
33
+ <config>
34
+ <modules>
35
+ <Numerno_Euromsg>
36
+ <active>true</active>
37
+ <codePool>local</codePool>
38
+ </Numerno_Euromsg>
39
+ </modules>
40
+ </config>
app/locale/tr_TR/Numerno_Euromsg.csv ADDED
@@ -0,0 +1,181 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ "euro.message","euro.message"
2
+ "Attribute","Özellik"
3
+ "Column Name","Sütun Adı"
4
+ "Add Attribute","Özellik Ekle"
5
+ "Wrong column name specified.","Hatalı bir sütun adı girdiniz."
6
+ "Customer ","Müşteri "
7
+ "Synchronize Now","Senkronize Et"
8
+ "ID #","No #"
9
+ "Send At","Gönderim Tarihi"
10
+ "Name","İsim"
11
+ "E-mail Address","Email Adresi"
12
+ "Subject","Konu"
13
+ "Is Marked Spam?","Spam Olarak İşaretlendi mi?"
14
+ "Delivery Status","Gönderim Durumu"
15
+ "euro.message Mail Logs","euro.message Mail Kayıtları"
16
+ "Type","Tür"
17
+ "Customer","Müşteri "
18
+ "GSM Number","Cep Telefonu"
19
+ "Message","Mesaj"
20
+ "Is Subscribed?","İzinli mi?"
21
+ "Subscribe","İzinli Yap"
22
+ "Unsubscribe","İzni Kaldır"
23
+ "euro.message SMS Logs","euro.message SMS Kayıtları"
24
+ "euro.message SMS Subscribers","euro.message SMS Üyeleri"
25
+ "Default data warehouse table name is invalid. Please use only letters (a-z), numbers (0-9) or underscore(_) in this field, first character should be a letter.","Varsayılan veri ambarı tablo ismi geçersiz. Lütfen yalnızca ingilizce karakter (a-z) ve ilk karakter hariç olmak üzere rakam (0-9) veya altçizgi (_) kullanınız."
26
+ "All member data successfully exported to euro.message platform.","Tüm müşteri verisi başarıyla euro.message platformuna aktarıldı."
27
+ "All product data successfully exported to euro.message platform.","Tüm ürün verisi başarıyla euro.message platformuna aktarıldı."
28
+ "Cannot process the request.","İşlem gerçekleştirilemiyor."
29
+ "Data warehouse table name is invalid. Please use only letters (a-z), numbers (0-9) or underscore(_) in this field, first character should be a letter.","Veri ambarı tablo ismi geçersiz. Lütfen yalnızca ingilizce karakter (a-z) ve ilk karakter hariç olmak üzere rakam (0-9) veya altçizgi (_) kullanınız."
30
+ "%s table successfully exported to euro.message platform.","%s tablosu başarıyla euro.message platformuna aktarıldı."
31
+ "Mail Logs","Mail Kayıtları"
32
+ "SMS Logs","SMS Kayıtları"
33
+ "SMS Subscribers","SMS Üyeleri"
34
+ "Transactional Emails","İşlemsel Emailler"
35
+ "Email Logs","Email Kayıtları"
36
+ "Settings","Ayarlar"
37
+ "SMS","SMS"
38
+ "Euromsg General","Euromsg Genel"
39
+ "Euromsg Transactional Emails","Euromsg İşlemsel Emailler"
40
+ "Euromsg Transactional SMS","Euromsg İşlemsel SMS"
41
+ "Euromsg Customer Data Integration","Euromsg Müşteri Verisi Entegrasyonu"
42
+ "Euromsg Catalog Data Integration","Euromsg Katalog Verisi Entegrasyonu"
43
+ "General","Genel"
44
+ "General Settings","Genel Ayarlar"
45
+ "euro.message Platform","euro.message Platformu"
46
+ "Choose your euro.message platform.","Kullanmakta olduğunuz euro.message platformunu seçin."
47
+ "Data Warehouse Language","Veri Ambarı Dili"
48
+ "If you are using MAX platform, there must be LANG_ID column in the data files.","Eğer MAX platformunu kullanıyorsanız, veir ambarına gönderilen her dosyada bir LANG_ID sütunu bulunmalı."
49
+ "Web Service Username","Web Servis Kullanıcı Adı"
50
+ "Web Service Password","Web Servis Parolası"
51
+ "Data Warehouse Connection","Veri Ambarı Bağlantısı"
52
+ "Configure Data Warehouse connection parameters for Customer and Catalog data integration.<br />","Müşteri ve Katalog veri entegrasyonu için veri ambarı bağlantı bilgilerinizi girin.<br />"
53
+ "Connection Policy","Bağlantı Politikası"
54
+ "SFTP Host","SFTP Host"
55
+ "SFTP Username","SFTP Kullanıcı Adı"
56
+ "SFTP Password","SFTP Parola"
57
+ "Data Warehouse Reporting","Data Warehouse Reporting"
58
+ "Configure directory to get feedbacks from euro.message Data Warehouse. These settings are mandatory to get unsubscribe reports.","euro.message veri ambarından geri besleme alacağınız alan bilgisini giriniz. Bu alan bülten aboneliğinden ayrılan kullanıcıların eşleştirilmesi için zorunludur."
59
+ "Enabled","Etkin"
60
+ "Reporting Source","Geri besleme kaynağı"
61
+ "You can either provide SFTP account details given to euro.message IT or a local directory under your Magento installation directory.","Bu alana Magento kurulumunuz altında bulunan yerel bir klasör veya euro.message IT personeline vermiş olduğunuz SFTP bilgilerini girebilirsiniz."
62
+ "SFTP Directory","SFTP Alt Klasörü"
63
+ "Local Directory","Yerel Klasör"
64
+ "Synchronization Time (Daily)","Senkronizasyon Saati (Günlük)"
65
+ "Delete files after check?","Kontrolden sonra dosyaları sil?"
66
+ "Enable euro.message transactional emails","Emailleri euro.message üzerinden gönder"
67
+ "If yes, transactional emails will be pushed trough euro.message platform.","Evet olarak işaretlendiğinde tüm mail gönderimi euro.message platformuna yönlendirilir"
68
+ "From Name","Gönderici Adı"
69
+ "From Address","Gönderici Adresi"
70
+ "Reply Address","Yanıt Adresi"
71
+ "Enable Logging","Kayıt Tut"
72
+ "Clean Logs","Kayıtları Sil"
73
+ "Keep Logs For, Days","Kayıtların Tutulacağı Gün Sayısı"
74
+ "Log Cleaning Frequency","Kayıt Silme Frekansı"
75
+ "Log Cleaning Start Time","Kayıt Silme Saati"
76
+ "Log Cleaning Interval","Kayıt Silme Sıklığı"
77
+ "Track Delivery Reports","Gönderim Raporlarını Takip Et"
78
+ "Transactional SMS","İşlemsel SMS"
79
+ "Sender Name (Originator)","Gönderici Adı (Originator)"
80
+ "Method","Gönderim Yöntemi"
81
+ "WARNING: Consult with euro.message staff before changing sending method.","DİKKAT: Bu alanda değişiklik yapmadan önce euro.message personeline danışınız."
82
+ "Customer Attribute","Müşteri Alanı"
83
+ "Customer attribute that includes gsm number.","Cep telefonu numarasını içeren müşteri alanı."
84
+ "Logging and Reports","Kayıtlar ve Geri besleme"
85
+ "Enable SMS Log","Sms Kayıtlarını Sakla"
86
+ "Save Log, Days","Kayıtların Tutulacağı Gün Sayısı"
87
+ "SMS Templates","SMS Şablonları"
88
+ "You can edit SMS templates using variables commented for each template.","SMS şablonlarını her şablonun altında bulunan değişkenleri kullanarak oluşturabilirsiniz."
89
+ "SMS Suffix","SMS Son Eki"
90
+ "Notify on New Order","Yeni Siparişte Gönderim Yap"
91
+ "New Order Template","Yeni Sipariş SMS Şablonu"
92
+ "Notify on Order Update","Sipariş Güncellemesinde Gönderim Yap"
93
+ "Order Udpate Template","Sipariş Güncellemesi SMS Şablonu"
94
+ "Notify on New Invoice","Yeni Faturada Gönderim Yap"
95
+ "New Invoice Template","Yeni Fatura SMS Şablonu"
96
+ "Notify on New Shipment","Yeni Kargoda Gönderim Yap"
97
+ "New Shipment Template","Yeni Kargo SMS Şablonu"
98
+ "Notify on New Shipment Tracking Number","Yeni Kargo Takip Numarasında Gönderim Yap"
99
+ "New Shipment Tracking Number Template","Yeni Kargo Takip Numarası SMS Şablonu"
100
+ "Notify on New Credit Memo","Yeni İadede Gönderim Yap"
101
+ "New Credit Memo Template","Yeni İade SMS Şablonu"
102
+ "Customer Data Integration","Müşteri Verisi Entegrasyonu"
103
+ "Use Data From","Veri Kaynağı"
104
+ "Use Unsubscribed Data","Bülten Abonliğinden Ayrılanları Gönder"
105
+ "Send Notification Emails to","Bilgilendirme Email Alıcısı"
106
+ "Data Warehouse Table Name","Veri Ambarı Tablo İsmi"
107
+ "Form will be saved after synchronization.","Senkronizasyon sonrasında form kaydedilecektir."
108
+ "Synchronization Enabled","Senkronizasyon Aktif"
109
+ "Synchronization Frequency","Senkronizasyon Frekansı"
110
+ "Synchronization Start Time","Senkronizasyon Saati"
111
+ "Synchronization Interval","Senkronizasyon Sıklığı"
112
+ "Attributes","Özellikler"
113
+ "Catalog Data Integration","Katalog Verisi Entegrasyonu"
114
+ "Export Only Visible Products","Sadece Görünür Ürünleri Aktar"
115
+ "euro.message default is PRODUCTS. Change only if requested by euro.message","euro.message varsayılanı PRODUCTS tır. Yalnızca euro.message personeli talep ettiğinde değiştiriniz."
116
+ "Advanced Settings","Gelişmiş Ayarlar"
117
+ "These values will be used to calculate how many products to load per export iteration.","Bu ayarlar her bir aktarım iterasyonunda maksimum kaç ürünün işleme alınacağını hesaplamada kullanılır."
118
+ "If <i>ini_get('memory_limit')</i> doesn't retrieve memory limit, this will be used as default","Eğer ini_get('memory_limit') bir değer döndürmez ise bu ayar varsayılan olarak kullanılacaktır."
119
+ "Memory Per Product","Ürün başına bellek"
120
+ "One product to have up to such size of memory","Bir ürünün ayırabileceği bellek miktarı"
121
+ "Memory Usage Percent (%)","Bellek Kullanım Oranı (%)"
122
+ "Calculated memory usage percent to be used per export iteration. Any value higher than 80 will be ignored to have supply","Hesaplama sonucu belleğin yüzde kaçının aktarım işlemine ayrılacağını belirleri. 80'in üzerindeki değerler kabul edilmez."
123
+ "Minimum Products Limit","En Az Ürün Miktarı"
124
+ "Minimum product count limit will be overriden with this value if a lower value calculated","Hesaplama sonucu ortaya çıkan rakam bu rakamdan düşükse bu rakam baz alınır."
125
+ "Select an attribute...","Bir özellik seçin"
126
+ "Subscriber ID","Bülten Abonesi ID"
127
+ "Subscriber Email","Bülten Abonesi Mail"
128
+ "Customer ID","Müşteri ID"
129
+ "Customer Last Web Login At","Müşteri Son Giriş Tarihi"
130
+ "Customer Last Order Created At","Müşteri Son Sipariş Tarihi"
131
+ "Customer Total Amount of Orders","Müşteri Toplam Sipariş Tutarı"
132
+ "Customer Most Ordered Category","Müşteri En Çok Sipariş Verdiği Kategori"
133
+ "Customer Group (group name)","Müşteri Grubu (grup adı)"
134
+ "Product ID (entity_id)","Ürün ID (entity_id)"
135
+ "Product URL","Ürün URL'i"
136
+ "Attribute Set","Özellik Seti"
137
+ "Qty","Adet"
138
+ "Stock Status","Stok Durumu"
139
+ "Root Category","Ana Kategori"
140
+ "Category (first, with tree)","Kategori (ilk, kırılımlı)"
141
+ "Relayed","İletildi"
142
+ "Undelivered (HARD)","İletilemedi (SÜREKLİ)"
143
+ "Undelivered (SOFT)","İletilemedi (GEÇİCİ)"
144
+ "Read","Okundu"
145
+ "Destination file path must be a string","Hedef dosya yolu alfanümerik olmalı"
146
+ "Destination directory is not writable","Hedef klasör yazılabilir değil"
147
+ "Destination file is not writable","Hedef dosya yazılabilir değil"
148
+ "There is no member data to export.","Aktarılabilecek müşteri bulunamadı."
149
+ "Invalid euro.message web service URL: %s","Geçersiz euro.message web servsi adresi: %s"
150
+ "Unable to save the cron expression.","Zamanlanmış görev kaydedilemedi."
151
+ "Hourly","Saatlik"
152
+ "Every hour","Her saat"
153
+ "Every %s hours","Her %s saatte bir"
154
+ "Newsletter Subscribers","Bülten Aboneleri"
155
+ "Newsletter Subscribers - Customers Only","Bülten Aboneleri - Yalnızca Müşteriler"
156
+ "Turkish","Türkçe"
157
+ "English","İngilize"
158
+ "German","Almanca"
159
+ "Arabic","Arapça"
160
+ "Sync","Senkron"
161
+ "Async","Asenkron"
162
+ "SFTP Account","SFTP Hesabı"
163
+ "Standart","Standart"
164
+ "Single-Shot (OTP)","Single-Shot (OTP)"
165
+ "Yes","Evet"
166
+ "No","Hayır"
167
+ "Not Active","Aktif Değil"
168
+ "E-Commerce","E-Commerce"
169
+ "MAX","MAX"
170
+ "System A","Sistem A"
171
+ "System B","Sistem B"
172
+ "Test","Test"
173
+ "Cannot login to euro.message web service: %s","euro.message web servisine giriş yapılamadı: %s"
174
+ "Please enter Data Warehouse Table Name","Lütfen veri ambarı tablo ismini giriniz:"
175
+ "Data Warehouse name is mandatory.","Veri ambarı tablo ismi zorunludur."
176
+ "Please use only letters (a-z), numbers (0-9) or underscore(_) in this field, first character should be a letter.","Lütfen yalnızca ingilizce karakter (a-z) ve ilk karakter hariç olmak üzere rakam (0-9) veya altçizgi (_) kullanınız."
177
+ "Notify Customer by SMS","Müşteriyi SMS ile Bilgilendir"
178
+ "<div style='height: 20px;margin-bottom:10px;'> <img style='float:left;' src='http://numerno.com/media/modules/euromsg-logo.png' /></div> Configure your catalog data synchronization preferences below. If you have any questions or would like any help please visit <a href='http://numerno.com' target='_blank'>numerno.com</a>.","<div style='height: 20px;margin-bottom:10px;'> <img style='float:left;' src='http://numerno.com/media/modules/euromsg-logo.png' /></div>"
179
+ "<div style='height: 20px;margin-bottom:10px;'> <img style='float:left;' src='http://numerno.com/media/modules/euromsg-logo.png' /></div> Configure your customer data synchronization preferences below. If you have any questions or would like any help please visit <a href='http://numerno.com' target='_blank'>numerno.com</a>.","<div style='height: 20px;margin-bottom:10px;'> <img style='float:left;' src='http://numerno.com/media/modules/euromsg-logo.png' /></div>"
180
+ "<div style='height: 20px;margin-bottom:10px;'> <img style='float:left;' src='http://numerno.com/media/modules/euromsg-logo.png' /></div> Configure your euro.message platform connection below. If you have any questions or would like any help please visit <a href='http://numerno.com' target='_blank'>numerno.com</a>.","<div style='height: 20px;margin-bottom:10px;'> <img style='float:left;' src='http://numerno.com/media/modules/euromsg-logo.png' /></div>"
181
+ "<div style='height: 20px;margin-bottom:10px;'> <img style='float:left;' src='http://numerno.com/media/modules/euromsg-logo.png' /></div> Configure your euro.message platform connection below. If you have any questions or would like any help please visit <a href='http://numerno.com' target='_blank'>numerno.com</a>.","<div style='height: 20px;margin-bottom:10px;'> <img style='float:left;' src='http://numerno.com/media/modules/euromsg-logo.png' /></div>"
package.xml ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <package>
3
+ <name>Numerno_Euromsg</name>
4
+ <version>1.0.0</version>
5
+ <stability>stable</stability>
6
+ <license uri="http://numerno.com/licenses/euromsg-ce.txt">NUMERNO EUROMESSAGE MAGENTO EXTENSION</license>
7
+ <channel>community</channel>
8
+ <extends/>
9
+ <summary>Email and omni-channel marketing automation. </summary>
10
+ <description>This extension allows you to integrate Customer and Catalog data with euro.message platform, send transactional emails and transactional SMS via euro.message platform.</description>
11
+ <notes>Initial Release&#xD;
12
+ * Transactional Emails&#xD;
13
+ * Email Logging&#xD;
14
+ * Email Delivery Tracking&#xD;
15
+ * Transactional SMS&#xD;
16
+ * SMS Logging&#xD;
17
+ * SMS Delivery Tracking&#xD;
18
+ * Customer Data Integration with euro.message Platform&#xD;
19
+ * Catalog Data Integration with euro.message Platform&#xD;
20
+ &#xD;
21
+ Build Date: 2015-11-24</notes>
22
+ <authors><author><name>Numerno</name><user>muhammedv</user><email>muhammedv@gmail.com</email></author></authors>
23
+ <date>2015-11-24</date>
24
+ <time>14:16:41</time>
25
+ <contents><target name="magelocal"><dir><dir name="Numerno"><dir name="Euromsg"><dir name="Block"><dir name="Adminhtml"><dir name="Customer"><file name="Grid.php" hash="100e8195b852490f0f5a3404f9b949be"/></dir><dir name="Form"><dir name="Field"><file name="Attribute.php" hash="903e9f413770e98eed0fbcbf0c45c0f5"/><file name="Attributes.php" hash="c63db1cd092894d7af434c981443062e"/><file name="CustomerAttribute.php" hash="3c7baa61e2d3c67cb7ab88556d368db8"/><file name="CustomerAttributes.php" hash="8aa7c13c5b3314d463f02cc1cfd9e4be"/><file name="SyncNow.php" hash="e650868a182c822dd851de221f1d0930"/></dir></dir><dir name="Grid"><file name="ExportJs.php" hash="8f5dcbdb4629640982f8800dacf7322a"/></dir><dir name="Mail"><dir name="Logs"><file name="Grid.php" hash="0cce60deb59330b5384b619413117c41"/></dir><file name="Logs.php" hash="5ccf4a64ecf89957ba08f270462af06f"/></dir><dir name="Newsletter"><dir name="Subscriber"><file name="Grid.php" hash="6355617d9d8a177b4cee2d534ac0f882"/></dir></dir><dir name="Sales"><dir name="Order"><dir name="Comments"><file name="View.php" hash="ba690fc39c2f65768a2ca3930e507422"/></dir><dir name="View"><file name="History.php" hash="fcba5923b7f47335dcc531e79d7725c7"/></dir></dir></dir><dir name="Sms"><dir name="Logs"><file name="Grid.php" hash="a6238e91ba58f3a5e5a72c081f377c05"/></dir><file name="Logs.php" hash="60a9b1d0381a744321c6d8160ec0e4a3"/><dir name="Renderer"><file name="Customer.php" hash="fff517d82da333ffb4985410ed9136c1"/></dir><dir name="Subscribers"><file name="Grid.php" hash="4458ea0ea15b74019d9cf307af326388"/></dir><file name="Subscribers.php" hash="280100b292bc224ce1d52e14422ea4d5"/></dir></dir></dir><dir name="Helper"><file name="Data.php" hash="1c66f1e6b5a61516ecc2c1e2f13d934b"/><file name="Post.php" hash="5a8c4d5430ea89fe29a8926ad7aaf108"/><file name="Sms.php" hash="8cddd4200949d1ae80a8aa8d8757265f"/></dir><dir name="Model"><dir name="Core"><dir name="Email"><file name="Queue.php" hash="6f1b8e36297af00955828eaccc50051d"/><file name="Template.php" hash="f4644e68285da6e7187f453817483e38"/></dir><file name="Email.php" hash="db29e8211d3f1946710c9fadd90a2daf"/></dir><file name="Cron.php" hash="c953225748678944b85f6cbee9fce01e"/><dir name="Export"><dir name="Adapter"><file name="Csv.php" hash="3767a84ce47ede192819005951eb9b66"/></dir><dir name="Entity"><file name="Member.php" hash="a2cf1db82dd572a5035fb34736ffbeb8"/><file name="Product.php" hash="e47ce7b698875f3e5a4149393b852b41"/></dir></dir><dir name="Io"><file name="Sftp.php" hash="7e06fe06678f2f5fe0d4fb7a59bee786"/></dir><dir name="Mail"><file name="Log.php" hash="ca27945728d2996c93c0dce3ab94e22d"/><dir name="Transport"><file name="EuroMessage.php" hash="3d43d7a0bc6622d2d087cedf66ba1100"/></dir></dir><file name="Mail.php" hash="4145937d390da1dd152df8aaa783f9da"/><dir name="Newsletter"><dir name="Subscriber"><file name="Collection.php" hash="25a07a245b3fdb25ebc48d130628d83d"/></dir></dir><file name="Observer.php" hash="4f6303db2cb0622e13dab785807d0eaa"/><dir name="Platform"><file name="Abstract.php" hash="d8d8fa73bf56d4c4477497ac0ea1f793"/><file name="Member.php" hash="fa271286b5255903d51cf5576291b59d"/><file name="Post.php" hash="46021255e3eb15b5ceaab0ff1df99da4"/><file name="PostSms.php" hash="b17d28363f22f4aeb74bd109102dfb2d"/><file name="Report.php" hash="41149419b4126964642bf042bc21749a"/></dir><file name="Platform.php" hash="40bb44506481ea987bf79b9d600f4a6b"/><file name="Process.php" hash="172fd2930f908b4f4533858bee86910a"/><dir name="Resource"><dir name="Mail"><dir name="Log"><file name="Collection.php" hash="4a1415867ae8a2a9ff666b165c16b4bc"/></dir><file name="Log.php" hash="4bccd49fefcc9da2b03cbbf9e57d90ba"/></dir><dir name="Process"><file name="Collection.php" hash="ac75a9bbb4725209d869385db83e0cb2"/></dir><file name="Process.php" hash="a8f27b87d819c72b40bc2e074031cd86"/><dir name="Sms"><file name="Collection.php" hash="3e2486cf998da3c5cdb419bdc45e6944"/></dir><file name="Sms.php" hash="d2ad96c9b21fb5531ebc1fd6b53fb048"/></dir><file name="Sms.php" hash="c2b74759fdefdd28388e23535f5f8825"/><dir name="System"><dir name="Config"><dir name="Backend"><file name="Attributes.php" hash="075abb8747dabe85810403309c062ff4"/><file name="Cron.php" hash="c4df35b3dea012d5a496f8207d45a95d"/></dir><dir name="Source"><dir name="Cron"><file name="Frequency.php" hash="3c4c6563dccde5d01fc7d9700d4bfa8e"/><file name="Hours.php" hash="592c40ef2f2e11b6f4eb483875dd4c76"/></dir><dir name="Customer"><file name="Attributes.php" hash="e6cdb9f9a694873f8fa70055b9444c95"/><file name="DataSource.php" hash="f31cde2f3f0c02897f387acbbf058a8b"/></dir><dir name="Dwh"><file name="LangId.php" hash="fdc3022e51e9c057372a7f4ad847f0eb"/><file name="Policy.php" hash="33217be32801fb83344674b65838c9a6"/><file name="Report.php" hash="1e9fd4b7c1c6a76703a059f20a3353c4"/></dir><file name="Platform.php" hash="e9f1c901ce4d235192f5546ed16c23af"/><dir name="Sms"><file name="Method.php" hash="979f30f9007c26dccb5260c719f448ae"/><file name="Permit.php" hash="822ac94d39911bd0056ea4c4d85e55ed"/></dir></dir></dir></dir></dir><dir name="controllers"><dir name="Adminhtml"><file name="EuromsgController.php" hash="5b8bb7bc3dd01ea5dba6404f5da4d5ea"/><file name="NewsletterController.php" hash="ad755dbd292d9cf1ec8030919275550d"/><file name="SmsController.php" hash="e0d8f71369a0f2eff28f37a87cf35ad8"/></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="778c026c42bc9840732332681f0ff6b8"/><file name="config.xml" hash="505da2e0d032bd2c5398684a37a5e52a"/><file name="system.xml" hash="17bfd8d0f27dc7ea060768be306cb6c0"/></dir><dir name="sql"><dir name="euromsg_setup"><file name="install-1.0.0.php" hash="19f5a9a2dab9d9041df950d7fbd2058f"/></dir></dir></dir></dir><dir name="en_US"><file name="Numerno_Euromsg.csv" hash=""/></dir></dir></target><target name="mageetc"><dir><dir name="modules"><file name="Numerno_Euromsg.xml" hash="099822005a15190062eaa33ebbfe79f9"/></dir></dir></target><target name="magedesign"><dir><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="euromsg.xml" hash="a8e471476ddce168d70776a153b8d006"/></dir><dir name="template"><dir name="euromsg"><dir name="form"><dir name="field"><file name="sync_now.phtml" hash="ebbc479e6312e0f8f32cb54d9b0a6dc0"/></dir></dir><dir name="grid"><file name="export_js.phtml" hash="d4ff01863fa8b344c0bee4a083f8cfdb"/></dir><dir name="sales"><dir name="order"><dir name="comments"><file name="view.phtml" hash="e0bfb31cfbaf2955ab0d092be13cce1d"/></dir><dir name="view"><file name="history.phtml" hash="3b21d6d8a655d13010c714d66c36b7ae"/></dir></dir></dir></dir></dir></dir></dir></dir></dir></target><target name="magelocale"><dir><dir name="tr_TR"><file name="Numerno_Euromsg.csv" hash="46a8388bdafe296f0c5ead6137a929f3"/></dir></dir></target><target name="mageskin"><dir><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="images"><dir name="euromsg"><file name="euromsg_logo.png" hash="8bc7732e48238d01a862f01cf0e6dcfb"/></dir></dir></dir></dir></dir></dir></target></contents>
26
+ <compatible/>
27
+ <dependencies><required><php><min>5.3.0</min><max>6.0.0</max></php></required></dependencies>
28
+ </package>
skin/adminhtml/default/default/images/euromsg/euromsg_logo.png ADDED
Binary file