Adfab_Emailcampaign - Version 1.2.1

Version Notes

Stories



  • [ECAMPAIGN-50] - Error on input field for campaign variables

  • [ECAMPAIGN-51] - Campaign abandoned_cart: remove those who bought

Download this release

Release Info

Developer Adfab
Extension Adfab_Emailcampaign
Version 1.2.1
Comparing to
See all releases


Code changes from version 1.2.0 to 1.2.1

Files changed (94) hide show
  1. app/code/community/Adfab/Emailcampaign/Block/Adminhtml/Campaign.php +5 -5
  2. app/code/community/Adfab/Emailcampaign/Block/Adminhtml/Campaign/Edit.php +5 -5
  3. app/code/community/Adfab/Emailcampaign/Block/Adminhtml/Campaign/Edit/Form.php +5 -5
  4. app/code/community/Adfab/Emailcampaign/Block/Adminhtml/Campaign/Edit/Tab/Cron.php +8 -6
  5. app/code/community/Adfab/Emailcampaign/Block/Adminhtml/Campaign/Edit/Tab/Form.php +33 -18
  6. app/code/community/Adfab/Emailcampaign/Block/Adminhtml/Campaign/Edit/Tabs.php +21 -6
  7. app/code/community/Adfab/Emailcampaign/Block/Adminhtml/Campaign/Forms/AbandonedCart.php +5 -5
  8. app/code/community/Adfab/Emailcampaign/Block/Adminhtml/Campaign/Forms/Abstract.php +5 -5
  9. app/code/community/Adfab/Emailcampaign/Block/Adminhtml/Campaign/Forms/CustomerBirthday.php +5 -5
  10. app/code/community/Adfab/Emailcampaign/Block/Adminhtml/Campaign/Forms/Nursing.php +72 -0
  11. app/code/community/Adfab/Emailcampaign/Block/Adminhtml/Campaign/Forms/WelcomeReminder.php +5 -5
  12. app/code/community/Adfab/Emailcampaign/Block/Adminhtml/Campaign/Forms/WishlistReminder.php +5 -5
  13. app/code/community/Adfab/Emailcampaign/Block/Adminhtml/Campaign/Forms/WishlistStockAlert.php +14 -6
  14. app/code/community/Adfab/Emailcampaign/Block/Adminhtml/Campaign/Grid.php +5 -5
  15. app/code/community/Adfab/Emailcampaign/Block/Adminhtml/Form/Edit/Renderer/Cron.php +5 -5
  16. app/code/community/Adfab/Emailcampaign/Block/Adminhtml/Notification/Toolbar.php +5 -5
  17. app/code/community/Adfab/Emailcampaign/Block/Adminhtml/Recipient.php +5 -5
  18. app/code/community/Adfab/Emailcampaign/Block/Adminhtml/Recipient/Grid.php +5 -5
  19. app/code/community/Adfab/Emailcampaign/Block/Adminhtml/System/Email/Template/Preview.php +86 -0
  20. app/code/community/Adfab/Emailcampaign/Helper/Connector.php +8 -8
  21. app/code/community/Adfab/Emailcampaign/Helper/Data.php +8 -8
  22. app/code/community/Adfab/Emailcampaign/Model/Adminhtml/Notification.php +5 -5
  23. app/code/community/Adfab/Emailcampaign/Model/Campaign.php +5 -5
  24. app/code/community/Adfab/Emailcampaign/Model/Campaign/AbandonedCart.php +9 -13
  25. app/code/community/Adfab/Emailcampaign/Model/Campaign/Abstract.php +12 -12
  26. app/code/community/Adfab/Emailcampaign/Model/Campaign/Cron.php +7 -7
  27. app/code/community/Adfab/Emailcampaign/Model/Campaign/CustomerBirthday.php +8 -8
  28. app/code/community/Adfab/Emailcampaign/Model/Campaign/InscriptionAnniversary.php +7 -12
  29. app/code/community/Adfab/Emailcampaign/Model/Campaign/Nursing.php +108 -0
  30. app/code/community/Adfab/Emailcampaign/Model/Campaign/Observer.php +7 -7
  31. app/code/community/Adfab/Emailcampaign/Model/Campaign/OrderSuccess.php +7 -12
  32. app/code/community/Adfab/Emailcampaign/Model/Campaign/State/Abstract.php +5 -5
  33. app/code/community/Adfab/Emailcampaign/Model/Campaign/State/Production.php +5 -5
  34. app/code/community/Adfab/Emailcampaign/Model/Campaign/State/Test.php +5 -5
  35. app/code/community/Adfab/Emailcampaign/Model/Campaign/State/TestAllEmail.php +5 -5
  36. app/code/community/Adfab/Emailcampaign/Model/Campaign/WelcomeReminder.php +21 -16
  37. app/code/community/Adfab/Emailcampaign/Model/Campaign/WishlistReminder.php +7 -12
  38. app/code/community/Adfab/Emailcampaign/Model/Campaign/WishlistStockAlert.php +34 -13
  39. app/code/community/Adfab/Emailcampaign/Model/Connector/Abstract.php +7 -7
  40. app/code/community/Adfab/Emailcampaign/Model/Connector/Magento.php +8 -8
  41. app/code/community/Adfab/Emailcampaign/Model/Connector/Void.php +7 -7
  42. app/code/community/Adfab/Emailcampaign/Model/Cron.php +6 -6
  43. app/code/community/Adfab/Emailcampaign/Model/Cron/Observer.php +6 -6
  44. app/code/community/Adfab/Emailcampaign/Model/Flag.php +4 -4
  45. app/code/community/Adfab/Emailcampaign/Model/Observer.php +7 -7
  46. app/code/community/Adfab/Emailcampaign/Model/Resource/Adminhtml/Notification.php +5 -5
  47. app/code/community/Adfab/Emailcampaign/Model/Resource/Adminhtml/Notification/Collection.php +5 -5
  48. app/code/community/Adfab/Emailcampaign/Model/Resource/Campaign.php +5 -5
  49. app/code/community/Adfab/Emailcampaign/Model/Resource/Campaign/Collection.php +5 -5
  50. app/code/community/Adfab/Emailcampaign/Model/Source/Campaign.php +5 -5
  51. app/code/community/Adfab/Emailcampaign/Model/Source/Connector.php +5 -5
  52. app/code/community/Adfab/Emailcampaign/Model/Source/Mode.php +5 -5
  53. app/code/community/Adfab/Emailcampaign/Model/Source/Template.php +5 -5
  54. app/code/community/Adfab/Emailcampaign/Model/Status.php +5 -5
  55. app/code/community/Adfab/Emailcampaign/Test/Model/Campaign.php +5 -5
  56. app/code/community/Adfab/Emailcampaign/Test/Model/Campaign/State/Config.php +5 -5
  57. app/code/community/Adfab/Emailcampaign/Test/Model/Config.php +5 -5
  58. app/code/community/Adfab/Emailcampaign/controllers/Adminhtml/CampaignController.php +32 -7
  59. app/code/community/Adfab/Emailcampaign/etc/adminhtml.xml +3 -3
  60. app/code/community/Adfab/Emailcampaign/etc/config.xml +39 -23
  61. app/code/community/Adfab/Emailcampaign/etc/system.xml +3 -3
  62. app/code/community/Adfab/Emailcampaign/sql/adfab_emailcampaign_setup/mysql4-install-0.1.0.php +3 -3
  63. app/code/community/Adfab/Emailcampaign/sql/adfab_emailcampaign_setup/mysql4-upgrade-0.1.0-0.1.1.php +3 -3
  64. app/code/community/Adfab/Emailcampaign/sql/adfab_emailcampaign_setup/mysql4-upgrade-0.1.1-0.1.2.php +3 -3
  65. app/code/community/Adfab/Emailcampaign/sql/adfab_emailcampaign_setup/mysql4-upgrade-0.1.2-0.1.3.php +3 -3
  66. app/code/community/Adfab/Emailcampaign/sql/adfab_emailcampaign_setup/mysql4-upgrade-0.1.3-1.1.4.php +42 -0
  67. app/design/adminhtml/default/default/layout/emailcampaign.xml +6 -0
  68. app/etc/modules/Adfab_Emailcampaign.xml +6 -6
  69. app/locale/en_US/emailcampaign/Adfab_EmailCampaign_CustomerBirthday.csv +0 -1
  70. app/locale/en_US/emailcampaign/Adfab_EmailCampaign_WishlistStockAlert.csv +0 -1
  71. app/locale/en_US/emailcampaign/{Adfab_EmailCampaign.csv → Adfab_Emailcampaign.csv} +0 -0
  72. app/locale/en_US/emailcampaign/{Adfab_EmailCampaign_AbandonedCart.csv → Adfab_Emailcampaign_AbandonedCart.csv} +0 -0
  73. app/locale/en_US/emailcampaign/Adfab_Emailcampaign_CustomerBirthday.csv +3 -0
  74. app/locale/en_US/emailcampaign/{Adfab_EmailCampaign_InscriptionAnniversary.csv → Adfab_Emailcampaign_InscriptionAnniversary.csv} +0 -0
  75. app/locale/en_US/emailcampaign/Adfab_Emailcampaign_Nursing.csv +3 -0
  76. app/locale/en_US/emailcampaign/{Adfab_EmailCampaign_OrderSuccess.csv → Adfab_Emailcampaign_OrderSuccess.csv} +0 -0
  77. app/locale/en_US/emailcampaign/{Adfab_EmailCampaign_WelcomeReminder.csv → Adfab_Emailcampaign_WelcomeReminder.csv} +0 -0
  78. app/locale/en_US/emailcampaign/{Adfab_EmailCampaign_WishlistReminder.csv → Adfab_Emailcampaign_WishlistReminder.csv} +0 -0
  79. app/locale/en_US/emailcampaign/Adfab_Emailcampaign_WishlistStockAlert.csv +2 -0
  80. app/locale/en_US/template/email/emailcampaign/nursing.html +42 -0
  81. app/locale/fr_FR/emailcampaign/Adfab_EmailCampaign_CustomerBirthday.csv +0 -1
  82. app/locale/fr_FR/emailcampaign/Adfab_EmailCampaign_WishlistStockAlert.csv +0 -1
  83. app/locale/fr_FR/emailcampaign/{Adfab_EmailCampaign.csv → Adfab_Emailcampaign.csv} +0 -0
  84. app/locale/fr_FR/emailcampaign/{Adfab_EmailCampaign_AbandonedCart.csv → Adfab_Emailcampaign_AbandonedCart.csv} +0 -0
  85. app/locale/fr_FR/emailcampaign/Adfab_Emailcampaign_CustomerBirthday.csv +3 -0
  86. app/locale/fr_FR/emailcampaign/{Adfab_EmailCampaign_InscriptionAnniversary.csv → Adfab_Emailcampaign_InscriptionAnniversary.csv} +0 -0
  87. app/locale/fr_FR/emailcampaign/Adfab_Emailcampaign_Nursing.csv +3 -0
  88. app/locale/fr_FR/emailcampaign/{Adfab_EmailCampaign_OrderSuccess.csv → Adfab_Emailcampaign_OrderSuccess.csv} +0 -0
  89. app/locale/fr_FR/emailcampaign/{Adfab_EmailCampaign_WelcomeReminder.csv → Adfab_Emailcampaign_WelcomeReminder.csv} +0 -0
  90. app/locale/fr_FR/emailcampaign/{Adfab_EmailCampaign_WishlistReminder.csv → Adfab_Emailcampaign_WishlistReminder.csv} +0 -0
  91. app/locale/fr_FR/emailcampaign/Adfab_Emailcampaign_WishlistStockAlert.csv +2 -0
  92. app/locale/fr_FR/template/email/emailcampaign/nursing.html +42 -0
  93. package.xml +3 -3
  94. skin/adminhtml/default/default/js/emailcampaign.js +66 -34
app/code/community/Adfab/Emailcampaign/Block/Adminhtml/Campaign.php CHANGED
@@ -14,12 +14,12 @@
14
  * DISCLAIMER
15
  *
16
  * Do not edit or add to this file if you wish to upgrade
17
- * the Adfab EmailCampaign module to newer versions in the future.
18
- * If you wish to customize the Adfab EmailCampaign module for your needs
19
  * please refer to http://www.magentocommerce.com for more information.
20
  *
21
  * @category Adfab
22
- * @package Adfab_EmailCampaign
23
  * @copyright Copyright (C) 2014 Adfab (http://www.adfab.fr/)
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
@@ -30,11 +30,11 @@
30
  * Long description of the class (if any...)
31
  *
32
  * @category Adfab
33
- * @package Adfab_EmailCampaign
34
  * @subpackage Block
35
  * @author Arnaud Hours <arnaud.hours@adfab.fr>
36
  */
37
- class Adfab_EmailCampaign_Block_Adminhtml_Campaign extends Mage_Adminhtml_Block_Widget_Grid_Container
38
  {
39
 
40
  public function __construct()
14
  * DISCLAIMER
15
  *
16
  * Do not edit or add to this file if you wish to upgrade
17
+ * the Adfab Emailcampaign module to newer versions in the future.
18
+ * If you wish to customize the Adfab Emailcampaign module for your needs
19
  * please refer to http://www.magentocommerce.com for more information.
20
  *
21
  * @category Adfab
22
+ * @package Adfab_Emailcampaign
23
  * @copyright Copyright (C) 2014 Adfab (http://www.adfab.fr/)
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
30
  * Long description of the class (if any...)
31
  *
32
  * @category Adfab
33
+ * @package Adfab_Emailcampaign
34
  * @subpackage Block
35
  * @author Arnaud Hours <arnaud.hours@adfab.fr>
36
  */
37
+ class Adfab_Emailcampaign_Block_Adminhtml_Campaign extends Mage_Adminhtml_Block_Widget_Grid_Container
38
  {
39
 
40
  public function __construct()
app/code/community/Adfab/Emailcampaign/Block/Adminhtml/Campaign/Edit.php CHANGED
@@ -14,12 +14,12 @@
14
  * DISCLAIMER
15
  *
16
  * Do not edit or add to this file if you wish to upgrade
17
- * the Adfab EmailCampaign module to newer versions in the future.
18
- * If you wish to customize the Adfab EmailCampaign module for your needs
19
  * please refer to http://www.magentocommerce.com for more information.
20
  *
21
  * @category Adfab
22
- * @package Adfab_EmailCampaign
23
  * @copyright Copyright (C) 2014 Adfab (http://www.adfab.fr/)
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
@@ -30,11 +30,11 @@
30
  * Long description of the class (if any...)
31
  *
32
  * @category Adfab
33
- * @package Adfab_EmailCampaign
34
  * @subpackage Block
35
  * @author Arnaud Hours <arnaud.hours@adfab.fr>
36
  */
37
- class Adfab_EmailCampaign_Block_Adminhtml_Campaign_Edit extends Mage_Adminhtml_Block_Widget_Form_Container
38
  {
39
 
40
  public function __construct()
14
  * DISCLAIMER
15
  *
16
  * Do not edit or add to this file if you wish to upgrade
17
+ * the Adfab Emailcampaign module to newer versions in the future.
18
+ * If you wish to customize the Adfab Emailcampaign module for your needs
19
  * please refer to http://www.magentocommerce.com for more information.
20
  *
21
  * @category Adfab
22
+ * @package Adfab_Emailcampaign
23
  * @copyright Copyright (C) 2014 Adfab (http://www.adfab.fr/)
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
30
  * Long description of the class (if any...)
31
  *
32
  * @category Adfab
33
+ * @package Adfab_Emailcampaign
34
  * @subpackage Block
35
  * @author Arnaud Hours <arnaud.hours@adfab.fr>
36
  */
37
+ class Adfab_Emailcampaign_Block_Adminhtml_Campaign_Edit extends Mage_Adminhtml_Block_Widget_Form_Container
38
  {
39
 
40
  public function __construct()
app/code/community/Adfab/Emailcampaign/Block/Adminhtml/Campaign/Edit/Form.php CHANGED
@@ -14,12 +14,12 @@
14
  * DISCLAIMER
15
  *
16
  * Do not edit or add to this file if you wish to upgrade
17
- * the Adfab EmailCampaign module to newer versions in the future.
18
- * If you wish to customize the Adfab EmailCampaign module for your needs
19
  * please refer to http://www.magentocommerce.com for more information.
20
  *
21
  * @category Adfab
22
- * @package Adfab_EmailCampaign
23
  * @copyright Copyright (C) 2014 Adfab (http://www.adfab.fr/)
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
@@ -30,11 +30,11 @@
30
  * Long description of the class (if any...)
31
  *
32
  * @category Adfab
33
- * @package Adfab_EmailCampaign
34
  * @subpackage Block
35
  * @author Arnaud Hours <arnaud.hours@adfab.fr>
36
  */
37
- class Adfab_EmailCampaign_Block_Adminhtml_Campaign_Edit_Form extends Mage_Adminhtml_Block_Widget_Form
38
  {
39
 
40
  protected function _prepareForm()
14
  * DISCLAIMER
15
  *
16
  * Do not edit or add to this file if you wish to upgrade
17
+ * the Adfab Emailcampaign module to newer versions in the future.
18
+ * If you wish to customize the Adfab Emailcampaign module for your needs
19
  * please refer to http://www.magentocommerce.com for more information.
20
  *
21
  * @category Adfab
22
+ * @package Adfab_Emailcampaign
23
  * @copyright Copyright (C) 2014 Adfab (http://www.adfab.fr/)
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
30
  * Long description of the class (if any...)
31
  *
32
  * @category Adfab
33
+ * @package Adfab_Emailcampaign
34
  * @subpackage Block
35
  * @author Arnaud Hours <arnaud.hours@adfab.fr>
36
  */
37
+ class Adfab_Emailcampaign_Block_Adminhtml_Campaign_Edit_Form extends Mage_Adminhtml_Block_Widget_Form
38
  {
39
 
40
  protected function _prepareForm()
app/code/community/Adfab/Emailcampaign/Block/Adminhtml/Campaign/Edit/Tab/Cron.php CHANGED
@@ -14,12 +14,12 @@
14
  * DISCLAIMER
15
  *
16
  * Do not edit or add to this file if you wish to upgrade
17
- * the Adfab EmailCampaign module to newer versions in the future.
18
- * If you wish to customize the Adfab EmailCampaign module for your needs
19
  * please refer to http://www.magentocommerce.com for more information.
20
  *
21
  * @category Adfab
22
- * @package Adfab_EmailCampaign
23
  * @copyright Copyright (C) 2014 Adfab (http://www.adfab.fr/)
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
@@ -30,11 +30,11 @@
30
  * Long description of the class (if any...)
31
  *
32
  * @category Adfab
33
- * @package Adfab_EmailCampaign
34
  * @subpackage Block
35
  * @author Arnaud Hours <arnaud.hours@adfab.fr>
36
  */
37
- class Adfab_EmailCampaign_Block_Adminhtml_Campaign_Edit_Tab_Cron extends Mage_Adminhtml_Block_Widget_Form
38
  {
39
 
40
  protected function _prepareForm()
@@ -66,7 +66,9 @@ class Adfab_EmailCampaign_Block_Adminhtml_Campaign_Edit_Tab_Cron extends Mage_Ad
66
  }
67
 
68
  if (Mage::getSingleton('cms/wysiwyg_config')->isEnabled()) {
69
- $this->getLayout()->getBlock('head')->setCanLoadTinyMce(true);
 
 
70
  }
71
 
72
  return parent::_prepareForm();
14
  * DISCLAIMER
15
  *
16
  * Do not edit or add to this file if you wish to upgrade
17
+ * the Adfab Emailcampaign module to newer versions in the future.
18
+ * If you wish to customize the Adfab Emailcampaign module for your needs
19
  * please refer to http://www.magentocommerce.com for more information.
20
  *
21
  * @category Adfab
22
+ * @package Adfab_Emailcampaign
23
  * @copyright Copyright (C) 2014 Adfab (http://www.adfab.fr/)
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
30
  * Long description of the class (if any...)
31
  *
32
  * @category Adfab
33
+ * @package Adfab_Emailcampaign
34
  * @subpackage Block
35
  * @author Arnaud Hours <arnaud.hours@adfab.fr>
36
  */
37
+ class Adfab_Emailcampaign_Block_Adminhtml_Campaign_Edit_Tab_Cron extends Mage_Adminhtml_Block_Widget_Form
38
  {
39
 
40
  protected function _prepareForm()
66
  }
67
 
68
  if (Mage::getSingleton('cms/wysiwyg_config')->isEnabled()) {
69
+ if ($block = $this->getLayout()->getBlock('head')) {
70
+ $block->setCanLoadTinyMce(true);
71
+ }
72
  }
73
 
74
  return parent::_prepareForm();
app/code/community/Adfab/Emailcampaign/Block/Adminhtml/Campaign/Edit/Tab/Form.php CHANGED
@@ -14,12 +14,12 @@
14
  * DISCLAIMER
15
  *
16
  * Do not edit or add to this file if you wish to upgrade
17
- * the Adfab EmailCampaign module to newer versions in the future.
18
- * If you wish to customize the Adfab EmailCampaign module for your needs
19
  * please refer to http://www.magentocommerce.com for more information.
20
  *
21
  * @category Adfab
22
- * @package Adfab_EmailCampaign
23
  * @copyright Copyright (C) 2014 Adfab (http://www.adfab.fr/)
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
@@ -30,11 +30,11 @@
30
  * Long description of the class (if any...)
31
  *
32
  * @category Adfab
33
- * @package Adfab_EmailCampaign
34
  * @subpackage Block
35
  * @author Arnaud Hours <arnaud.hours@adfab.fr>
36
  */
37
- class Adfab_EmailCampaign_Block_Adminhtml_Campaign_Edit_Tab_Form extends Mage_Adminhtml_Block_Widget_Form
38
  {
39
 
40
  protected function _prepareForm()
@@ -85,12 +85,12 @@ class Adfab_EmailCampaign_Block_Adminhtml_Campaign_Edit_Tab_Form extends Mage_Ad
85
  'required' => true,
86
  'values' => array(
87
  array(
88
- 'value' => Adfab_EmailCampaign_Model_Status::STATUS_ENABLED,
89
  'label' => Mage::helper('adminhtml')->__('Enabled'),
90
  ),
91
 
92
  array(
93
- 'value' => Adfab_EmailCampaign_Model_Status::STATUS_DISABLED,
94
  'label' => Mage::helper('adminhtml')->__('Disabled'),
95
  ),
96
  ),
@@ -103,7 +103,7 @@ class Adfab_EmailCampaign_Block_Adminhtml_Campaign_Edit_Tab_Form extends Mage_Ad
103
  'name' => 'code',
104
  'required' => true,
105
  'values' => $campaigns,
106
- 'note' => $this->__('if you change this value, please save and continue edit before editing campaign variables')
107
  ));
108
 
109
  $fieldset->addField('template_id', 'select', array(
@@ -113,16 +113,23 @@ class Adfab_EmailCampaign_Block_Adminhtml_Campaign_Edit_Tab_Form extends Mage_Ad
113
  'values' => Mage::getSingleton('adfab_emailcampaign/source_template')->toFormOptionArray()
114
  ));
115
 
116
- $id = $model ? $model->getTemplateId() : 1;
117
-
 
 
 
 
118
  $fieldset->addField('preview', 'note', array(
119
- 'text' => '<a target="_blank" href="'.Mage::helper("adminhtml")->getUrl('/system_email_template/preview/id/'.$id).'">'.$this->__('Preview').'</a>'
120
  ));
121
 
122
  $fieldset->addField('create_template', 'note', array(
123
  'text' => '<a target="_blank" href="'.Mage::helper("adminhtml")->getUrl('/system_email_template/new').'">'.$this->__('Create template').'</a>'
124
  ));
125
 
 
 
 
126
  /**
127
  * Adfab Logo. This module is open source and we just ask you to let this logo for a very passive ad :)
128
  */
@@ -130,24 +137,32 @@ class Adfab_EmailCampaign_Block_Adminhtml_Campaign_Edit_Tab_Form extends Mage_Ad
130
 
131
  foreach ($campaigns as $campaign) {
132
 
133
- $usage = $fieldset->addField('usage_' . $campaign['value'], 'note', array(
134
  'text' => $campaign['usage']
135
  ));
136
- $warning = $fieldset->addField('warning_' . $campaign['value'], 'note', array(
137
  'text' => $campaign['warning']
138
  ));
139
  }
140
-
141
  if ( $model ) {
142
- $form->setValues($model->getData());
143
  } else {
144
- $form->setValues(array(
145
  'mode' => 'test'
146
- ));
147
  }
 
 
 
 
 
 
 
148
 
149
  if (Mage::getSingleton('cms/wysiwyg_config')->isEnabled()) {
150
- $this->getLayout()->getBlock('head')->setCanLoadTinyMce(true);
 
 
151
  }
152
 
153
  return parent::_prepareForm();
14
  * DISCLAIMER
15
  *
16
  * Do not edit or add to this file if you wish to upgrade
17
+ * the Adfab Emailcampaign module to newer versions in the future.
18
+ * If you wish to customize the Adfab Emailcampaign module for your needs
19
  * please refer to http://www.magentocommerce.com for more information.
20
  *
21
  * @category Adfab
22
+ * @package Adfab_Emailcampaign
23
  * @copyright Copyright (C) 2014 Adfab (http://www.adfab.fr/)
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
30
  * Long description of the class (if any...)
31
  *
32
  * @category Adfab
33
+ * @package Adfab_Emailcampaign
34
  * @subpackage Block
35
  * @author Arnaud Hours <arnaud.hours@adfab.fr>
36
  */
37
+ class Adfab_Emailcampaign_Block_Adminhtml_Campaign_Edit_Tab_Form extends Mage_Adminhtml_Block_Widget_Form
38
  {
39
 
40
  protected function _prepareForm()
85
  'required' => true,
86
  'values' => array(
87
  array(
88
+ 'value' => Adfab_Emailcampaign_Model_Status::STATUS_ENABLED,
89
  'label' => Mage::helper('adminhtml')->__('Enabled'),
90
  ),
91
 
92
  array(
93
+ 'value' => Adfab_Emailcampaign_Model_Status::STATUS_DISABLED,
94
  'label' => Mage::helper('adminhtml')->__('Disabled'),
95
  ),
96
  ),
103
  'name' => 'code',
104
  'required' => true,
105
  'values' => $campaigns,
106
+ // 'note' => $this->__('if you change this value, please save and continue edit before editing campaign variables')
107
  ));
108
 
109
  $fieldset->addField('template_id', 'select', array(
113
  'values' => Mage::getSingleton('adfab_emailcampaign/source_template')->toFormOptionArray()
114
  ));
115
 
116
+ if ($model) {
117
+ $id = $model->getTemplateId() ? $model->getTemplateId() : 0;
118
+ } else {
119
+ $id = 0;
120
+ }
121
+
122
  $fieldset->addField('preview', 'note', array(
123
+ 'text' => '<a target="_blank" href="'.Mage::helper("adminhtml")->getUrl('/campaign/preview/id/'.$id).'">'.$this->__('Preview').'</a>'
124
  ));
125
 
126
  $fieldset->addField('create_template', 'note', array(
127
  'text' => '<a target="_blank" href="'.Mage::helper("adminhtml")->getUrl('/system_email_template/new').'">'.$this->__('Create template').'</a>'
128
  ));
129
 
130
+ $code = $fieldset->addField('loadFormAjaxUrl', 'hidden', array(
131
+ ));
132
+
133
  /**
134
  * Adfab Logo. This module is open source and we just ask you to let this logo for a very passive ad :)
135
  */
137
 
138
  foreach ($campaigns as $campaign) {
139
 
140
+ $fieldset->addField('usage_' . $campaign['value'], 'note', array(
141
  'text' => $campaign['usage']
142
  ));
143
+ $fieldset->addField('warning_' . $campaign['value'], 'note', array(
144
  'text' => $campaign['warning']
145
  ));
146
  }
 
147
  if ( $model ) {
148
+ $data = $model->getData();
149
  } else {
150
+ $data = array(
151
  'mode' => 'test'
152
+ );
153
  }
154
+ $data['loadFormAjaxUrl'] = Mage::helper("adminhtml")->getUrl('adminhtml/campaign/loadFormAjax/');
155
+
156
+ if ($code = Mage::app()->getRequest()->getParam('campaign_code', false)) {
157
+ $data['code'] = $code;
158
+ }
159
+
160
+ $form->setValues($data);
161
 
162
  if (Mage::getSingleton('cms/wysiwyg_config')->isEnabled()) {
163
+ if ($block = $this->getLayout()->getBlock('head')) {
164
+ $this->getLayout()->getBlock('head')->setCanLoadTinyMce(true);
165
+ }
166
  }
167
 
168
  return parent::_prepareForm();
app/code/community/Adfab/Emailcampaign/Block/Adminhtml/Campaign/Edit/Tabs.php CHANGED
@@ -14,12 +14,12 @@
14
  * DISCLAIMER
15
  *
16
  * Do not edit or add to this file if you wish to upgrade
17
- * the Adfab EmailCampaign module to newer versions in the future.
18
- * If you wish to customize the Adfab EmailCampaign module for your needs
19
  * please refer to http://www.magentocommerce.com for more information.
20
  *
21
  * @category Adfab
22
- * @package Adfab_EmailCampaign
23
  * @copyright Copyright (C) 2014 Adfab (http://www.adfab.fr/)
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
@@ -30,11 +30,11 @@
30
  * Long description of the class (if any...)
31
  *
32
  * @category Adfab
33
- * @package Adfab_EmailCampaign
34
  * @subpackage Block
35
  * @author Arnaud Hours <arnaud.hours@adfab.fr>
36
  */
37
- class Adfab_EmailCampaign_Block_Adminhtml_Campaign_Edit_Tabs extends Mage_Adminhtml_Block_Widget_Tabs
38
  {
39
 
40
  public function __construct()
@@ -74,8 +74,23 @@ class Adfab_EmailCampaign_Block_Adminhtml_Campaign_Edit_Tabs extends Mage_Adminh
74
  ));
75
  }
76
  }
77
-
78
  return parent::_beforeToHtml();
79
  }
80
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
81
  }
14
  * DISCLAIMER
15
  *
16
  * Do not edit or add to this file if you wish to upgrade
17
+ * the Adfab Emailcampaign module to newer versions in the future.
18
+ * If you wish to customize the Adfab Emailcampaign module for your needs
19
  * please refer to http://www.magentocommerce.com for more information.
20
  *
21
  * @category Adfab
22
+ * @package Adfab_Emailcampaign
23
  * @copyright Copyright (C) 2014 Adfab (http://www.adfab.fr/)
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
30
  * Long description of the class (if any...)
31
  *
32
  * @category Adfab
33
+ * @package Adfab_Emailcampaign
34
  * @subpackage Block
35
  * @author Arnaud Hours <arnaud.hours@adfab.fr>
36
  */
37
+ class Adfab_Emailcampaign_Block_Adminhtml_Campaign_Edit_Tabs extends Mage_Adminhtml_Block_Widget_Tabs
38
  {
39
 
40
  public function __construct()
74
  ));
75
  }
76
  }
77
+
78
  return parent::_beforeToHtml();
79
  }
80
 
81
+ /**
82
+ *
83
+ * @return array
84
+ */
85
+ public function getTabsHtml()
86
+ {
87
+ $html = array();
88
+ $i = 0;
89
+ foreach ($this->_tabs as $tab) {
90
+ if ($i++ < 3) continue;
91
+ $html[] = $this->getTabContent($tab);
92
+ }
93
+ return $html;
94
+ }
95
+
96
  }
app/code/community/Adfab/Emailcampaign/Block/Adminhtml/Campaign/Forms/AbandonedCart.php CHANGED
@@ -14,12 +14,12 @@
14
  * DISCLAIMER
15
  *
16
  * Do not edit or add to this file if you wish to upgrade
17
- * the Adfab EmailCampaign module to newer versions in the future.
18
- * If you wish to customize the Adfab EmailCampaign module for your needs
19
  * please refer to http://www.magentocommerce.com for more information.
20
  *
21
  * @category Adfab
22
- * @package Adfab_EmailCampaign
23
  * @copyright Copyright (C) 2014 Adfab (http://www.adfab.fr/)
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
@@ -30,11 +30,11 @@
30
  * Long description of the class (if any...)
31
  *
32
  * @category Adfab
33
- * @package Adfab_EmailCampaign
34
  * @subpackage Block
35
  * @author Arnaud Hours <arnaud.hours@adfab.fr>
36
  */
37
- class Adfab_EmailCampaign_Block_Adminhtml_Campaign_Forms_AbandonedCart extends Adfab_EmailCampaign_Block_Adminhtml_Campaign_Forms_Abstract
38
  {
39
 
40
  protected function _prepareForm()
14
  * DISCLAIMER
15
  *
16
  * Do not edit or add to this file if you wish to upgrade
17
+ * the Adfab Emailcampaign module to newer versions in the future.
18
+ * If you wish to customize the Adfab Emailcampaign module for your needs
19
  * please refer to http://www.magentocommerce.com for more information.
20
  *
21
  * @category Adfab
22
+ * @package Adfab_Emailcampaign
23
  * @copyright Copyright (C) 2014 Adfab (http://www.adfab.fr/)
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
30
  * Long description of the class (if any...)
31
  *
32
  * @category Adfab
33
+ * @package Adfab_Emailcampaign
34
  * @subpackage Block
35
  * @author Arnaud Hours <arnaud.hours@adfab.fr>
36
  */
37
+ class Adfab_Emailcampaign_Block_Adminhtml_Campaign_Forms_AbandonedCart extends Adfab_Emailcampaign_Block_Adminhtml_Campaign_Forms_Abstract
38
  {
39
 
40
  protected function _prepareForm()
app/code/community/Adfab/Emailcampaign/Block/Adminhtml/Campaign/Forms/Abstract.php CHANGED
@@ -14,12 +14,12 @@
14
  * DISCLAIMER
15
  *
16
  * Do not edit or add to this file if you wish to upgrade
17
- * the Adfab EmailCampaign module to newer versions in the future.
18
- * If you wish to customize the Adfab EmailCampaign module for your needs
19
  * please refer to http://www.magentocommerce.com for more information.
20
  *
21
  * @category Adfab
22
- * @package Adfab_EmailCampaign
23
  * @copyright Copyright (C) 2014 Adfab (http://www.adfab.fr/)
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
@@ -30,11 +30,11 @@
30
  * Long description of the class (if any...)
31
  *
32
  * @category Adfab
33
- * @package Adfab_EmailCampaign
34
  * @subpackage Block
35
  * @author Arnaud Hours <arnaud.hours@adfab.fr>
36
  */
37
- abstract class Adfab_EmailCampaign_Block_Adminhtml_Campaign_Forms_Abstract extends Mage_Adminhtml_Block_Widget_Form
38
  {
39
 
40
  /**
14
  * DISCLAIMER
15
  *
16
  * Do not edit or add to this file if you wish to upgrade
17
+ * the Adfab Emailcampaign module to newer versions in the future.
18
+ * If you wish to customize the Adfab Emailcampaign module for your needs
19
  * please refer to http://www.magentocommerce.com for more information.
20
  *
21
  * @category Adfab
22
+ * @package Adfab_Emailcampaign
23
  * @copyright Copyright (C) 2014 Adfab (http://www.adfab.fr/)
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
30
  * Long description of the class (if any...)
31
  *
32
  * @category Adfab
33
+ * @package Adfab_Emailcampaign
34
  * @subpackage Block
35
  * @author Arnaud Hours <arnaud.hours@adfab.fr>
36
  */
37
+ abstract class Adfab_Emailcampaign_Block_Adminhtml_Campaign_Forms_Abstract extends Mage_Adminhtml_Block_Widget_Form
38
  {
39
 
40
  /**
app/code/community/Adfab/Emailcampaign/Block/Adminhtml/Campaign/Forms/CustomerBirthday.php CHANGED
@@ -14,12 +14,12 @@
14
  * DISCLAIMER
15
  *
16
  * Do not edit or add to this file if you wish to upgrade
17
- * the Adfab EmailCampaign module to newer versions in the future.
18
- * If you wish to customize the Adfab EmailCampaign module for your needs
19
  * please refer to http://www.magentocommerce.com for more information.
20
  *
21
  * @category Adfab
22
- * @package Adfab_EmailCampaign
23
  * @copyright Copyright (C) 2014 Adfab (http://www.adfab.fr/)
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
@@ -30,11 +30,11 @@
30
  * Long description of the class (if any...)
31
  *
32
  * @category Adfab
33
- * @package Adfab_EmailCampaign
34
  * @subpackage Block
35
  * @author Arnaud Hours <arnaud.hours@adfab.fr>
36
  */
37
- class Adfab_EmailCampaign_Block_Adminhtml_Campaign_Forms_CustomerBirthday extends Adfab_EmailCampaign_Block_Adminhtml_Campaign_Forms_Abstract
38
  {
39
 
40
  protected function _prepareForm()
14
  * DISCLAIMER
15
  *
16
  * Do not edit or add to this file if you wish to upgrade
17
+ * the Adfab Emailcampaign module to newer versions in the future.
18
+ * If you wish to customize the Adfab Emailcampaign module for your needs
19
  * please refer to http://www.magentocommerce.com for more information.
20
  *
21
  * @category Adfab
22
+ * @package Adfab_Emailcampaign
23
  * @copyright Copyright (C) 2014 Adfab (http://www.adfab.fr/)
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
30
  * Long description of the class (if any...)
31
  *
32
  * @category Adfab
33
+ * @package Adfab_Emailcampaign
34
  * @subpackage Block
35
  * @author Arnaud Hours <arnaud.hours@adfab.fr>
36
  */
37
+ class Adfab_Emailcampaign_Block_Adminhtml_Campaign_Forms_CustomerBirthday extends Adfab_Emailcampaign_Block_Adminhtml_Campaign_Forms_Abstract
38
  {
39
 
40
  protected function _prepareForm()
app/code/community/Adfab/Emailcampaign/Block/Adminhtml/Campaign/Forms/Nursing.php ADDED
@@ -0,0 +1,72 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Adfab extension for Magento
4
+ *
5
+ * Long description of this file (if any...)
6
+ *
7
+ * NOTICE OF LICENSE
8
+ *
9
+ * This source file is subject to the Open Software License (OSL 3.0)
10
+ * that is bundled with this package in the file LICENSE.txt.
11
+ * It is also available through the world-wide-web at this URL:
12
+ * http://opensource.org/licenses/osl-3.0.php
13
+ *
14
+ * DISCLAIMER
15
+ *
16
+ * Do not edit or add to this file if you wish to upgrade
17
+ * the Adfab Emailcampaign module to newer versions in the future.
18
+ * If you wish to customize the Adfab Emailcampaign module for your needs
19
+ * please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category Adfab
22
+ * @package Adfab_Emailcampaign
23
+ * @copyright Copyright (C) 2014 Adfab (http://www.adfab.fr/)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+
27
+ /**
28
+ * Short description of the class
29
+ *
30
+ * Long description of the class (if any...)
31
+ *
32
+ * @category Adfab
33
+ * @package Adfab_Emailcampaign
34
+ * @subpackage Block
35
+ * @author Arnaud Hours <arnaud.hours@adfab.fr>
36
+ */
37
+ class Adfab_Emailcampaign_Block_Adminhtml_Campaign_Forms_Nursing extends Adfab_Emailcampaign_Block_Adminhtml_Campaign_Forms_Abstract
38
+ {
39
+
40
+ protected function _prepareForm()
41
+ {
42
+ $form = new Varien_Data_Form();
43
+ $this->setForm($form);
44
+ $form->setHtmlIdPrefix('emailcampaign_vars_');
45
+ $fieldset = $form->addFieldset('emailcampaign_target_form', array('legend'=>Mage::helper('adfab_emailcampaign')->__('Campaign Variables')));
46
+
47
+ $fieldset->addField('variables_send_after_days', 'text', array(
48
+ 'label' => Mage::helper('adfab_emailcampaign')->__('Send mail after how many days ?'),
49
+ 'class' => 'required-entry',
50
+ 'required' => true,
51
+ 'name' => 'variables[send_after_days]',
52
+ ));
53
+
54
+ $fieldset->addField('variables_resend', 'select', array(
55
+ 'label' => Mage::helper('adfab_emailcampaign')->__('Re send mail to customers at next planification if they already received it ?'),
56
+ 'class' => 'required-entry',
57
+ 'required' => true,
58
+ 'name' => 'variables[resend]',
59
+ 'value' => '1',
60
+ 'values' => array(
61
+ '1' => Mage::helper('core')->__('Yes'),
62
+ '2' => Mage::helper('core')->__('No')
63
+ ),
64
+ ));
65
+
66
+ if ($campaign = Mage::registry('emailcampaign_data')) {
67
+ $form->setValues($this->_transform($campaign->getVariable()));
68
+ }
69
+ return parent::_prepareForm();
70
+ }
71
+
72
+ }
app/code/community/Adfab/Emailcampaign/Block/Adminhtml/Campaign/Forms/WelcomeReminder.php CHANGED
@@ -14,12 +14,12 @@
14
  * DISCLAIMER
15
  *
16
  * Do not edit or add to this file if you wish to upgrade
17
- * the Adfab EmailCampaign module to newer versions in the future.
18
- * If you wish to customize the Adfab EmailCampaign module for your needs
19
  * please refer to http://www.magentocommerce.com for more information.
20
  *
21
  * @category Adfab
22
- * @package Adfab_EmailCampaign
23
  * @copyright Copyright (C) 2014 Adfab (http://www.adfab.fr/)
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
@@ -30,11 +30,11 @@
30
  * Long description of the class (if any...)
31
  *
32
  * @category Adfab
33
- * @package Adfab_EmailCampaign
34
  * @subpackage Block
35
  * @author Arnaud Hours <arnaud.hours@adfab.fr>
36
  */
37
- class Adfab_EmailCampaign_Block_Adminhtml_Campaign_Forms_WelcomeReminder extends Adfab_EmailCampaign_Block_Adminhtml_Campaign_Forms_Abstract
38
  {
39
 
40
  protected function _prepareForm()
14
  * DISCLAIMER
15
  *
16
  * Do not edit or add to this file if you wish to upgrade
17
+ * the Adfab Emailcampaign module to newer versions in the future.
18
+ * If you wish to customize the Adfab Emailcampaign module for your needs
19
  * please refer to http://www.magentocommerce.com for more information.
20
  *
21
  * @category Adfab
22
+ * @package Adfab_Emailcampaign
23
  * @copyright Copyright (C) 2014 Adfab (http://www.adfab.fr/)
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
30
  * Long description of the class (if any...)
31
  *
32
  * @category Adfab
33
+ * @package Adfab_Emailcampaign
34
  * @subpackage Block
35
  * @author Arnaud Hours <arnaud.hours@adfab.fr>
36
  */
37
+ class Adfab_Emailcampaign_Block_Adminhtml_Campaign_Forms_WelcomeReminder extends Adfab_Emailcampaign_Block_Adminhtml_Campaign_Forms_Abstract
38
  {
39
 
40
  protected function _prepareForm()
app/code/community/Adfab/Emailcampaign/Block/Adminhtml/Campaign/Forms/WishlistReminder.php CHANGED
@@ -14,12 +14,12 @@
14
  * DISCLAIMER
15
  *
16
  * Do not edit or add to this file if you wish to upgrade
17
- * the Adfab EmailCampaign module to newer versions in the future.
18
- * If you wish to customize the Adfab EmailCampaign module for your needs
19
  * please refer to http://www.magentocommerce.com for more information.
20
  *
21
  * @category Adfab
22
- * @package Adfab_EmailCampaign
23
  * @copyright Copyright (C) 2014 Adfab (http://www.adfab.fr/)
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
@@ -30,11 +30,11 @@
30
  * Long description of the class (if any...)
31
  *
32
  * @category Adfab
33
- * @package Adfab_EmailCampaign
34
  * @subpackage Block
35
  * @author Arnaud Hours <arnaud.hours@adfab.fr>
36
  */
37
- class Adfab_EmailCampaign_Block_Adminhtml_Campaign_Forms_WishlistReminder extends Adfab_EmailCampaign_Block_Adminhtml_Campaign_Forms_Abstract
38
  {
39
 
40
  protected function _prepareForm()
14
  * DISCLAIMER
15
  *
16
  * Do not edit or add to this file if you wish to upgrade
17
+ * the Adfab Emailcampaign module to newer versions in the future.
18
+ * If you wish to customize the Adfab Emailcampaign module for your needs
19
  * please refer to http://www.magentocommerce.com for more information.
20
  *
21
  * @category Adfab
22
+ * @package Adfab_Emailcampaign
23
  * @copyright Copyright (C) 2014 Adfab (http://www.adfab.fr/)
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
30
  * Long description of the class (if any...)
31
  *
32
  * @category Adfab
33
+ * @package Adfab_Emailcampaign
34
  * @subpackage Block
35
  * @author Arnaud Hours <arnaud.hours@adfab.fr>
36
  */
37
+ class Adfab_Emailcampaign_Block_Adminhtml_Campaign_Forms_WishlistReminder extends Adfab_Emailcampaign_Block_Adminhtml_Campaign_Forms_Abstract
38
  {
39
 
40
  protected function _prepareForm()
app/code/community/Adfab/Emailcampaign/Block/Adminhtml/Campaign/Forms/WishlistStockAlert.php CHANGED
@@ -14,12 +14,12 @@
14
  * DISCLAIMER
15
  *
16
  * Do not edit or add to this file if you wish to upgrade
17
- * the Adfab EmailCampaign module to newer versions in the future.
18
- * If you wish to customize the Adfab EmailCampaign module for your needs
19
  * please refer to http://www.magentocommerce.com for more information.
20
  *
21
  * @category Adfab
22
- * @package Adfab_EmailCampaign
23
  * @copyright Copyright (C) 2014 Adfab (http://www.adfab.fr/)
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
@@ -30,11 +30,11 @@
30
  * Long description of the class (if any...)
31
  *
32
  * @category Adfab
33
- * @package Adfab_EmailCampaign
34
  * @subpackage Block
35
  * @author Arnaud Hours <arnaud.hours@adfab.fr>
36
  */
37
- class Adfab_EmailCampaign_Block_Adminhtml_Campaign_Forms_WishlistStockAlert extends Adfab_EmailCampaign_Block_Adminhtml_Campaign_Forms_Abstract
38
  {
39
 
40
  protected function _prepareForm()
@@ -46,11 +46,19 @@ class Adfab_EmailCampaign_Block_Adminhtml_Campaign_Forms_WishlistStockAlert exte
46
 
47
  $fieldset->addField('variables_stock_alert', 'text', array(
48
  'label' => Mage::helper('adfab_emailcampaign')->__('Stock is less than'),
49
- 'class' => 'required-entry',
50
  'required' => true,
51
  'name' => 'variables[stock_alert]'
52
  ));
53
 
 
 
 
 
 
 
 
 
54
  if ($campaign = Mage::registry('emailcampaign_data')) {
55
  $form->setValues($this->_transform($campaign->getVariable()));
56
  }
14
  * DISCLAIMER
15
  *
16
  * Do not edit or add to this file if you wish to upgrade
17
+ * the Adfab Emailcampaign module to newer versions in the future.
18
+ * If you wish to customize the Adfab Emailcampaign module for your needs
19
  * please refer to http://www.magentocommerce.com for more information.
20
  *
21
  * @category Adfab
22
+ * @package Adfab_Emailcampaign
23
  * @copyright Copyright (C) 2014 Adfab (http://www.adfab.fr/)
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
30
  * Long description of the class (if any...)
31
  *
32
  * @category Adfab
33
+ * @package Adfab_Emailcampaign
34
  * @subpackage Block
35
  * @author Arnaud Hours <arnaud.hours@adfab.fr>
36
  */
37
+ class Adfab_Emailcampaign_Block_Adminhtml_Campaign_Forms_WishlistStockAlert extends Adfab_Emailcampaign_Block_Adminhtml_Campaign_Forms_Abstract
38
  {
39
 
40
  protected function _prepareForm()
46
 
47
  $fieldset->addField('variables_stock_alert', 'text', array(
48
  'label' => Mage::helper('adfab_emailcampaign')->__('Stock is less than'),
49
+ 'class' => 'required-entry validate-number',
50
  'required' => true,
51
  'name' => 'variables[stock_alert]'
52
  ));
53
 
54
+ $fieldset->addField('variables_interval', 'text', array(
55
+ 'label' => Mage::helper('adfab_emailcampaign')->__('Interval between a customer cannot receive a second stock alert email'),
56
+ 'class' => 'required-entry validate-number',
57
+ 'required' => true,
58
+ 'name' => 'variables[interval]',
59
+ 'note' => Mage::helper('adfab_emailcampaign')->__('in days')
60
+ ));
61
+
62
  if ($campaign = Mage::registry('emailcampaign_data')) {
63
  $form->setValues($this->_transform($campaign->getVariable()));
64
  }
app/code/community/Adfab/Emailcampaign/Block/Adminhtml/Campaign/Grid.php CHANGED
@@ -14,12 +14,12 @@
14
  * DISCLAIMER
15
  *
16
  * Do not edit or add to this file if you wish to upgrade
17
- * the Adfab EmailCampaign module to newer versions in the future.
18
- * If you wish to customize the Adfab EmailCampaign module for your needs
19
  * please refer to http://www.magentocommerce.com for more information.
20
  *
21
  * @category Adfab
22
- * @package Adfab_EmailCampaign
23
  * @copyright Copyright (C) 2014 Adfab (http://www.adfab.fr/)
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
@@ -30,11 +30,11 @@
30
  * Long description of the class (if any...)
31
  *
32
  * @category Adfab
33
- * @package Adfab_EmailCampaign
34
  * @subpackage Block
35
  * @author Arnaud Hours <arnaud.hours@adfab.fr>
36
  */
37
- class Adfab_EmailCampaign_Block_Adminhtml_Campaign_Grid extends Mage_Adminhtml_Block_Widget_Grid
38
  {
39
 
40
  public function __construct()
14
  * DISCLAIMER
15
  *
16
  * Do not edit or add to this file if you wish to upgrade
17
+ * the Adfab Emailcampaign module to newer versions in the future.
18
+ * If you wish to customize the Adfab Emailcampaign module for your needs
19
  * please refer to http://www.magentocommerce.com for more information.
20
  *
21
  * @category Adfab
22
+ * @package Adfab_Emailcampaign
23
  * @copyright Copyright (C) 2014 Adfab (http://www.adfab.fr/)
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
30
  * Long description of the class (if any...)
31
  *
32
  * @category Adfab
33
+ * @package Adfab_Emailcampaign
34
  * @subpackage Block
35
  * @author Arnaud Hours <arnaud.hours@adfab.fr>
36
  */
37
+ class Adfab_Emailcampaign_Block_Adminhtml_Campaign_Grid extends Mage_Adminhtml_Block_Widget_Grid
38
  {
39
 
40
  public function __construct()
app/code/community/Adfab/Emailcampaign/Block/Adminhtml/Form/Edit/Renderer/Cron.php CHANGED
@@ -14,12 +14,12 @@
14
  * DISCLAIMER
15
  *
16
  * Do not edit or add to this file if you wish to upgrade
17
- * the Adfab EmailCampaign module to newer versions in the future.
18
- * If you wish to customize the Adfab EmailCampaign module for your needs
19
  * please refer to http://www.magentocommerce.com for more information.
20
  *
21
  * @category Adfab
22
- * @package Adfab_EmailCampaign
23
  * @copyright Copyright (C) 2014 Adfab (http://www.adfab.fr/)
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
@@ -29,11 +29,11 @@
29
  * Need jQuery and jquery-cron to work properly
30
  *
31
  * @category Adfab
32
- * @package Adfab_EmailCampaign
33
  * @subpackage Block
34
  * @author Arnaud Hours <arnaud.hours@adfab.fr>
35
  */
36
- class Adfab_EmailCampaign_Block_Adminhtml_Form_Edit_Renderer_Cron extends Mage_Adminhtml_Block_Widget implements Varien_Data_Form_Element_Renderer_Interface
37
  {
38
 
39
  /**
14
  * DISCLAIMER
15
  *
16
  * Do not edit or add to this file if you wish to upgrade
17
+ * the Adfab Emailcampaign module to newer versions in the future.
18
+ * If you wish to customize the Adfab Emailcampaign module for your needs
19
  * please refer to http://www.magentocommerce.com for more information.
20
  *
21
  * @category Adfab
22
+ * @package Adfab_Emailcampaign
23
  * @copyright Copyright (C) 2014 Adfab (http://www.adfab.fr/)
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
29
  * Need jQuery and jquery-cron to work properly
30
  *
31
  * @category Adfab
32
+ * @package Adfab_Emailcampaign
33
  * @subpackage Block
34
  * @author Arnaud Hours <arnaud.hours@adfab.fr>
35
  */
36
+ class Adfab_Emailcampaign_Block_Adminhtml_Form_Edit_Renderer_Cron extends Mage_Adminhtml_Block_Widget implements Varien_Data_Form_Element_Renderer_Interface
37
  {
38
 
39
  /**
app/code/community/Adfab/Emailcampaign/Block/Adminhtml/Notification/Toolbar.php CHANGED
@@ -14,12 +14,12 @@
14
  * DISCLAIMER
15
  *
16
  * Do not edit or add to this file if you wish to upgrade
17
- * the Adfab EmailCampaign module to newer versions in the future.
18
- * If you wish to customize the Adfab EmailCampaign module for your needs
19
  * please refer to http://www.magentocommerce.com for more information.
20
  *
21
  * @category Adfab
22
- * @package Adfab_EmailCampaign
23
  * @copyright Copyright (C) 2014 Adfab (http://www.adfab.fr/)
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
@@ -30,11 +30,11 @@
30
  * Long description of the class (if any...)
31
  *
32
  * @category Adfab
33
- * @package Adfab_EmailCampaign
34
  * @subpackage Block
35
  * @author Arnaud Hours <arnaud.hours@adfab.fr>
36
  */
37
- class Adfab_EmailCampaign_Block_Adminhtml_Notification_Toolbar extends Mage_Adminhtml_Block_Notification_Toolbar
38
  {
39
 
40
  protected $_notifications;
14
  * DISCLAIMER
15
  *
16
  * Do not edit or add to this file if you wish to upgrade
17
+ * the Adfab Emailcampaign module to newer versions in the future.
18
+ * If you wish to customize the Adfab Emailcampaign module for your needs
19
  * please refer to http://www.magentocommerce.com for more information.
20
  *
21
  * @category Adfab
22
+ * @package Adfab_Emailcampaign
23
  * @copyright Copyright (C) 2014 Adfab (http://www.adfab.fr/)
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
30
  * Long description of the class (if any...)
31
  *
32
  * @category Adfab
33
+ * @package Adfab_Emailcampaign
34
  * @subpackage Block
35
  * @author Arnaud Hours <arnaud.hours@adfab.fr>
36
  */
37
+ class Adfab_Emailcampaign_Block_Adminhtml_Notification_Toolbar extends Mage_Adminhtml_Block_Notification_Toolbar
38
  {
39
 
40
  protected $_notifications;
app/code/community/Adfab/Emailcampaign/Block/Adminhtml/Recipient.php CHANGED
@@ -14,12 +14,12 @@
14
  * DISCLAIMER
15
  *
16
  * Do not edit or add to this file if you wish to upgrade
17
- * the Adfab EmailCampaign module to newer versions in the future.
18
- * If you wish to customize the Adfab EmailCampaign module for your needs
19
  * please refer to http://www.magentocommerce.com for more information.
20
  *
21
  * @category Adfab
22
- * @package Adfab_EmailCampaign
23
  * @copyright Copyright (C) 2014 Adfab (http://www.adfab.fr/)
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
@@ -30,11 +30,11 @@
30
  * Long description of the class (if any...)
31
  *
32
  * @category Adfab
33
- * @package Adfab_EmailCampaign
34
  * @subpackage Block
35
  * @author Arnaud Hours <arnaud.hours@adfab.fr>
36
  */
37
- class Adfab_EmailCampaign_Block_Adminhtml_Recipient extends Mage_Adminhtml_Block_Widget_Grid_Container
38
  {
39
 
40
  public function __construct()
14
  * DISCLAIMER
15
  *
16
  * Do not edit or add to this file if you wish to upgrade
17
+ * the Adfab Emailcampaign module to newer versions in the future.
18
+ * If you wish to customize the Adfab Emailcampaign module for your needs
19
  * please refer to http://www.magentocommerce.com for more information.
20
  *
21
  * @category Adfab
22
+ * @package Adfab_Emailcampaign
23
  * @copyright Copyright (C) 2014 Adfab (http://www.adfab.fr/)
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
30
  * Long description of the class (if any...)
31
  *
32
  * @category Adfab
33
+ * @package Adfab_Emailcampaign
34
  * @subpackage Block
35
  * @author Arnaud Hours <arnaud.hours@adfab.fr>
36
  */
37
+ class Adfab_Emailcampaign_Block_Adminhtml_Recipient extends Mage_Adminhtml_Block_Widget_Grid_Container
38
  {
39
 
40
  public function __construct()
app/code/community/Adfab/Emailcampaign/Block/Adminhtml/Recipient/Grid.php CHANGED
@@ -14,12 +14,12 @@
14
  * DISCLAIMER
15
  *
16
  * Do not edit or add to this file if you wish to upgrade
17
- * the Adfab EmailCampaign module to newer versions in the future.
18
- * If you wish to customize the Adfab EmailCampaign module for your needs
19
  * please refer to http://www.magentocommerce.com for more information.
20
  *
21
  * @category Adfab
22
- * @package Adfab_EmailCampaign
23
  * @copyright Copyright (C) 2014 Adfab (http://www.adfab.fr/)
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
@@ -30,11 +30,11 @@
30
  * Long description of the class (if any...)
31
  *
32
  * @category Adfab
33
- * @package Adfab_EmailCampaign
34
  * @subpackage Block
35
  * @author Arnaud Hours <arnaud.hours@adfab.fr>
36
  */
37
- class Adfab_EmailCampaign_Block_Adminhtml_Recipient_Grid extends Mage_Adminhtml_Block_Widget_Grid
38
  {
39
 
40
  public function __construct()
14
  * DISCLAIMER
15
  *
16
  * Do not edit or add to this file if you wish to upgrade
17
+ * the Adfab Emailcampaign module to newer versions in the future.
18
+ * If you wish to customize the Adfab Emailcampaign module for your needs
19
  * please refer to http://www.magentocommerce.com for more information.
20
  *
21
  * @category Adfab
22
+ * @package Adfab_Emailcampaign
23
  * @copyright Copyright (C) 2014 Adfab (http://www.adfab.fr/)
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
30
  * Long description of the class (if any...)
31
  *
32
  * @category Adfab
33
+ * @package Adfab_Emailcampaign
34
  * @subpackage Block
35
  * @author Arnaud Hours <arnaud.hours@adfab.fr>
36
  */
37
+ class Adfab_Emailcampaign_Block_Adminhtml_Recipient_Grid extends Mage_Adminhtml_Block_Widget_Grid
38
  {
39
 
40
  public function __construct()
app/code/community/Adfab/Emailcampaign/Block/Adminhtml/System/Email/Template/Preview.php ADDED
@@ -0,0 +1,86 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Adfab extension for Magento
4
+ *
5
+ * Long description of this file (if any...)
6
+ *
7
+ * NOTICE OF LICENSE
8
+ *
9
+ * This source file is subject to the Open Software License (OSL 3.0)
10
+ * that is bundled with this package in the file LICENSE.txt.
11
+ * It is also available through the world-wide-web at this URL:
12
+ * http://opensource.org/licenses/osl-3.0.php
13
+ *
14
+ * DISCLAIMER
15
+ *
16
+ * Do not edit or add to this file if you wish to upgrade
17
+ * the Adfab Emailcampaign module to newer versions in the future.
18
+ * If you wish to customize the Adfab Emailcampaign module for your needs
19
+ * please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category Adfab
22
+ * @package Adfab_Emailcampaign
23
+ * @copyright Copyright (C) 2014 Adfab (http://www.adfab.fr/)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+
27
+ /**
28
+ * Short description of the class
29
+ *
30
+ * Long description of the class (if any...)
31
+ *
32
+ * @category Adfab
33
+ * @package Adfab_Emailcampaign
34
+ * @subpackage Model
35
+ * @author Arnaud Hours <arnaud.hours@adfab.fr>
36
+ */
37
+ class Adfab_Emailcampaign_Block_Adminhtml_System_Email_Template_Preview extends Mage_Adminhtml_Block_System_Email_Template_Preview
38
+ {
39
+
40
+ /**
41
+ * Prepare html output
42
+ *
43
+ * @return string
44
+ */
45
+ protected function _toHtml()
46
+ {
47
+ $id = $this->getRequest()->getParam('id');
48
+ if (is_numeric($id)) {
49
+ return parent::_toHtml();
50
+ }
51
+
52
+ // else we can load by code
53
+
54
+ /** @var $template Mage_Core_Model_Email_Template */
55
+ $template = Mage::getModel('core/email_template');
56
+ if ($id) {
57
+ $localeCode = Mage::getStoreConfig('general/locale/code');
58
+ $template->loadDefault($id);
59
+ } else {
60
+ $template->setTemplateType($this->getRequest()->getParam('type'));
61
+ $template->setTemplateText($this->getRequest()->getParam('text'));
62
+ $template->setTemplateStyles($this->getRequest()->getParam('styles'));
63
+ }
64
+
65
+ /* @var $filter Mage_Core_Model_Input_Filter_MaliciousCode */
66
+ $filter = Mage::getSingleton('core/input_filter_maliciousCode');
67
+
68
+ $template->setTemplateText(
69
+ $filter->filter($template->getTemplateText())
70
+ );
71
+
72
+ Varien_Profiler::start("email_template_proccessing");
73
+ $vars = array();
74
+
75
+ $templateProcessed = $template->getProcessedTemplate($vars, true);
76
+
77
+ if ($template->isPlain()) {
78
+ $templateProcessed = "<pre>" . htmlspecialchars($templateProcessed) . "</pre>";
79
+ }
80
+
81
+ Varien_Profiler::stop("email_template_proccessing");
82
+
83
+ return $templateProcessed;
84
+ }
85
+
86
+ }
app/code/community/Adfab/Emailcampaign/Helper/Connector.php CHANGED
@@ -14,12 +14,12 @@
14
  * DISCLAIMER
15
  *
16
  * Do not edit or add to this file if you wish to upgrade
17
- * the Adfab EmailCampaign module to newer versions in the future.
18
- * If you wish to customize the Adfab EmailCampaign module for your needs
19
  * please refer to http://www.magentocommerce.com for more information.
20
  *
21
  * @category Adfab
22
- * @package Adfab_EmailCampaign
23
  * @copyright Copyright (C) 2014 Adfab (http://www.adfab.fr/)
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
@@ -30,15 +30,15 @@
30
  * Long description of the class (if any...)
31
  *
32
  * @category Adfab
33
- * @package Adfab_EmailCampaign
34
  * @subpackage Helper
35
  * @author Arnaud Hours <arnaud.hours@adfab.fr>
36
  */
37
- class Adfab_EmailCampaign_Helper_Connector extends Mage_Core_Helper_Data
38
  {
39
 
40
  /**
41
- * @return Adfab_EmailCampaign_Model_Connector_Abstract
42
  */
43
  public function getConnector()
44
  {
@@ -54,7 +54,7 @@ class Adfab_EmailCampaign_Helper_Connector extends Mage_Core_Helper_Data
54
 
55
  /**
56
  *
57
- * @return Adfab_EmailCampaign_Model_Connector_Magento
58
  */
59
  public function getDefaultConnector()
60
  {
@@ -63,7 +63,7 @@ class Adfab_EmailCampaign_Helper_Connector extends Mage_Core_Helper_Data
63
 
64
  /**
65
  *
66
- * @return Adfab_EmailCampaign_Model_Connector_Magento
67
  */
68
  public function getVoidConnector()
69
  {
14
  * DISCLAIMER
15
  *
16
  * Do not edit or add to this file if you wish to upgrade
17
+ * the Adfab Emailcampaign module to newer versions in the future.
18
+ * If you wish to customize the Adfab Emailcampaign module for your needs
19
  * please refer to http://www.magentocommerce.com for more information.
20
  *
21
  * @category Adfab
22
+ * @package Adfab_Emailcampaign
23
  * @copyright Copyright (C) 2014 Adfab (http://www.adfab.fr/)
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
30
  * Long description of the class (if any...)
31
  *
32
  * @category Adfab
33
+ * @package Adfab_Emailcampaign
34
  * @subpackage Helper
35
  * @author Arnaud Hours <arnaud.hours@adfab.fr>
36
  */
37
+ class Adfab_Emailcampaign_Helper_Connector extends Mage_Core_Helper_Data
38
  {
39
 
40
  /**
41
+ * @return Adfab_Emailcampaign_Model_Connector_Abstract
42
  */
43
  public function getConnector()
44
  {
54
 
55
  /**
56
  *
57
+ * @return Adfab_Emailcampaign_Model_Connector_Magento
58
  */
59
  public function getDefaultConnector()
60
  {
63
 
64
  /**
65
  *
66
+ * @return Adfab_Emailcampaign_Model_Connector_Magento
67
  */
68
  public function getVoidConnector()
69
  {
app/code/community/Adfab/Emailcampaign/Helper/Data.php CHANGED
@@ -14,12 +14,12 @@
14
  * DISCLAIMER
15
  *
16
  * Do not edit or add to this file if you wish to upgrade
17
- * the Adfab EmailCampaign module to newer versions in the future.
18
- * If you wish to customize the Adfab EmailCampaign module for your needs
19
  * please refer to http://www.magentocommerce.com for more information.
20
  *
21
  * @category Adfab
22
- * @package Adfab_EmailCampaign
23
  * @copyright Copyright (C) 2014 Adfab (http://www.adfab.fr/)
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
@@ -30,11 +30,11 @@
30
  * Long description of the class (if any...)
31
  *
32
  * @category Adfab
33
- * @package Adfab_EmailCampaign
34
  * @subpackage Helper
35
  * @author Arnaud Hours <arnaud.hours@adfab.fr>
36
  */
37
- class Adfab_EmailCampaign_Helper_Data extends Mage_Core_Helper_Data
38
  {
39
 
40
  protected $_campaigns;
@@ -47,13 +47,13 @@ class Adfab_EmailCampaign_Helper_Data extends Mage_Core_Helper_Data
47
  /**
48
  *
49
  * @param string $type
50
- * @return array<Adfab_EmailCampaign_Model_Campaign>
51
  */
52
  public function getCampaignsByType($type)
53
  {
54
  if (is_null($this->_campaigns)) {
55
  $this->_campaigns = Mage::getResourceModel('adfab_emailcampaign/campaign_collection')
56
- ->addFieldToFilter('status', array('eq' => Adfab_EmailCampaign_Model_Status::STATUS_ENABLED));
57
  }
58
  $found = array();
59
  foreach ($this->_campaigns as $campaign) {
@@ -103,7 +103,7 @@ class Adfab_EmailCampaign_Helper_Data extends Mage_Core_Helper_Data
103
  /**
104
  *
105
  * @param string $code
106
- * @return Adfab_EmailCampaign_Model_Campaign_Abstract
107
  */
108
  public function getCampaignModel($code)
109
  {
14
  * DISCLAIMER
15
  *
16
  * Do not edit or add to this file if you wish to upgrade
17
+ * the Adfab Emailcampaign module to newer versions in the future.
18
+ * If you wish to customize the Adfab Emailcampaign module for your needs
19
  * please refer to http://www.magentocommerce.com for more information.
20
  *
21
  * @category Adfab
22
+ * @package Adfab_Emailcampaign
23
  * @copyright Copyright (C) 2014 Adfab (http://www.adfab.fr/)
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
30
  * Long description of the class (if any...)
31
  *
32
  * @category Adfab
33
+ * @package Adfab_Emailcampaign
34
  * @subpackage Helper
35
  * @author Arnaud Hours <arnaud.hours@adfab.fr>
36
  */
37
+ class Adfab_Emailcampaign_Helper_Data extends Mage_Core_Helper_Data
38
  {
39
 
40
  protected $_campaigns;
47
  /**
48
  *
49
  * @param string $type
50
+ * @return array<Adfab_Emailcampaign_Model_Campaign>
51
  */
52
  public function getCampaignsByType($type)
53
  {
54
  if (is_null($this->_campaigns)) {
55
  $this->_campaigns = Mage::getResourceModel('adfab_emailcampaign/campaign_collection')
56
+ ->addFieldToFilter('status', array('eq' => Adfab_Emailcampaign_Model_Status::STATUS_ENABLED));
57
  }
58
  $found = array();
59
  foreach ($this->_campaigns as $campaign) {
103
  /**
104
  *
105
  * @param string $code
106
+ * @return Adfab_Emailcampaign_Model_Campaign_Abstract
107
  */
108
  public function getCampaignModel($code)
109
  {
app/code/community/Adfab/Emailcampaign/Model/Adminhtml/Notification.php CHANGED
@@ -14,12 +14,12 @@
14
  * DISCLAIMER
15
  *
16
  * Do not edit or add to this file if you wish to upgrade
17
- * the Adfab EmailCampaign module to newer versions in the future.
18
- * If you wish to customize the Adfab EmailCampaign module for your needs
19
  * please refer to http://www.magentocommerce.com for more information.
20
  *
21
  * @category Adfab
22
- * @package Adfab_EmailCampaign
23
  * @copyright Copyright (C) 2014 Adfab (http://www.adfab.fr/)
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
@@ -30,11 +30,11 @@
30
  * Long description of the class (if any...)
31
  *
32
  * @category Adfab
33
- * @package Adfab_EmailCampaign
34
  * @subpackage Model
35
  * @author Arnaud Hours <arnaud.hours@adfab.fr>
36
  */
37
- class Adfab_EmailCampaign_Model_Adminhtml_Notification extends Mage_Core_Model_Abstract
38
  {
39
 
40
  public function _construct()
14
  * DISCLAIMER
15
  *
16
  * Do not edit or add to this file if you wish to upgrade
17
+ * the Adfab Emailcampaign module to newer versions in the future.
18
+ * If you wish to customize the Adfab Emailcampaign module for your needs
19
  * please refer to http://www.magentocommerce.com for more information.
20
  *
21
  * @category Adfab
22
+ * @package Adfab_Emailcampaign
23
  * @copyright Copyright (C) 2014 Adfab (http://www.adfab.fr/)
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
30
  * Long description of the class (if any...)
31
  *
32
  * @category Adfab
33
+ * @package Adfab_Emailcampaign
34
  * @subpackage Model
35
  * @author Arnaud Hours <arnaud.hours@adfab.fr>
36
  */
37
+ class Adfab_Emailcampaign_Model_Adminhtml_Notification extends Mage_Core_Model_Abstract
38
  {
39
 
40
  public function _construct()
app/code/community/Adfab/Emailcampaign/Model/Campaign.php CHANGED
@@ -14,12 +14,12 @@
14
  * DISCLAIMER
15
  *
16
  * Do not edit or add to this file if you wish to upgrade
17
- * the Adfab EmailCampaign module to newer versions in the future.
18
- * If you wish to customize the Adfab EmailCampaign module for your needs
19
  * please refer to http://www.magentocommerce.com for more information.
20
  *
21
  * @category Adfab
22
- * @package Adfab_EmailCampaign
23
  * @copyright Copyright (C) 2014 Adfab (http://www.adfab.fr/)
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
@@ -30,11 +30,11 @@
30
  * Long description of the class (if any...)
31
  *
32
  * @category Adfab
33
- * @package Adfab_EmailCampaign
34
  * @subpackage Model
35
  * @author Arnaud Hours <arnaud.hours@adfab.fr>
36
  */
37
- class Adfab_EmailCampaign_Model_Campaign extends Mage_Core_Model_Abstract
38
  {
39
 
40
  const TYPE_CRON = 'cron';
14
  * DISCLAIMER
15
  *
16
  * Do not edit or add to this file if you wish to upgrade
17
+ * the Adfab Emailcampaign module to newer versions in the future.
18
+ * If you wish to customize the Adfab Emailcampaign module for your needs
19
  * please refer to http://www.magentocommerce.com for more information.
20
  *
21
  * @category Adfab
22
+ * @package Adfab_Emailcampaign
23
  * @copyright Copyright (C) 2014 Adfab (http://www.adfab.fr/)
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
30
  * Long description of the class (if any...)
31
  *
32
  * @category Adfab
33
+ * @package Adfab_Emailcampaign
34
  * @subpackage Model
35
  * @author Arnaud Hours <arnaud.hours@adfab.fr>
36
  */
37
+ class Adfab_Emailcampaign_Model_Campaign extends Mage_Core_Model_Abstract
38
  {
39
 
40
  const TYPE_CRON = 'cron';
app/code/community/Adfab/Emailcampaign/Model/Campaign/AbandonedCart.php CHANGED
@@ -14,12 +14,12 @@
14
  * DISCLAIMER
15
  *
16
  * Do not edit or add to this file if you wish to upgrade
17
- * the Adfab EmailCampaign module to newer versions in the future.
18
- * If you wish to customize the Adfab EmailCampaign module for your needs
19
  * please refer to http://www.magentocommerce.com for more information.
20
  *
21
  * @category Adfab
22
- * @package Adfab_EmailCampaign
23
  * @copyright Copyright (C) 2014 Adfab (http://www.adfab.fr/)
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
@@ -30,14 +30,14 @@
30
  * Long description of the class (if any...)
31
  *
32
  * @category Adfab
33
- * @package Adfab_EmailCampaign
34
  * @subpackage Model
35
  * @author Arnaud Hours <arnaud.hours@adfab.fr>
36
  */
37
- class Adfab_EmailCampaign_Model_Campaign_AbandonedCart extends Adfab_EmailCampaign_Model_Campaign_Cron
38
  {
39
 
40
- public function process(Adfab_EmailCampaign_Model_Campaign $campaign)
41
  {
42
  $this->_init($campaign);
43
 
@@ -63,6 +63,8 @@ class Adfab_EmailCampaign_Model_Campaign_AbandonedCart extends Adfab_EmailCampai
63
  array()
64
  )->where(
65
  'quote.is_active = ?', 1
 
 
66
  )->where(
67
  'quote.updated_at > ?', date('Y-m-d H:i:s', $dateFrom->getTimestamp())
68
  )->where(
@@ -80,11 +82,5 @@ class Adfab_EmailCampaign_Model_Campaign_AbandonedCart extends Adfab_EmailCampai
80
  public function getCampaignUsage()
81
  {
82
  return Mage::helper('adfab_emailcampaign')->__('notice_abandoned_cart');
83
- }
84
-
85
- public function getCampaignWarning()
86
- {
87
- return Mage::helper('adfab_emailcampaign')->__('warning_abandoned_cart');
88
- }
89
-
90
  }
14
  * DISCLAIMER
15
  *
16
  * Do not edit or add to this file if you wish to upgrade
17
+ * the Adfab Emailcampaign module to newer versions in the future.
18
+ * If you wish to customize the Adfab Emailcampaign module for your needs
19
  * please refer to http://www.magentocommerce.com for more information.
20
  *
21
  * @category Adfab
22
+ * @package Adfab_Emailcampaign
23
  * @copyright Copyright (C) 2014 Adfab (http://www.adfab.fr/)
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
30
  * Long description of the class (if any...)
31
  *
32
  * @category Adfab
33
+ * @package Adfab_Emailcampaign
34
  * @subpackage Model
35
  * @author Arnaud Hours <arnaud.hours@adfab.fr>
36
  */
37
+ class Adfab_Emailcampaign_Model_Campaign_AbandonedCart extends Adfab_Emailcampaign_Model_Campaign_Cron
38
  {
39
 
40
+ public function process(Adfab_Emailcampaign_Model_Campaign $campaign)
41
  {
42
  $this->_init($campaign);
43
 
63
  array()
64
  )->where(
65
  'quote.is_active = ?', 1
66
+ )->where(
67
+ 'quote.items_count != ?', 0
68
  )->where(
69
  'quote.updated_at > ?', date('Y-m-d H:i:s', $dateFrom->getTimestamp())
70
  )->where(
82
  public function getCampaignUsage()
83
  {
84
  return Mage::helper('adfab_emailcampaign')->__('notice_abandoned_cart');
85
+ }
 
 
 
 
 
 
86
  }
app/code/community/Adfab/Emailcampaign/Model/Campaign/Abstract.php CHANGED
@@ -14,12 +14,12 @@
14
  * DISCLAIMER
15
  *
16
  * Do not edit or add to this file if you wish to upgrade
17
- * the Adfab EmailCampaign module to newer versions in the future.
18
- * If you wish to customize the Adfab EmailCampaign module for your needs
19
  * please refer to http://www.magentocommerce.com for more information.
20
  *
21
  * @category Adfab
22
- * @package Adfab_EmailCampaign
23
  * @copyright Copyright (C) 2014 Adfab (http://www.adfab.fr/)
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
@@ -30,16 +30,16 @@
30
  * Long description of the class (if any...)
31
  *
32
  * @category Adfab
33
- * @package Adfab_EmailCampaign
34
  * @subpackage Model
35
  * @author Arnaud Hours <arnaud.hours@adfab.fr>
36
  */
37
- abstract class Adfab_EmailCampaign_Model_Campaign_Abstract
38
  {
39
 
40
  /**
41
  * state pattern
42
- * @var Adfab_EmailCampaign_Model_Campaign_State_Abstract
43
  */
44
  private $_state;
45
 
@@ -50,12 +50,12 @@ abstract class Adfab_EmailCampaign_Model_Campaign_Abstract
50
  private $_void = false;
51
 
52
  /**
53
- * @var Adfab_EmailCampaign_Model_Connector_Abstract
54
  */
55
  protected $_connector;
56
 
57
  /**
58
- * @var Adfab_EmailCampaign_Model_Campaign
59
  */
60
  protected $_campaign;
61
 
@@ -64,7 +64,7 @@ abstract class Adfab_EmailCampaign_Model_Campaign_Abstract
64
  */
65
  protected $_processTime;
66
 
67
- protected function _init(Adfab_EmailCampaign_Model_Campaign $campaign)
68
  {
69
  $this->_campaign = $campaign;
70
  $this->_state = Mage::getSingleton('adfab_emailcampaign/campaign_state_' . $campaign->getMode());
@@ -81,7 +81,7 @@ abstract class Adfab_EmailCampaign_Model_Campaign_Abstract
81
 
82
  /**
83
  *
84
- * @param Adfab_EmailCampaign_Model_Campaign $campaign
85
  * @param Mage_Customer_Model_Resource_Customer_Collection $customer
86
  * @param array $data
87
  */
@@ -122,7 +122,7 @@ abstract class Adfab_EmailCampaign_Model_Campaign_Abstract
122
 
123
  /**
124
  * @param bool $void
125
- * @return Adfab_EmailCampaign_Model_Campaign_Abstract
126
  */
127
  public function setIsVoid($void)
128
  {
@@ -140,7 +140,7 @@ abstract class Adfab_EmailCampaign_Model_Campaign_Abstract
140
 
141
  /**
142
  * update campaign last run in campaign variables
143
- * @return Adfab_EmailCampaign_Model_Campaign_Abstract
144
  */
145
  public function updateLastRunDate()
146
  {
14
  * DISCLAIMER
15
  *
16
  * Do not edit or add to this file if you wish to upgrade
17
+ * the Adfab Emailcampaign module to newer versions in the future.
18
+ * If you wish to customize the Adfab Emailcampaign module for your needs
19
  * please refer to http://www.magentocommerce.com for more information.
20
  *
21
  * @category Adfab
22
+ * @package Adfab_Emailcampaign
23
  * @copyright Copyright (C) 2014 Adfab (http://www.adfab.fr/)
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
30
  * Long description of the class (if any...)
31
  *
32
  * @category Adfab
33
+ * @package Adfab_Emailcampaign
34
  * @subpackage Model
35
  * @author Arnaud Hours <arnaud.hours@adfab.fr>
36
  */
37
+ abstract class Adfab_Emailcampaign_Model_Campaign_Abstract
38
  {
39
 
40
  /**
41
  * state pattern
42
+ * @var Adfab_Emailcampaign_Model_Campaign_State_Abstract
43
  */
44
  private $_state;
45
 
50
  private $_void = false;
51
 
52
  /**
53
+ * @var Adfab_Emailcampaign_Model_Connector_Abstract
54
  */
55
  protected $_connector;
56
 
57
  /**
58
+ * @var Adfab_Emailcampaign_Model_Campaign
59
  */
60
  protected $_campaign;
61
 
64
  */
65
  protected $_processTime;
66
 
67
+ protected function _init(Adfab_Emailcampaign_Model_Campaign $campaign)
68
  {
69
  $this->_campaign = $campaign;
70
  $this->_state = Mage::getSingleton('adfab_emailcampaign/campaign_state_' . $campaign->getMode());
81
 
82
  /**
83
  *
84
+ * @param Adfab_Emailcampaign_Model_Campaign $campaign
85
  * @param Mage_Customer_Model_Resource_Customer_Collection $customer
86
  * @param array $data
87
  */
122
 
123
  /**
124
  * @param bool $void
125
+ * @return Adfab_Emailcampaign_Model_Campaign_Abstract
126
  */
127
  public function setIsVoid($void)
128
  {
140
 
141
  /**
142
  * update campaign last run in campaign variables
143
+ * @return Adfab_Emailcampaign_Model_Campaign_Abstract
144
  */
145
  public function updateLastRunDate()
146
  {
app/code/community/Adfab/Emailcampaign/Model/Campaign/Cron.php CHANGED
@@ -14,12 +14,12 @@
14
  * DISCLAIMER
15
  *
16
  * Do not edit or add to this file if you wish to upgrade
17
- * the Adfab EmailCampaign module to newer versions in the future.
18
- * If you wish to customize the Adfab EmailCampaign module for your needs
19
  * please refer to http://www.magentocommerce.com for more information.
20
  *
21
  * @category Adfab
22
- * @package Adfab_EmailCampaign
23
  * @copyright Copyright (C) 2014 Adfab (http://www.adfab.fr/)
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
@@ -30,18 +30,18 @@
30
  * Long description of the class (if any...)
31
  *
32
  * @category Adfab
33
- * @package Adfab_EmailCampaign
34
  * @subpackage Model
35
  * @author Arnaud Hours <arnaud.hours@adfab.fr>
36
  */
37
- abstract class Adfab_EmailCampaign_Model_Campaign_Cron extends Adfab_EmailCampaign_Model_Campaign_Abstract
38
  {
39
 
40
  /**
41
  * process specific campaign
42
  *
43
- * @param Adfab_EmailCampaign_Model_Campaign $campaign
44
  */
45
- abstract public function process(Adfab_EmailCampaign_Model_Campaign $campaign);
46
 
47
  }
14
  * DISCLAIMER
15
  *
16
  * Do not edit or add to this file if you wish to upgrade
17
+ * the Adfab Emailcampaign module to newer versions in the future.
18
+ * If you wish to customize the Adfab Emailcampaign module for your needs
19
  * please refer to http://www.magentocommerce.com for more information.
20
  *
21
  * @category Adfab
22
+ * @package Adfab_Emailcampaign
23
  * @copyright Copyright (C) 2014 Adfab (http://www.adfab.fr/)
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
30
  * Long description of the class (if any...)
31
  *
32
  * @category Adfab
33
+ * @package Adfab_Emailcampaign
34
  * @subpackage Model
35
  * @author Arnaud Hours <arnaud.hours@adfab.fr>
36
  */
37
+ abstract class Adfab_Emailcampaign_Model_Campaign_Cron extends Adfab_Emailcampaign_Model_Campaign_Abstract
38
  {
39
 
40
  /**
41
  * process specific campaign
42
  *
43
+ * @param Adfab_Emailcampaign_Model_Campaign $campaign
44
  */
45
+ abstract public function process(Adfab_Emailcampaign_Model_Campaign $campaign);
46
 
47
  }
app/code/community/Adfab/Emailcampaign/Model/Campaign/CustomerBirthday.php CHANGED
@@ -14,12 +14,12 @@
14
  * DISCLAIMER
15
  *
16
  * Do not edit or add to this file if you wish to upgrade
17
- * the Adfab EmailCampaign module to newer versions in the future.
18
- * If you wish to customize the Adfab EmailCampaign module for your needs
19
  * please refer to http://www.magentocommerce.com for more information.
20
  *
21
  * @category Adfab
22
- * @package Adfab_EmailCampaign
23
  * @copyright Copyright (C) 2014 Adfab (http://www.adfab.fr/)
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
@@ -30,14 +30,14 @@
30
  * Long description of the class (if any...)
31
  *
32
  * @category Adfab
33
- * @package Adfab_EmailCampaign
34
  * @subpackage Model
35
  * @author Arnaud Hours <arnaud.hours@adfab.fr>
36
  */
37
- class Adfab_EmailCampaign_Model_Campaign_CustomerBirthday extends Adfab_EmailCampaign_Model_Campaign_Cron
38
  {
39
 
40
- public function process(Adfab_EmailCampaign_Model_Campaign $campaign)
41
  {
42
  $this->_init($campaign);
43
 
@@ -70,7 +70,7 @@ class Adfab_EmailCampaign_Model_Campaign_CustomerBirthday extends Adfab_EmailCam
70
 
71
  switch ($configDob) {
72
  case 'req':
73
- return Mage::helper('adfab_emailcampaign')->__('warning_customer_birthday_cart_req');
74
  break;
75
  case 'opt':
76
  return Mage::helper('adfab_emailcampaign')->__('warning_customer_birthday_cart_opt');
@@ -84,7 +84,7 @@ class Adfab_EmailCampaign_Model_Campaign_CustomerBirthday extends Adfab_EmailCam
84
  /**
85
  * manually set cron expr to schedule campaign every days
86
  *
87
- * @param Adfab_EmailCampaign_Model_Campaign $campaign
88
  */
89
  public function beforeCampaignSave($campaign)
90
  {
14
  * DISCLAIMER
15
  *
16
  * Do not edit or add to this file if you wish to upgrade
17
+ * the Adfab Emailcampaign module to newer versions in the future.
18
+ * If you wish to customize the Adfab Emailcampaign module for your needs
19
  * please refer to http://www.magentocommerce.com for more information.
20
  *
21
  * @category Adfab
22
+ * @package Adfab_Emailcampaign
23
  * @copyright Copyright (C) 2014 Adfab (http://www.adfab.fr/)
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
30
  * Long description of the class (if any...)
31
  *
32
  * @category Adfab
33
+ * @package Adfab_Emailcampaign
34
  * @subpackage Model
35
  * @author Arnaud Hours <arnaud.hours@adfab.fr>
36
  */
37
+ class Adfab_Emailcampaign_Model_Campaign_CustomerBirthday extends Adfab_Emailcampaign_Model_Campaign_Cron
38
  {
39
 
40
+ public function process(Adfab_Emailcampaign_Model_Campaign $campaign)
41
  {
42
  $this->_init($campaign);
43
 
70
 
71
  switch ($configDob) {
72
  case 'req':
73
+ return "";
74
  break;
75
  case 'opt':
76
  return Mage::helper('adfab_emailcampaign')->__('warning_customer_birthday_cart_opt');
84
  /**
85
  * manually set cron expr to schedule campaign every days
86
  *
87
+ * @param Adfab_Emailcampaign_Model_Campaign $campaign
88
  */
89
  public function beforeCampaignSave($campaign)
90
  {
app/code/community/Adfab/Emailcampaign/Model/Campaign/InscriptionAnniversary.php CHANGED
@@ -14,12 +14,12 @@
14
  * DISCLAIMER
15
  *
16
  * Do not edit or add to this file if you wish to upgrade
17
- * the Adfab EmailCampaign module to newer versions in the future.
18
- * If you wish to customize the Adfab EmailCampaign module for your needs
19
  * please refer to http://www.magentocommerce.com for more information.
20
  *
21
  * @category Adfab
22
- * @package Adfab_EmailCampaign
23
  * @copyright Copyright (C) 2014 Adfab (http://www.adfab.fr/)
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
@@ -30,14 +30,14 @@
30
  * Long description of the class (if any...)
31
  *
32
  * @category Adfab
33
- * @package Adfab_EmailCampaign
34
  * @subpackage Model
35
  * @author Arnaud Hours <arnaud.hours@adfab.fr>
36
  */
37
- class Adfab_EmailCampaign_Model_Campaign_InscriptionAnniversary extends Adfab_EmailCampaign_Model_Campaign_Cron
38
  {
39
 
40
- public function process(Adfab_EmailCampaign_Model_Campaign $campaign)
41
  {
42
  $this->_init($campaign);
43
 
@@ -60,16 +60,11 @@ class Adfab_EmailCampaign_Model_Campaign_InscriptionAnniversary extends Adfab_Em
60
  {
61
  return Mage::helper('adfab_emailcampaign')->__('notice_inscription_anniversary');
62
  }
63
-
64
- public function getCampaignWarning()
65
- {
66
- return Mage::helper('adfab_emailcampaign')->__('warning_inscription_anniversary');
67
- }
68
 
69
  /**
70
  * manually set cron expr to schedule campaign every days
71
  *
72
- * @param Adfab_EmailCampaign_Model_Campaign $campaign
73
  */
74
  public function beforeCampaignSave($campaign)
75
  {
14
  * DISCLAIMER
15
  *
16
  * Do not edit or add to this file if you wish to upgrade
17
+ * the Adfab Emailcampaign module to newer versions in the future.
18
+ * If you wish to customize the Adfab Emailcampaign module for your needs
19
  * please refer to http://www.magentocommerce.com for more information.
20
  *
21
  * @category Adfab
22
+ * @package Adfab_Emailcampaign
23
  * @copyright Copyright (C) 2014 Adfab (http://www.adfab.fr/)
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
30
  * Long description of the class (if any...)
31
  *
32
  * @category Adfab
33
+ * @package Adfab_Emailcampaign
34
  * @subpackage Model
35
  * @author Arnaud Hours <arnaud.hours@adfab.fr>
36
  */
37
+ class Adfab_Emailcampaign_Model_Campaign_InscriptionAnniversary extends Adfab_Emailcampaign_Model_Campaign_Cron
38
  {
39
 
40
+ public function process(Adfab_Emailcampaign_Model_Campaign $campaign)
41
  {
42
  $this->_init($campaign);
43
 
60
  {
61
  return Mage::helper('adfab_emailcampaign')->__('notice_inscription_anniversary');
62
  }
 
 
 
 
 
63
 
64
  /**
65
  * manually set cron expr to schedule campaign every days
66
  *
67
+ * @param Adfab_Emailcampaign_Model_Campaign $campaign
68
  */
69
  public function beforeCampaignSave($campaign)
70
  {
app/code/community/Adfab/Emailcampaign/Model/Campaign/Nursing.php ADDED
@@ -0,0 +1,108 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Adfab extension for Magento
4
+ *
5
+ * Long description of this file (if any...)
6
+ *
7
+ * NOTICE OF LICENSE
8
+ *
9
+ * This source file is subject to the Open Software License (OSL 3.0)
10
+ * that is bundled with this package in the file LICENSE.txt.
11
+ * It is also available through the world-wide-web at this URL:
12
+ * http://opensource.org/licenses/osl-3.0.php
13
+ *
14
+ * DISCLAIMER
15
+ *
16
+ * Do not edit or add to this file if you wish to upgrade
17
+ * the Adfab Emailcampaign module to newer versions in the future.
18
+ * If you wish to customize the Adfab Emailcampaign module for your needs
19
+ * please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category Adfab
22
+ * @package Adfab_Emailcampaign
23
+ * @copyright Copyright (C) 2014 Adfab (http://www.adfab.fr/)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+
27
+ /**
28
+ * Short description of the class
29
+ *
30
+ * Long description of the class (if any...)
31
+ *
32
+ * @category Adfab
33
+ * @package Adfab_Emailcampaign
34
+ * @subpackage Model
35
+ * @author Arnaud Hours <arnaud.hours@adfab.fr>
36
+ */
37
+ class Adfab_Emailcampaign_Model_Campaign_Nursing extends Adfab_Emailcampaign_Model_Campaign_Cron
38
+ {
39
+
40
+ protected $_sendAfterDays;
41
+
42
+ public function process(Adfab_Emailcampaign_Model_Campaign $campaign)
43
+ {
44
+ $this->_init($campaign);
45
+
46
+ $this->_sendAfterDays = $sendAfterDays = $campaign->getVariable('send_after_days');
47
+ $resend = $campaign->getVariable('resend');
48
+ $lastRun = $campaign->getVariable('last_run');
49
+
50
+ $resend = (intval($resend) === 1) && $lastRun;
51
+ $customers = $this->getCustomerList();
52
+
53
+ $format = 'Y-m-d H:i:s';
54
+ // take everything before $dateTo
55
+ $dateTo = new DateTime(date($format));
56
+ $dateTo->sub(new DateInterval('P'.($sendAfterDays).'D'));
57
+
58
+ $resource = Mage::getSingleton('core/resource');
59
+
60
+ /* @var $read Varien_Db_Adapter_Pdo_Mysql */
61
+ $read = $resource->getConnection('core_read');
62
+
63
+ $select = $read->select()
64
+ ->from(
65
+ array('c' => $resource->getTableName('sales/order'), array('customer_id'))
66
+ )->join(
67
+ array('sfo' => $resource->getTableName('sales/order')),
68
+ 'c.entity_id = sfo.customer_id',
69
+ array()
70
+ )->where(
71
+ 'sfo.created_at > ?', $dateTo->format($format)
72
+ )->group(
73
+ 'c.entity_id'
74
+ );
75
+
76
+ $alreadyOrdered = $read->fetchCol($select);
77
+
78
+ $customers->getSelect()->joinLeft(
79
+ array('sfo' => $resource->getTableName('sales/order')),
80
+ 'sfo.customer_id = e.entity_id',
81
+ array()
82
+ )->where(
83
+ 'e.entity_id NOT IN (?)', implode(',', $alreadyOrdered)
84
+ );
85
+
86
+ if (!$resend) {
87
+ $dateFrom = new DateTime(date($format));
88
+ $dateFrom->sub(new DateInterval('P'.($sendAfterDays).'D'));
89
+ $dateFrom->sub(new DateInterval('PT'.($this->_processTime - $lastRun).'S'));
90
+ $customers->getSelect()->where('sfo.created_at > ?', $dateFrom->format($format));
91
+ }
92
+
93
+ $customers->getSelect()->distinct('e.entity_id');
94
+
95
+ $this->sendMail(
96
+ $customers,
97
+ function($customer) {
98
+ return array('customer' => $customer, 'send_after_days' => $this->_sendAfterDays);
99
+ }
100
+ );
101
+ }
102
+
103
+ public function getCampaignUsage()
104
+ {
105
+ return Mage::helper('adfab_emailcampaign')->__('notice_nursing');
106
+ }
107
+
108
+ }
app/code/community/Adfab/Emailcampaign/Model/Campaign/Observer.php CHANGED
@@ -14,12 +14,12 @@
14
  * DISCLAIMER
15
  *
16
  * Do not edit or add to this file if you wish to upgrade
17
- * the Adfab EmailCampaign module to newer versions in the future.
18
- * If you wish to customize the Adfab EmailCampaign module for your needs
19
  * please refer to http://www.magentocommerce.com for more information.
20
  *
21
  * @category Adfab
22
- * @package Adfab_EmailCampaign
23
  * @copyright Copyright (C) 2014 Adfab (http://www.adfab.fr/)
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
@@ -30,19 +30,19 @@
30
  * Long description of the class (if any...)
31
  *
32
  * @category Adfab
33
- * @package Adfab_EmailCampaign
34
  * @subpackage Model
35
  * @author Arnaud Hours <arnaud.hours@adfab.fr>
36
  */
37
- abstract class Adfab_EmailCampaign_Model_Campaign_Observer extends Adfab_EmailCampaign_Model_Campaign_Abstract
38
  {
39
 
40
  /**
41
  * process specific campaign
42
  *
43
- * @param Adfab_EmailCampaign_Model_Campaign $campaign
44
  * @param Varien_Event_Observer $observer
45
  */
46
- abstract public function process(Adfab_EmailCampaign_Model_Campaign $campaign, Varien_Event_Observer $observer);
47
 
48
  }
14
  * DISCLAIMER
15
  *
16
  * Do not edit or add to this file if you wish to upgrade
17
+ * the Adfab Emailcampaign module to newer versions in the future.
18
+ * If you wish to customize the Adfab Emailcampaign module for your needs
19
  * please refer to http://www.magentocommerce.com for more information.
20
  *
21
  * @category Adfab
22
+ * @package Adfab_Emailcampaign
23
  * @copyright Copyright (C) 2014 Adfab (http://www.adfab.fr/)
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
30
  * Long description of the class (if any...)
31
  *
32
  * @category Adfab
33
+ * @package Adfab_Emailcampaign
34
  * @subpackage Model
35
  * @author Arnaud Hours <arnaud.hours@adfab.fr>
36
  */
37
+ abstract class Adfab_Emailcampaign_Model_Campaign_Observer extends Adfab_Emailcampaign_Model_Campaign_Abstract
38
  {
39
 
40
  /**
41
  * process specific campaign
42
  *
43
+ * @param Adfab_Emailcampaign_Model_Campaign $campaign
44
  * @param Varien_Event_Observer $observer
45
  */
46
+ abstract public function process(Adfab_Emailcampaign_Model_Campaign $campaign, Varien_Event_Observer $observer);
47
 
48
  }
app/code/community/Adfab/Emailcampaign/Model/Campaign/OrderSuccess.php CHANGED
@@ -14,12 +14,12 @@
14
  * DISCLAIMER
15
  *
16
  * Do not edit or add to this file if you wish to upgrade
17
- * the Adfab EmailCampaign module to newer versions in the future.
18
- * If you wish to customize the Adfab EmailCampaign module for your needs
19
  * please refer to http://www.magentocommerce.com for more information.
20
  *
21
  * @category Adfab
22
- * @package Adfab_EmailCampaign
23
  * @copyright Copyright (C) 2014 Adfab (http://www.adfab.fr/)
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
@@ -30,14 +30,14 @@
30
  * Long description of the class (if any...)
31
  *
32
  * @category Adfab
33
- * @package Adfab_EmailCampaign
34
  * @subpackage Model
35
  * @author Arnaud Hours <arnaud.hours@adfab.fr>
36
  */
37
- class Adfab_EmailCampaign_Model_Campaign_OrderSuccess extends Adfab_EmailCampaign_Model_Campaign_Observer
38
  {
39
 
40
- public function process(Adfab_EmailCampaign_Model_Campaign $campaign, Varien_Event_Observer $observer)
41
  {
42
  $this->_init($campaign);
43
  $order = $observer->getOrder();
@@ -56,10 +56,5 @@ class Adfab_EmailCampaign_Model_Campaign_OrderSuccess extends Adfab_EmailCampaig
56
  public function getCampaignUsage()
57
  {
58
  return Mage::helper('adfab_emailcampaign')->__('notice_order_success');
59
- }
60
-
61
- public function getCampaignWarning()
62
- {
63
- return Mage::helper('adfab_emailcampaign')->__('warning_order_success');
64
- }
65
  }
14
  * DISCLAIMER
15
  *
16
  * Do not edit or add to this file if you wish to upgrade
17
+ * the Adfab Emailcampaign module to newer versions in the future.
18
+ * If you wish to customize the Adfab Emailcampaign module for your needs
19
  * please refer to http://www.magentocommerce.com for more information.
20
  *
21
  * @category Adfab
22
+ * @package Adfab_Emailcampaign
23
  * @copyright Copyright (C) 2014 Adfab (http://www.adfab.fr/)
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
30
  * Long description of the class (if any...)
31
  *
32
  * @category Adfab
33
+ * @package Adfab_Emailcampaign
34
  * @subpackage Model
35
  * @author Arnaud Hours <arnaud.hours@adfab.fr>
36
  */
37
+ class Adfab_Emailcampaign_Model_Campaign_OrderSuccess extends Adfab_Emailcampaign_Model_Campaign_Observer
38
  {
39
 
40
+ public function process(Adfab_Emailcampaign_Model_Campaign $campaign, Varien_Event_Observer $observer)
41
  {
42
  $this->_init($campaign);
43
  $order = $observer->getOrder();
56
  public function getCampaignUsage()
57
  {
58
  return Mage::helper('adfab_emailcampaign')->__('notice_order_success');
59
+ }
 
 
 
 
 
60
  }
app/code/community/Adfab/Emailcampaign/Model/Campaign/State/Abstract.php CHANGED
@@ -14,12 +14,12 @@
14
  * DISCLAIMER
15
  *
16
  * Do not edit or add to this file if you wish to upgrade
17
- * the Adfab EmailCampaign module to newer versions in the future.
18
- * If you wish to customize the Adfab EmailCampaign module for your needs
19
  * please refer to http://www.magentocommerce.com for more information.
20
  *
21
  * @category Adfab
22
- * @package Adfab_EmailCampaign
23
  * @copyright Copyright (C) 2014 Adfab (http://www.adfab.fr/)
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
@@ -30,11 +30,11 @@
30
  * Long description of the class (if any...)
31
  *
32
  * @category Adfab
33
- * @package Adfab_EmailCampaign
34
  * @subpackage Model
35
  * @author Arnaud Hours <arnaud.hours@adfab.fr>
36
  */
37
- abstract class Adfab_EmailCampaign_Model_Campaign_State_Abstract
38
  {
39
 
40
  /**
14
  * DISCLAIMER
15
  *
16
  * Do not edit or add to this file if you wish to upgrade
17
+ * the Adfab Emailcampaign module to newer versions in the future.
18
+ * If you wish to customize the Adfab Emailcampaign module for your needs
19
  * please refer to http://www.magentocommerce.com for more information.
20
  *
21
  * @category Adfab
22
+ * @package Adfab_Emailcampaign
23
  * @copyright Copyright (C) 2014 Adfab (http://www.adfab.fr/)
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
30
  * Long description of the class (if any...)
31
  *
32
  * @category Adfab
33
+ * @package Adfab_Emailcampaign
34
  * @subpackage Model
35
  * @author Arnaud Hours <arnaud.hours@adfab.fr>
36
  */
37
+ abstract class Adfab_Emailcampaign_Model_Campaign_State_Abstract
38
  {
39
 
40
  /**
app/code/community/Adfab/Emailcampaign/Model/Campaign/State/Production.php CHANGED
@@ -14,12 +14,12 @@
14
  * DISCLAIMER
15
  *
16
  * Do not edit or add to this file if you wish to upgrade
17
- * the Adfab EmailCampaign module to newer versions in the future.
18
- * If you wish to customize the Adfab EmailCampaign module for your needs
19
  * please refer to http://www.magentocommerce.com for more information.
20
  *
21
  * @category Adfab
22
- * @package Adfab_EmailCampaign
23
  * @copyright Copyright (C) 2014 Adfab (http://www.adfab.fr/)
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
@@ -30,10 +30,10 @@
30
  * Long description of the class (if any...)
31
  *
32
  * @category Adfab
33
- * @package Adfab_EmailCampaign
34
  * @subpackage Model
35
  * @author Arnaud Hours <arnaud.hours@adfab.fr>
36
  */
37
- class Adfab_EmailCampaign_Model_Campaign_State_Production extends Adfab_EmailCampaign_Model_Campaign_State_Abstract
38
  {
39
  }
14
  * DISCLAIMER
15
  *
16
  * Do not edit or add to this file if you wish to upgrade
17
+ * the Adfab Emailcampaign module to newer versions in the future.
18
+ * If you wish to customize the Adfab Emailcampaign module for your needs
19
  * please refer to http://www.magentocommerce.com for more information.
20
  *
21
  * @category Adfab
22
+ * @package Adfab_Emailcampaign
23
  * @copyright Copyright (C) 2014 Adfab (http://www.adfab.fr/)
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
30
  * Long description of the class (if any...)
31
  *
32
  * @category Adfab
33
+ * @package Adfab_Emailcampaign
34
  * @subpackage Model
35
  * @author Arnaud Hours <arnaud.hours@adfab.fr>
36
  */
37
+ class Adfab_Emailcampaign_Model_Campaign_State_Production extends Adfab_Emailcampaign_Model_Campaign_State_Abstract
38
  {
39
  }
app/code/community/Adfab/Emailcampaign/Model/Campaign/State/Test.php CHANGED
@@ -14,12 +14,12 @@
14
  * DISCLAIMER
15
  *
16
  * Do not edit or add to this file if you wish to upgrade
17
- * the Adfab EmailCampaign module to newer versions in the future.
18
- * If you wish to customize the Adfab EmailCampaign module for your needs
19
  * please refer to http://www.magentocommerce.com for more information.
20
  *
21
  * @category Adfab
22
- * @package Adfab_EmailCampaign
23
  * @copyright Copyright (C) 2014 Adfab (http://www.adfab.fr/)
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
@@ -30,11 +30,11 @@
30
  * Long description of the class (if any...)
31
  *
32
  * @category Adfab
33
- * @package Adfab_EmailCampaign
34
  * @subpackage Model
35
  * @author Arnaud Hours <arnaud.hours@adfab.fr>
36
  */
37
- class Adfab_EmailCampaign_Model_Campaign_State_Test extends Adfab_EmailCampaign_Model_Campaign_State_Abstract
38
  {
39
 
40
  public function getCustomerList()
14
  * DISCLAIMER
15
  *
16
  * Do not edit or add to this file if you wish to upgrade
17
+ * the Adfab Emailcampaign module to newer versions in the future.
18
+ * If you wish to customize the Adfab Emailcampaign module for your needs
19
  * please refer to http://www.magentocommerce.com for more information.
20
  *
21
  * @category Adfab
22
+ * @package Adfab_Emailcampaign
23
  * @copyright Copyright (C) 2014 Adfab (http://www.adfab.fr/)
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
30
  * Long description of the class (if any...)
31
  *
32
  * @category Adfab
33
+ * @package Adfab_Emailcampaign
34
  * @subpackage Model
35
  * @author Arnaud Hours <arnaud.hours@adfab.fr>
36
  */
37
+ class Adfab_Emailcampaign_Model_Campaign_State_Test extends Adfab_Emailcampaign_Model_Campaign_State_Abstract
38
  {
39
 
40
  public function getCustomerList()
app/code/community/Adfab/Emailcampaign/Model/Campaign/State/TestAllEmail.php CHANGED
@@ -14,12 +14,12 @@
14
  * DISCLAIMER
15
  *
16
  * Do not edit or add to this file if you wish to upgrade
17
- * the Adfab EmailCampaign module to newer versions in the future.
18
- * If you wish to customize the Adfab EmailCampaign module for your needs
19
  * please refer to http://www.magentocommerce.com for more information.
20
  *
21
  * @category Adfab
22
- * @package Adfab_EmailCampaign
23
  * @copyright Copyright (C) 2014 Adfab (http://www.adfab.fr/)
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
@@ -30,11 +30,11 @@
30
  * Long description of the class (if any...)
31
  *
32
  * @category Adfab
33
- * @package Adfab_EmailCampaign
34
  * @subpackage Model
35
  * @author Arnaud Hours <arnaud.hours@adfab.fr>
36
  */
37
- class Adfab_EmailCampaign_Model_Campaign_State_TestAllEmail extends Adfab_EmailCampaign_Model_Campaign_State_Abstract
38
  {
39
 
40
  public function getCustomerList()
14
  * DISCLAIMER
15
  *
16
  * Do not edit or add to this file if you wish to upgrade
17
+ * the Adfab Emailcampaign module to newer versions in the future.
18
+ * If you wish to customize the Adfab Emailcampaign module for your needs
19
  * please refer to http://www.magentocommerce.com for more information.
20
  *
21
  * @category Adfab
22
+ * @package Adfab_Emailcampaign
23
  * @copyright Copyright (C) 2014 Adfab (http://www.adfab.fr/)
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
30
  * Long description of the class (if any...)
31
  *
32
  * @category Adfab
33
+ * @package Adfab_Emailcampaign
34
  * @subpackage Model
35
  * @author Arnaud Hours <arnaud.hours@adfab.fr>
36
  */
37
+ class Adfab_Emailcampaign_Model_Campaign_State_TestAllEmail extends Adfab_Emailcampaign_Model_Campaign_State_Abstract
38
  {
39
 
40
  public function getCustomerList()
app/code/community/Adfab/Emailcampaign/Model/Campaign/WelcomeReminder.php CHANGED
@@ -14,12 +14,12 @@
14
  * DISCLAIMER
15
  *
16
  * Do not edit or add to this file if you wish to upgrade
17
- * the Adfab EmailCampaign module to newer versions in the future.
18
- * If you wish to customize the Adfab EmailCampaign module for your needs
19
  * please refer to http://www.magentocommerce.com for more information.
20
  *
21
  * @category Adfab
22
- * @package Adfab_EmailCampaign
23
  * @copyright Copyright (C) 2014 Adfab (http://www.adfab.fr/)
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
@@ -30,14 +30,14 @@
30
  * Long description of the class (if any...)
31
  *
32
  * @category Adfab
33
- * @package Adfab_EmailCampaign
34
  * @subpackage Model
35
  * @author Arnaud Hours <arnaud.hours@adfab.fr>
36
  */
37
- class Adfab_EmailCampaign_Model_Campaign_WelcomeReminder extends Adfab_EmailCampaign_Model_Campaign_Cron
38
  {
39
 
40
- public function process(Adfab_EmailCampaign_Model_Campaign $campaign)
41
  {
42
  $this->_init($campaign);
43
 
@@ -55,12 +55,23 @@ class Adfab_EmailCampaign_Model_Campaign_WelcomeReminder extends Adfab_EmailCamp
55
  $dateFrom->add((-$olderThan), Zend_Date::DAY);
56
  $dateFrom->add($lastRun - $this->_processTime, Zend_Date::SECOND);
57
 
 
 
58
  $customers->addFieldToFilter('created_at', array(
59
  'gt' => date('Y-m-d H:i:s', $dateFrom->getTimestamp())
60
- ));
61
- $customers->addFieldToFilter('created_at', array(
62
  'lt' => date('Y-m-d H:i:s', $dateTo->getTimestamp())
63
- ));
 
 
 
 
 
 
 
 
 
64
 
65
  $this->sendMail(
66
  $customers,
@@ -73,11 +84,5 @@ class Adfab_EmailCampaign_Model_Campaign_WelcomeReminder extends Adfab_EmailCamp
73
  public function getCampaignUsage()
74
  {
75
  return Mage::helper('adfab_emailcampaign')->__('notice_welcome_reminder');
76
- }
77
-
78
-
79
- public function getCampaignWarning()
80
- {
81
- return Mage::helper('adfab_emailcampaign')->__('warning_welcome_reminder');
82
- }
83
  }
14
  * DISCLAIMER
15
  *
16
  * Do not edit or add to this file if you wish to upgrade
17
+ * the Adfab Emailcampaign module to newer versions in the future.
18
+ * If you wish to customize the Adfab Emailcampaign module for your needs
19
  * please refer to http://www.magentocommerce.com for more information.
20
  *
21
  * @category Adfab
22
+ * @package Adfab_Emailcampaign
23
  * @copyright Copyright (C) 2014 Adfab (http://www.adfab.fr/)
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
30
  * Long description of the class (if any...)
31
  *
32
  * @category Adfab
33
+ * @package Adfab_Emailcampaign
34
  * @subpackage Model
35
  * @author Arnaud Hours <arnaud.hours@adfab.fr>
36
  */
37
+ class Adfab_Emailcampaign_Model_Campaign_WelcomeReminder extends Adfab_Emailcampaign_Model_Campaign_Cron
38
  {
39
 
40
+ public function process(Adfab_Emailcampaign_Model_Campaign $campaign)
41
  {
42
  $this->_init($campaign);
43
 
55
  $dateFrom->add((-$olderThan), Zend_Date::DAY);
56
  $dateFrom->add($lastRun - $this->_processTime, Zend_Date::SECOND);
57
 
58
+ $ressource = Mage::getSingleton('core/resource');
59
+
60
  $customers->addFieldToFilter('created_at', array(
61
  'gt' => date('Y-m-d H:i:s', $dateFrom->getTimestamp())
62
+ ))
63
+ ->addFieldToFilter('created_at', array(
64
  'lt' => date('Y-m-d H:i:s', $dateTo->getTimestamp())
65
+ ))
66
+ ->getSelect()->joinLeft(
67
+ array(
68
+ 'order' => $ressource->getTableName('sales/order')
69
+ ),
70
+ 'order.customer_id = e.entity_id',
71
+ array()
72
+ )
73
+ ->where('order.entity_id IS NULL')
74
+ ->distinct(true);
75
 
76
  $this->sendMail(
77
  $customers,
84
  public function getCampaignUsage()
85
  {
86
  return Mage::helper('adfab_emailcampaign')->__('notice_welcome_reminder');
87
+ }
 
 
 
 
 
 
88
  }
app/code/community/Adfab/Emailcampaign/Model/Campaign/WishlistReminder.php CHANGED
@@ -14,12 +14,12 @@
14
  * DISCLAIMER
15
  *
16
  * Do not edit or add to this file if you wish to upgrade
17
- * the Adfab EmailCampaign module to newer versions in the future.
18
- * If you wish to customize the Adfab EmailCampaign module for your needs
19
  * please refer to http://www.magentocommerce.com for more information.
20
  *
21
  * @category Adfab
22
- * @package Adfab_EmailCampaign
23
  * @copyright Copyright (C) 2014 Adfab (http://www.adfab.fr/)
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
@@ -30,14 +30,14 @@
30
  * Long description of the class (if any...)
31
  *
32
  * @category Adfab
33
- * @package Adfab_EmailCampaign
34
  * @subpackage Model
35
  * @author Arnaud Hours <arnaud.hours@adfab.fr>
36
  */
37
- class Adfab_EmailCampaign_Model_Campaign_WishlistReminder extends Adfab_EmailCampaign_Model_Campaign_Cron
38
  {
39
 
40
- public function process(Adfab_EmailCampaign_Model_Campaign $campaign)
41
  {
42
  $this->_init($campaign);
43
 
@@ -78,10 +78,5 @@ class Adfab_EmailCampaign_Model_Campaign_WishlistReminder extends Adfab_EmailCam
78
  public function getCampaignUsage()
79
  {
80
  return Mage::helper('adfab_emailcampaign')->__('notice_wishlist_reminder');
81
- }
82
-
83
- public function getCampaignWarning()
84
- {
85
- return Mage::helper('adfab_emailcampaign')->__('warning_wishlist_reminder');
86
- }
87
  }
14
  * DISCLAIMER
15
  *
16
  * Do not edit or add to this file if you wish to upgrade
17
+ * the Adfab Emailcampaign module to newer versions in the future.
18
+ * If you wish to customize the Adfab Emailcampaign module for your needs
19
  * please refer to http://www.magentocommerce.com for more information.
20
  *
21
  * @category Adfab
22
+ * @package Adfab_Emailcampaign
23
  * @copyright Copyright (C) 2014 Adfab (http://www.adfab.fr/)
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
30
  * Long description of the class (if any...)
31
  *
32
  * @category Adfab
33
+ * @package Adfab_Emailcampaign
34
  * @subpackage Model
35
  * @author Arnaud Hours <arnaud.hours@adfab.fr>
36
  */
37
+ class Adfab_Emailcampaign_Model_Campaign_WishlistReminder extends Adfab_Emailcampaign_Model_Campaign_Cron
38
  {
39
 
40
+ public function process(Adfab_Emailcampaign_Model_Campaign $campaign)
41
  {
42
  $this->_init($campaign);
43
 
78
  public function getCampaignUsage()
79
  {
80
  return Mage::helper('adfab_emailcampaign')->__('notice_wishlist_reminder');
81
+ }
 
 
 
 
 
82
  }
app/code/community/Adfab/Emailcampaign/Model/Campaign/WishlistStockAlert.php CHANGED
@@ -14,12 +14,12 @@
14
  * DISCLAIMER
15
  *
16
  * Do not edit or add to this file if you wish to upgrade
17
- * the Adfab EmailCampaign module to newer versions in the future.
18
- * If you wish to customize the Adfab EmailCampaign module for your needs
19
  * please refer to http://www.magentocommerce.com for more information.
20
  *
21
  * @category Adfab
22
- * @package Adfab_EmailCampaign
23
  * @copyright Copyright (C) 2014 Adfab (http://www.adfab.fr/)
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
@@ -30,18 +30,24 @@
30
  * Long description of the class (if any...)
31
  *
32
  * @category Adfab
33
- * @package Adfab_EmailCampaign
34
  * @subpackage Model
35
  * @author Arnaud Hours <arnaud.hours@adfab.fr>
36
  */
37
- class Adfab_EmailCampaign_Model_Campaign_WishlistStockAlert extends Adfab_EmailCampaign_Model_Campaign_Cron
38
  {
39
 
40
- public function process(Adfab_EmailCampaign_Model_Campaign $campaign)
 
 
41
  {
42
  $this->_init($campaign);
43
-
44
  $alert = $campaign->getVariable('stock_alert');
 
 
 
 
 
45
 
46
  $customers = $this->getCustomerList();
47
 
@@ -76,24 +82,39 @@ class Adfab_EmailCampaign_Model_Campaign_WishlistStockAlert extends Adfab_EmailC
76
  HAVING sum_qty <= '.$alert.'
77
  ) as subRequest
78
  ')->fetchAll(Zend_Db::FETCH_COLUMN));
79
-
80
  $customers->addFieldToFilter('entity_id', array('in' => $ids));
81
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
82
  $this->sendMail(
83
  $customers,
84
  function($customer) {
85
  return array('customer' => $customer);
86
  }
87
  );
 
 
88
  }
89
 
90
  public function getCampaignUsage()
91
  {
92
  return Mage::helper('adfab_emailcampaign')->__('notice_wishlist_stock_alert');
93
  }
94
-
95
- public function getCampaignWarning()
96
- {
97
- return Mage::helper('adfab_emailcampaign')->__('warning_wishlist_stock_alert');
98
- }
99
  }
14
  * DISCLAIMER
15
  *
16
  * Do not edit or add to this file if you wish to upgrade
17
+ * the Adfab Emailcampaign module to newer versions in the future.
18
+ * If you wish to customize the Adfab Emailcampaign module for your needs
19
  * please refer to http://www.magentocommerce.com for more information.
20
  *
21
  * @category Adfab
22
+ * @package Adfab_Emailcampaign
23
  * @copyright Copyright (C) 2014 Adfab (http://www.adfab.fr/)
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
30
  * Long description of the class (if any...)
31
  *
32
  * @category Adfab
33
+ * @package Adfab_Emailcampaign
34
  * @subpackage Model
35
  * @author Arnaud Hours <arnaud.hours@adfab.fr>
36
  */
37
+ class Adfab_Emailcampaign_Model_Campaign_WishlistStockAlert extends Adfab_Emailcampaign_Model_Campaign_Cron
38
  {
39
 
40
+
41
+
42
+ public function process(Adfab_Emailcampaign_Model_Campaign $campaign)
43
  {
44
  $this->_init($campaign);
 
45
  $alert = $campaign->getVariable('stock_alert');
46
+ $customerIds = $campaign->getVariable('customer_ids'); // customers that already receive the email
47
+ if (!$customerIds) {
48
+ $customerIds = array();
49
+ }
50
+ $interval = $campaign->getVariable('interval'); // days interval before sending another email to a same customer
51
 
52
  $customers = $this->getCustomerList();
53
 
82
  HAVING sum_qty <= '.$alert.'
83
  ) as subRequest
84
  ')->fetchAll(Zend_Db::FETCH_COLUMN));
85
+
86
  $customers->addFieldToFilter('entity_id', array('in' => $ids));
87
 
88
+ // exclude customers that already received an email recently
89
+ // and update
90
+ $exclude = array();
91
+ $beforeTime = $this->_processTime - ($interval*24*60*60);
92
+ foreach ($ids as $id) {
93
+ if (isset($customerIds[$id])
94
+ && $customerIds[$id] > $beforeTime) {
95
+ $exclude[] = $id;
96
+ } else {
97
+ $customerIds[$id] = $this->_processTime;
98
+ }
99
+ }
100
+
101
+ if (!empty($exclude)) {
102
+ $customers->addFieldToFilter('entity_id', array('nin' => $exclude));
103
+ }
104
+
105
  $this->sendMail(
106
  $customers,
107
  function($customer) {
108
  return array('customer' => $customer);
109
  }
110
  );
111
+
112
+ $campaign->setVariable('customer_ids', $customerIds);
113
  }
114
 
115
  public function getCampaignUsage()
116
  {
117
  return Mage::helper('adfab_emailcampaign')->__('notice_wishlist_stock_alert');
118
  }
119
+
 
 
 
 
120
  }
app/code/community/Adfab/Emailcampaign/Model/Connector/Abstract.php CHANGED
@@ -14,12 +14,12 @@
14
  * DISCLAIMER
15
  *
16
  * Do not edit or add to this file if you wish to upgrade
17
- * the Adfab EmailCampaign module to newer versions in the future.
18
- * If you wish to customize the Adfab EmailCampaign module for your needs
19
  * please refer to http://www.magentocommerce.com for more information.
20
  *
21
  * @category Adfab
22
- * @package Adfab_EmailCampaign
23
  * @copyright Copyright (C) 2014 Adfab (http://www.adfab.fr/)
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
@@ -30,19 +30,19 @@
30
  * Long description of the class (if any...)
31
  *
32
  * @category Adfab
33
- * @package Adfab_EmailCampaign
34
  * @subpackage Model
35
  * @author Arnaud Hours <arnaud.hours@adfab.fr>
36
  */
37
- abstract class Adfab_EmailCampaign_Model_Connector_Abstract
38
  {
39
 
40
  /**
41
  *
42
- * @param Adfab_EmailCampaign_Model_Campaign $campaign
43
  * @param Mage_Customer_Model_Resource_Customer_Collection $customer
44
  * @param array $data
45
  */
46
- abstract public function sendMail(Adfab_EmailCampaign_Model_Campaign $campaign, Mage_Customer_Model_Resource_Customer_Collection $customers, $data);
47
 
48
  }
14
  * DISCLAIMER
15
  *
16
  * Do not edit or add to this file if you wish to upgrade
17
+ * the Adfab Emailcampaign module to newer versions in the future.
18
+ * If you wish to customize the Adfab Emailcampaign module for your needs
19
  * please refer to http://www.magentocommerce.com for more information.
20
  *
21
  * @category Adfab
22
+ * @package Adfab_Emailcampaign
23
  * @copyright Copyright (C) 2014 Adfab (http://www.adfab.fr/)
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
30
  * Long description of the class (if any...)
31
  *
32
  * @category Adfab
33
+ * @package Adfab_Emailcampaign
34
  * @subpackage Model
35
  * @author Arnaud Hours <arnaud.hours@adfab.fr>
36
  */
37
+ abstract class Adfab_Emailcampaign_Model_Connector_Abstract
38
  {
39
 
40
  /**
41
  *
42
+ * @param Adfab_Emailcampaign_Model_Campaign $campaign
43
  * @param Mage_Customer_Model_Resource_Customer_Collection $customer
44
  * @param array $data
45
  */
46
+ abstract public function sendMail(Adfab_Emailcampaign_Model_Campaign $campaign, Mage_Customer_Model_Resource_Customer_Collection $customers, $data);
47
 
48
  }
app/code/community/Adfab/Emailcampaign/Model/Connector/Magento.php CHANGED
@@ -14,12 +14,12 @@
14
  * DISCLAIMER
15
  *
16
  * Do not edit or add to this file if you wish to upgrade
17
- * the Adfab EmailCampaign module to newer versions in the future.
18
- * If you wish to customize the Adfab EmailCampaign module for your needs
19
  * please refer to http://www.magentocommerce.com for more information.
20
  *
21
  * @category Adfab
22
- * @package Adfab_EmailCampaign
23
  * @copyright Copyright (C) 2014 Adfab (http://www.adfab.fr/)
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
@@ -30,20 +30,20 @@
30
  * Long description of the class (if any...)
31
  *
32
  * @category Adfab
33
- * @package Adfab_EmailCampaign
34
  * @subpackage Model
35
  * @author Arnaud Hours <arnaud.hours@adfab.fr>
36
  */
37
- class Adfab_EmailCampaign_Model_Connector_Magento extends Adfab_EmailCampaign_Model_Connector_Abstract
38
  {
39
 
40
  /**
41
  *
42
- * @param Adfab_EmailCampaign_Model_Campaign $campaign
43
  * @param Mage_Customer_Model_Resource_Customer_Collection $customer
44
  * @param array $data
45
  */
46
- public function sendMail(Adfab_EmailCampaign_Model_Campaign $campaign, Mage_Customer_Model_Resource_Customer_Collection $customers, $data)
47
  {
48
  $mailTemplate = Mage::getModel('core/email_template');
49
  $closure = is_object($data) && ($data instanceof Closure);
@@ -57,7 +57,7 @@ class Adfab_EmailCampaign_Model_Connector_Magento extends Adfab_EmailCampaign_Mo
57
  ->setReplyTo($customer->getEmail())
58
  ->setTemplateSubject('test')
59
  ->sendTransactional(
60
- (int)$campaign->getTemplateId(),
61
  array('email' => $customer->getEmail(), 'name' => $customer->getFirstname() . ' ' . $customer->getLastname()),
62
  $customer->getEmail(),
63
  $customer->getFirstname() . ' ' . $customer->getLastname(),
14
  * DISCLAIMER
15
  *
16
  * Do not edit or add to this file if you wish to upgrade
17
+ * the Adfab Emailcampaign module to newer versions in the future.
18
+ * If you wish to customize the Adfab Emailcampaign module for your needs
19
  * please refer to http://www.magentocommerce.com for more information.
20
  *
21
  * @category Adfab
22
+ * @package Adfab_Emailcampaign
23
  * @copyright Copyright (C) 2014 Adfab (http://www.adfab.fr/)
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
30
  * Long description of the class (if any...)
31
  *
32
  * @category Adfab
33
+ * @package Adfab_Emailcampaign
34
  * @subpackage Model
35
  * @author Arnaud Hours <arnaud.hours@adfab.fr>
36
  */
37
+ class Adfab_Emailcampaign_Model_Connector_Magento extends Adfab_Emailcampaign_Model_Connector_Abstract
38
  {
39
 
40
  /**
41
  *
42
+ * @param Adfab_Emailcampaign_Model_Campaign $campaign
43
  * @param Mage_Customer_Model_Resource_Customer_Collection $customer
44
  * @param array $data
45
  */
46
+ public function sendMail(Adfab_Emailcampaign_Model_Campaign $campaign, Mage_Customer_Model_Resource_Customer_Collection $customers, $data)
47
  {
48
  $mailTemplate = Mage::getModel('core/email_template');
49
  $closure = is_object($data) && ($data instanceof Closure);
57
  ->setReplyTo($customer->getEmail())
58
  ->setTemplateSubject('test')
59
  ->sendTransactional(
60
+ (is_numeric($campaign->getTemplateId())) ? (int)$campaign->getTemplateId() : $campaign->getTemplateId(),
61
  array('email' => $customer->getEmail(), 'name' => $customer->getFirstname() . ' ' . $customer->getLastname()),
62
  $customer->getEmail(),
63
  $customer->getFirstname() . ' ' . $customer->getLastname(),
app/code/community/Adfab/Emailcampaign/Model/Connector/Void.php CHANGED
@@ -14,12 +14,12 @@
14
  * DISCLAIMER
15
  *
16
  * Do not edit or add to this file if you wish to upgrade
17
- * the Adfab EmailCampaign module to newer versions in the future.
18
- * If you wish to customize the Adfab EmailCampaign module for your needs
19
  * please refer to http://www.magentocommerce.com for more information.
20
  *
21
  * @category Adfab
22
- * @package Adfab_EmailCampaign
23
  * @copyright Copyright (C) 2014 Adfab (http://www.adfab.fr/)
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
@@ -30,20 +30,20 @@
30
  * Long description of the class (if any...)
31
  *
32
  * @category Adfab
33
- * @package Adfab_EmailCampaign
34
  * @subpackage Model
35
  * @author Arnaud Hours <arnaud.hours@adfab.fr>
36
  */
37
- class Adfab_EmailCampaign_Model_Connector_Void extends Adfab_EmailCampaign_Model_Connector_Abstract
38
  {
39
 
40
  /**
41
  *
42
- * @param Adfab_EmailCampaign_Model_Campaign $campaign
43
  * @param Mage_Customer_Model_Resource_Customer_Collection $customer
44
  * @param array $data
45
  */
46
- public function sendMail(Adfab_EmailCampaign_Model_Campaign $campaign, Mage_Customer_Model_Resource_Customer_Collection $customers, $data)
47
  {
48
  }
49
 
14
  * DISCLAIMER
15
  *
16
  * Do not edit or add to this file if you wish to upgrade
17
+ * the Adfab Emailcampaign module to newer versions in the future.
18
+ * If you wish to customize the Adfab Emailcampaign module for your needs
19
  * please refer to http://www.magentocommerce.com for more information.
20
  *
21
  * @category Adfab
22
+ * @package Adfab_Emailcampaign
23
  * @copyright Copyright (C) 2014 Adfab (http://www.adfab.fr/)
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
30
  * Long description of the class (if any...)
31
  *
32
  * @category Adfab
33
+ * @package Adfab_Emailcampaign
34
  * @subpackage Model
35
  * @author Arnaud Hours <arnaud.hours@adfab.fr>
36
  */
37
+ class Adfab_Emailcampaign_Model_Connector_Void extends Adfab_Emailcampaign_Model_Connector_Abstract
38
  {
39
 
40
  /**
41
  *
42
+ * @param Adfab_Emailcampaign_Model_Campaign $campaign
43
  * @param Mage_Customer_Model_Resource_Customer_Collection $customer
44
  * @param array $data
45
  */
46
+ public function sendMail(Adfab_Emailcampaign_Model_Campaign $campaign, Mage_Customer_Model_Resource_Customer_Collection $customers, $data)
47
  {
48
  }
49
 
app/code/community/Adfab/Emailcampaign/Model/Cron.php CHANGED
@@ -14,12 +14,12 @@
14
  * DISCLAIMER
15
  *
16
  * Do not edit or add to this file if you wish to upgrade
17
- * the Adfab EmailCampaign module to newer versions in the future.
18
- * If you wish to customize the Adfab EmailCampaign module for your needs
19
  * please refer to http://www.magentocommerce.com for more information.
20
  *
21
  * @category Adfab
22
- * @package Adfab_EmailCampaign
23
  * @copyright Copyright (C) 2014 Adfab (http://www.adfab.fr/)
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
@@ -30,18 +30,18 @@
30
  * Long description of the class (if any...)
31
  *
32
  * @category Adfab
33
- * @package Adfab_EmailCampaign
34
  * @subpackage Model
35
  * @author Arnaud Hours <arnaud.hours@adfab.fr>
36
  */
37
- class Adfab_EmailCampaign_Model_Cron
38
  {
39
 
40
  /**
41
  * redispatch, but only emailcampaign cronjobs this time.
42
  *
43
  * @param Varien_Event_Observer $observer
44
- * @return Adfab_EmailCampaign_Model_Cron
45
  */
46
  public function dispatch ($observer)
47
  {
14
  * DISCLAIMER
15
  *
16
  * Do not edit or add to this file if you wish to upgrade
17
+ * the Adfab Emailcampaign module to newer versions in the future.
18
+ * If you wish to customize the Adfab Emailcampaign module for your needs
19
  * please refer to http://www.magentocommerce.com for more information.
20
  *
21
  * @category Adfab
22
+ * @package Adfab_Emailcampaign
23
  * @copyright Copyright (C) 2014 Adfab (http://www.adfab.fr/)
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
30
  * Long description of the class (if any...)
31
  *
32
  * @category Adfab
33
+ * @package Adfab_Emailcampaign
34
  * @subpackage Model
35
  * @author Arnaud Hours <arnaud.hours@adfab.fr>
36
  */
37
+ class Adfab_Emailcampaign_Model_Cron
38
  {
39
 
40
  /**
41
  * redispatch, but only emailcampaign cronjobs this time.
42
  *
43
  * @param Varien_Event_Observer $observer
44
+ * @return Adfab_Emailcampaign_Model_Cron
45
  */
46
  public function dispatch ($observer)
47
  {
app/code/community/Adfab/Emailcampaign/Model/Cron/Observer.php CHANGED
@@ -14,12 +14,12 @@
14
  * DISCLAIMER
15
  *
16
  * Do not edit or add to this file if you wish to upgrade
17
- * the Adfab EmailCampaign module to newer versions in the future.
18
- * If you wish to customize the Adfab EmailCampaign module for your needs
19
  * please refer to http://www.magentocommerce.com for more information.
20
  *
21
  * @category Adfab
22
- * @package Adfab_EmailCampaign
23
  * @copyright Copyright (C) 2014 Adfab (http://www.adfab.fr/)
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
@@ -29,11 +29,11 @@
29
  * Methods are overloded from magento ce 1.7.0.2
30
  *
31
  * @category Adfab
32
- * @package Adfab_EmailCampaign
33
  * @subpackage Model
34
  * @author Arnaud Hours <arnaud.hours@adfab.fr>
35
  */
36
- class Adfab_EmailCampaign_Model_Cron_Observer extends Mage_Cron_Model_Observer
37
  {
38
 
39
  const EMAILCAMPAIGN_CACHE_KEY_LAST_SCHEDULE_GENERATE_AT = 'emailcampaign_cron_last_history_cleanup_at';
@@ -189,7 +189,7 @@ class Adfab_EmailCampaign_Model_Cron_Observer extends Mage_Cron_Model_Observer
189
  protected function _getCronCampaigns()
190
  {
191
  if (is_null($this->_campaigns)) {
192
- $this->_campaigns = Mage::helper('adfab_emailcampaign')->getCampaignsByType(Adfab_EmailCampaign_Model_Campaign::TYPE_CRON);
193
  }
194
  return $this->_campaigns;
195
  }
14
  * DISCLAIMER
15
  *
16
  * Do not edit or add to this file if you wish to upgrade
17
+ * the Adfab Emailcampaign module to newer versions in the future.
18
+ * If you wish to customize the Adfab Emailcampaign module for your needs
19
  * please refer to http://www.magentocommerce.com for more information.
20
  *
21
  * @category Adfab
22
+ * @package Adfab_Emailcampaign
23
  * @copyright Copyright (C) 2014 Adfab (http://www.adfab.fr/)
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
29
  * Methods are overloded from magento ce 1.7.0.2
30
  *
31
  * @category Adfab
32
+ * @package Adfab_Emailcampaign
33
  * @subpackage Model
34
  * @author Arnaud Hours <arnaud.hours@adfab.fr>
35
  */
36
+ class Adfab_Emailcampaign_Model_Cron_Observer extends Mage_Cron_Model_Observer
37
  {
38
 
39
  const EMAILCAMPAIGN_CACHE_KEY_LAST_SCHEDULE_GENERATE_AT = 'emailcampaign_cron_last_history_cleanup_at';
189
  protected function _getCronCampaigns()
190
  {
191
  if (is_null($this->_campaigns)) {
192
+ $this->_campaigns = Mage::helper('adfab_emailcampaign')->getCampaignsByType(Adfab_Emailcampaign_Model_Campaign::TYPE_CRON);
193
  }
194
  return $this->_campaigns;
195
  }
app/code/community/Adfab/Emailcampaign/Model/Flag.php CHANGED
@@ -14,16 +14,16 @@
14
  * DISCLAIMER
15
  *
16
  * Do not edit or add to this file if you wish to upgrade
17
- * the Adfab EmailCampaign module to newer versions in the future.
18
- * If you wish to customize the Adfab EmailCampaign module for your needs
19
  * please refer to http://www.magentocommerce.com for more information.
20
  *
21
  * @category Adfab
22
- * @package Adfab_EmailCampaign
23
  * @copyright Copyright (C) 2014 Adfab (http://www.adfab.fr/)
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
26
- class Adfab_EmailCampaign_Model_Flag extends Mage_Core_Model_Flag {
27
 
28
  /**
29
  * Flag code
14
  * DISCLAIMER
15
  *
16
  * Do not edit or add to this file if you wish to upgrade
17
+ * the Adfab Emailcampaign module to newer versions in the future.
18
+ * If you wish to customize the Adfab Emailcampaign module for your needs
19
  * please refer to http://www.magentocommerce.com for more information.
20
  *
21
  * @category Adfab
22
+ * @package Adfab_Emailcampaign
23
  * @copyright Copyright (C) 2014 Adfab (http://www.adfab.fr/)
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
26
+ class Adfab_Emailcampaign_Model_Flag extends Mage_Core_Model_Flag {
27
 
28
  /**
29
  * Flag code
app/code/community/Adfab/Emailcampaign/Model/Observer.php CHANGED
@@ -14,12 +14,12 @@
14
  * DISCLAIMER
15
  *
16
  * Do not edit or add to this file if you wish to upgrade
17
- * the Adfab EmailCampaign module to newer versions in the future.
18
- * If you wish to customize the Adfab EmailCampaign module for your needs
19
  * please refer to http://www.magentocommerce.com for more information.
20
  *
21
  * @category Adfab
22
- * @package Adfab_EmailCampaign
23
  * @copyright Copyright (C) 2014 Adfab (http://www.adfab.fr/)
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
@@ -30,18 +30,18 @@
30
  * Long description of the class (if any...)
31
  *
32
  * @category Adfab
33
- * @package Adfab_EmailCampaign
34
  * @subpackage Model
35
  * @author Arnaud Hours <arnaud.hours@adfab.fr>
36
  */
37
- class Adfab_EmailCampaign_Model_Observer extends Mage_Core_Model_Abstract
38
  {
39
 
40
  /**
41
  * add campaign events into config
42
  *
43
  * @param Varien_Event_Observer $event
44
- * @return Adfab_EmailCampaign_Model_Observer
45
  */
46
  public function addObservers($event)
47
  {
@@ -81,7 +81,7 @@ class Adfab_EmailCampaign_Model_Observer extends Mage_Core_Model_Abstract
81
  $configs = Mage::helper('adfab_emailcampaign')->getCampaignConfigByNodeValue('event', $observer->getEvent()->getName());
82
  foreach ($configs as $config) {
83
  $campaigns = Mage::getResourceModel('adfab_emailcampaign/campaign_collection')
84
- ->addFieldToFilter('status', array('eq' => Adfab_EmailCampaign_Model_Status::STATUS_ENABLED))
85
  ->addFieldToFilter('code', array('eq' => (string)$config->getName()));
86
  $class = Mage::getModel((string)$config->class);
87
  foreach ($campaigns as $campaign) {
14
  * DISCLAIMER
15
  *
16
  * Do not edit or add to this file if you wish to upgrade
17
+ * the Adfab Emailcampaign module to newer versions in the future.
18
+ * If you wish to customize the Adfab Emailcampaign module for your needs
19
  * please refer to http://www.magentocommerce.com for more information.
20
  *
21
  * @category Adfab
22
+ * @package Adfab_Emailcampaign
23
  * @copyright Copyright (C) 2014 Adfab (http://www.adfab.fr/)
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
30
  * Long description of the class (if any...)
31
  *
32
  * @category Adfab
33
+ * @package Adfab_Emailcampaign
34
  * @subpackage Model
35
  * @author Arnaud Hours <arnaud.hours@adfab.fr>
36
  */
37
+ class Adfab_Emailcampaign_Model_Observer extends Mage_Core_Model_Abstract
38
  {
39
 
40
  /**
41
  * add campaign events into config
42
  *
43
  * @param Varien_Event_Observer $event
44
+ * @return Adfab_Emailcampaign_Model_Observer
45
  */
46
  public function addObservers($event)
47
  {
81
  $configs = Mage::helper('adfab_emailcampaign')->getCampaignConfigByNodeValue('event', $observer->getEvent()->getName());
82
  foreach ($configs as $config) {
83
  $campaigns = Mage::getResourceModel('adfab_emailcampaign/campaign_collection')
84
+ ->addFieldToFilter('status', array('eq' => Adfab_Emailcampaign_Model_Status::STATUS_ENABLED))
85
  ->addFieldToFilter('code', array('eq' => (string)$config->getName()));
86
  $class = Mage::getModel((string)$config->class);
87
  foreach ($campaigns as $campaign) {
app/code/community/Adfab/Emailcampaign/Model/Resource/Adminhtml/Notification.php CHANGED
@@ -14,12 +14,12 @@
14
  * DISCLAIMER
15
  *
16
  * Do not edit or add to this file if you wish to upgrade
17
- * the Adfab EmailCampaign module to newer versions in the future.
18
- * If you wish to customize the Adfab EmailCampaign module for your needs
19
  * please refer to http://www.magentocommerce.com for more information.
20
  *
21
  * @category Adfab
22
- * @package Adfab_EmailCampaign
23
  * @copyright Copyright (C) 2014 Adfab (http://www.adfab.fr/)
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
@@ -30,11 +30,11 @@
30
  * Long description of the class (if any...)
31
  *
32
  * @category Adfab
33
- * @package Adfab_EmailCampaign
34
  * @subpackage Model
35
  * @author Arnaud Hours <arnaud.hours@adfab.fr>
36
  */
37
- class Adfab_EmailCampaign_Model_Resource_Adminhtml_Notification extends Mage_Core_Model_Resource_Db_Abstract
38
  {
39
 
40
  /**
14
  * DISCLAIMER
15
  *
16
  * Do not edit or add to this file if you wish to upgrade
17
+ * the Adfab Emailcampaign module to newer versions in the future.
18
+ * If you wish to customize the Adfab Emailcampaign module for your needs
19
  * please refer to http://www.magentocommerce.com for more information.
20
  *
21
  * @category Adfab
22
+ * @package Adfab_Emailcampaign
23
  * @copyright Copyright (C) 2014 Adfab (http://www.adfab.fr/)
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
30
  * Long description of the class (if any...)
31
  *
32
  * @category Adfab
33
+ * @package Adfab_Emailcampaign
34
  * @subpackage Model
35
  * @author Arnaud Hours <arnaud.hours@adfab.fr>
36
  */
37
+ class Adfab_Emailcampaign_Model_Resource_Adminhtml_Notification extends Mage_Core_Model_Resource_Db_Abstract
38
  {
39
 
40
  /**
app/code/community/Adfab/Emailcampaign/Model/Resource/Adminhtml/Notification/Collection.php CHANGED
@@ -14,12 +14,12 @@
14
  * DISCLAIMER
15
  *
16
  * Do not edit or add to this file if you wish to upgrade
17
- * the Adfab EmailCampaign module to newer versions in the future.
18
- * If you wish to customize the Adfab EmailCampaign module for your needs
19
  * please refer to http://www.magentocommerce.com for more information.
20
  *
21
  * @category Adfab
22
- * @package Adfab_EmailCampaign
23
  * @copyright Copyright (C) 2014 Adfab (http://www.adfab.fr/)
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
@@ -30,11 +30,11 @@
30
  * Long description of the class (if any...)
31
  *
32
  * @category Adfab
33
- * @package Adfab_EmailCampaign
34
  * @subpackage Model
35
  * @author Arnaud Hours <arnaud.hours@adfab.fr>
36
  */
37
- class Adfab_EmailCampaign_Model_Resource_Adminhtml_Notification_Collection extends Mage_Core_Model_Resource_Db_Collection_Abstract
38
  {
39
 
40
  public function _construct()
14
  * DISCLAIMER
15
  *
16
  * Do not edit or add to this file if you wish to upgrade
17
+ * the Adfab Emailcampaign module to newer versions in the future.
18
+ * If you wish to customize the Adfab Emailcampaign module for your needs
19
  * please refer to http://www.magentocommerce.com for more information.
20
  *
21
  * @category Adfab
22
+ * @package Adfab_Emailcampaign
23
  * @copyright Copyright (C) 2014 Adfab (http://www.adfab.fr/)
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
30
  * Long description of the class (if any...)
31
  *
32
  * @category Adfab
33
+ * @package Adfab_Emailcampaign
34
  * @subpackage Model
35
  * @author Arnaud Hours <arnaud.hours@adfab.fr>
36
  */
37
+ class Adfab_Emailcampaign_Model_Resource_Adminhtml_Notification_Collection extends Mage_Core_Model_Resource_Db_Collection_Abstract
38
  {
39
 
40
  public function _construct()
app/code/community/Adfab/Emailcampaign/Model/Resource/Campaign.php CHANGED
@@ -14,12 +14,12 @@
14
  * DISCLAIMER
15
  *
16
  * Do not edit or add to this file if you wish to upgrade
17
- * the Adfab EmailCampaign module to newer versions in the future.
18
- * If you wish to customize the Adfab EmailCampaign module for your needs
19
  * please refer to http://www.magentocommerce.com for more information.
20
  *
21
  * @category Adfab
22
- * @package Adfab_EmailCampaign
23
  * @copyright Copyright (C) 2014 Adfab (http://www.adfab.fr/)
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
@@ -30,11 +30,11 @@
30
  * Long description of the class (if any...)
31
  *
32
  * @category Adfab
33
- * @package Adfab_EmailCampaign
34
  * @subpackage Model
35
  * @author Arnaud Hours <arnaud.hours@adfab.fr>
36
  */
37
- class Adfab_EmailCampaign_Model_Resource_Campaign extends Mage_Core_Model_Resource_Db_Abstract
38
  {
39
 
40
  /**
14
  * DISCLAIMER
15
  *
16
  * Do not edit or add to this file if you wish to upgrade
17
+ * the Adfab Emailcampaign module to newer versions in the future.
18
+ * If you wish to customize the Adfab Emailcampaign module for your needs
19
  * please refer to http://www.magentocommerce.com for more information.
20
  *
21
  * @category Adfab
22
+ * @package Adfab_Emailcampaign
23
  * @copyright Copyright (C) 2014 Adfab (http://www.adfab.fr/)
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
30
  * Long description of the class (if any...)
31
  *
32
  * @category Adfab
33
+ * @package Adfab_Emailcampaign
34
  * @subpackage Model
35
  * @author Arnaud Hours <arnaud.hours@adfab.fr>
36
  */
37
+ class Adfab_Emailcampaign_Model_Resource_Campaign extends Mage_Core_Model_Resource_Db_Abstract
38
  {
39
 
40
  /**
app/code/community/Adfab/Emailcampaign/Model/Resource/Campaign/Collection.php CHANGED
@@ -14,12 +14,12 @@
14
  * DISCLAIMER
15
  *
16
  * Do not edit or add to this file if you wish to upgrade
17
- * the Adfab EmailCampaign module to newer versions in the future.
18
- * If you wish to customize the Adfab EmailCampaign module for your needs
19
  * please refer to http://www.magentocommerce.com for more information.
20
  *
21
  * @category Adfab
22
- * @package Adfab_EmailCampaign
23
  * @copyright Copyright (C) 2014 Adfab (http://www.adfab.fr/)
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
@@ -30,11 +30,11 @@
30
  * Long description of the class (if any...)
31
  *
32
  * @category Adfab
33
- * @package Adfab_EmailCampaign
34
  * @subpackage Model
35
  * @author Arnaud Hours <arnaud.hours@adfab.fr>
36
  */
37
- class Adfab_EmailCampaign_Model_Resource_Campaign_Collection extends Mage_Core_Model_Resource_Db_Collection_Abstract
38
  {
39
 
40
  public function _construct()
14
  * DISCLAIMER
15
  *
16
  * Do not edit or add to this file if you wish to upgrade
17
+ * the Adfab Emailcampaign module to newer versions in the future.
18
+ * If you wish to customize the Adfab Emailcampaign module for your needs
19
  * please refer to http://www.magentocommerce.com for more information.
20
  *
21
  * @category Adfab
22
+ * @package Adfab_Emailcampaign
23
  * @copyright Copyright (C) 2014 Adfab (http://www.adfab.fr/)
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
30
  * Long description of the class (if any...)
31
  *
32
  * @category Adfab
33
+ * @package Adfab_Emailcampaign
34
  * @subpackage Model
35
  * @author Arnaud Hours <arnaud.hours@adfab.fr>
36
  */
37
+ class Adfab_Emailcampaign_Model_Resource_Campaign_Collection extends Mage_Core_Model_Resource_Db_Collection_Abstract
38
  {
39
 
40
  public function _construct()
app/code/community/Adfab/Emailcampaign/Model/Source/Campaign.php CHANGED
@@ -14,12 +14,12 @@
14
  * DISCLAIMER
15
  *
16
  * Do not edit or add to this file if you wish to upgrade
17
- * the Adfab EmailCampaign module to newer versions in the future.
18
- * If you wish to customize the Adfab EmailCampaign module for your needs
19
  * please refer to http://www.magentocommerce.com for more information.
20
  *
21
  * @category Adfab
22
- * @package Adfab_EmailCampaign
23
  * @copyright Copyright (C) 2014 Adfab (http://www.adfab.fr/)
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
@@ -30,11 +30,11 @@
30
  * Long description of the class (if any...)
31
  *
32
  * @category Adfab
33
- * @package Adfab_EmailCampaign
34
  * @subpackage Model
35
  * @author Arnaud Hours <arnaud.hours@adfab.fr>
36
  */
37
- class Adfab_EmailCampaign_Model_Source_Campaign
38
  {
39
 
40
  protected $_campaigns;
14
  * DISCLAIMER
15
  *
16
  * Do not edit or add to this file if you wish to upgrade
17
+ * the Adfab Emailcampaign module to newer versions in the future.
18
+ * If you wish to customize the Adfab Emailcampaign module for your needs
19
  * please refer to http://www.magentocommerce.com for more information.
20
  *
21
  * @category Adfab
22
+ * @package Adfab_Emailcampaign
23
  * @copyright Copyright (C) 2014 Adfab (http://www.adfab.fr/)
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
30
  * Long description of the class (if any...)
31
  *
32
  * @category Adfab
33
+ * @package Adfab_Emailcampaign
34
  * @subpackage Model
35
  * @author Arnaud Hours <arnaud.hours@adfab.fr>
36
  */
37
+ class Adfab_Emailcampaign_Model_Source_Campaign
38
  {
39
 
40
  protected $_campaigns;
app/code/community/Adfab/Emailcampaign/Model/Source/Connector.php CHANGED
@@ -14,12 +14,12 @@
14
  * DISCLAIMER
15
  *
16
  * Do not edit or add to this file if you wish to upgrade
17
- * the Adfab EmailCampaign module to newer versions in the future.
18
- * If you wish to customize the Adfab EmailCampaign module for your needs
19
  * please refer to http://www.magentocommerce.com for more information.
20
  *
21
  * @category Adfab
22
- * @package Adfab_EmailCampaign
23
  * @copyright Copyright (C) 2014 Adfab (http://www.adfab.fr/)
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
@@ -30,11 +30,11 @@
30
  * Long description of the class (if any...)
31
  *
32
  * @category Adfab
33
- * @package Adfab_EmailCampaign
34
  * @subpackage Model
35
  * @author Arnaud Hours <arnaud.hours@adfab.fr>
36
  */
37
- class Adfab_EmailCampaign_Model_Source_Connector
38
  {
39
 
40
  protected $_connectors;
14
  * DISCLAIMER
15
  *
16
  * Do not edit or add to this file if you wish to upgrade
17
+ * the Adfab Emailcampaign module to newer versions in the future.
18
+ * If you wish to customize the Adfab Emailcampaign module for your needs
19
  * please refer to http://www.magentocommerce.com for more information.
20
  *
21
  * @category Adfab
22
+ * @package Adfab_Emailcampaign
23
  * @copyright Copyright (C) 2014 Adfab (http://www.adfab.fr/)
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
30
  * Long description of the class (if any...)
31
  *
32
  * @category Adfab
33
+ * @package Adfab_Emailcampaign
34
  * @subpackage Model
35
  * @author Arnaud Hours <arnaud.hours@adfab.fr>
36
  */
37
+ class Adfab_Emailcampaign_Model_Source_Connector
38
  {
39
 
40
  protected $_connectors;
app/code/community/Adfab/Emailcampaign/Model/Source/Mode.php CHANGED
@@ -14,12 +14,12 @@
14
  * DISCLAIMER
15
  *
16
  * Do not edit or add to this file if you wish to upgrade
17
- * the Adfab EmailCampaign module to newer versions in the future.
18
- * If you wish to customize the Adfab EmailCampaign module for your needs
19
  * please refer to http://www.magentocommerce.com for more information.
20
  *
21
  * @category Adfab
22
- * @package Adfab_EmailCampaign
23
  * @copyright Copyright (C) 2014 Adfab (http://www.adfab.fr/)
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
@@ -30,11 +30,11 @@
30
  * Long description of the class (if any...)
31
  *
32
  * @category Adfab
33
- * @package Adfab_EmailCampaign
34
  * @subpackage Model
35
  * @author Arnaud Hours <arnaud.hours@adfab.fr>
36
  */
37
- class Adfab_EmailCampaign_Model_Source_Mode
38
  {
39
 
40
  const TEST = 'test';
14
  * DISCLAIMER
15
  *
16
  * Do not edit or add to this file if you wish to upgrade
17
+ * the Adfab Emailcampaign module to newer versions in the future.
18
+ * If you wish to customize the Adfab Emailcampaign module for your needs
19
  * please refer to http://www.magentocommerce.com for more information.
20
  *
21
  * @category Adfab
22
+ * @package Adfab_Emailcampaign
23
  * @copyright Copyright (C) 2014 Adfab (http://www.adfab.fr/)
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
30
  * Long description of the class (if any...)
31
  *
32
  * @category Adfab
33
+ * @package Adfab_Emailcampaign
34
  * @subpackage Model
35
  * @author Arnaud Hours <arnaud.hours@adfab.fr>
36
  */
37
+ class Adfab_Emailcampaign_Model_Source_Mode
38
  {
39
 
40
  const TEST = 'test';
app/code/community/Adfab/Emailcampaign/Model/Source/Template.php CHANGED
@@ -14,12 +14,12 @@
14
  * DISCLAIMER
15
  *
16
  * Do not edit or add to this file if you wish to upgrade
17
- * the Adfab EmailCampaign module to newer versions in the future.
18
- * If you wish to customize the Adfab EmailCampaign module for your needs
19
  * please refer to http://www.magentocommerce.com for more information.
20
  *
21
  * @category Adfab
22
- * @package Adfab_EmailCampaign
23
  * @copyright Copyright (C) 2014 Adfab (http://www.adfab.fr/)
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
@@ -30,11 +30,11 @@
30
  * Long description of the class (if any...)
31
  *
32
  * @category Adfab
33
- * @package Adfab_EmailCampaign
34
  * @subpackage Model
35
  * @author Arnaud Hours <arnaud.hours@adfab.fr>
36
  */
37
- class Adfab_EmailCampaign_Model_Source_Template
38
  {
39
 
40
  /**
14
  * DISCLAIMER
15
  *
16
  * Do not edit or add to this file if you wish to upgrade
17
+ * the Adfab Emailcampaign module to newer versions in the future.
18
+ * If you wish to customize the Adfab Emailcampaign module for your needs
19
  * please refer to http://www.magentocommerce.com for more information.
20
  *
21
  * @category Adfab
22
+ * @package Adfab_Emailcampaign
23
  * @copyright Copyright (C) 2014 Adfab (http://www.adfab.fr/)
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
30
  * Long description of the class (if any...)
31
  *
32
  * @category Adfab
33
+ * @package Adfab_Emailcampaign
34
  * @subpackage Model
35
  * @author Arnaud Hours <arnaud.hours@adfab.fr>
36
  */
37
+ class Adfab_Emailcampaign_Model_Source_Template
38
  {
39
 
40
  /**
app/code/community/Adfab/Emailcampaign/Model/Status.php CHANGED
@@ -14,12 +14,12 @@
14
  * DISCLAIMER
15
  *
16
  * Do not edit or add to this file if you wish to upgrade
17
- * the Adfab EmailCampaign module to newer versions in the future.
18
- * If you wish to customize the Adfab EmailCampaign module for your needs
19
  * please refer to http://www.magentocommerce.com for more information.
20
  *
21
  * @category Adfab
22
- * @package Adfab_EmailCampaign
23
  * @copyright Copyright (C) 2014 Adfab (http://www.adfab.fr/)
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
@@ -30,11 +30,11 @@
30
  * Long description of the class (if any...)
31
  *
32
  * @category Adfab
33
- * @package Adfab_EmailCampaign
34
  * @subpackage Model
35
  * @author Arnaud Hours <arnaud.hours@adfab.fr>
36
  */
37
- class Adfab_EmailCampaign_Model_Status
38
  {
39
 
40
  const STATUS_ENABLED = 1;
14
  * DISCLAIMER
15
  *
16
  * Do not edit or add to this file if you wish to upgrade
17
+ * the Adfab Emailcampaign module to newer versions in the future.
18
+ * If you wish to customize the Adfab Emailcampaign module for your needs
19
  * please refer to http://www.magentocommerce.com for more information.
20
  *
21
  * @category Adfab
22
+ * @package Adfab_Emailcampaign
23
  * @copyright Copyright (C) 2014 Adfab (http://www.adfab.fr/)
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
30
  * Long description of the class (if any...)
31
  *
32
  * @category Adfab
33
+ * @package Adfab_Emailcampaign
34
  * @subpackage Model
35
  * @author Arnaud Hours <arnaud.hours@adfab.fr>
36
  */
37
+ class Adfab_Emailcampaign_Model_Status
38
  {
39
 
40
  const STATUS_ENABLED = 1;
app/code/community/Adfab/Emailcampaign/Test/Model/Campaign.php CHANGED
@@ -14,12 +14,12 @@
14
  * DISCLAIMER
15
  *
16
  * Do not edit or add to this file if you wish to upgrade
17
- * the Adfab EmailCampaign module to newer versions in the future.
18
- * If you wish to customize the Adfab EmailCampaign module for your needs
19
  * please refer to http://www.magentocommerce.com for more information.
20
  *
21
  * @category Adfab
22
- * @package Adfab_EmailCampaign
23
  * @copyright Copyright (C) 2014 Adfab (http://www.adfab.fr/)
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
@@ -30,11 +30,11 @@
30
  * Long description of the class (if any...)
31
  *
32
  * @category Adfab
33
- * @package Adfab_EmailCampaign
34
  * @subpackage Model
35
  * @author Arnaud Hours <arnaud.hours@adfab.fr>
36
  */
37
- class Adfab_EmailCampaign_Test_Model_Campaign extends EcomDev_PHPUnit_Test_Case
38
  {
39
 
40
  /**
14
  * DISCLAIMER
15
  *
16
  * Do not edit or add to this file if you wish to upgrade
17
+ * the Adfab Emailcampaign module to newer versions in the future.
18
+ * If you wish to customize the Adfab Emailcampaign module for your needs
19
  * please refer to http://www.magentocommerce.com for more information.
20
  *
21
  * @category Adfab
22
+ * @package Adfab_Emailcampaign
23
  * @copyright Copyright (C) 2014 Adfab (http://www.adfab.fr/)
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
30
  * Long description of the class (if any...)
31
  *
32
  * @category Adfab
33
+ * @package Adfab_Emailcampaign
34
  * @subpackage Model
35
  * @author Arnaud Hours <arnaud.hours@adfab.fr>
36
  */
37
+ class Adfab_Emailcampaign_Test_Model_Campaign extends EcomDev_PHPUnit_Test_Case
38
  {
39
 
40
  /**
app/code/community/Adfab/Emailcampaign/Test/Model/Campaign/State/Config.php CHANGED
@@ -14,12 +14,12 @@
14
  * DISCLAIMER
15
  *
16
  * Do not edit or add to this file if you wish to upgrade
17
- * the Adfab EmailCampaign module to newer versions in the future.
18
- * If you wish to customize the Adfab EmailCampaign module for your needs
19
  * please refer to http://www.magentocommerce.com for more information.
20
  *
21
  * @category Adfab
22
- * @package Adfab_EmailCampaign
23
  * @copyright Copyright (C) 2014 Adfab (http://www.adfab.fr/)
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
@@ -30,11 +30,11 @@
30
  * Long description of the class (if any...)
31
  *
32
  * @category Adfab
33
- * @package Adfab_EmailCampaign
34
  * @subpackage Model
35
  * @author Arnaud Hours <arnaud.hours@adfab.fr>
36
  */
37
- class Adfab_EmailCampaign_Test_Model_Campaign_State_Config extends EcomDev_PHPUnit_Test_Case
38
  {
39
 
40
  /**
14
  * DISCLAIMER
15
  *
16
  * Do not edit or add to this file if you wish to upgrade
17
+ * the Adfab Emailcampaign module to newer versions in the future.
18
+ * If you wish to customize the Adfab Emailcampaign module for your needs
19
  * please refer to http://www.magentocommerce.com for more information.
20
  *
21
  * @category Adfab
22
+ * @package Adfab_Emailcampaign
23
  * @copyright Copyright (C) 2014 Adfab (http://www.adfab.fr/)
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
30
  * Long description of the class (if any...)
31
  *
32
  * @category Adfab
33
+ * @package Adfab_Emailcampaign
34
  * @subpackage Model
35
  * @author Arnaud Hours <arnaud.hours@adfab.fr>
36
  */
37
+ class Adfab_Emailcampaign_Test_Model_Campaign_State_Config extends EcomDev_PHPUnit_Test_Case
38
  {
39
 
40
  /**
app/code/community/Adfab/Emailcampaign/Test/Model/Config.php CHANGED
@@ -14,12 +14,12 @@
14
  * DISCLAIMER
15
  *
16
  * Do not edit or add to this file if you wish to upgrade
17
- * the Adfab EmailCampaign module to newer versions in the future.
18
- * If you wish to customize the Adfab EmailCampaign module for your needs
19
  * please refer to http://www.magentocommerce.com for more information.
20
  *
21
  * @category Adfab
22
- * @package Adfab_EmailCampaign
23
  * @copyright Copyright (C) 2014 Adfab (http://www.adfab.fr/)
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
@@ -30,11 +30,11 @@
30
  * Long description of the class (if any...)
31
  *
32
  * @category Adfab
33
- * @package Adfab_EmailCampaign
34
  * @subpackage Model
35
  * @author Arnaud Hours <arnaud.hours@adfab.fr>
36
  */
37
- class Adfab_EmailCampaign_Test_Model_Config extends EcomDev_PHPUnit_Test_Case
38
  {
39
 
40
  /**
14
  * DISCLAIMER
15
  *
16
  * Do not edit or add to this file if you wish to upgrade
17
+ * the Adfab Emailcampaign module to newer versions in the future.
18
+ * If you wish to customize the Adfab Emailcampaign module for your needs
19
  * please refer to http://www.magentocommerce.com for more information.
20
  *
21
  * @category Adfab
22
+ * @package Adfab_Emailcampaign
23
  * @copyright Copyright (C) 2014 Adfab (http://www.adfab.fr/)
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
30
  * Long description of the class (if any...)
31
  *
32
  * @category Adfab
33
+ * @package Adfab_Emailcampaign
34
  * @subpackage Model
35
  * @author Arnaud Hours <arnaud.hours@adfab.fr>
36
  */
37
+ class Adfab_Emailcampaign_Test_Model_Config extends EcomDev_PHPUnit_Test_Case
38
  {
39
 
40
  /**
app/code/community/Adfab/Emailcampaign/controllers/Adminhtml/CampaignController.php CHANGED
@@ -15,16 +15,16 @@
15
  * DISCLAIMER
16
  *
17
  * Do not edit or add to this file if you wish to upgrade
18
- * the Adfab EmailCampaign module to newer versions in the future.
19
- * If you wish to customize the Adfab EmailCampaign module for your needs
20
  * please refer to http://www.magentocommerce.com for more information.
21
  *
22
  * @category Adfab
23
- * @package Adfab_EmailCampaign
24
  * @copyright Copyright (C) 2014 Adfab (http://www.adfab.fr/)
25
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
26
  */
27
- class Adfab_EmailCampaign_Adminhtml_CampaignController extends Mage_Adminhtml_Controller_Action
28
  {
29
 
30
  protected function _initAction()
@@ -90,7 +90,7 @@ class Adfab_EmailCampaign_Adminhtml_CampaignController extends Mage_Adminhtml_Co
90
  public function saveAction()
91
  {
92
  if ($data = $this->getRequest()->getPost()) {
93
- /* @var $model Adfab_EmailCampaign_Model_Campaign */
94
  $model = Mage::getModel('adfab_emailcampaign/campaign');
95
  if (isset($data['variables']) && is_array($data['variables'])) {
96
  $model->setVariable($data['variables']);
@@ -203,7 +203,7 @@ class Adfab_EmailCampaign_Adminhtml_CampaignController extends Mage_Adminhtml_Co
203
  }
204
 
205
  $oldMode = $campaign->getMode();
206
- $campaign->setMode(Adfab_EmailCampaign_Model_Source_Mode::TEST_ALL_EMAIL);
207
  Mage::dispatchEvent('emailcampaign_campaign_process_before', array('campaign' => $campaign, 'model' => $class));
208
  $class->process($campaign);
209
  Mage::dispatchEvent('emailcampaign_campaign_process_after', array('campaign' => $campaign, 'model' => $class));
@@ -344,4 +344,29 @@ class Adfab_EmailCampaign_Adminhtml_CampaignController extends Mage_Adminhtml_Co
344
  $this->renderLayout();
345
  }
346
 
347
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
15
  * DISCLAIMER
16
  *
17
  * Do not edit or add to this file if you wish to upgrade
18
+ * the Adfab Emailcampaign module to newer versions in the future.
19
+ * If you wish to customize the Adfab Emailcampaign module for your needs
20
  * please refer to http://www.magentocommerce.com for more information.
21
  *
22
  * @category Adfab
23
+ * @package Adfab_Emailcampaign
24
  * @copyright Copyright (C) 2014 Adfab (http://www.adfab.fr/)
25
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
26
  */
27
+ class Adfab_Emailcampaign_Adminhtml_CampaignController extends Mage_Adminhtml_Controller_Action
28
  {
29
 
30
  protected function _initAction()
90
  public function saveAction()
91
  {
92
  if ($data = $this->getRequest()->getPost()) {
93
+ /* @var $model Adfab_Emailcampaign_Model_Campaign */
94
  $model = Mage::getModel('adfab_emailcampaign/campaign');
95
  if (isset($data['variables']) && is_array($data['variables'])) {
96
  $model->setVariable($data['variables']);
203
  }
204
 
205
  $oldMode = $campaign->getMode();
206
+ $campaign->setMode(Adfab_Emailcampaign_Model_Source_Mode::TEST_ALL_EMAIL);
207
  Mage::dispatchEvent('emailcampaign_campaign_process_before', array('campaign' => $campaign, 'model' => $class));
208
  $class->process($campaign);
209
  Mage::dispatchEvent('emailcampaign_campaign_process_after', array('campaign' => $campaign, 'model' => $class));
344
  $this->renderLayout();
345
  }
346
 
347
+ public function loadFormAjaxAction()
348
+ {
349
+ $campaign = Mage::getModel('adfab_emailcampaign/campaign');
350
+ foreach ($this->getRequest()->getParams() as $k => $param) {
351
+ if (is_string($param)) {
352
+ $campaign->setData($k, $param);
353
+ }
354
+ }
355
+ Mage::register('emailcampaign_data', $campaign);
356
+ $block = $this->getLayout()->createBlock('adfab_emailcampaign/adminhtml_campaign_edit_tabs');
357
+ $html = $block->toHtml();
358
+
359
+ $this->getResponse()->setHeader('Content-Type', 'application/json');
360
+
361
+ echo Zend_Json::encode(array(
362
+ 'tabs' => $html,
363
+ ));
364
+ }
365
+
366
+ public function previewAction()
367
+ {
368
+ $this->loadLayout('campaignPreview');
369
+ $this->renderLayout();
370
+ }
371
+
372
+ }
app/code/community/Adfab/Emailcampaign/etc/adminhtml.xml CHANGED
@@ -13,12 +13,12 @@
13
  * DISCLAIMER
14
  *
15
  * Do not edit or add to this file if you wish to upgrade
16
- * the Adfab EmailCampaign module to newer versions in the future.
17
- * If you wish to customize the Adfab EmailCampaign module for your needs
18
  * please refer to http://www.magentocommerce.com for more information.
19
  *
20
  * @category Adfab
21
- * @package Adfab_EmailCampaign
22
  * @copyright Copyright (C) 2014
23
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
24
  */
13
  * DISCLAIMER
14
  *
15
  * Do not edit or add to this file if you wish to upgrade
16
+ * the Adfab Emailcampaign module to newer versions in the future.
17
+ * If you wish to customize the Adfab Emailcampaign module for your needs
18
  * please refer to http://www.magentocommerce.com for more information.
19
  *
20
  * @category Adfab
21
+ * @package Adfab_Emailcampaign
22
  * @copyright Copyright (C) 2014
23
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
24
  */
app/code/community/Adfab/Emailcampaign/etc/config.xml CHANGED
@@ -13,48 +13,48 @@
13
  * DISCLAIMER
14
  *
15
  * Do not edit or add to this file if you wish to upgrade
16
- * the Adfab EmailCampaign module to newer versions in the future.
17
- * If you wish to customize the Adfab EmailCampaign module for your needs
18
  * please refer to http://www.magentocommerce.com for more information.
19
  *
20
  * @category Adfab
21
- * @package Adfab_EmailCampaign
22
  * @copyright Copyright (C) 2014
23
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
24
  */
25
  -->
26
  <config>
27
  <modules>
28
- <Adfab_EmailCampaign>
29
- <version>0.1.3</version>
30
- </Adfab_EmailCampaign>
31
  </modules>
32
  <global>
33
  <helpers>
34
  <adfab_emailcampaign>
35
- <class>Adfab_EmailCampaign_Helper</class>
36
  </adfab_emailcampaign>
37
  </helpers>
38
  <blocks>
39
  <adfab_emailcampaign>
40
- <class>Adfab_EmailCampaign_Block</class>
41
  </adfab_emailcampaign>
42
  </blocks>
43
  <resources>
44
  <adfab_emailcampaign_setup>
45
  <setup>
46
- <module>Adfab_EmailCampaign</module>
47
  <connection>core_setup</connection>
48
  </setup>
49
  </adfab_emailcampaign_setup>
50
  </resources>
51
  <models>
52
  <adfab_emailcampaign>
53
- <class>Adfab_EmailCampaign_Model</class>
54
  <resourceModel>adfab_emailcampaign_resource</resourceModel>
55
  </adfab_emailcampaign>
56
  <adfab_emailcampaign_resource>
57
- <class>Adfab_EmailCampaign_Model_Resource</class>
58
  <entities>
59
  <campaign>
60
  <table>emailcampaign_campaign</table>
@@ -129,6 +129,16 @@
129
  </form>
130
  </forms>
131
  </emailcampaign_inscriptionanniversary>
 
 
 
 
 
 
 
 
 
 
132
  <!--emailcampaign_ordersuccess>
133
  <name>Order Success</name>
134
  <class>adfab_emailcampaign/campaign_orderSuccess</class>
@@ -175,6 +185,11 @@
175
  <file>emailcampaign/inscription_anniversary.html</file>
176
  <type>html</type>
177
  </emailcampaign_inscriptionanniversary_email_template>
 
 
 
 
 
178
  <!--emailcampaign_ordersuccess_email_template translate="label" module="adfab_emailcampaign">
179
  <label>Order success</label>
180
  <file>emailcampaign/order_success.html</file>
@@ -198,7 +213,7 @@
198
  <adminhtml>
199
  <args>
200
  <modules>
201
- <adfab_emailcampaign before="Mage_Adminhtml">Adfab_EmailCampaign_Adminhtml</adfab_emailcampaign>
202
  </modules>
203
  </args>
204
  </adminhtml>
@@ -207,18 +222,19 @@
207
  <adminhtml>
208
  <translate>
209
  <modules>
210
- <Adfab_EmailCampaign>
211
  <files>
212
- <default>emailcampaign/Adfab_EmailCampaign.csv</default>
213
- <abandoned_cart>emailcampaign/Adfab_EmailCampaign_AbandonedCart.csv</abandoned_cart>
214
- <customer_birthday>emailcampaign/Adfab_EmailCampaign_CustomerBirthday.csv</customer_birthday>
215
- <inscription_anniversary>emailcampaign/Adfab_EmailCampaign_InscriptionAnniversary.csv</inscription_anniversary>
216
- <order_success>emailcampaign/Adfab_EmailCampaign_OrderSuccess.csv</order_success>
217
- <welcome_reminder>emailcampaign/Adfab_EmailCampaign_WelcomeReminder.csv</welcome_reminder>
218
- <wishlist_reminder>emailcampaign/Adfab_EmailCampaign_WishlistReminder.csv</wishlist_reminder>
219
- <wishlist_stock_alert>emailcampaign/Adfab_EmailCampaign_WishlistStockAlert.csv</wishlist_stock_alert>
 
220
  </files>
221
- </Adfab_EmailCampaign>
222
  </modules>
223
  </translate>
224
  <layout>
@@ -282,7 +298,7 @@
282
  <phpunit>
283
  <suite>
284
  <modules>
285
- <Adfab_EmailCampaign />
286
  </modules>
287
  </suite>
288
  </phpunit>
13
  * DISCLAIMER
14
  *
15
  * Do not edit or add to this file if you wish to upgrade
16
+ * the Adfab Emailcampaign module to newer versions in the future.
17
+ * If you wish to customize the Adfab Emailcampaign module for your needs
18
  * please refer to http://www.magentocommerce.com for more information.
19
  *
20
  * @category Adfab
21
+ * @package Adfab_Emailcampaign
22
  * @copyright Copyright (C) 2014
23
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
24
  */
25
  -->
26
  <config>
27
  <modules>
28
+ <Adfab_Emailcampaign>
29
+ <version>1.2.1</version>
30
+ </Adfab_Emailcampaign>
31
  </modules>
32
  <global>
33
  <helpers>
34
  <adfab_emailcampaign>
35
+ <class>Adfab_Emailcampaign_Helper</class>
36
  </adfab_emailcampaign>
37
  </helpers>
38
  <blocks>
39
  <adfab_emailcampaign>
40
+ <class>Adfab_Emailcampaign_Block</class>
41
  </adfab_emailcampaign>
42
  </blocks>
43
  <resources>
44
  <adfab_emailcampaign_setup>
45
  <setup>
46
+ <module>Adfab_Emailcampaign</module>
47
  <connection>core_setup</connection>
48
  </setup>
49
  </adfab_emailcampaign_setup>
50
  </resources>
51
  <models>
52
  <adfab_emailcampaign>
53
+ <class>Adfab_Emailcampaign_Model</class>
54
  <resourceModel>adfab_emailcampaign_resource</resourceModel>
55
  </adfab_emailcampaign>
56
  <adfab_emailcampaign_resource>
57
+ <class>Adfab_Emailcampaign_Model_Resource</class>
58
  <entities>
59
  <campaign>
60
  <table>emailcampaign_campaign</table>
129
  </form>
130
  </forms>
131
  </emailcampaign_inscriptionanniversary>
132
+ <emailcampaign_nursing>
133
+ <name>Nursing</name>
134
+ <class>adfab_emailcampaign/campaign_nursing</class>
135
+ <type>cron</type>
136
+ <forms>
137
+ <form>
138
+ <class>adfab_emailcampaign/adminhtml_campaign_forms_nursing</class>
139
+ </form>
140
+ </forms>
141
+ </emailcampaign_nursing>
142
  <!--emailcampaign_ordersuccess>
143
  <name>Order Success</name>
144
  <class>adfab_emailcampaign/campaign_orderSuccess</class>
185
  <file>emailcampaign/inscription_anniversary.html</file>
186
  <type>html</type>
187
  </emailcampaign_inscriptionanniversary_email_template>
188
+ <emailcampaign_nursing_email_template translate="label" module="adfab_emailcampaign">
189
+ <label>Nursing</label>
190
+ <file>emailcampaign/nursing.html</file>
191
+ <type>html</type>
192
+ </emailcampaign_nursing_email_template>
193
  <!--emailcampaign_ordersuccess_email_template translate="label" module="adfab_emailcampaign">
194
  <label>Order success</label>
195
  <file>emailcampaign/order_success.html</file>
213
  <adminhtml>
214
  <args>
215
  <modules>
216
+ <adfab_emailcampaign before="Mage_Adminhtml">Adfab_Emailcampaign_Adminhtml</adfab_emailcampaign>
217
  </modules>
218
  </args>
219
  </adminhtml>
222
  <adminhtml>
223
  <translate>
224
  <modules>
225
+ <Adfab_Emailcampaign>
226
  <files>
227
+ <default>emailcampaign/Adfab_Emailcampaign.csv</default>
228
+ <abandoned_cart>emailcampaign/Adfab_Emailcampaign_AbandonedCart.csv</abandoned_cart>
229
+ <customer_birthday>emailcampaign/Adfab_Emailcampaign_CustomerBirthday.csv</customer_birthday>
230
+ <inscription_anniversary>emailcampaign/Adfab_Emailcampaign_InscriptionAnniversary.csv</inscription_anniversary>
231
+ <order_success>emailcampaign/Adfab_Emailcampaign_OrderSuccess.csv</order_success>
232
+ <welcome_reminder>emailcampaign/Adfab_Emailcampaign_WelcomeReminder.csv</welcome_reminder>
233
+ <wishlist_reminder>emailcampaign/Adfab_Emailcampaign_WishlistReminder.csv</wishlist_reminder>
234
+ <wishlist_stock_alert>emailcampaign/Adfab_Emailcampaign_WishlistStockAlert.csv</wishlist_stock_alert>
235
+ <nursing>emailcampaign/Adfab_Emailcampaign_Nursing.csv</nursing>
236
  </files>
237
+ </Adfab_Emailcampaign>
238
  </modules>
239
  </translate>
240
  <layout>
298
  <phpunit>
299
  <suite>
300
  <modules>
301
+ <Adfab_Emailcampaign />
302
  </modules>
303
  </suite>
304
  </phpunit>
app/code/community/Adfab/Emailcampaign/etc/system.xml CHANGED
@@ -13,12 +13,12 @@
13
  * DISCLAIMER
14
  *
15
  * Do not edit or add to this file if you wish to upgrade
16
- * the Adfab EmailCampaign module to newer versions in the future.
17
- * If you wish to customize the Adfab EmailCampaign module for your needs
18
  * please refer to http://www.magentocommerce.com for more information.
19
  *
20
  * @category Adfab
21
- * @package Adfab_EmailCampaign
22
  * @copyright Copyright (C) 2014
23
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
24
  */
13
  * DISCLAIMER
14
  *
15
  * Do not edit or add to this file if you wish to upgrade
16
+ * the Adfab Emailcampaign module to newer versions in the future.
17
+ * If you wish to customize the Adfab Emailcampaign module for your needs
18
  * please refer to http://www.magentocommerce.com for more information.
19
  *
20
  * @category Adfab
21
+ * @package Adfab_Emailcampaign
22
  * @copyright Copyright (C) 2014
23
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
24
  */
app/code/community/Adfab/Emailcampaign/sql/adfab_emailcampaign_setup/mysql4-install-0.1.0.php CHANGED
@@ -14,12 +14,12 @@
14
  * DISCLAIMER
15
  *
16
  * Do not edit or add to this file if you wish to upgrade
17
- * the Adfab EmailCampaign module to newer versions in the future.
18
- * If you wish to customize the Adfab EmailCampaign module for your needs
19
  * please refer to http://www.magentocommerce.com for more information.
20
  *
21
  * @category Adfab
22
- * @package Adfab_EmailCampaign
23
  * @copyright Copyright (C) 2014 Adfab (http://www.adfab.fr/)
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
14
  * DISCLAIMER
15
  *
16
  * Do not edit or add to this file if you wish to upgrade
17
+ * the Adfab Emailcampaign module to newer versions in the future.
18
+ * If you wish to customize the Adfab Emailcampaign module for your needs
19
  * please refer to http://www.magentocommerce.com for more information.
20
  *
21
  * @category Adfab
22
+ * @package Adfab_Emailcampaign
23
  * @copyright Copyright (C) 2014 Adfab (http://www.adfab.fr/)
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
app/code/community/Adfab/Emailcampaign/sql/adfab_emailcampaign_setup/mysql4-upgrade-0.1.0-0.1.1.php CHANGED
@@ -14,12 +14,12 @@
14
  * DISCLAIMER
15
  *
16
  * Do not edit or add to this file if you wish to upgrade
17
- * the Adfab EmailCampaign module to newer versions in the future.
18
- * If you wish to customize the Adfab EmailCampaign module for your needs
19
  * please refer to http://www.magentocommerce.com for more information.
20
  *
21
  * @category Adfab
22
- * @package Adfab_EmailCampaign
23
  * @copyright Copyright (C) 2014 Adfab (http://www.adfab.fr/)
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
14
  * DISCLAIMER
15
  *
16
  * Do not edit or add to this file if you wish to upgrade
17
+ * the Adfab Emailcampaign module to newer versions in the future.
18
+ * If you wish to customize the Adfab Emailcampaign module for your needs
19
  * please refer to http://www.magentocommerce.com for more information.
20
  *
21
  * @category Adfab
22
+ * @package Adfab_Emailcampaign
23
  * @copyright Copyright (C) 2014 Adfab (http://www.adfab.fr/)
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
app/code/community/Adfab/Emailcampaign/sql/adfab_emailcampaign_setup/mysql4-upgrade-0.1.1-0.1.2.php CHANGED
@@ -14,12 +14,12 @@
14
  * DISCLAIMER
15
  *
16
  * Do not edit or add to this file if you wish to upgrade
17
- * the Adfab EmailCampaign module to newer versions in the future.
18
- * If you wish to customize the Adfab EmailCampaign module for your needs
19
  * please refer to http://www.magentocommerce.com for more information.
20
  *
21
  * @category Adfab
22
- * @package Adfab_EmailCampaign
23
  * @copyright Copyright (C) 2014 Adfab (http://www.adfab.fr/)
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
14
  * DISCLAIMER
15
  *
16
  * Do not edit or add to this file if you wish to upgrade
17
+ * the Adfab Emailcampaign module to newer versions in the future.
18
+ * If you wish to customize the Adfab Emailcampaign module for your needs
19
  * please refer to http://www.magentocommerce.com for more information.
20
  *
21
  * @category Adfab
22
+ * @package Adfab_Emailcampaign
23
  * @copyright Copyright (C) 2014 Adfab (http://www.adfab.fr/)
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
app/code/community/Adfab/Emailcampaign/sql/adfab_emailcampaign_setup/mysql4-upgrade-0.1.2-0.1.3.php CHANGED
@@ -14,12 +14,12 @@
14
  * DISCLAIMER
15
  *
16
  * Do not edit or add to this file if you wish to upgrade
17
- * the Adfab EmailCampaign module to newer versions in the future.
18
- * If you wish to customize the Adfab EmailCampaign module for your needs
19
  * please refer to http://www.magentocommerce.com for more information.
20
  *
21
  * @category Adfab
22
- * @package Adfab_EmailCampaign
23
  * @copyright Copyright (C) 2014 Adfab (http://www.adfab.fr/)
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
14
  * DISCLAIMER
15
  *
16
  * Do not edit or add to this file if you wish to upgrade
17
+ * the Adfab Emailcampaign module to newer versions in the future.
18
+ * If you wish to customize the Adfab Emailcampaign module for your needs
19
  * please refer to http://www.magentocommerce.com for more information.
20
  *
21
  * @category Adfab
22
+ * @package Adfab_Emailcampaign
23
  * @copyright Copyright (C) 2014 Adfab (http://www.adfab.fr/)
24
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
app/code/community/Adfab/Emailcampaign/sql/adfab_emailcampaign_setup/mysql4-upgrade-0.1.3-1.1.4.php ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Adfab extension for Magento
4
+ *
5
+ * Long description of this file (if any...)
6
+ *
7
+ * NOTICE OF LICENSE
8
+ *
9
+ * This source file is subject to the Open Software License (OSL 3.0)
10
+ * that is bundled with this package in the file LICENSE.txt.
11
+ * It is also available through the world-wide-web at this URL:
12
+ * http://opensource.org/licenses/osl-3.0.php
13
+ *
14
+ * DISCLAIMER
15
+ *
16
+ * Do not edit or add to this file if you wish to upgrade
17
+ * the Adfab EmailCampaign module to newer versions in the future.
18
+ * If you wish to customize the Adfab EmailCampaign module for your needs
19
+ * please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category Adfab
22
+ * @package Adfab_EmailCampaign
23
+ * @copyright Copyright (C) 2014 Adfab (http://www.adfab.fr/)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+
27
+ /**
28
+ * @var $this Mage_Core_Model_Resource_Setup
29
+ */
30
+
31
+ $installer = $this;
32
+ $installer->startSetup();
33
+ try {
34
+ $installer->getConnection()->modifyColumn(
35
+ $installer->getTable('adfab_emailcampaign/campaign'),
36
+ 'template_id',
37
+ 'varchar (64) NULL DEFAULT NULL'
38
+ );
39
+ } catch (Exception $e) {
40
+ Mage::logException($e);
41
+ }
42
+ $installer->endSetup();
app/design/adminhtml/default/default/layout/emailcampaign.xml CHANGED
@@ -28,4 +28,10 @@
28
  </reference>
29
  </default>
30
 
 
 
 
 
 
 
31
  </layout>
28
  </reference>
29
  </default>
30
 
31
+ <campaignPreview>
32
+ <block type="core/template" name="root" output="toHtml" template="system/email/template/preview.phtml">
33
+ <block type="adfab_emailcampaign/adminhtml_system_email_template_preview" name="content" as="content"></block>
34
+ </block>
35
+ </campaignPreview>
36
+
37
  </layout>
app/etc/modules/Adfab_Emailcampaign.xml CHANGED
@@ -13,21 +13,21 @@
13
  * DISCLAIMER
14
  *
15
  * Do not edit or add to this file if you wish to upgrade
16
- * the Adfab EmailCampaign module to newer versions in the future.
17
- * If you wish to customize the Adfab EmailCampaign module for your needs
18
  * please refer to http://www.magentocommerce.com for more information.
19
  *
20
  * @category Adfab
21
- * @package Adfab_EmailCampaign
22
  * @copyright Copyright (C) 2014
23
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
24
  */
25
- -->
26
  <config>
27
  <modules>
28
- <Adfab_EmailCampaign>
29
  <active>true</active>
30
  <codePool>community</codePool>
31
- </Adfab_EmailCampaign>
32
  </modules>
33
  </config>
13
  * DISCLAIMER
14
  *
15
  * Do not edit or add to this file if you wish to upgrade
16
+ * the Adfab Emailcampaign module to newer versions in the future.
17
+ * If you wish to customize the Adfab Emailcampaign module for your needs
18
  * please refer to http://www.magentocommerce.com for more information.
19
  *
20
  * @category Adfab
21
+ * @package Adfab_Emailcampaign
22
  * @copyright Copyright (C) 2014
23
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
24
  */
25
+ -->
26
  <config>
27
  <modules>
28
+ <Adfab_Emailcampaign>
29
  <active>true</active>
30
  <codePool>community</codePool>
31
+ </Adfab_Emailcampaign>
32
  </modules>
33
  </config>
app/locale/en_US/emailcampaign/Adfab_EmailCampaign_CustomerBirthday.csv DELETED
@@ -1 +0,0 @@
1
- "notice_customer_birthday","A mail is sent to the customers who have a birthday"
 
app/locale/en_US/emailcampaign/Adfab_EmailCampaign_WishlistStockAlert.csv DELETED
@@ -1 +0,0 @@
1
- "notice_wishlist_stock_alert","A mail is sent to people whit wishlist containing products almost out of stock"
 
app/locale/en_US/emailcampaign/{Adfab_EmailCampaign.csv → Adfab_Emailcampaign.csv} RENAMED
File without changes
app/locale/en_US/emailcampaign/{Adfab_EmailCampaign_AbandonedCart.csv → Adfab_Emailcampaign_AbandonedCart.csv} RENAMED
File without changes
app/locale/en_US/emailcampaign/Adfab_Emailcampaign_CustomerBirthday.csv ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ "notice_customer_birthday","A mail is sent to the customers who have a birthday"
2
+ "warning_customer_birthday_cart_opt","The birthday date is currently optional in the client configuration"
3
+ "warning_customer_birthday_cart_none","The birthday date is currently disabled in the client configuration"
app/locale/en_US/emailcampaign/{Adfab_EmailCampaign_InscriptionAnniversary.csv → Adfab_Emailcampaign_InscriptionAnniversary.csv} RENAMED
File without changes
app/locale/en_US/emailcampaign/Adfab_Emailcampaign_Nursing.csv ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ "Send mail after how many days ?","Send mail after how many days ?"
2
+ "Re send mail to customers at next planification if they already received it ?","Re send mail to customers at next planification if they already received it ?"
3
+ "notice_nursing","Emailing automatically sent to the customer who has not purchased for x days to remind them of the benefits of the site"
app/locale/en_US/emailcampaign/{Adfab_EmailCampaign_OrderSuccess.csv → Adfab_Emailcampaign_OrderSuccess.csv} RENAMED
File without changes
app/locale/en_US/emailcampaign/{Adfab_EmailCampaign_WelcomeReminder.csv → Adfab_Emailcampaign_WelcomeReminder.csv} RENAMED
File without changes
app/locale/en_US/emailcampaign/{Adfab_EmailCampaign_WishlistReminder.csv → Adfab_Emailcampaign_WishlistReminder.csv} RENAMED
File without changes
app/locale/en_US/emailcampaign/Adfab_Emailcampaign_WishlistStockAlert.csv ADDED
@@ -0,0 +1,2 @@
 
 
1
+ "notice_wishlist_stock_alert","A mail is sent to people whit wishlist containing products almost out of stock"
2
+ "Interval between a customer cannot receive a second stock alert email","Interval between a customer cannot receive a second stock alert email"
app/locale/en_US/template/email/emailcampaign/nursing.html ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!--@subject You're short in time ! @-->
2
+ <!--@vars
3
+ {"store url=\"\"":"Store Url",
4
+ "var logo_url":"Email Logo Image Url",
5
+ "htmlescape var=$customer.name":"Customer Name",
6
+ "store url=\"customer/account/\"":"Customer Account Url",
7
+ "var customer.email":"Customer Email"
8
+ }
9
+ @-->
10
+
11
+ <!--@styles
12
+ body,td { color:#2f2f2f; font:11px/1.35em Verdana, Arial, Helvetica, sans-serif; }
13
+ @-->
14
+
15
+ <body style="background:#F6F6F6; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:12px; margin:0; padding:0;">
16
+ <div style="background:#F6F6F6; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:12px; margin:0; padding:0;">
17
+ <table cellspacing="0" cellpadding="0" border="0" height="100%" width="100%">
18
+ <tr>
19
+ <td align="center" valign="top" style="padding:20px 0 20px 0">
20
+ <!-- [ header starts here] -->
21
+ <table bgcolor="FFFFFF" cellspacing="0" cellpadding="10" border="0" width="650" style="border:1px solid #E0E0E0;">
22
+ <tr>
23
+ <td valign="top">
24
+ <a href="{{store url=""}}"><img src="{{var logo_url}}" alt="{{var logo_alt}}" style="margin-bottom:10px;" border="0"/></a></td>
25
+ </tr>
26
+ <!-- [ middle starts here] -->
27
+ <tr>
28
+ <td valign="top">
29
+ <h1 style="font-size:22px; font-weight:normal; line-height:22px; margin:0 0 11px 0;"">Dear {{htmlescape var=$customer.name}},</h1>
30
+ <p style="font-size:12px; line-height:16px; margin:0 0 16px 0;">You have not purshased for {{htmlescape var=$send_after_days}}] please visit <a href="{{store url="/"}}" style="color:#1E7EC8;">homepage</a>.</p>
31
+ <p style="font-size:12px; line-height:16px; margin:0;">If you have any questions about your account or any other matter, please feel free to contact us at <a href="mailto:{{config path='trans_email/ident_support/email'}}" style="color:#1E7EC8;">{{config path='trans_email/ident_support/email'}}</a> or by phone at {{config path='general/store_information/phone'}}.</p>
32
+ </td>
33
+ </tr>
34
+ <tr>
35
+ <td bgcolor="#EAEAEA" align="center" style="background:#EAEAEA; text-align:center;"><center><p style="font-size:12px; margin:0;">Thank you again, <strong>{{var store.getFrontendName()}}</strong></p></center></td>
36
+ </tr>
37
+ </table>
38
+ </td>
39
+ </tr>
40
+ </table>
41
+ </div>
42
+ </body>
app/locale/fr_FR/emailcampaign/Adfab_EmailCampaign_CustomerBirthday.csv DELETED
@@ -1 +0,0 @@
1
- "notice_customer_birthday","Cette campagne permet d'envoyer des mails planifiés chaque jour aux clients fêtant leur anniversaire"
 
app/locale/fr_FR/emailcampaign/Adfab_EmailCampaign_WishlistStockAlert.csv DELETED
@@ -1 +0,0 @@
1
- "notice_wishlist_stock_alert","Cette campagne permet d'envoyer des mails de relance aux clients ayant un produit dans leur wishlist dont la quantité est en dessous d'un certain seuil"
 
app/locale/fr_FR/emailcampaign/{Adfab_EmailCampaign.csv → Adfab_Emailcampaign.csv} RENAMED
File without changes
app/locale/fr_FR/emailcampaign/{Adfab_EmailCampaign_AbandonedCart.csv → Adfab_Emailcampaign_AbandonedCart.csv} RENAMED
File without changes
app/locale/fr_FR/emailcampaign/Adfab_Emailcampaign_CustomerBirthday.csv ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ "notice_customer_birthday","Cette campagne permet d'envoyer des mails planifiés chaque jour aux clients fêtant leur anniversaire"
2
+ "warning_customer_birthday_cart_opt","La date d'anniversaire est actuellement en optionel dans la configuration client"
3
+ "warning_customer_birthday_cart_none","La date d'anniversaire n'est actuellement pas activée dans la configuration client"
app/locale/fr_FR/emailcampaign/{Adfab_EmailCampaign_InscriptionAnniversary.csv → Adfab_Emailcampaign_InscriptionAnniversary.csv} RENAMED
File without changes
app/locale/fr_FR/emailcampaign/Adfab_Emailcampaign_Nursing.csv ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ "Send mail after how many days ?","Envoyer un mail après combien de jours ?"
2
+ "Re send mail to customers at next planification if they already received it ?","Renvoyer un mail au client l'ayant déjà reçus auparavant ?"
3
+ "notice_nursing","Emailing envoyé automatiquement au client n'ayant pas acheté depuis x jours pour leur rappeler les avantages du site"
app/locale/fr_FR/emailcampaign/{Adfab_EmailCampaign_OrderSuccess.csv → Adfab_Emailcampaign_OrderSuccess.csv} RENAMED
File without changes
app/locale/fr_FR/emailcampaign/{Adfab_EmailCampaign_WelcomeReminder.csv → Adfab_Emailcampaign_WelcomeReminder.csv} RENAMED
File without changes
app/locale/fr_FR/emailcampaign/{Adfab_EmailCampaign_WishlistReminder.csv → Adfab_Emailcampaign_WishlistReminder.csv} RENAMED
File without changes
app/locale/fr_FR/emailcampaign/Adfab_Emailcampaign_WishlistStockAlert.csv ADDED
@@ -0,0 +1,2 @@
 
 
1
+ "notice_wishlist_stock_alert","Cette campagne permet d'envoyer des mails de relance aux clients ayant un produit dans leur wishlist dont la quantité est en dessous d'un certain seuil"
2
+ "Interval between a customer cannot receive a second stock alert email","Interval pendant lequel un client ne peut recevoir un second mail d'alerte de stock"
app/locale/fr_FR/template/email/emailcampaign/nursing.html ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!--@subject You're short in time ! @-->
2
+ <!--@vars
3
+ {"store url=\"\"":"Store Url",
4
+ "var logo_url":"Email Logo Image Url",
5
+ "htmlescape var=$customer.name":"Customer Name",
6
+ "store url=\"customer/account/\"":"Customer Account Url",
7
+ "var customer.email":"Customer Email"
8
+ }
9
+ @-->
10
+
11
+ <!--@styles
12
+ body,td { color:#2f2f2f; font:11px/1.35em Verdana, Arial, Helvetica, sans-serif; }
13
+ @-->
14
+
15
+ <body style="background:#F6F6F6; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:12px; margin:0; padding:0;">
16
+ <div style="background:#F6F6F6; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:12px; margin:0; padding:0;">
17
+ <table cellspacing="0" cellpadding="0" border="0" height="100%" width="100%">
18
+ <tr>
19
+ <td align="center" valign="top" style="padding:20px 0 20px 0">
20
+ <!-- [ header starts here] -->
21
+ <table bgcolor="FFFFFF" cellspacing="0" cellpadding="10" border="0" width="650" style="border:1px solid #E0E0E0;">
22
+ <tr>
23
+ <td valign="top">
24
+ <a href="{{store url=""}}"><img src="{{var logo_url}}" alt="{{var logo_alt}}" style="margin-bottom:10px;" border="0"/></a></td>
25
+ </tr>
26
+ <!-- [ middle starts here] -->
27
+ <tr>
28
+ <td valign="top">
29
+ <h1 style="font-size:22px; font-weight:normal; line-height:22px; margin:0 0 11px 0;"">Cher {{htmlescape var=$customer.name}},</h1>
30
+ <p style="font-size:12px; line-height:16px; margin:0 0 16px 0;">Vous n'avez pas commandé sur <a href="{{store url="/"}}" style="color:#1E7EC8;">notre site</a> depuis {{htmlescape var=$send_after_days}}].</p>
31
+ <p style="font-size:12px; line-height:16px; margin:0;">Pour toute question au sujet de votre compte, contactez par mail <a href="mailto:{{config path='trans_email/ident_support/email'}}" style="color:#1E7EC8;">{{config path='trans_email/ident_support/email'}}</a> ou par téléphone au {{config path='general/store_information/phone'}}.</p>
32
+ </td>
33
+ </tr>
34
+ <tr>
35
+ <td bgcolor="#EAEAEA" align="center" style="background:#EAEAEA; text-align:center;"><center><p style="font-size:12px; margin:0;">Thank you again, <strong>{{var store.getFrontendName()}}</strong></p></center></td>
36
+ </tr>
37
+ </table>
38
+ </td>
39
+ </tr>
40
+ </table>
41
+ </div>
42
+ </body>
package.xml CHANGED
@@ -1,7 +1,7 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Adfab_Emailcampaign</name>
4
- <version>1.2.0</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/MIT">MIT</license>
7
  <channel>community</channel>
@@ -30,8 +30,8 @@ We've decided to offer you this incredibly efficient tool ! &#xD;
30
  &lt;/ul&gt;</notes>
31
  <authors><author><name>Adfab</name><user>Connect</user><email>dev@adfab.fr</email></author><author><name>Arnaud</name><user>Hours</user><email>arnaud.hours@adfab.fr</email></author><author><name>Gr&#xE9;gory</name><user>Besson</user><email>gregory.besson@adfab.fr</email></author><author><name>Fabien</name><user>Logarinho</user><email>fabien.logarinho@adfab.fr</email></author></authors>
32
  <date>2014-09-01</date>
33
- <time>15:37:51</time>
34
- <contents><target name="magecommunity"><dir name="Adfab"><dir name="Emailcampaign"><dir name="Block"><dir name="Adminhtml"><dir name="Campaign"><dir name="Edit"><file name="Form.php" hash="612137b6569b7ef1268b088227182d7e"/><dir name="Tab"><file name="Cron.php" hash="1f86db233bbfaf3b71a7529e07515642"/><file name="Form.php" hash="34dfc18455cf49eca1fb613734ad7287"/></dir><file name="Tabs.php" hash="91718633c37ca05ee580e7613e451a28"/></dir><file name="Edit.php" hash="8eba049dba2ffd761052d46c9af81bb8"/><dir name="Forms"><file name="AbandonedCart.php" hash="d0a22decfe94ff3f9744e4009b95ffda"/><file name="Abstract.php" hash="db83c1e9fb333d04efff09ce0455b62d"/><file name="CustomerBirthday.php" hash="ecd919c9c5cc7a4981b7b1dd841c4739"/><file name="WelcomeReminder.php" hash="794e731115f2b3d0b0fc4ad41a5c5849"/><file name="WishlistReminder.php" hash="b3d68c02095f0405b79ef968f46f71dc"/><file name="WishlistStockAlert.php" hash="df8a53c6911c00f8f7519decbf40b2ca"/></dir><file name="Grid.php" hash="a1c97257e6c6f31a7ca8409715a3fc46"/></dir><file name="Campaign.php" hash="49179a58c32a61bafea90ffa1499d37f"/><dir name="Form"><dir name="Edit"><dir name="Renderer"><file name="Cron.php" hash="6b58b6091d5de4290b3804ffe1175cf7"/></dir></dir></dir><dir name="Notification"><file name="Toolbar.php" hash="4d8d0581bb197db50fab9bbabcd06648"/></dir><dir name="Recipient"><file name="Grid.php" hash="46128fb3d994a24c83308c1859196dc8"/></dir><file name="Recipient.php" hash="c3d039c1e3156667256d42f245ea1696"/></dir></dir><dir name="Helper"><file name="Connector.php" hash="fc1d9c504573a91d842f8b106977d974"/><file name="Data.php" hash="190f8136744bb0dceae0c1604c5e2591"/></dir><dir name="Model"><dir name="Adminhtml"><file name="Notification.php" hash="85458269aa733f1466a4a0a2a03e30a6"/><file name="Observer.php" hash="d16bd2a407612392e368fe98bf255d74"/></dir><dir name="Campaign"><file name="AbandonedCart.php" hash="e735277db4061e1d642d823bed87d3df"/><file name="Abstract.php" hash="b0baaf6b0f1ed3f4117fd506a6707f6a"/><file name="Cron.php" hash="213d55f50b946856edb3686d387f81fb"/><file name="CustomerBirthday.php" hash="7fae52cb937c93a01c6761c7f0f3b5f7"/><file name="InscriptionAnniversary.php" hash="4bbeeba8d89f3dd0a52e3758a9a121b8"/><file name="Observer.php" hash="04088bb39028d5535203a9d949d3d65c"/><file name="OrderSuccess.php" hash="f8730dd0575da11ce95a5a219d170f1b"/><dir name="State"><file name="Abstract.php" hash="1b5286e709a3eeb8fc1aeab87f4e4bcb"/><file name="Production.php" hash="ab19f0aa6ef4efe3d4b08e614e532caa"/><file name="Test.php" hash="16f8e8b2a57cc90de28549a3bb007174"/><file name="TestAllEmail.php" hash="d6e111e85839c8c763b47f48d829ddee"/></dir><file name="WelcomeReminder.php" hash="ca313c4476e9e0448b340cda70a1a769"/><file name="WishlistReminder.php" hash="30ae842514051d8a48c6c2f802bb4cc8"/><file name="WishlistStockAlert.php" hash="01c50b3e19ea22bccefcab07bad45774"/></dir><file name="Campaign.php" hash="699133aa1b9ca3f3b12581fdb448d22d"/><dir name="Connector"><file name="Abstract.php" hash="b85cb4571a8c51567f5a4d1fb189a8f1"/><file name="Magento.php" hash="5d74ea6dcb2eb3283a8c928b599e3ba5"/><file name="Void.php" hash="f226a1a0e0274b02455425005307aa2c"/></dir><dir name="Cron"><file name="Observer.php" hash="e9393acd17e97c5ac350fc791998198a"/></dir><file name="Cron.php" hash="e59ee1f2c37cefabc6e1a6b44b35a75f"/><file name="Flag.php" hash="3e8b8d59aadf13875e1ceca57d6499f5"/><file name="Observer.php" hash="032683e41d88e2cb286fa7130618eede"/><dir name="Resource"><dir name="Adminhtml"><dir name="Notification"><file name="Collection.php" hash="0fa4dfe584877fd19f4e3ee35af472e5"/></dir><file name="Notification.php" hash="f12c625a753cfd8d66947b14cd636d49"/></dir><dir name="Campaign"><file name="Collection.php" hash="0a13c6658ef90650bcae7fa6c2c21b77"/></dir><file name="Campaign.php" hash="16f9b5cd5bd52a84a62f5f64230ad2e6"/></dir><dir name="Source"><file name="Campaign.php" hash="6f0310144a7569867d6eb69ebefeadb2"/><file name="Connector.php" hash="51b089c2a5ae7ab20cba90c3cbe87711"/><file name="Mode.php" hash="3df79dcf428b0adc2f9aa9ccf454c8e4"/><file name="Template.php" hash="0e0d290bd3dc86cb0de26eb45974e3db"/></dir><file name="Status.php" hash="d642241ec120a33fc659dfa9ad63958b"/></dir><dir name="Test"><dir name="Model"><dir name="Campaign"><dir name="State"><file name="Config.php" hash="68ddc78ece7cdf85ffb991d680fd0928"/></dir></dir><file name="Campaign.php" hash="2ea4a6842f9e8c236a86e9c9953b5c68"/><file name="Config.php" hash="1e12c1420a79e506d5aeb443f044bea1"/></dir></dir><dir name="controllers"><dir name="Adminhtml"><file name="CampaignController.php" hash="063396dbe45dc33789b8b476842c8d75"/></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="576a1848898c0d9a9ae0e5db5c378eec"/><file name="config.xml" hash="474cbb4ea215fdc38f75b217127c7692"/><file name="system.xml" hash="1c821f605aa19529aaecb05056e37724"/></dir><dir name="sql"><dir name="adfab_emailcampaign_setup"><file name="mysql4-install-0.1.0.php" hash="1f23e7c324c00a54c0648a61816b7083"/><file name="mysql4-upgrade-0.1.0-0.1.1.php" hash="9456ef9cd957797fc928c8435a3e6984"/><file name="mysql4-upgrade-0.1.1-0.1.2.php" hash="6f08197931c6d169bfc56917ed4b4963"/><file name="mysql4-upgrade-0.1.2-0.1.3.php" hash="e1c41c37866f8d80312d3ef696261236"/></dir></dir></dir></dir></target><target name="mageskin"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="css"><file name="jquery-cron.css" hash="d2c80b786c31d1f149bdc23efa4f8dc9"/></dir><dir name="js"><file name="emailcampaign.js" hash="d3ad69e74f199c4c01b15047252f9176"/><file name="promoboost.js" hash="3ed5d51b01c30b28d6b308c523c170db"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="emailcampaign.xml" hash="2f38c14dfe40d0f8c3ab00ed4f10469b"/></dir><dir name="template"><dir name="emailcampaign"><dir name="notification"><file name="toolbar.phtml" hash="d34f7ad086c70032c9fb1486d9fb0ed1"/><file name="window.phtml" hash="c8495623259d7142ffdc0a2e0990efe1"/></dir><dir name="system"><dir name="email"><dir name="template"><file name="edit.phtml" hash="8a631cc2f30e751038a47459dcd4c2c2"/></dir></dir></dir></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Adfab_Emailcampaign.xml" hash="a1a10d83a150fd4c170493ddf6ec719e"/></dir></target><target name="magelocale"><dir name="en_US"><dir name="emailcampaign"><file name="Adfab_EmailCampaign.csv" hash="175ed476c2aa21abc528abfedc66d938"/><file name="Adfab_EmailCampaign_AbandonedCart.csv" hash="ee4435a37b05062c23c088c137c32cc0"/><file name="Adfab_EmailCampaign_CustomerBirthday.csv" hash="54c7d1860ac81be27c3b007db25d794d"/><file name="Adfab_EmailCampaign_InscriptionAnniversary.csv" hash="befaa0fa1f6fce97d8571407e94f7d9f"/><file name="Adfab_EmailCampaign_OrderSuccess.csv" hash="e3ff726605dd139054ffe6e7f91ab1d8"/><file name="Adfab_EmailCampaign_WelcomeReminder.csv" hash="8edb549e7b5cf31718361d6d1885340e"/><file name="Adfab_EmailCampaign_WishlistReminder.csv" hash="bd615da4bfcf92fe312bcb366d5a3baf"/><file name="Adfab_EmailCampaign_WishlistStockAlert.csv" hash="00ecd662351382621701eb876e0aa504"/></dir><dir name="template"><dir name="email"><dir name="emailcampaign"><file name="abandoned_cart.html" hash="e1da3bd3c8898e66fa86ed2c7f25f0a1"/><file name="customer_birthday.html" hash="1c8700144a93f2f0f51f65b7c2b9cea5"/><file name="inscription_anniversary.html" hash="1063b67ad73a35e761b2152ea2b227ac"/><file name="order_success.html" hash="27f50eb0f7dc590b1a775aed6232f24c"/><file name="welcome_reminder.html" hash="a7efe6d290216c92cfbb488de88408de"/><file name="wishlist_reminder.html" hash="d3ea8b42d506b81e88e96e24cf396ad4"/><file name="wishlist_stock_alert.html" hash="fe75dc922b483433db7d646c973a2432"/></dir></dir></dir></dir><dir name="fr_FR"><dir name="emailcampaign"><file name="Adfab_EmailCampaign.csv" hash="424e0b8fe6deba48ffc624b72776030f"/><file name="Adfab_EmailCampaign_AbandonedCart.csv" hash="962c2f9b0b13302b5c910bd776a0e177"/><file name="Adfab_EmailCampaign_CustomerBirthday.csv" hash="de370aaffa47c3bd003f92163546b826"/><file name="Adfab_EmailCampaign_InscriptionAnniversary.csv" hash="32314f7b43a6431890c196f7ac0b9dea"/><file name="Adfab_EmailCampaign_OrderSuccess.csv" hash="6b1cd6e24298331c4a3e317e24695d1c"/><file name="Adfab_EmailCampaign_WelcomeReminder.csv" hash="de057c50c853f81ed0f2bc10a7565f6a"/><file name="Adfab_EmailCampaign_WishlistReminder.csv" hash="f4071c638993793d001d6902d1cbca44"/><file name="Adfab_EmailCampaign_WishlistStockAlert.csv" hash="0aa97b28c6e1dfbcfa9816a5bd4a5766"/></dir><dir name="template"><dir name="email"><dir name="emailcampaign"><file name="abandoned_cart.html" hash="9c07490d6d2c48e373c41e21bc5faf6b"/><file name="customer_birthday.html" hash="2c63c5a9d9551c7f5c09637d98725ccf"/><file name="inscription_anniversary.html" hash="d7742a3632fda1d2a7af02ada64316ee"/><file name="order_success.html" hash="27f50eb0f7dc590b1a775aed6232f24c"/><file name="welcome_reminder.html" hash="11878a468f48e52ab9b8bcdf1c7a80eb"/><file name="wishlist_reminder.html" hash="bdd9b11d9b453bca83fe2e7116b385f7"/><file name="wishlist_stock_alert.html" hash="67495578ab15182417fd9088daab4dd3"/></dir></dir></dir></dir></target><target name="mageweb"><dir name="js"><dir name="jquery"><file name="jquery.min.js" hash="19cc2d381510a7f54d17d4f363db76d2"/><file name="jquery-cron.min.js" hash="7102f517bb2ffb5d6d5f4d9f4ccb5a1e"/></dir></dir></target></contents>
35
  <compatible/>
36
  <dependencies><required><php><min>5.3.0</min><max>6.0.0</max></php></required></dependencies>
37
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Adfab_Emailcampaign</name>
4
+ <version>1.2.1</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/MIT">MIT</license>
7
  <channel>community</channel>
30
  &lt;/ul&gt;</notes>
31
  <authors><author><name>Adfab</name><user>Connect</user><email>dev@adfab.fr</email></author><author><name>Arnaud</name><user>Hours</user><email>arnaud.hours@adfab.fr</email></author><author><name>Gr&#xE9;gory</name><user>Besson</user><email>gregory.besson@adfab.fr</email></author><author><name>Fabien</name><user>Logarinho</user><email>fabien.logarinho@adfab.fr</email></author></authors>
32
  <date>2014-09-01</date>
33
+ <time>16:26:54</time>
34
+ <contents><target name="magecommunity"><dir name="Adfab"><dir name="Emailcampaign"><dir name="Block"><dir name="Adminhtml"><dir name="Campaign"><dir name="Edit"><file name="Form.php" hash="38d57e4be14d61760ea5ca9c2332c1cd"/><dir name="Tab"><file name="Cron.php" hash="ea1e1369ffa49f9769ea01c99a3f33d2"/><file name="Form.php" hash="82ede399adfdf869675c6ef58887ecd7"/></dir><file name="Tabs.php" hash="49c73b5c188788bc4555f90e6b9fc0b8"/></dir><file name="Edit.php" hash="0a295843e2249465087af280f06df179"/><dir name="Forms"><file name="AbandonedCart.php" hash="aeeb014d69eb474788e7d70a3ad91e66"/><file name="Abstract.php" hash="7a520a7c1e8518ca78d4762296a7a1ef"/><file name="CustomerBirthday.php" hash="d06856eb66ddc6f451502d9ca9edd054"/><file name="Nursing.php" hash="a601713fc6dcee213018fb953058ee90"/><file name="WelcomeReminder.php" hash="ec3bf8ad71709469e793dbc5dc50a904"/><file name="WishlistReminder.php" hash="e0d48c5ac2729755f05d458ce7a8ba6f"/><file name="WishlistStockAlert.php" hash="76ed4b5e0fef4dd3054778e4eab7956c"/></dir><file name="Grid.php" hash="f501eb5c2e9a73a39dde4aba31f65eb7"/></dir><file name="Campaign.php" hash="f04e05aeb7069c4dbca1de34a440b3f8"/><dir name="Form"><dir name="Edit"><dir name="Renderer"><file name="Cron.php" hash="66473bf095f32c7bb7c54c4283065d11"/></dir></dir></dir><dir name="Notification"><file name="Toolbar.php" hash="be40e4dba0ccd9b93e689dc7b210dd60"/></dir><dir name="Recipient"><file name="Grid.php" hash="e4e7fb3758f7e984373f0000d10025a7"/></dir><file name="Recipient.php" hash="62c555f70bae4588040cbd3e9d9c6f09"/><dir name="System"><dir name="Email"><dir name="Template"><file name="Preview.php" hash="daad77cd95f3fcff86b1043d2fd0a917"/></dir></dir></dir></dir></dir><dir name="Helper"><file name="Connector.php" hash="905978c328a28b488f93564f5a61e0d8"/><file name="Data.php" hash="0e2194d99e8210d7cebd7f4fd870f0eb"/></dir><dir name="Model"><dir name="Adminhtml"><file name="Notification.php" hash="74add7866eead70769ffc45ec20a716c"/><file name="Observer.php" hash="d16bd2a407612392e368fe98bf255d74"/></dir><dir name="Campaign"><file name="AbandonedCart.php" hash="f150d6796a831bdc0c1cc59f615a2e45"/><file name="Abstract.php" hash="46c5f101a34ad7a6478de5bac082f19a"/><file name="Cron.php" hash="e6ce7eb666f4004d6d5e6badf866fde9"/><file name="CustomerBirthday.php" hash="ca0a0815fb518b3aab54ff02652cb366"/><file name="InscriptionAnniversary.php" hash="9bd7b33e55fa334c2d1a66f974a825af"/><file name="Nursing.php" hash="4796a032bec4cc7193439412eb30ac02"/><file name="Observer.php" hash="fd7df54d5027794a406751b8603b1d0f"/><file name="OrderSuccess.php" hash="04e0fb677ff43fb3ddf3febe16a71214"/><dir name="State"><file name="Abstract.php" hash="1b3569e77742011692316fd3ba274299"/><file name="Production.php" hash="1d072e2bf7bc2991596c709f96793574"/><file name="Test.php" hash="655693f73bc87f50768ab6ae34a06667"/><file name="TestAllEmail.php" hash="8213f1424490c0a638294d9b7cf13fd6"/></dir><file name="WelcomeReminder.php" hash="6e17fe38a7ce85e6a69448235910eb5f"/><file name="WishlistReminder.php" hash="b3608c014115ec5f2f3d12b9d460875e"/><file name="WishlistStockAlert.php" hash="6edd1e5c31d8819a946441619f220034"/></dir><file name="Campaign.php" hash="fbef74c9482f7ffd25ae6814f1f47a49"/><dir name="Connector"><file name="Abstract.php" hash="e54d842728fe6693baf84b8e10e78886"/><file name="Magento.php" hash="d5f5f408ad4cb2a7a34e4f9ba2a404ab"/><file name="Void.php" hash="cd5279f607c424524149745f29923628"/></dir><dir name="Cron"><file name="Observer.php" hash="362eea820924b4d48f7881eb5632c9d6"/></dir><file name="Cron.php" hash="d9193bb51f8c10e6df333a8d49ccff22"/><file name="Flag.php" hash="45c1adafa319cd4c7ad6ae33f488f7a9"/><file name="Observer.php" hash="1e381c9c966b47c3d538ab1f0d68a5ff"/><dir name="Resource"><dir name="Adminhtml"><dir name="Notification"><file name="Collection.php" hash="3f67feeb81bc2af50473487c3f946c35"/></dir><file name="Notification.php" hash="fed59a2d370cc925ad4d96d8cdf6252f"/></dir><dir name="Campaign"><file name="Collection.php" hash="c099bd0d4f772cb9fb7264dfcc89f1a4"/></dir><file name="Campaign.php" hash="23d238af26c9e8541e261b74755e97df"/></dir><dir name="Source"><file name="Campaign.php" hash="ad5e32b9342dfa0f9b10cb8dd4ba0fba"/><file name="Connector.php" hash="3266cb74618deacb4e5de06b28aceeb7"/><file name="Mode.php" hash="c0908ca6704bea3915799e3d3b27a4f5"/><file name="Template.php" hash="b00741e9685d6dd4fb2422648b2802da"/></dir><file name="Status.php" hash="555097dde09b0cdb49a91af8deb7399a"/></dir><dir name="Test"><dir name="Model"><dir name="Campaign"><dir name="State"><file name="Config.php" hash="dd1651f1305e8ddbf0ff2012eaee693d"/></dir></dir><file name="Campaign.php" hash="ee494b41dc1cf8ea579ec5b02ab42539"/><file name="Config.php" hash="b45e5ea3d4b71559eeeb02bf16a1be95"/></dir></dir><dir name="controllers"><dir name="Adminhtml"><file name="CampaignController.php" hash="1a49ccd3f565f3e6e33f52830e28811f"/></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="17c682b2b7fb4913a4188b6d87a69c81"/><file name="config.xml" hash="5fec4bfe51d6e20aa814ebc61f9dd80d"/><file name="system.xml" hash="d63724f9a64b1850ef1f6310f124a975"/></dir><dir name="sql"><dir name="adfab_emailcampaign_setup"><file name="mysql4-install-0.1.0.php" hash="5ad95df2af791ec795e0e7a3c7d7bf5f"/><file name="mysql4-upgrade-0.1.0-0.1.1.php" hash="6e4cdae76f993ad980650c5e456d61f6"/><file name="mysql4-upgrade-0.1.1-0.1.2.php" hash="7c92fe8a203dc06db0cde68fe660936d"/><file name="mysql4-upgrade-0.1.2-0.1.3.php" hash="97d172952a7e88f2da9d1f730623e880"/><file name="mysql4-upgrade-0.1.3-1.1.4.php" hash="60ca085cfd3eb743bbfe5023072c3ce7"/></dir></dir></dir></dir></target><target name="mageskin"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="css"><file name="jquery-cron.css" hash="d2c80b786c31d1f149bdc23efa4f8dc9"/></dir><dir name="js"><file name="emailcampaign.js" hash="9503e0128221ddda88e3ed7a96c532ce"/><file name="promoboost.js" hash="3ed5d51b01c30b28d6b308c523c170db"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="emailcampaign.xml" hash="e33be069a902bbdb2f06db0bee3969f7"/></dir><dir name="template"><dir name="emailcampaign"><dir name="notification"><file name="toolbar.phtml" hash="d34f7ad086c70032c9fb1486d9fb0ed1"/><file name="window.phtml" hash="c8495623259d7142ffdc0a2e0990efe1"/></dir><dir name="system"><dir name="email"><dir name="template"><file name="edit.phtml" hash="8a631cc2f30e751038a47459dcd4c2c2"/></dir></dir></dir></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Adfab_Emailcampaign.xml" hash="de9adb4d334e9b28430f039c236e90cb"/></dir></target><target name="magelocale"><dir name="en_US"><dir name="emailcampaign"><file name="Adfab_Emailcampaign.csv" hash="175ed476c2aa21abc528abfedc66d938"/><file name="Adfab_Emailcampaign_AbandonedCart.csv" hash="ee4435a37b05062c23c088c137c32cc0"/><file name="Adfab_Emailcampaign_CustomerBirthday.csv" hash="f29be5ecbcdffb5eb7cc407baafba821"/><file name="Adfab_Emailcampaign_InscriptionAnniversary.csv" hash="befaa0fa1f6fce97d8571407e94f7d9f"/><file name="Adfab_Emailcampaign_Nursing.csv" hash="392113e808ea2bd8cdbbec3a2a2505a5"/><file name="Adfab_Emailcampaign_OrderSuccess.csv" hash="e3ff726605dd139054ffe6e7f91ab1d8"/><file name="Adfab_Emailcampaign_WelcomeReminder.csv" hash="8edb549e7b5cf31718361d6d1885340e"/><file name="Adfab_Emailcampaign_WishlistReminder.csv" hash="bd615da4bfcf92fe312bcb366d5a3baf"/><file name="Adfab_Emailcampaign_WishlistStockAlert.csv" hash="8dc3196198e9cc0b9e10d9ce79a2dabb"/></dir><dir name="template"><dir name="email"><dir name="emailcampaign"><file name="abandoned_cart.html" hash="e1da3bd3c8898e66fa86ed2c7f25f0a1"/><file name="customer_birthday.html" hash="1c8700144a93f2f0f51f65b7c2b9cea5"/><file name="inscription_anniversary.html" hash="1063b67ad73a35e761b2152ea2b227ac"/><file name="nursing.html" hash="41a55fb6d2d2bec03a1bd314413690c4"/><file name="order_success.html" hash="27f50eb0f7dc590b1a775aed6232f24c"/><file name="welcome_reminder.html" hash="a7efe6d290216c92cfbb488de88408de"/><file name="wishlist_reminder.html" hash="d3ea8b42d506b81e88e96e24cf396ad4"/><file name="wishlist_stock_alert.html" hash="fe75dc922b483433db7d646c973a2432"/></dir></dir></dir></dir><dir name="fr_FR"><dir name="emailcampaign"><file name="Adfab_Emailcampaign.csv" hash="424e0b8fe6deba48ffc624b72776030f"/><file name="Adfab_Emailcampaign_AbandonedCart.csv" hash="962c2f9b0b13302b5c910bd776a0e177"/><file name="Adfab_Emailcampaign_CustomerBirthday.csv" hash="789b307d91ed3df3722ebf47ba88e3ce"/><file name="Adfab_Emailcampaign_InscriptionAnniversary.csv" hash="32314f7b43a6431890c196f7ac0b9dea"/><file name="Adfab_Emailcampaign_Nursing.csv" hash="a94b29f96a3fa3dfb1726fef5323b499"/><file name="Adfab_Emailcampaign_OrderSuccess.csv" hash="6b1cd6e24298331c4a3e317e24695d1c"/><file name="Adfab_Emailcampaign_WelcomeReminder.csv" hash="de057c50c853f81ed0f2bc10a7565f6a"/><file name="Adfab_Emailcampaign_WishlistReminder.csv" hash="f4071c638993793d001d6902d1cbca44"/><file name="Adfab_Emailcampaign_WishlistStockAlert.csv" hash="a6cb9f4041c03fe2565393fbf132df32"/></dir><dir name="template"><dir name="email"><dir name="emailcampaign"><file name="abandoned_cart.html" hash="9c07490d6d2c48e373c41e21bc5faf6b"/><file name="customer_birthday.html" hash="2c63c5a9d9551c7f5c09637d98725ccf"/><file name="inscription_anniversary.html" hash="d7742a3632fda1d2a7af02ada64316ee"/><file name="nursing.html" hash="74e4745914d0db37f7b00b1bda79c42d"/><file name="order_success.html" hash="27f50eb0f7dc590b1a775aed6232f24c"/><file name="welcome_reminder.html" hash="11878a468f48e52ab9b8bcdf1c7a80eb"/><file name="wishlist_reminder.html" hash="bdd9b11d9b453bca83fe2e7116b385f7"/><file name="wishlist_stock_alert.html" hash="67495578ab15182417fd9088daab4dd3"/></dir></dir></dir></dir></target><target name="mageweb"><dir name="js"><dir name="jquery"><file name="jquery.min.js" hash="19cc2d381510a7f54d17d4f363db76d2"/><file name="jquery-cron.min.js" hash="7102f517bb2ffb5d6d5f4d9f4ccb5a1e"/></dir></dir></target></contents>
35
  <compatible/>
36
  <dependencies><required><php><min>5.3.0</min><max>6.0.0</max></php></required></dependencies>
37
  </package>
skin/adminhtml/default/default/js/emailcampaign.js CHANGED
@@ -1,41 +1,73 @@
1
  document.observe("dom:loaded", function() {
2
- var select = $('emailcampaign_code');
3
-
4
- $$('#emailcampaign_emailcampaign_usage_form tr').invoke('hide');
5
- var usage = $('emailcampaign_usage_' + $F(select)).up(1);
6
-
7
- $$('#emailcampaign_emailcampaign_warning_form tr').invoke('hide');
8
- var warning = $('emailcampaign_warning_' + $F(select)).up(1);
9
-
10
- usage.show();
11
- $('emailcampaign_warning_' + $F(select)).setStyle({color:'#FF0000'});
12
 
13
- select.observe('change', function(event, element) {
14
- usage.hide();
15
- usage = $('emailcampaign_usage_' + $F(select)).up(1);
 
 
 
 
 
 
 
 
16
  usage.show();
 
 
 
 
 
 
 
 
 
 
17
 
18
- warning.hide();
19
- warning = $('emailcampaign_warning_' + $F(select)).up(1);
20
- $('emailcampaign_warning_' + $F(select)).setStyle({color:'#FF0000'});
21
- warning.show();
22
-
23
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
24
 
25
- var templateSelect = $('emailcampaign_template_id');
26
- var a = $$('#emailcampaign_preview > a')[0];
27
- var href = a.readAttribute('href');
28
 
29
- templateSelect.observe('change', function(event, element) {
30
- var templateData = $F(templateSelect);
31
- // I check if the template id is an integer. If not, it's a default template I have to load. Cf http://support.adfab.fr/support/browse/ECAMPAIGN-49
32
- if (!isNaN(templateData) && parseInt(Number(templateData)) == templateData && (templateData + "").replace(/ /g,'') !== ""){
33
- a.href = href.replace(/\/id\/[0-9]*\//g, '/id/'+templateData+'/');
34
- }else{
35
- // change it to a form
36
- a.href = href.replace(/\/id\/[0-9]*\//g, '/id/'+templateData+'/');
37
- }
38
-
39
-
40
- });
41
  });
1
  document.observe("dom:loaded", function() {
2
+
3
+ var loadFormAjaxUrl = $('emailcampaign_loadFormAjaxUrl');
 
 
 
 
 
 
 
 
4
 
5
+ function observe()
6
+ {
7
+ var select = $('emailcampaign_code');
8
+ var tabs = $('page:left');
9
+
10
+ $$('#emailcampaign_emailcampaign_usage_form tr').invoke('hide');
11
+ var usage = $('emailcampaign_usage_' + $F(select)).up(1);
12
+
13
+ $$('#emailcampaign_emailcampaign_warning_form tr').invoke('hide');
14
+ var warning = $('emailcampaign_warning_' + $F(select)).up(1);
15
+
16
  usage.show();
17
+ $('emailcampaign_warning_' + $F(select)).setStyle({color:'#FF0000'});
18
+
19
+ var templateSelect = $('emailcampaign_template_id');
20
+ var a = $$('#emailcampaign_preview > a')[0];
21
+ var href = a.readAttribute('href');
22
+
23
+ select.observe('change', function(event, element) {
24
+ usage.hide();
25
+ usage = $('emailcampaign_usage_' + $F(select)).up(1);
26
+ usage.show();
27
 
28
+ warning.hide();
29
+ warning = $('emailcampaign_warning_' + $F(select)).up(1);
30
+ $('emailcampaign_warning_' + $F(select)).setStyle({color:'#FF0000'});
31
+ warning.show();
32
+ });
33
+
34
+ select.observe('change', function(event, element) {
35
+ new Ajax.Request($F(loadFormAjaxUrl), {
36
+ method:'get',
37
+ parameters: $('edit_form').serialize(),
38
+ onSuccess: function(response) {
39
+ var data = response.responseText.evalJSON();
40
+ var i = 0;
41
+
42
+ $$('#edit_form > div').each(function (form) {
43
+ if (i++ > 0) {
44
+ form.remove();
45
+ }
46
+ })
47
+ tabs.update(data.tabs);
48
+ tabs.childElements('script', function (script) {
49
+ eval(script.innerHTML);
50
+ });
51
+ observe();
52
+ }
53
+ });
54
+ });
55
+
56
+ templateSelect.observe('change', function(event, element) {
57
+ var templateData = $F(templateSelect);
58
+ // I check if the template id is an integer. If not, it's a default template I have to load. Cf http://support.adfab.fr/support/browse/ECAMPAIGN-49
59
+ if (!isNaN(templateData) && parseInt(Number(templateData)) == templateData && (templateData + "").replace(/ /g,'') !== ""){
60
+ a.href = href.replace(/\/id\/[0-9]*\//g, '/id/'+templateData+'/');
61
+ }else{
62
+ // change it to a form
63
+ a.href = href.replace(/\/id\/[0-9]*\//g, '/id/'+templateData+'/');
64
+ }
65
+ });
66
+ setTimeout(function(){
67
+ $('emailcampaign_tabs_form_section_info').click();
68
+ }, 20);
69
+ }
70
 
71
+ observe();
 
 
72
 
 
 
 
 
 
 
 
 
 
 
 
 
73
  });