Springbot - Version 1.3.0.7

Version Notes

Added asynchronous javascript loader

Download this release

Release Info

Developer Springbot Integrations Team
Extension Springbot
Version 1.3.0.7
Comparing to
See all releases


Code changes from version 1.2.1.4 to 1.3.0.7

Files changed (95) hide show
  1. app/code/community/Springbot/Bmbleb/Block/Adminhtml/Auth.php +1 -0
  2. app/code/community/Springbot/Bmbleb/Block/Adminhtml/Bmbleb/Login.php +7 -8
  3. app/code/community/Springbot/Bmbleb/Block/Adminhtml/Bmbleb/Login/Form.php +50 -58
  4. app/code/community/Springbot/Bmbleb/Block/Adminhtml/Bmbleb/Register.php +0 -36
  5. app/code/community/Springbot/Bmbleb/Block/Adminhtml/Bmbleb/Register/Form.php +0 -72
  6. app/code/community/Springbot/Bmbleb/Block/Adminhtml/Connected.php +1 -3
  7. app/code/community/Springbot/Bmbleb/Block/Adminhtml/Help.php +1 -0
  8. app/code/community/Springbot/Bmbleb/Block/Adminhtml/Index.php +5 -5
  9. app/code/community/Springbot/Bmbleb/Block/Adminhtml/Index/Messages.php +0 -5
  10. app/code/community/Springbot/Bmbleb/Block/Adminhtml/Index/Terms.php +0 -5
  11. app/code/community/Springbot/Bmbleb/Block/Adminhtml/Jobs.php +1 -2
  12. app/code/community/Springbot/Bmbleb/Block/Adminhtml/Jobs/Grid.php +3 -2
  13. app/code/community/Springbot/Bmbleb/Block/Adminhtml/Login.php +1 -1
  14. app/code/community/Springbot/Bmbleb/Block/Adminhtml/Logout.php +1 -5
  15. app/code/community/Springbot/Bmbleb/Block/Adminhtml/Logs.php +1 -4
  16. app/code/community/Springbot/Bmbleb/Block/Adminhtml/Notifications.php +21 -18
  17. app/code/community/Springbot/Bmbleb/Block/Adminhtml/Problems.php +1 -1
  18. app/code/community/Springbot/Bmbleb/Block/Adminhtml/Settings.php +0 -29
  19. app/code/community/Springbot/Bmbleb/Block/Adminhtml/Settings/Edit/Form.php +0 -43
  20. app/code/community/Springbot/Bmbleb/Block/Adminhtml/Status.php +1 -4
  21. app/code/community/Springbot/Bmbleb/Block/Adminhtml/Tabs.php +1 -2
  22. app/code/community/Springbot/Bmbleb/Helper/Account.php +0 -33
  23. app/code/community/Springbot/Bmbleb/Helper/Alerts.php +0 -14
  24. app/code/community/Springbot/Bmbleb/Helper/ApiCall.php +0 -116
  25. app/code/community/Springbot/Bmbleb/Helper/ApiResponse.php +0 -59
  26. app/code/community/Springbot/Bmbleb/Helper/BmblebProps.php +0 -26
  27. app/code/community/Springbot/Bmbleb/Helper/ChangePassword.php +0 -55
  28. app/code/community/Springbot/Bmbleb/Helper/Data.php +0 -129
  29. app/code/community/Springbot/Bmbleb/Helper/ExternalLogging.php +0 -69
  30. app/code/community/Springbot/Bmbleb/Helper/GetTermsOfService.php +0 -54
  31. app/code/community/Springbot/Bmbleb/Helper/PluginStatus.php +58 -64
  32. app/code/community/Springbot/Bmbleb/Model/Alert.php +0 -63
  33. app/code/community/Springbot/Bmbleb/Model/Alert/Priority.php +0 -27
  34. app/code/community/Springbot/Bmbleb/Model/Alert/Status.php +0 -27
  35. app/code/community/Springbot/Bmbleb/Model/Alert/Type.php +0 -45
  36. app/code/community/Springbot/Bmbleb/Model/Bmblebprops.php +0 -38
  37. app/code/community/Springbot/Bmbleb/Model/Mysql4/Bmbleb/Collection.php +0 -10
  38. app/code/community/Springbot/Bmbleb/Model/Sync.php +0 -1
  39. app/code/community/Springbot/Bmbleb/controllers/Adminhtml/LogsController.php +1 -1
  40. app/code/community/Springbot/Bmbleb/controllers/Adminhtml/SettingsController.php +11 -30
  41. app/code/community/Springbot/Bmbleb/controllers/LoginController.php +29 -34
  42. app/code/community/Springbot/Bmbleb/controllers/RegisterController.php +0 -350
  43. app/code/community/Springbot/Bmbleb/etc/config.xml +50 -57
  44. app/code/community/Springbot/BoneCollector/Model/HarvestAbstract.php +0 -11
  45. app/code/community/Springbot/BoneCollector/Model/HarvestAttribute/Observer.php +3 -6
  46. app/code/community/Springbot/BoneCollector/Model/HarvestCaptureSKU/Observer.php +25 -29
  47. app/code/community/Springbot/BoneCollector/Model/HarvestCart/Observer.php +3 -3
  48. app/code/community/Springbot/BoneCollector/Model/HarvestCategory/Observer.php +2 -6
  49. app/code/community/Springbot/BoneCollector/Model/HarvestCustomer/Observer.php +10 -5
  50. app/code/community/Springbot/BoneCollector/Model/HarvestProduct/Observer.php +2 -6
  51. app/code/community/Springbot/BoneCollector/Model/HarvestPurchase/Observer.php +3 -3
  52. app/code/community/Springbot/BoneCollector/Model/HarvestRule/Observer.php +78 -0
  53. app/code/community/Springbot/BoneCollector/Model/HarvestSubscriber/Observer.php +2 -2
  54. app/code/community/Springbot/BoneCollector/etc/config.xml +34 -17
  55. app/code/community/Springbot/Boss.php +12 -12
  56. app/code/community/Springbot/Combine/Helper/Data.php +30 -8
  57. app/code/community/Springbot/Combine/Helper/Harvest.php +24 -16
  58. app/code/community/Springbot/Combine/Helper/Parser.php +7 -4
  59. app/code/community/Springbot/Combine/Model/Api.php +8 -10
  60. app/code/community/Springbot/Combine/Model/Cron/Queue/Batch.php +2 -2
  61. app/code/community/Springbot/Combine/Model/Harvest/Abstract.php +3 -3
  62. app/code/community/Springbot/Combine/Model/Harvest/Coupons.php +27 -0
  63. app/code/community/Springbot/Combine/Model/Harvest/Rules.php +27 -0
  64. app/code/community/Springbot/Combine/Model/Harvester.php +0 -5
  65. app/code/community/Springbot/Combine/Model/Parser/Abstract.php +9 -5
  66. app/code/community/Springbot/Combine/Model/Parser/Coupon.php +40 -0
  67. app/code/community/Springbot/Combine/Model/Parser/Purchase/Item.php +3 -6
  68. app/code/community/Springbot/Combine/Model/Parser/Quote.php +11 -5
  69. app/code/community/Springbot/Combine/Model/Parser/Quote/Item.php +5 -10
  70. app/code/community/Springbot/Combine/Model/Parser/Rule.php +60 -0
  71. app/code/community/Springbot/Combine/Model/Parser/Subscriber.php +0 -1
  72. app/code/community/Springbot/Combine/Model/Redirect.php +0 -2
  73. app/code/community/Springbot/Combine/etc/config.xml +7 -4
  74. app/code/community/Springbot/Combine/sql/combine_setup/mysql4-upgrade-1.2.0.1-1.2.1.0.php +0 -2
  75. app/code/community/Springbot/DataServices/HarvestingManager.php +7 -8
  76. app/code/community/Springbot/Log.php +1 -6
  77. app/code/community/Springbot/Services/Cmd/Harvest.php +2 -1
  78. app/code/community/Springbot/Services/Harvest/Coupons.php +35 -0
  79. app/code/community/Springbot/Services/Harvest/Rules.php +46 -0
  80. app/code/community/Springbot/Services/Post/Coupon.php +14 -0
  81. app/code/community/Springbot/Services/Post/Rule.php +14 -0
  82. app/code/community/Springbot/Services/Work/Report.php +1 -1
  83. app/code/community/Springbot/Shadow/Block/Js/Boot.php +24 -0
  84. app/code/community/Springbot/Shadow/Model/Listeners/Observer.php +37 -13
  85. app/code/community/Springbot/Shadow/etc/config.xml +61 -55
  86. app/code/community/Springbot/Util/Categories.php +19 -2
  87. app/code/community/Springbot/Util/Logger.php +2 -0
  88. app/code/community/Springbot/Util/Partition.php +2 -1
  89. app/design/adminhtml/default/default/template/bmbleb/alert/finished.phtml +0 -9
  90. app/design/adminhtml/default/default/template/bmbleb/alert/index.phtml +0 -32
  91. app/design/adminhtml/default/default/template/bmbleb/alert/next/form.phtml +0 -65
  92. app/design/adminhtml/default/default/template/bmbleb/index/terms.phtml +8 -9
  93. app/etc/modules/Springbot.xml +0 -27
  94. package.xml +5 -5
  95. shell/springbot.php +4 -5
app/code/community/Springbot/Bmbleb/Block/Adminhtml/Auth.php CHANGED
@@ -1,4 +1,5 @@
1
  <?php
 
2
  class Springbot_Bmbleb_Block_Adminhtml_Auth extends Mage_Adminhtml_Block_Template
3
  {
4
  public function __construct()
1
  <?php
2
+
3
  class Springbot_Bmbleb_Block_Adminhtml_Auth extends Mage_Adminhtml_Block_Template
4
  {
5
  public function __construct()
app/code/community/Springbot/Bmbleb/Block/Adminhtml/Bmbleb/Login.php CHANGED
@@ -19,20 +19,19 @@ class Springbot_Bmbleb_Block_Adminhtml_Bmbleb_Login extends Mage_Adminhtml_Block
19
  $this->_removeButton('back');
20
  $this->_removeButton('reset');
21
  $this->_removeButton('save');
22
- //$this->_updateButton('save', 'label', Mage::helper('bmbleb')->__('Login'));
23
-
24
  $this->_addButton('login', array(
25
  'label' => Mage::helper('bmbleb')->__('Login'),
26
  'onclick' => 'login_form.submit();',
27
- //'class' => 'go' // could use class of 'save' for checkmark
28
  ), 0, 100, 'footer');
29
 
30
  }
31
- /*
32
- NOTE: the issue with sumitting is being caused because of this html
33
- editForm = new varienForm('edit_form', '');
34
- this is also the reason js validation is not working
35
- */
 
36
  public function getHeaderText()
37
  {
38
  return Mage::helper('bmbleb')->__('Log In');
19
  $this->_removeButton('back');
20
  $this->_removeButton('reset');
21
  $this->_removeButton('save');
22
+
 
23
  $this->_addButton('login', array(
24
  'label' => Mage::helper('bmbleb')->__('Login'),
25
  'onclick' => 'login_form.submit();',
 
26
  ), 0, 100, 'footer');
27
 
28
  }
29
+
30
+ /*
31
+ NOTE: the issue with submitting is being caused because of this html
32
+ editForm = new varienForm('edit_form', '');
33
+ this is also the reason js validation is not working
34
+ */
35
  public function getHeaderText()
36
  {
37
  return Mage::helper('bmbleb')->__('Log In');
app/code/community/Springbot/Bmbleb/Block/Adminhtml/Bmbleb/Login/Form.php CHANGED
@@ -8,69 +8,69 @@
8
  */
9
  class Springbot_Bmbleb_Block_Adminhtml_Bmbleb_Login_Form extends Mage_Adminhtml_Block_Widget_Form
10
  {
11
- protected function _prepareForm()
12
- {
13
- $form = new Varien_Data_Form();
14
-
15
 
16
- $fieldset = $form->addFieldset('bmbleb_form', array('legend'=>Mage::helper('bmbleb')->__('Already Registered at www.springbot.com?')));
17
 
18
- $fieldset->addField('email', 'text', array(
19
- 'label' => Mage::helper('bmbleb')->__('Email'),
20
- 'class' => 'required-entry',
21
- 'required' => true,
22
- 'name' => 'email'
23
- ));
24
 
25
- $fieldset->addField('password', 'password', array(
26
- 'label' => Mage::helper('bmbleb')->__('Password'),
27
- 'class' => 'required-entry',
28
- 'required' => true,
29
- 'name' => 'password',
30
- ));
31
 
32
  $fieldset->addField('link', 'note', array(
33
  'label' => '',
34
  'text' => '<a href="http://www.springbot.com">Need a Springbot Account? Click Here</a>',
35
  ));
36
 
37
- // Hide submit button so that we can press enter to submit
38
- $submitButton = new Varien_Data_Form_Element_Submit(array('style' => 'position: absolute; left: -9999px; width: 1px; height: 1px;'));
39
- $fieldset->addElement($submitButton);
 
 
 
 
 
 
 
 
 
40
 
41
- $form->setMethod('post');
42
- $form->setUseContainer(true);
43
- $form->setId('login_form');
44
- $form->setName('login_form');
45
- $form->setAction($this->getUrl('*/login/login'));
46
- $this->logPageVisit();
47
- $this->setForm($form);
48
- }
49
- private function logPageVisit()
50
  {
51
- $this->configVars =array();
52
- $springbotStoreID ='';
53
 
54
- $storeID =Mage::app()->getStore()->getStoreId();
55
- $storeURL =Mage::getStoreConfig('web/unsecure/base_url',$storeID);
56
- if (empty($url)) { $url=Mage::getBaseDir(); }
57
 
58
- $varIndex ='store_id_'.$storeID;
59
- $this->configVars = Mage::getStoreConfig('springbot/config',$storeID);
60
- if (isset($this->configVars[$varIndex])) {
61
- $springbotStoreID =$this->configVars[$varIndex];
62
  }
63
- $eventDatetime =date("Y-m-d H:i:s ".'-0500');
64
- $pri ='1';
65
- $msg ='User is viewing Sprinnbgot Login Form from '.$storeURL;
66
- $url = $this->fetchConfigVariable('api_url','https://api.springbot.com/').'api/logs';
67
- $rawJSON='{"logs" :{"'.$springbotStoreID.'":{"store_id":"'.$springbotStoreID.'",'
68
- .'"event_time":"' .$eventDatetime.'",'
69
- .'"store_url":"' .$storeURL.'",'
70
- .'"remote_addr":"",'
71
- .'"priority":"' .$pri.'",'
72
- .'"description":"'.$msg.'"'
73
- .'}}}';
 
 
 
 
74
 
75
  try {
76
  $client = new Varien_Http_Client($url);
@@ -81,13 +81,5 @@ class Springbot_Bmbleb_Block_Adminhtml_Bmbleb_Login_Form extends Mage_Adminhtml_
81
  Mage::logException($e);
82
  }
83
  }
84
- private function fetchConfigVariable($varName,$default_value='')
85
- {
86
- if (isset($this->configVars[$varName])) {
87
- $rtnValue = $this->configVars[$varName];
88
- } else {
89
- $rtnValue = $default_value;
90
- }
91
- return $rtnValue;
92
- }
93
  }
8
  */
9
  class Springbot_Bmbleb_Block_Adminhtml_Bmbleb_Login_Form extends Mage_Adminhtml_Block_Widget_Form
10
  {
11
+ protected function _prepareForm()
12
+ {
13
+ $form = new Varien_Data_Form();
 
14
 
15
+ $fieldset = $form->addFieldset('bmbleb_form', array('legend' => Mage::helper('bmbleb')->__('Already Registered at www.springbot.com?')));
16
 
17
+ $fieldset->addField('email', 'text', array(
18
+ 'label' => Mage::helper('bmbleb')->__('Email'),
19
+ 'class' => 'required-entry',
20
+ 'required' => true,
21
+ 'name' => 'email'
22
+ ));
23
 
24
+ $fieldset->addField('password', 'password', array(
25
+ 'label' => Mage::helper('bmbleb')->__('Password'),
26
+ 'class' => 'required-entry',
27
+ 'required' => true,
28
+ 'name' => 'password',
29
+ ));
30
 
31
  $fieldset->addField('link', 'note', array(
32
  'label' => '',
33
  'text' => '<a href="http://www.springbot.com">Need a Springbot Account? Click Here</a>',
34
  ));
35
 
36
+ // Hide submit button so that we can press enter to submit
37
+ $submitButton = new Varien_Data_Form_Element_Submit(array('style' => 'position: absolute; left: -9999px; width: 1px; height: 1px;'));
38
+ $fieldset->addElement($submitButton);
39
+
40
+ $form->setMethod('post');
41
+ $form->setUseContainer(true);
42
+ $form->setId('login_form');
43
+ $form->setName('login_form');
44
+ $form->setAction($this->getUrl('*/login/login'));
45
+ $this->logPageVisit();
46
+ $this->setForm($form);
47
+ }
48
 
49
+ private function logPageVisit()
 
 
 
 
 
 
 
 
50
  {
51
+ $springbotStoreId = '';
 
52
 
53
+ $storeId = Mage::app()->getStore()->getStoreId();
54
+ $storeURL = Mage::getStoreConfig('web/unsecure/base_url', $storeId);
 
55
 
56
+ if (Mage::getStoreConfig("springbot/config/store_id_{$storeId}")) {
57
+ $springbotStoreId = Mage::getStoreConfig("springbot/config/store_id_{$storeId}");
 
 
58
  }
59
+
60
+ $eventDatetime = date("Y-m-d H:i:s " . '-0500');
61
+ $pri = '1';
62
+ $msg = 'User is viewing Springbot Login Form from ' . $storeURL;
63
+ if (!($url = Mage::getStoreConfig('springbot/config/api_url'))) {
64
+ $url = 'https://api.springbot.com/';
65
+ }
66
+ $url .= 'api/logs';
67
+ $rawJSON = '{"logs" :{"' . $springbotStoreId . '":{"store_id":"' . $springbotStoreId . '",'
68
+ . '"event_time":"' . $eventDatetime . '",'
69
+ . '"store_url":"' . $storeURL . '",'
70
+ . '"remote_addr":"",'
71
+ . '"priority":"' . $pri . '",'
72
+ . '"description":"' . $msg . '"'
73
+ . '}}}';
74
 
75
  try {
76
  $client = new Varien_Http_Client($url);
81
  Mage::logException($e);
82
  }
83
  }
84
+
 
 
 
 
 
 
 
 
85
  }
app/code/community/Springbot/Bmbleb/Block/Adminhtml/Bmbleb/Register.php DELETED
@@ -1,36 +0,0 @@
1
- <?php
2
- /**
3
- * Created by JetBrains PhpStorm.
4
- * User: joereger
5
- * Date: 12/09/11
6
- * Time: 2:56 PM
7
- * To change this template use File | Settings | File Templates.
8
- */
9
- class Springbot_Bmbleb_Block_Adminhtml_Bmbleb_Register extends Mage_Adminhtml_Block_Widget_Form_Container
10
- {
11
- public function __construct()
12
- {
13
- parent::__construct();
14
-
15
- $this->_blockGroup = 'bmbleb';
16
- $this->_controller = 'adminhtml_bmbleb';
17
- $this->_mode = 'register';
18
-
19
- $this->_removeButton('back');
20
- $this->_removeButton('reset');
21
- $this->_removeButton('save');
22
-
23
- $this->_addButton('register', array(
24
- 'label' => Mage::helper('bmbleb')->__('Register Now'),
25
- 'onclick' => 'register_form.submit();',
26
- //'class' => 'go' // could use class of 'save' for checkmark
27
- ), 0, 100, 'footer');
28
-
29
-
30
- }
31
-
32
- public function getHeaderText()
33
- {
34
- return Mage::helper('bmbleb')->__('Register');
35
- }
36
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/Springbot/Bmbleb/Block/Adminhtml/Bmbleb/Register/Form.php DELETED
@@ -1,72 +0,0 @@
1
- <?php
2
- /**
3
- * Created by JetBrains PhpStorm.
4
- * User: joereger
5
- * Date: 12/10/11
6
- * Time: 4:31 PM
7
- * To change this template use File | Settings | File Templates.
8
- */
9
- class Springbot_Bmbleb_Block_Adminhtml_Bmbleb_Register_Form extends Mage_Adminhtml_Block_Widget_Form
10
- {
11
- protected function _prepareForm()
12
- {
13
-
14
- $guid = Mage::getStoreConfig('bmbleb/config/store_guid',Mage::app()->getStore());
15
- if (empty($guid) || $guid == '0' || $guid == ''){
16
- $charid = strtoupper(md5(uniqid(rand(), true)));
17
- $guid = substr($charid, 0, 8).'-'
18
- .substr($charid, 8, 4).'-'
19
- .substr($charid,12, 4).'-'
20
- .substr($charid,16, 4).'-'
21
- .substr($charid,20,12);
22
- $config = new Mage_Core_Model_Config();
23
- $config->saveConfig('bmbleb/config/store_guid', $guid, 'default', 0);
24
- }
25
- $form = new Varien_Data_Form();
26
-
27
- $fieldset = $form->addFieldset('bmbleb_form', array('legend'=>Mage::helper('bmbleb')->__('Register Now for a Springbot Account')));
28
-
29
- $fieldset->addField('uname', 'text', array(
30
- 'label' => Mage::helper('bmbleb')->__('Your Name'),
31
- 'class' => 'required-entry',
32
- 'required' => true,
33
- 'name' => 'uname',
34
- ));
35
- $fieldset->addField('email', 'text', array(
36
- 'label' => Mage::helper('bmbleb')->__('Email'),
37
- 'class' => 'required-entry',
38
- 'required' => true,
39
- 'name' => 'email',
40
- ));
41
-
42
- $fieldset->addField('password', 'password', array(
43
- 'label' => Mage::helper('bmbleb')->__('Password'),
44
- 'class' => 'required-entry',
45
- 'required' => true,
46
- 'name' => 'password',
47
- ));
48
-
49
- $fieldset->addField('passwordverify', 'password', array(
50
- 'label' => Mage::helper('bmbleb')->__('Confirm Password'),
51
- 'class' => 'required-entry',
52
- 'required' => true,
53
- 'name' => 'passwordverify',
54
- ));
55
-
56
- $fieldset->addField('storeguid', 'hidden', array(
57
- 'value' => $guid,
58
- 'name' => 'storeguid'
59
- ));
60
-
61
- /*
62
- $form->setMethod('post');
63
- $form->setUseContainer(true);
64
- $form->setId('register_form');
65
- $form->setName('register_form');
66
- $form->setAction($this->getUrl('*/register/register'));
67
-
68
- $this->setForm($form);
69
- */
70
-
71
- }
72
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/Springbot/Bmbleb/Block/Adminhtml/Connected.php CHANGED
@@ -1,9 +1,7 @@
1
  <?php
 
2
  class Springbot_Bmbleb_Block_Adminhtml_Connected extends Mage_Adminhtml_Block_Template
3
  {
4
- /**
5
- * Block constructor
6
- */
7
  public function __construct()
8
  {
9
  parent::__construct();
1
  <?php
2
+
3
  class Springbot_Bmbleb_Block_Adminhtml_Connected extends Mage_Adminhtml_Block_Template
4
  {
 
 
 
5
  public function __construct()
6
  {
7
  parent::__construct();
app/code/community/Springbot/Bmbleb/Block/Adminhtml/Help.php CHANGED
@@ -1,4 +1,5 @@
1
  <?php
 
2
  class Springbot_Bmbleb_Block_Adminhtml_Help extends Mage_Adminhtml_Block_Template
3
  {
4
  public function __construct()
1
  <?php
2
+
3
  class Springbot_Bmbleb_Block_Adminhtml_Help extends Mage_Adminhtml_Block_Template
4
  {
5
  public function __construct()
app/code/community/Springbot/Bmbleb/Block/Adminhtml/Index.php CHANGED
@@ -1,4 +1,5 @@
1
  <?php
 
2
  class Springbot_Bmbleb_Block_Adminhtml_Index extends Mage_Adminhtml_Block_Template
3
  {
4
  public function __construct()
@@ -7,14 +8,13 @@ class Springbot_Bmbleb_Block_Adminhtml_Index extends Mage_Adminhtml_Block_Templa
7
  $this->setTemplate("bmbleb/index.phtml");
8
  }
9
 
10
- public function didSyncThisSession(){
11
-
12
  return false;
13
-
14
  }
15
 
16
- public function autoLauchSync(){
17
-
18
  return false;
19
  }
20
  }
1
  <?php
2
+
3
  class Springbot_Bmbleb_Block_Adminhtml_Index extends Mage_Adminhtml_Block_Template
4
  {
5
  public function __construct()
8
  $this->setTemplate("bmbleb/index.phtml");
9
  }
10
 
11
+ public function didSyncThisSession()
12
+ {
13
  return false;
 
14
  }
15
 
16
+ public function autoLauchSync()
17
+ {
18
  return false;
19
  }
20
  }
app/code/community/Springbot/Bmbleb/Block/Adminhtml/Index/Messages.php CHANGED
@@ -1,7 +1,6 @@
1
  <?php
2
  class Springbot_Bmbleb_Block_Adminhtml_Index_Messages extends Mage_Adminhtml_Block_Template
3
  {
4
-
5
  /**
6
  * Block constructor
7
  */
@@ -11,8 +10,4 @@ class Springbot_Bmbleb_Block_Adminhtml_Index_Messages extends Mage_Adminhtml_Blo
11
  $this->setTemplate("bmbleb/index/messages.phtml");
12
  }
13
 
14
-
15
-
16
-
17
-
18
  }
1
  <?php
2
  class Springbot_Bmbleb_Block_Adminhtml_Index_Messages extends Mage_Adminhtml_Block_Template
3
  {
 
4
  /**
5
  * Block constructor
6
  */
10
  $this->setTemplate("bmbleb/index/messages.phtml");
11
  }
12
 
 
 
 
 
13
  }
app/code/community/Springbot/Bmbleb/Block/Adminhtml/Index/Terms.php CHANGED
@@ -1,14 +1,9 @@
1
  <?php
2
  class Springbot_Bmbleb_Block_Adminhtml_Index_Terms extends Mage_Adminhtml_Block_Template
3
  {
4
-
5
- /**
6
- * Block constructor
7
- */
8
  public function __construct()
9
  {
10
  parent::__construct();
11
  $this->setTemplate("bmbleb/index/terms.phtml");
12
  }
13
-
14
  }
1
  <?php
2
  class Springbot_Bmbleb_Block_Adminhtml_Index_Terms extends Mage_Adminhtml_Block_Template
3
  {
 
 
 
 
4
  public function __construct()
5
  {
6
  parent::__construct();
7
  $this->setTemplate("bmbleb/index/terms.phtml");
8
  }
 
9
  }
app/code/community/Springbot/Bmbleb/Block/Adminhtml/Jobs.php CHANGED
@@ -1,4 +1,5 @@
1
  <?php
 
2
  class Springbot_Bmbleb_Block_Adminhtml_Jobs extends Mage_Adminhtml_Block_Widget_Grid_Container
3
  {
4
  public function __construct()
@@ -6,9 +7,7 @@ class Springbot_Bmbleb_Block_Adminhtml_Jobs extends Mage_Adminhtml_Block_Widget_
6
  $this->_controller = 'adminhtml_jobs';
7
  $this->_blockGroup = 'bmbleb';
8
  $this->_headerText = $this->__('Jobs');
9
-
10
  parent::__construct();
11
-
12
  $this->_removeButton('add');
13
  }
14
  }
1
  <?php
2
+
3
  class Springbot_Bmbleb_Block_Adminhtml_Jobs extends Mage_Adminhtml_Block_Widget_Grid_Container
4
  {
5
  public function __construct()
7
  $this->_controller = 'adminhtml_jobs';
8
  $this->_blockGroup = 'bmbleb';
9
  $this->_headerText = $this->__('Jobs');
 
10
  parent::__construct();
 
11
  $this->_removeButton('add');
12
  }
13
  }
app/code/community/Springbot/Bmbleb/Block/Adminhtml/Jobs/Grid.php CHANGED
@@ -19,7 +19,8 @@ class Springbot_Bmbleb_Block_Adminhtml_Jobs_Grid extends Mage_Adminhtml_Block_Wi
19
  return parent::_prepareCollection();
20
  }
21
 
22
- protected function _prepareColumns() {
 
23
  $this->addColumn('id', array(
24
  'header' => $this->__('Id'),
25
  'width' => '80',
@@ -62,7 +63,7 @@ class Springbot_Bmbleb_Block_Adminhtml_Jobs_Grid extends Mage_Adminhtml_Block_Wi
62
  ));
63
 
64
  $this->addColumn('created_at', array(
65
- 'header' => $this->__('locked_at'),
66
  'index' => 'created_at',
67
  'type' => 'datetime'
68
  ));
19
  return parent::_prepareCollection();
20
  }
21
 
22
+ protected function _prepareColumns()
23
+ {
24
  $this->addColumn('id', array(
25
  'header' => $this->__('Id'),
26
  'width' => '80',
63
  ));
64
 
65
  $this->addColumn('created_at', array(
66
+ 'header' => $this->__('created_at'),
67
  'index' => 'created_at',
68
  'type' => 'datetime'
69
  ));
app/code/community/Springbot/Bmbleb/Block/Adminhtml/Login.php CHANGED
@@ -1,4 +1,5 @@
1
  <?php
 
2
  class Springbot_Bmbleb_Block_Adminhtml_Login extends Mage_Adminhtml_Block_Template
3
  {
4
  public function __construct()
@@ -6,5 +7,4 @@ class Springbot_Bmbleb_Block_Adminhtml_Login extends Mage_Adminhtml_Block_Templa
6
  parent::__construct();
7
  $this->setTemplate("bmbleb/login.phtml");
8
  }
9
-
10
  }
1
  <?php
2
+
3
  class Springbot_Bmbleb_Block_Adminhtml_Login extends Mage_Adminhtml_Block_Template
4
  {
5
  public function __construct()
7
  parent::__construct();
8
  $this->setTemplate("bmbleb/login.phtml");
9
  }
 
10
  }
app/code/community/Springbot/Bmbleb/Block/Adminhtml/Logout.php CHANGED
@@ -1,14 +1,10 @@
1
  <?php
 
2
  class Springbot_Bmbleb_Block_Adminhtml_Logout extends Mage_Adminhtml_Block_Template
3
  {
4
-
5
- /**
6
- * Block constructor
7
- */
8
  public function __construct()
9
  {
10
  //parent::__construct();
11
  //$this->setTemplate("bmbleb/login.phtml");
12
  }
13
-
14
  }
1
  <?php
2
+
3
  class Springbot_Bmbleb_Block_Adminhtml_Logout extends Mage_Adminhtml_Block_Template
4
  {
 
 
 
 
5
  public function __construct()
6
  {
7
  //parent::__construct();
8
  //$this->setTemplate("bmbleb/login.phtml");
9
  }
 
10
  }
app/code/community/Springbot/Bmbleb/Block/Adminhtml/Logs.php CHANGED
@@ -1,9 +1,7 @@
1
  <?php
 
2
  class Springbot_Bmbleb_Block_Adminhtml_Logs extends Mage_Adminhtml_Block_Template
3
  {
4
- /**
5
- * __construct
6
- */
7
  public function __construct()
8
  {
9
  $this->setTemplate("bmbleb/logs/index.phtml");
@@ -15,5 +13,4 @@ class Springbot_Bmbleb_Block_Adminhtml_Logs extends Mage_Adminhtml_Block_Templat
15
  {
16
  return htmlspecialchars(Mage::helper('combine')->getLogContents($logName));
17
  }
18
-
19
  }
1
  <?php
2
+
3
  class Springbot_Bmbleb_Block_Adminhtml_Logs extends Mage_Adminhtml_Block_Template
4
  {
 
 
 
5
  public function __construct()
6
  {
7
  $this->setTemplate("bmbleb/logs/index.phtml");
13
  {
14
  return htmlspecialchars(Mage::helper('combine')->getLogContents($logName));
15
  }
 
16
  }
app/code/community/Springbot/Bmbleb/Block/Adminhtml/Notifications.php CHANGED
@@ -2,31 +2,34 @@
2
 
3
  class Springbot_Bmbleb_Block_Adminhtml_Notifications extends Mage_Adminhtml_Block_Template
4
  {
5
-
6
  /**
7
  * Uses PluginStatus helper to determine if major problem needs to be displayed globally
8
  */
9
  public function getMessage()
10
  {
11
- if (Mage::getStoreConfig('springbot/config/show_notifications') == 1) {
12
- if ($problems = Mage::helper('bmbleb/PluginStatus')->getGlobalPluginProblems()) {
13
- $message = 'Springbot has encountered a small issue. ' .
14
- '<a href="' . $this->getUrl('bmbleb/adminhtml_problems/index') . '">Click here to get more details</a>. ' .
15
- 'You can turn off Springbot notifications in ' .
16
- '<a href="' . $this->getUrl('adminhtml/system_config/edit/section/springbot') . '">Springbot configuration.</a>'
17
- ;
18
-
19
- return array('message' => $message, 'type' => 'error');
20
- }
21
- else if (Mage::helper('bmbleb/PluginStatus')->needsToLogin()) {
22
- $message = 'Springbot has been installed successfully. ' .
23
- '<a href="' . $this->getUrl('bmbleb/adminhtml_index/status') . '">Click here to login</a>. ' .
24
- 'You can turn off Springbot notifications in ' .
25
- '<a href="' . $this->getUrl('adminhtml/system_config/edit/section/springbot') . '">Springbot configuration.</a>'
26
- ;
27
- return array('message' => $message, 'type' => 'success');
 
28
  }
29
  }
 
 
 
30
  return false;
31
  }
32
  }
2
 
3
  class Springbot_Bmbleb_Block_Adminhtml_Notifications extends Mage_Adminhtml_Block_Template
4
  {
 
5
  /**
6
  * Uses PluginStatus helper to determine if major problem needs to be displayed globally
7
  */
8
  public function getMessage()
9
  {
10
+ try {
11
+ if (Mage::getStoreConfig('springbot/config/show_notifications') == 1) {
12
+ if (Mage::helper('bmbleb/PluginStatus')->needsToLogin()) {
13
+ $message = 'Springbot has been installed successfully. ' .
14
+ '<a href="' . $this->getUrl('bmbleb/adminhtml_index/status') . '">Click here to login</a>. ' .
15
+ 'You can turn off Springbot notifications in ' .
16
+ '<a href="' . $this->getUrl('adminhtml/system_config/edit/section/springbot') . '">Springbot configuration.</a>'
17
+ ;
18
+ return array('message' => $message, 'type' => 'success');
19
+ }
20
+ else if ($problems = Mage::helper('bmbleb/PluginStatus')->tooLongSinceCheckin()) {
21
+ $message = 'Springbot has not synced in a while. ' .
22
+ '<a href="' . $this->getUrl('bmbleb/adminhtml_problems/index') . '">Click here to get more details</a>. ' .
23
+ 'You can turn off Springbot notifications in ' .
24
+ '<a href="' . $this->getUrl('adminhtml/system_config/edit/section/springbot') . '">Springbot configuration.</a>'
25
+ ;
26
+ return array('message' => $message, 'type' => 'error');
27
+ }
28
  }
29
  }
30
+ catch (Exception $e) {
31
+ Springbot_Log::error($e);
32
+ }
33
  return false;
34
  }
35
  }
app/code/community/Springbot/Bmbleb/Block/Adminhtml/Problems.php CHANGED
@@ -1,4 +1,5 @@
1
  <?php
 
2
  class Springbot_Bmbleb_Block_Adminhtml_Problems extends Mage_Adminhtml_Block_Template
3
  {
4
  public function __construct()
@@ -14,5 +15,4 @@ class Springbot_Bmbleb_Block_Adminhtml_Problems extends Mage_Adminhtml_Block_Tem
14
  {
15
  return Mage::helper('bmbleb/PluginStatus')->getAllPluginProblems();
16
  }
17
-
18
  }
1
  <?php
2
+
3
  class Springbot_Bmbleb_Block_Adminhtml_Problems extends Mage_Adminhtml_Block_Template
4
  {
5
  public function __construct()
15
  {
16
  return Mage::helper('bmbleb/PluginStatus')->getAllPluginProblems();
17
  }
 
18
  }
app/code/community/Springbot/Bmbleb/Block/Adminhtml/Settings.php DELETED
@@ -1,29 +0,0 @@
1
- <?php
2
- /**
3
- */
4
- class Springbot_Bmbleb_Block_Adminhtml_Settings extends Mage_Adminhtml_Block_Widget_Form_Container
5
- {
6
- public function __construct()
7
- {
8
- $this->_blockGroup = 'bmbleb';
9
- $this->_controller = 'adminhtml_settings';
10
- $this->_headerText = Mage::helper('bmbleb')->__('Springbot Settings');
11
-
12
- parent::__construct();
13
-
14
- $this->_removeButton('reset');
15
- $this->_removeButton('back');
16
-
17
- }
18
-
19
- /**
20
- * Check permission for passed action
21
- *
22
- * @param string $action
23
- * @return bool
24
- */
25
- protected function _isAllowedAction($action)
26
- {
27
- return Mage::getSingleton('admin/session')->isAllowed('bmbleb/adminhtml_settings/' . $action);
28
- }
29
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/Springbot/Bmbleb/Block/Adminhtml/Settings/Edit/Form.php DELETED
@@ -1,43 +0,0 @@
1
- <?php
2
- /**
3
- */
4
- class Socketware_Bmbleb_Block_Adminhtml_Settings_Edit_Form extends Mage_Adminhtml_Block_Widget_Form
5
- {
6
- protected function _prepareForm()
7
- {
8
- $form = new Varien_Data_Form();
9
-
10
- $fieldset = $form->addFieldset('bmbleb_password', array('legend'=>Mage::helper('bmbleb')->__('Change your springbot account password - leave this blank if you do not want to change it.')));
11
-
12
- $fieldset->addField('email', 'label', array(
13
- 'label' => Mage::helper('bmbleb')->__('Account Email Address'),
14
- 'value' => Mage::getStoreConfig('bmbleb/config/account_email',Mage::app()->getStore())
15
- ));
16
-
17
- $fieldset->addField('password', 'password', array(
18
- 'label' => Mage::helper('bmbleb')->__('Password'),
19
- //'class' => 'required-entry',
20
- 'required' => false,
21
- 'name' => 'password',
22
- 'note' => Mage::helper('bmbleb')->__('Passwords must be more than 6 characters long and cannot contain spaces or special characters')
23
- ));
24
-
25
- $fieldset->addField('passwordverify', 'password', array(
26
- 'label' => Mage::helper('bmbleb')->__('Confirm Password'),
27
- //'class' => 'required-entry',
28
- 'required' => false,
29
- 'name' => 'passwordverify',
30
- ));
31
-
32
-
33
- $form->setMethod('post');
34
- $form->setUseContainer(true);
35
- $form->setId('edit_form');
36
- $form->setName('edit_form');
37
- $form->setAction($this->getUrl('*/*/post'));
38
-
39
- $this->setForm($form);
40
-
41
-
42
- }
43
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/Springbot/Bmbleb/Block/Adminhtml/Status.php CHANGED
@@ -1,13 +1,10 @@
1
  <?php
 
2
  class Springbot_Bmbleb_Block_Adminhtml_Status extends Mage_Adminhtml_Block_Template
3
  {
4
- /**
5
- * Block constructor
6
- */
7
  public function __construct()
8
  {
9
  parent::__construct();
10
  $this->setTemplate("bmbleb/status.phtml");
11
  }
12
-
13
  }
1
  <?php
2
+
3
  class Springbot_Bmbleb_Block_Adminhtml_Status extends Mage_Adminhtml_Block_Template
4
  {
 
 
 
5
  public function __construct()
6
  {
7
  parent::__construct();
8
  $this->setTemplate("bmbleb/status.phtml");
9
  }
 
10
  }
app/code/community/Springbot/Bmbleb/Block/Adminhtml/Tabs.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
 
2
  class Springbot_Bmbleb_Block_Adminhtml_Tabs extends Mage_Adminhtml_Block_Template
3
  {
4
-
5
  /**
6
  * Block constructor
7
  */
@@ -29,5 +29,4 @@ class Springbot_Bmbleb_Block_Adminhtml_Tabs extends Mage_Adminhtml_Block_Templat
29
  {
30
  return (Mage::getStoreConfig('springbot/advanced/extended_config') == 1);
31
  }
32
-
33
  }
1
  <?php
2
+
3
  class Springbot_Bmbleb_Block_Adminhtml_Tabs extends Mage_Adminhtml_Block_Template
4
  {
 
5
  /**
6
  * Block constructor
7
  */
29
  {
30
  return (Mage::getStoreConfig('springbot/advanced/extended_config') == 1);
31
  }
 
32
  }
app/code/community/Springbot/Bmbleb/Helper/Account.php CHANGED
@@ -8,15 +8,6 @@
8
  */
9
  class Springbot_Bmbleb_Helper_Account extends Mage_Core_Helper_Abstract
10
  {
11
- public function getResyncOption()
12
- {
13
- return Mage::getSingleton('core/session')->getSpringbotResyncOption();
14
- }
15
-
16
- public function setResyncOption($value)
17
- {
18
- Mage::getSingleton('core/session')->setSpringbotResyncOption($value);
19
- }
20
  public function setAccount($account = array())
21
  {
22
  Mage::getSingleton('core/session')->setBmblebAccount($account);
@@ -53,26 +44,6 @@ class Springbot_Bmbleb_Helper_Account extends Mage_Core_Helper_Abstract
53
  return false;
54
  }
55
 
56
- protected function checkCredentials($email = '', $password = '')
57
- {
58
- $account = array('valid' => false);
59
-
60
- $apiResponse = Mage::helper('bmbleb/ApiCall')->call("login", array('email' => $email,'password' => $password));
61
- if ($apiResponse->getResponsecode() == "200"){
62
- $account['valid'] = true;
63
- $account['email'] = $email;
64
- } elseif ($apiResponse->getResponsecode() == "400"){
65
- $account['message'] = Mage::helper('bmbleb')->__('Unable to login with the email and password provided.');
66
- } elseif ($apiResponse->getResponsecode() == "401"){
67
- $account['message'] = Mage::helper('bmbleb')->__('Unable to login with the email and password provided.');
68
- } else {
69
- $account['message'] = Mage::helper('bmbleb')->__('Unable to check your login.');
70
- }
71
- $this->setAccount($account);
72
-
73
- return $account;
74
- }
75
-
76
  public function authenticate($email = '', $password = '')
77
  {
78
  $result = false;
@@ -131,14 +102,10 @@ class Springbot_Bmbleb_Helper_Account extends Mage_Core_Helper_Abstract
131
 
132
  public function setSavedAccountInformation($email='', $password='', $secToken='')
133
  {
134
- $prevOwner=$this->getSavedEmail();
135
-
136
  $config = new Mage_Core_Model_Config();
137
-
138
  $config->saveConfig('springbot/config/account_email', $email, 'default', 0);
139
  $config->saveConfig('springbot/config/account_password', Mage::helper('core')->encrypt($password), 'default', 0);
140
  $config->saveConfig('springbot/config/security_token', $secToken, 'default', 0);
141
-
142
  Mage::getConfig()->cleanCache();
143
  Mage::getConfig()->reinit();
144
  }
8
  */
9
  class Springbot_Bmbleb_Helper_Account extends Mage_Core_Helper_Abstract
10
  {
 
 
 
 
 
 
 
 
 
11
  public function setAccount($account = array())
12
  {
13
  Mage::getSingleton('core/session')->setBmblebAccount($account);
44
  return false;
45
  }
46
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
47
  public function authenticate($email = '', $password = '')
48
  {
49
  $result = false;
102
 
103
  public function setSavedAccountInformation($email='', $password='', $secToken='')
104
  {
 
 
105
  $config = new Mage_Core_Model_Config();
 
106
  $config->saveConfig('springbot/config/account_email', $email, 'default', 0);
107
  $config->saveConfig('springbot/config/account_password', Mage::helper('core')->encrypt($password), 'default', 0);
108
  $config->saveConfig('springbot/config/security_token', $secToken, 'default', 0);
 
109
  Mage::getConfig()->cleanCache();
110
  Mage::getConfig()->reinit();
111
  }
app/code/community/Springbot/Bmbleb/Helper/Alerts.php DELETED
@@ -1,14 +0,0 @@
1
- <?php
2
- /**
3
- * Created by JetBrains PhpStorm.
4
- * User: joereger
5
- * Date: 1/6/12
6
- * Time: 9:39 AM
7
- * To change this template use File | Settings | File Templates.
8
- */
9
- class Socketware_Bmbleb_Helper_Alerts
10
- {
11
-
12
-
13
-
14
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/Springbot/Bmbleb/Helper/ApiCall.php DELETED
@@ -1,116 +0,0 @@
1
- <?php
2
- class Springbot_Bmbleb_Helper_ApiCall
3
- {
4
- private function getKey(){
5
- return Mage::getStoreConfig('bmbleb/config/encrypt_key',Mage::app()->getStore());
6
- }
7
- private function getAPIHost(){
8
- return Mage::getStoreConfig('bmbleb/config/api_url',Mage::app()->getStore());
9
- }
10
-
11
- public function call($APIMethod, $payloadAsArray)
12
- {
13
- try {
14
- $rawData='';
15
-
16
- $uri = $this->fetchConfigVariable('api_url','https://api.springbot.com/').'api/registration';
17
- if (isset($payloadAsArray['uname'])) {
18
- $rawData='{'
19
- . '"name":"' .$payloadAsArray['uname'].'",'
20
- . '"email":"' .$payloadAsArray['registeremail'].'",'
21
- . '"password":"' .$payloadAsArray['registerpassword'].'",'
22
- . '"password_confirmation":"'.$payloadAsArray['verifypassword'].'"'
23
- .'}';
24
- }
25
- $client = new Varien_Http_Client($uri);
26
- $client->setRawData($rawData);
27
- $req = $client->request('POST');
28
-
29
- $begJson =strpos($req,'{');
30
- $endJson =strpos($req,'}',$begJson);
31
- $jBuf =substr($req,$begJson,($endJson-$begJson-1));
32
- $response =json_decode($jBuf,true);
33
- if ($response['status']=='error') {
34
- $errorCode ='999';
35
- } else {
36
- $errorCode ='200';
37
- }
38
-
39
- try{
40
- //Populate ApiResponse object
41
- $apiResponse = Mage::helper('bmbleb/ApiResponse');
42
- $apiResponse->setFullresponse($req);
43
- $apiResponse->setResponsecode($errorCode);
44
- $apiResponse->setResponsecodedescription($response['status']);
45
- $apiResponse->setMessage($response['message']);
46
- return $apiResponse;
47
-
48
- }catch (Exception $e) {
49
- Mage::log($e);
50
- }
51
-
52
- } catch (Exception $e) {
53
- Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
54
- Mage::log($e->getMessage());
55
- }
56
-
57
- $apiResponse = Mage::helper('bmbleb/ApiResponse');
58
- $apiResponse->setFullresponse('');
59
- $apiResponse->setResponsecode('500');
60
- $apiResponse->setResponsecodedescription('Server Error');
61
- $apiResponse->setMessage('An unknown error.');
62
-
63
- return $apiResponse;
64
- }
65
-
66
- private function getEncrypt($sStr, $sKey = "")
67
- {
68
- if ($sKey==null || $sKey==""){$sKey = self::getKey();}
69
- $sStr = self::pkcs5_pad($sStr, 16);
70
-
71
- $iv_size = mcrypt_get_iv_size(MCRYPT_RIJNDAEL_128, MCRYPT_MODE_ECB);
72
- $iv = mcrypt_create_iv($iv_size, MCRYPT_RAND);
73
-
74
- return base64_encode(
75
- mcrypt_encrypt(
76
- MCRYPT_RIJNDAEL_128,
77
- $sKey,
78
- $sStr,
79
- MCRYPT_MODE_ECB,
80
- $iv
81
- )
82
- );
83
- }
84
-
85
- private function getDecrypt($sStr, $sKey = "")
86
- {
87
- if ($sKey==null || $sKey==""){$sKey = self::getKey();}
88
-
89
- $iv_size = mcrypt_get_iv_size(MCRYPT_RIJNDAEL_128, MCRYPT_MODE_ECB);
90
- $iv = mcrypt_create_iv($iv_size, MCRYPT_RAND);
91
-
92
- return mcrypt_decrypt(
93
- MCRYPT_RIJNDAEL_128,
94
- $sKey,
95
- base64_decode($sStr),
96
- MCRYPT_MODE_ECB,
97
- $iv
98
- );
99
- }
100
-
101
- private function pkcs5_pad($text, $blocksize)
102
- {
103
- $pad = $blocksize - (strlen($text) % $blocksize);
104
- return $text . str_repeat(chr($pad), $pad);
105
- }
106
- private function fetchConfigVariable($varName,$default_value='')
107
- {
108
- if (isset($this->configVars[$varName])) {
109
- $rtnValue = $this->configVars[$varName];
110
- } else {
111
- $rtnValue = $default_value;
112
- }
113
- return $rtnValue;
114
- }
115
-
116
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/Springbot/Bmbleb/Helper/ApiResponse.php DELETED
@@ -1,59 +0,0 @@
1
- <?php
2
- class Springbot_Bmbleb_Helper_ApiResponse
3
- {
4
- private $responsecode;
5
- private $responsecodedescription;
6
- private $message;
7
- private $fullresponse;
8
- private $customers;
9
- private $usageLimits;
10
-
11
- public function setMessage($message) {
12
- $this->message = $message;
13
- }
14
-
15
- public function getMessage() {
16
- return $this->message;
17
- }
18
-
19
- public function setResponsecode($responsecode) {
20
- $this->responsecode = $responsecode;
21
- }
22
-
23
- public function getResponsecode() {
24
- return $this->responsecode;
25
- }
26
-
27
- public function setResponsecodedescription($responsecodedescription) {
28
- $this->responsecodedescription = $responsecodedescription;
29
- }
30
-
31
- public function getResponsecodedescription() {
32
- return $this->responsecodedescription;
33
- }
34
-
35
- public function setFullresponse($fullresponse) {
36
- $this->fullresponse = $fullresponse;
37
- }
38
-
39
- public function getFullresponse() {
40
- return $this->fullresponse;
41
- }
42
-
43
- public function setCustomers($value) {
44
- $this->customers = $value;
45
- }
46
-
47
- public function getCustomers() {
48
- return $this->customers;
49
- }
50
-
51
- public function setUsageLimits($value) {
52
- $this->usageLimits = $value;
53
- }
54
-
55
- public function getUsageLimits() {
56
- return $this->usageLimits;
57
- }
58
-
59
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/Springbot/Bmbleb/Helper/BmblebProps.php DELETED
@@ -1,26 +0,0 @@
1
- <?php
2
- /**
3
- * Created by JetBrains PhpStorm.
4
- * User: joereger
5
- * Date: 12/2/11
6
- * Time: 9:39 AM
7
- * To change this template use File | Settings | File Templates.
8
- */
9
- class Socketware_Bmbleb_Helper_BmblebProps{
10
-
11
-
12
-
13
- public static function get($key) {
14
- return Mage::getModel('bmbleb/bmblebprops')->getValueByKey($key);
15
- }
16
-
17
- public static function put($key, $value) {
18
- return Mage::getModel('bmbleb/bmblebprops')->setValueByKey($key, $value);
19
- }
20
-
21
-
22
-
23
-
24
-
25
-
26
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/Springbot/Bmbleb/Helper/ChangePassword.php DELETED
@@ -1,55 +0,0 @@
1
- <?php
2
- /**
3
- * Created by JetBrains PhpStorm.
4
- * User: joereger
5
- * Date: 1/6/12
6
- * Time: 9:39 AM
7
- * To change this template use File | Settings | File Templates.
8
- */
9
- class Socketware_Bmbleb_Helper_ChangePassword
10
- {
11
-
12
-
13
- public static function ChangePassword($newpassword){
14
- try {
15
-
16
- $payload = array();
17
- $payload['newpassword'] = $newpassword;
18
- $payload['storeguid'] = Mage::helper('bmbleb/Sync')->getStoreGuid();
19
-
20
-
21
- $apiResponse = Mage::helper('bmbleb/ApiCall')->call("changepassword", $payload);
22
- Mage::log("ChangePassword responsecode=" . $apiResponse->getResponsecode());
23
- Mage::log("changepassword json: " . $apiResponse->getFullresponse());
24
-
25
- if ($apiResponse->getResponsecode() == "200"){
26
- Mage::log("Starting to parse changepassword json");
27
- //Parse the response
28
- //Note that JSON.php is an edited version (see bottom of file)
29
- require_once('JSON.php'); // JSON parser
30
- require_once('jsonpath-0.8.1.php'); // JSONPath evaluator
31
- $parser = new Services_JSON(SERVICES_JSON_LOOSE_TYPE);
32
- $o = $parser->decode($apiResponse->getFullresponse());
33
- return true;
34
-
35
- } elseif ($apiResponse->getResponsecode() == "400"){
36
- return $apiResponse->getMessage();
37
- //Mage::getSingleton('adminhtml/session')->addError(Mage::helper('bmbleb')->__('We\'re sorry, there\'s been an error: ' . $apiResponse->getMessage()));
38
- } else {
39
- return Mage::helper('bmbleb')->__('There was an error updating your password');
40
- //Mage::getSingleton('adminhtml/session')->addError(Mage::helper('bmbleb')->__('We\'re sorry, there\'s been an error.'));
41
- }
42
- // end try/catch
43
- }
44
- catch (Mage_Core_Exception $e) {
45
- Mage::log("Error changing password: Mage_Core_Exception " . $e->getMessage());
46
- return $e->getMessage();
47
- }
48
- catch (Exception $e) {
49
- Mage::log("Error changing password: Exception " . $e->getMessage());
50
- return $e->getMessage();
51
- }
52
- // if passes through to here there was an error
53
- return Mage::helper('bmbleb')->__('Unspecified error');
54
- }
55
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/Springbot/Bmbleb/Helper/Data.php CHANGED
@@ -1,135 +1,6 @@
1
  <?php
2
 
3
-
4
  class Springbot_Bmbleb_Helper_Data extends Mage_Core_Helper_Abstract
5
  {
6
 
7
- /**
8
- * Helper method to only write debug logging when debug mode is enabled
9
- * @return string|number
10
- */
11
- function debugLog($message = ''){
12
- if (Mage::getStoreConfig('bmbleb/config/debug_enabled',Mage::app()->getStore())){
13
- Mage::log($message);
14
- }
15
- }
16
-
17
- /**
18
- * Helper method to wrap requests for current time so we can adjust for different magento versions
19
- * @return string|number
20
- */
21
- function getTime(){
22
- if (function_exists('now')){
23
- return now(); // test just incase
24
- } else if (method_exists('Varien_Date','now')){
25
- return Varien_Date::now();
26
- }
27
- // fallback
28
- return time();
29
- }
30
-
31
- function getDashboardInsightsStats(){
32
- return $this->getSalesByAttributeCode('bmbleb_gender', 120);
33
- }
34
-
35
- function getSalesByAttributeCode($attributeCode = 'bmbmeb_age', $numberDaysInRange = 120){
36
- /*
37
- * Sales by Age Last 60 Days. Pie chart. Use the age groups that Rapleaf gives us (whatever's in the data already.) Calculate the total sales by customers of each age group over the last 60 days and put that value into a pie chart. I guess you'll have to sum them all and determine a percentage for each so that they total 100%.
38
- */
39
- $stats = array();
40
- // load the table data with a custom query
41
- $resource = Mage::getSingleton('core/resource');
42
- $readConnection = $resource->getConnection('core_read');
43
-
44
- // setup date range
45
- $now = strtotime(Mage::helper('bmbleb')->getTime());
46
- $format = 'Y-m-d H:i:s';
47
- $currentEndDate = date($format, $now);
48
- $previousStartDate = date($format, strtotime("- ".($numberDaysInRange)." days", $now));
49
-
50
- $attribIdSelect = "SELECT a.attribute_id from " . $resource->getTableName('eav_attribute') . " a WHERE a.attribute_code = '" . $attributeCode . "'";
51
- $query = "SELECT v.attribute_id, v.value, COUNT(o.entity_id) AS orders_count, SUM((IFNULL(o.base_grand_total, 0) - IFNULL(o.base_total_canceled, 0)) * IFNULL(o.base_to_global_rate, 0)) AS total_income_amount FROM ".$resource->getTableName('sales_flat_order')." AS o left join " . $resource->getTableName('customer_entity_varchar') . " v on o.customer_id = v.entity_id WHERE (o.state NOT IN ('pending_payment', 'new')) and o.created_at between '".$previousStartDate."' and '".$currentEndDate."' and v.attribute_id in (" . $attribIdSelect . ") group by v.value, v.attribute_id order by v.attribute_id";
52
- $results = $readConnection->fetchAll($query);
53
- foreach ($results as $row){
54
- $attribValue = $row['value'];
55
- if (!empty($attribValue) && !empty($attribValue)){
56
- $stat = new Varien_Object();
57
- $stat->setData(array('label' => $attribValue, 'value' => $row['total_income_amount']));
58
- $stats[] = $stat;
59
- }
60
- }
61
-
62
- return $stats;
63
- }
64
-
65
- function getStatsSocialNetworkLinks(){
66
- $stats = array();
67
-
68
- $collection = Mage::getResourceModel('customer/customer_collection');
69
- $totalCustomers = $collection->count();
70
-
71
- // NOTE: the OR was hard to track down. The key was the 'left' join - needed to pass through a null for the second parameter
72
- $collection = Mage::getResourceModel('customer/customer_collection')
73
- ->addAttributeToFilter(
74
- array(
75
- array('attribute' => 'bmbleb_twitter', 'notnull'=>true),
76
- array('attribute' => 'bmbleb_facebook', 'notnull'=>true),
77
- array('attribute' => 'bmbleb_linkedin', 'notnull'=>true)
78
- ),
79
- NULL,
80
- 'left'
81
- );
82
- $hasOneOrMore = $collection->count();
83
-
84
- $collection = Mage::getResourceModel('customer/customer_collection')
85
- ->addAttributeToFilter('bmbleb_twitter', array('notnull'=>true))
86
- ->addAttributeToFilter('bmbleb_facebook', array('notnull'=>true))
87
- ->addAttributeToFilter('bmbleb_linkedin', array('notnull'=>true));
88
- $hasThree = $collection->count();
89
-
90
- $hasNone = $totalCustomers - $hasOneOrMore; // no links = total - one or more
91
- $hasOneOrTwo = $hasOneOrMore - $hasThree; // one or two = one or more - has three
92
-
93
- $stat = new Varien_Object();
94
- $stat->setData(array('label' => 'No Links', 'value' => $hasNone));
95
- $stats[] = $stat;
96
-
97
- $stat = new Varien_Object();
98
- $stat->setData(array('label' => '1 or 2 Links', 'value' => $hasOneOrTwo));
99
- $stats[] = $stat;
100
-
101
- $stat = new Varien_Object();
102
- $stat->setData(array('label' => '3 Links', 'value' => $hasThree, 'selected' => true));
103
- $stats[] = $stat;
104
-
105
- return $stats;
106
- }
107
-
108
- function getInsightsStats(){
109
- $collection = Mage::getResourceModel('customer/customer_collection');
110
- $totalCustomers = $collection->count();
111
-
112
- $collection = Mage::getResourceModel('customer/customer_collection')
113
- ->addAttributeToFilter('bmbleb_facebook', array('notnull'=>true));
114
- $totalFacebook = $collection->count();
115
-
116
- $collection = Mage::getResourceModel('customer/customer_collection')
117
- ->addAttributeToFilter('bmbleb_twitter', array('notnull'=>true));
118
- $totalTwitter = $collection->count();
119
-
120
- $collection = Mage::getResourceModel('customer/customer_collection')
121
- ->addAttributeToFilter('bmbleb_linkedin', array('notnull'=>true));
122
- $totalLinkedIn = $collection->count();
123
-
124
- $stats = new Varien_Object();
125
- $stats->setTotal($totalCustomers);
126
- $stats->setFacebook($totalFacebook / $totalCustomers * 100);
127
- $stats->setTwitter($totalTwitter / $totalCustomers * 100);
128
- $stats->setLinkedIn($totalLinkedIn / $totalCustomers * 100);
129
-
130
- return $stats;
131
- }
132
-
133
-
134
-
135
  }
1
  <?php
2
 
 
3
  class Springbot_Bmbleb_Helper_Data extends Mage_Core_Helper_Abstract
4
  {
5
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6
  }
app/code/community/Springbot/Bmbleb/Helper/ExternalLogging.php DELETED
@@ -1,69 +0,0 @@
1
- <?php
2
- class Springbot_Bmbleb_Helper_ExternalLogging
3
- {
4
- public function visibility($msg,$storeID='',$storeURL='',$pri='5')
5
- {
6
- Mage::log('Springbot: '.$msg);
7
- $uri = $this->fetchConfigVariable('api_url','https://api.springbot.com/').'api/logs';
8
- $filterChr =array('"','{','}'.'[',']',':');
9
-
10
- try {
11
- $rawJSON='{"logs" :{"'.$storeID.'":{"store_id":"'.$storeID.'",'
12
- .'"event_time":"' .date("Y-m-d H:i:s ".'-0500').'",'
13
- .'"store_url":"' .$storeURL.'",'
14
- .'"priority":"' .$pri.'",'
15
- .'"description":"'.str_replace($filterChr,' ',$msg).'"'
16
- .'}}}';
17
- $client = new Varien_Http_Client($uri);
18
- $client->setRawData($rawJSON);
19
- $response = json_decode($client->request('POST'),true);
20
- if ($response['status']=='error') {
21
- Mage::log('Springbot: '
22
- .'Post to->'.$url.' '
23
- .'JSON Buffer->'.$rawJSON.' '
24
- .'Response->'.implode(' ',$response));
25
- }
26
- } catch (Exception $e) {
27
- Mage::log('Springbot: '.$e->getMessage());
28
- }
29
- return;
30
- }
31
-
32
- public function log($toSend, $storeID, $priority = '5')
33
- {
34
- $uri = $this->fetchConfigVariable('api_url','https://api.springbot.com/').'api/logs';
35
-
36
- try {
37
- $client = new Varien_Http_Client($uri);
38
- $client->setRawData($this->encodePayload($toSend, $storeID));
39
- $response = json_decode($client->request('POST'),true);
40
-
41
- if ($response['status']=='error') {
42
- Mage::log('Springbot: '
43
- .'Post to->'.$url.' '
44
- .'JSON Buffer->'.$rawJSON.' '
45
- .'Response->'.implode(' ',$response));
46
- }
47
- } catch (Exception $e) {
48
- Mage::log('Springbot: '.$e->getMessage());
49
- }
50
- return;
51
- }
52
-
53
- public function encodePayload($array, $storeId, $priority = '5', $type = 'logs')
54
- {
55
- $array['event_time'] = date("Y-m-d H:i:s ".'-0500');
56
- $array['priority'] = $priority;
57
- $obj = new stdClass;
58
- $str = new stdClass;
59
- $str->$storeId = $array;
60
- $obj->$type = $str;
61
- return json_encode($obj);
62
- }
63
-
64
- private function fetchConfigVariable($varName,$defaultValue='')
65
- {
66
- $rtnValue = Mage::getStoreConfig('springbot/config/' . $varName);
67
- return !empty($rtnValue) ? $rtnValue : $defaultValue;
68
- }
69
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/Springbot/Bmbleb/Helper/GetTermsOfService.php DELETED
@@ -1,54 +0,0 @@
1
- <?php
2
- /**
3
- * Created by JetBrains PhpStorm.
4
- * User: joereger
5
- * Date: 1/6/12
6
- * Time: 9:39 AM
7
- * To change this template use File | Settings | File Templates.
8
- */
9
- class Socketware_Bmbleb_Helper_GetTermsOfService
10
- {
11
-
12
-
13
-
14
- public static function getTermsOfService(){
15
- $tos = '';
16
- try {
17
-
18
- $payload = array();
19
- $payload['storeguid'] = Mage::helper('bmbleb/Sync')->getStoreGuid();
20
-
21
-
22
- $apiResponse = Mage::helper('bmbleb/ApiCall')->call("gettermsofservice", $payload);
23
-
24
- if ($apiResponse->getResponsecode() == "200"){
25
- //Parse the response
26
- //Note that JSON.php is an edited version (see bottom of file)
27
- require_once('JSON.php'); // JSON parser
28
- require_once('jsonpath-0.8.1.php'); // JSONPath evaluator
29
- $parser = new Services_JSON(SERVICES_JSON_LOOSE_TYPE);
30
- $o = $parser->decode($apiResponse->getFullresponse());
31
- $tos = $o['termsofservice'];
32
- } elseif ($apiResponse->getResponsecode() == "400"){
33
- // return the error message instead of using flash system
34
- $tos = Mage::helper('bmbleb')->__('We\'re sorry, there\'s been an error loading the terms of service: ' . $apiResponse->getMessage());
35
- } else {
36
- // return the error message instead of using flash system
37
- $tos = Mage::helper('bmbleb')->__('We\'re sorry, there\'s been an error loading the terms of service.');
38
- }
39
- // end try/catch
40
- }
41
- catch (Mage_Core_Exception $e) {
42
- Mage::log("Error loading alerts: Mage_Core_Exception " . $e->getMessage());
43
- // return the error message instead of using flash system
44
- $tos = Mage::helper('bmbleb')->__('There\'s been an error loading the terms of service.');
45
- }
46
- catch (Exception $e) {
47
- Mage::log("Error loading alerts: Exception " . $e->getMessage());
48
- // return the error message instead of using flash system
49
- $tos = Mage::helper('bmbleb')->__('There was an error loading the terms of service.');
50
- }
51
- return $tos;
52
-
53
- }
54
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/Springbot/Bmbleb/Helper/PluginStatus.php CHANGED
@@ -2,12 +2,9 @@
2
 
3
  class Springbot_Bmbleb_Helper_PluginStatus extends Mage_Core_Helper_Abstract
4
  {
5
- const REPORTED_PROBLEMS_HASH_CONFIG = 'springbot/config/reported_problems_hash';
6
  const REPORT_PROBLEMS_INTERVAL_SECONDS = 604800; // Seven days in seconds
7
  const TOO_MANY_HOURS = 3; // Minimum number of hours since harvest to display warning
8
  const STORE_TIMESTAMP_GLOB = 'sb-cache-healthcheck-*.dat'; // Globbing string to find all
9
- const STORE_GUID_CONFIG_PREFIX = 'store_guid_'; // Prefix for the store guid config name
10
- const STORE_ID_CONFIG_PREFIX = 'store_id_'; // Prefix for the store id config name
11
 
12
  /**
13
  * Run all checks for fatal problems
@@ -39,6 +36,35 @@ class Springbot_Bmbleb_Helper_PluginStatus extends Mage_Core_Helper_Abstract
39
  return $this->_getPluginProblems(true, true, true);
40
  }
41
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
42
  /**
43
  * Get a list of all potential plugin problems to display on the problems page
44
  *
@@ -47,21 +73,20 @@ class Springbot_Bmbleb_Helper_PluginStatus extends Mage_Core_Helper_Abstract
47
  */
48
  private function _getPluginProblems($fatalProblems, $globalProblems, $possibleProblems)
49
  {
50
- $configVars = Mage::getStoreConfig('springbot/config');
51
  $problems = array();
52
 
53
 
54
  // Fatal problems are problems that will cause the Springbot section to redirect to the problems page
55
  if ($fatalProblems) {
56
 
57
- if ($this->_emailPasswordSet($configVars) && !$this->_harvestInFlight()) {
58
- if (($missingGuids = $this->_getMissingStoreGuids($configVars))) {
59
  $problems[] = array(
60
  'problem' => 'Missing GUIDs for the following stores: ' . $missingGuids,
61
  'solution' => 'This problem can usually be fixed by re-logging into your Springbot account. '
62
  );
63
  }
64
- if ($this->_tokenIsInvalid($configVars)) {
65
  $problems[] = array(
66
  'problem' => 'Security token is invalid',
67
  'solution' => 'This problem can usually be fixed by re-logging into your Springbot account. '
@@ -101,7 +126,7 @@ class Springbot_Bmbleb_Helper_PluginStatus extends Mage_Core_Helper_Abstract
101
  . 'navigate to your Magento directory and run the command "chown &lt;your webserver user&gt; var/tmp". '
102
  );
103
  }
104
- if ($secondsSinceHarvest = $this->_tooLongSinceCheckin()) {
105
  $hoursSinceHarvest = round($secondsSinceHarvest / 60 / 60);
106
  $problems[] = array(
107
  'problem' => 'It\'s been ' . $hoursSinceHarvest . ' hours since the Springbot plugin last checked in',
@@ -127,13 +152,12 @@ class Springbot_Bmbleb_Helper_PluginStatus extends Mage_Core_Helper_Abstract
127
  }
128
 
129
  // Report any plugin problems to the Springbot API once a week or for the very first time
130
- $configModel = Mage::getModel('core/config');
131
  if ($problems) {
132
- $lastApiReportHash = Mage::getStoreConfig(self::REPORTED_PROBLEMS_HASH_CONFIG, Mage::app()->getStore());
133
  $currentProblemsHash = md5(serialize($problems));
134
 
135
  if ($lastApiReportHash != $currentProblemsHash) {
136
- $configModel->saveConfig(self::REPORTED_PROBLEMS_HASH_CONFIG, $currentProblemsHash, 'default', 0);
137
  $this->_postProblemsToApi($problems);
138
  }
139
  }
@@ -155,21 +179,18 @@ class Springbot_Bmbleb_Helper_PluginStatus extends Mage_Core_Helper_Abstract
155
 
156
 
157
  public function needsToLogin() {
158
- $configVars = Mage::getStoreConfig('springbot/config');
159
- if ($this->_emailPasswordSet($configVars)) return false;
160
  else return true;
161
  }
162
 
163
  /**
164
  * Check to make sure user has logged in to avoid showing a problem notification before they even login
165
  */
166
- private function _emailPasswordSet($configVars)
167
  {
168
  if (
169
- isset($configVars['account_email']) &&
170
- isset($configVars['account_password']) &&
171
- $configVars['account_email'] &&
172
- $configVars['account_password']
173
  ) {
174
  return true;
175
  }
@@ -187,9 +208,9 @@ class Springbot_Bmbleb_Helper_PluginStatus extends Mage_Core_Helper_Abstract
187
  * Check if token is valid. Ideally we would want to check the actual validity of the token but we avoid that since
188
  * it would involve phoning home on each admin page load.
189
  */
190
- private function _tokenIsInvalid($configVars)
191
  {
192
- if ($configVars['security_token']) {
193
  return false;
194
  }
195
  else {
@@ -200,17 +221,13 @@ class Springbot_Bmbleb_Helper_PluginStatus extends Mage_Core_Helper_Abstract
200
  /**
201
  * Check if a GUID exists for every store
202
  */
203
- private function _getMissingStoreGuids($configVars)
204
  {
205
  $missingGuids = array();
206
  foreach (Mage::app()->getStores() as $store) {
207
- if (isset($configVars[self::STORE_ID_CONFIG_PREFIX . $store->getId()])) {
208
- $storeId = $configVars[self::STORE_ID_CONFIG_PREFIX . $store->getId()];
209
- }
210
- if (isset($configVars[self::STORE_GUID_CONFIG_PREFIX . $store->getId()])) {
211
- $storeGuid = $configVars[self::STORE_GUID_CONFIG_PREFIX . $store->getId()];
212
- }
213
- if (isset($storeId) && isset($storeGuid) && $storeId && !$storeGuid) {
214
  $missingGuids[] = $store->getId();
215
  }
216
  }
@@ -223,39 +240,12 @@ class Springbot_Bmbleb_Helper_PluginStatus extends Mage_Core_Helper_Abstract
223
 
224
  }
225
 
226
- /**
227
- * Check to see if its been a long time since the last checkin
228
- */
229
- private function _tooLongSinceCheckin()
230
- {
231
- $fileNameGlob = $this->_getFilenameGlob();
232
- $currentTime = time();
233
- $matches = glob($fileNameGlob);
234
- $secondsSinceLastCheckin = null;
235
- $mostRecentCheckin = null;
236
- foreach ($matches as $match) {
237
- $checkinTimestap = file_get_contents($match);
238
- $secondsSinceLastCheckin = $currentTime - $checkinTimestap;
239
- if (!$mostRecentCheckin || ($secondsSinceLastCheckin < $mostRecentCheckin)) {
240
- $mostRecentCheckin = $secondsSinceLastCheckin;
241
- }
242
- }
243
-
244
- if (($mostRecentCheckin === null) || ($mostRecentCheckin > (self::TOO_MANY_HOURS * 60 * 60))) {
245
- return $mostRecentCheckin;
246
- }
247
- else {
248
- return false;
249
- }
250
- }
251
-
252
-
253
  /**
254
  * Check to see if Magento tmp directory is writable
255
  */
256
  private function _tmpDirIsWritable()
257
  {
258
- return is_writable(Mage::getBaseDir() . '/var/tmp');
259
  }
260
 
261
  /**
@@ -263,7 +253,7 @@ class Springbot_Bmbleb_Helper_PluginStatus extends Mage_Core_Helper_Abstract
263
  */
264
  private function _logDirIsWritable()
265
  {
266
- return is_writable(Mage::getBaseDir() . '/var/log');
267
  }
268
 
269
  /**
@@ -271,7 +261,7 @@ class Springbot_Bmbleb_Helper_PluginStatus extends Mage_Core_Helper_Abstract
271
  */
272
  private function _tmpDirIsReadable()
273
  {
274
- return is_readable(Mage::getBaseDir() . '/var/tmp');
275
  }
276
 
277
  /**
@@ -279,7 +269,7 @@ class Springbot_Bmbleb_Helper_PluginStatus extends Mage_Core_Helper_Abstract
279
  */
280
  private function _logDirIsReadable()
281
  {
282
- return is_readable(Mage::getBaseDir() . '/var/log');
283
  }
284
 
285
  /**
@@ -295,7 +285,7 @@ class Springbot_Bmbleb_Helper_PluginStatus extends Mage_Core_Helper_Abstract
295
  */
296
  private function _postProblemsToApi($problems)
297
  {
298
- try{
299
  $baseStoreUrl = Mage::getStoreConfig('springbot/config/web/unsecure/base_url');
300
  $data = array(
301
  'store_url' => $baseStoreUrl,
@@ -306,8 +296,7 @@ class Springbot_Bmbleb_Helper_PluginStatus extends Mage_Core_Helper_Abstract
306
  $data['problems'][] = $problem['problem'];
307
  }
308
  $dataJson = json_encode($data);
309
- $apiModel = Mage::getModel('combine/api');
310
- $apiModel->call('installs', $dataJson, false);
311
  } catch (Exception $e) {
312
  // this call completing is not mission critical
313
  Springbot_Log::error($e);
@@ -337,9 +326,14 @@ class Springbot_Bmbleb_Helper_PluginStatus extends Mage_Core_Helper_Abstract
337
  {
338
  $phpPath = Mage::helper('combine/harvest')->getPhpExec();
339
  ob_start();
340
- Springbot_boss::spawn("{$phpPath} -r \"echo '<!-- PHP Test -->';\"", $output);
 
 
 
 
 
 
341
  $result = ob_get_clean();
342
  return trim($result) == '<!-- PHP Test -->';
343
  }
344
-
345
  }
2
 
3
  class Springbot_Bmbleb_Helper_PluginStatus extends Mage_Core_Helper_Abstract
4
  {
 
5
  const REPORT_PROBLEMS_INTERVAL_SECONDS = 604800; // Seven days in seconds
6
  const TOO_MANY_HOURS = 3; // Minimum number of hours since harvest to display warning
7
  const STORE_TIMESTAMP_GLOB = 'sb-cache-healthcheck-*.dat'; // Globbing string to find all
 
 
8
 
9
  /**
10
  * Run all checks for fatal problems
36
  return $this->_getPluginProblems(true, true, true);
37
  }
38
 
39
+
40
+ /**
41
+ * Check to see if its been a long time since the last checkin
42
+ */
43
+ public function tooLongSinceCheckin()
44
+ {
45
+ $fileNameGlob = $this->_getFilenameGlob();
46
+ $currentTime = time();
47
+ $matches = glob($fileNameGlob);
48
+ $secondsSinceLastCheckin = null;
49
+ $mostRecentCheckin = null;
50
+ foreach ($matches as $match) {
51
+ $checkinTimestap = file_get_contents($match);
52
+ $secondsSinceLastCheckin = $currentTime - $checkinTimestap;
53
+ if (!$mostRecentCheckin || ($secondsSinceLastCheckin < $mostRecentCheckin)) {
54
+ $mostRecentCheckin = $secondsSinceLastCheckin;
55
+ }
56
+ }
57
+
58
+ if (($mostRecentCheckin === null) || ($mostRecentCheckin > (self::TOO_MANY_HOURS * 60 * 60))) {
59
+ return $mostRecentCheckin;
60
+ }
61
+ else {
62
+ return false;
63
+ }
64
+ }
65
+
66
+
67
+
68
  /**
69
  * Get a list of all potential plugin problems to display on the problems page
70
  *
73
  */
74
  private function _getPluginProblems($fatalProblems, $globalProblems, $possibleProblems)
75
  {
 
76
  $problems = array();
77
 
78
 
79
  // Fatal problems are problems that will cause the Springbot section to redirect to the problems page
80
  if ($fatalProblems) {
81
 
82
+ if ($this->_emailPasswordSet() && !$this->_harvestInFlight()) {
83
+ if (($missingGuids = $this->_getMissingStoreGuids())) {
84
  $problems[] = array(
85
  'problem' => 'Missing GUIDs for the following stores: ' . $missingGuids,
86
  'solution' => 'This problem can usually be fixed by re-logging into your Springbot account. '
87
  );
88
  }
89
+ if ($this->_tokenIsInvalid()) {
90
  $problems[] = array(
91
  'problem' => 'Security token is invalid',
92
  'solution' => 'This problem can usually be fixed by re-logging into your Springbot account. '
126
  . 'navigate to your Magento directory and run the command "chown &lt;your webserver user&gt; var/tmp". '
127
  );
128
  }
129
+ if ($secondsSinceHarvest = $this->tooLongSinceCheckin()) {
130
  $hoursSinceHarvest = round($secondsSinceHarvest / 60 / 60);
131
  $problems[] = array(
132
  'problem' => 'It\'s been ' . $hoursSinceHarvest . ' hours since the Springbot plugin last checked in',
152
  }
153
 
154
  // Report any plugin problems to the Springbot API once a week or for the very first time
 
155
  if ($problems) {
156
+ $lastApiReportHash = Mage::getStoreConfig('springbot/config/reported_problems_hash', Mage::app()->getStore());
157
  $currentProblemsHash = md5(serialize($problems));
158
 
159
  if ($lastApiReportHash != $currentProblemsHash) {
160
+ Mage::getModel('core/config')->saveConfig('springbot/config/reported_problems_hash', $currentProblemsHash, 'default', 0);
161
  $this->_postProblemsToApi($problems);
162
  }
163
  }
179
 
180
 
181
  public function needsToLogin() {
182
+ if ($this->_emailPasswordSet()) return false;
 
183
  else return true;
184
  }
185
 
186
  /**
187
  * Check to make sure user has logged in to avoid showing a problem notification before they even login
188
  */
189
+ private function _emailPasswordSet()
190
  {
191
  if (
192
+ Mage::getStoreConfig('springbot/config/account_email') &&
193
+ Mage::getStoreConfig('springbot/config/account_password')
 
 
194
  ) {
195
  return true;
196
  }
208
  * Check if token is valid. Ideally we would want to check the actual validity of the token but we avoid that since
209
  * it would involve phoning home on each admin page load.
210
  */
211
+ private function _tokenIsInvalid()
212
  {
213
+ if (Mage::getStoreConfig('springbot/config/security_token')) {
214
  return false;
215
  }
216
  else {
221
  /**
222
  * Check if a GUID exists for every store
223
  */
224
+ private function _getMissingStoreGuids()
225
  {
226
  $missingGuids = array();
227
  foreach (Mage::app()->getStores() as $store) {
228
+ $storeId = Mage::getStoreConfig('springbot/config/store_id_' . $store->getId());
229
+ $storeGuid = Mage::getStoreConfig('springbot/config/store_guid_' . $store->getId());
230
+ if ($storeId && !$storeGuid) {
 
 
 
 
231
  $missingGuids[] = $store->getId();
232
  }
233
  }
240
 
241
  }
242
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
243
  /**
244
  * Check to see if Magento tmp directory is writable
245
  */
246
  private function _tmpDirIsWritable()
247
  {
248
+ return is_writable(Mage::getBaseDir('tmp'));
249
  }
250
 
251
  /**
253
  */
254
  private function _logDirIsWritable()
255
  {
256
+ return is_writable(Mage::getBaseDir('log'));
257
  }
258
 
259
  /**
261
  */
262
  private function _tmpDirIsReadable()
263
  {
264
+ return is_readable(Mage::getBaseDir('tmp'));
265
  }
266
 
267
  /**
269
  */
270
  private function _logDirIsReadable()
271
  {
272
+ return is_readable(Mage::getBaseDir('log'));
273
  }
274
 
275
  /**
285
  */
286
  private function _postProblemsToApi($problems)
287
  {
288
+ try {
289
  $baseStoreUrl = Mage::getStoreConfig('springbot/config/web/unsecure/base_url');
290
  $data = array(
291
  'store_url' => $baseStoreUrl,
296
  $data['problems'][] = $problem['problem'];
297
  }
298
  $dataJson = json_encode($data);
299
+ Mage::getModel('combine/api')->call('installs', $dataJson, false);
 
300
  } catch (Exception $e) {
301
  // this call completing is not mission critical
302
  Springbot_Log::error($e);
326
  {
327
  $phpPath = Mage::helper('combine/harvest')->getPhpExec();
328
  ob_start();
329
+ try {
330
+ Springbot_boss::spawn("{$phpPath} -r \"echo '<!-- PHP Test -->';\"", $output);
331
+ }
332
+ catch (Exception $e) {
333
+ // We do not know if the PHP executable path is correct or not since we cannot run spawn anyway
334
+ return true;
335
+ }
336
  $result = ob_get_clean();
337
  return trim($result) == '<!-- PHP Test -->';
338
  }
 
339
  }
app/code/community/Springbot/Bmbleb/Model/Alert.php DELETED
@@ -1,63 +0,0 @@
1
- <?php
2
-
3
- class Socketware_Bmbleb_Model_Alert extends Mage_Core_Model_Abstract
4
- {
5
-
6
- public function _construct()
7
- {
8
- parent::_construct();
9
- $this->_init('bmbleb/alert');
10
- }
11
-
12
- /*
13
- * Returns the next Alert that should be completed using the following logic:
14
- * exclude all completed ones
15
- * AND return new ones before skipped ones
16
- * AND return higher priority ones first
17
- * AND return the most recently updated ones first
18
- */
19
- public function getNextToDo()
20
- {
21
- $collection = Mage::getModel('bmbleb/alert')->getCollection()
22
- ->addFieldToFilter('status', array('neq' => Socketware_Bmbleb_Model_Alert_Status::COMPLETED));
23
- $collection->addOrder('status', 'asc')
24
- ->addOrder('priority', 'desc')
25
- ->addOrder('updated_at', 'desc');
26
- return $collection->getFirstItem();
27
- }
28
-
29
- public function getStatusCounts()
30
- {
31
- $collection = Mage::getModel('bmbleb/alert')->getCollection()
32
- ->removeAllFieldsFromSelect()
33
- ->removeFieldFromSelect($this->getIdFieldName())
34
- ->addFieldToSelect('status')
35
- ->addExpressionFieldToSelect('total', 'COUNT({{status}})', 'status');
36
- // NOTE: had to add the group by clause separately and to the select itself
37
- $collection->getSelect()->group('status');
38
-
39
- $stats = array(
40
- 'new' => 0,
41
- 'skipped' => 0,
42
- 'completed' => 0,
43
- 'total' => 0
44
- );
45
- foreach ($collection as $model){
46
- switch ($model->getStatus()){
47
- case Socketware_Bmbleb_Model_Alert_Status::UNOPENED:
48
- $stats['new'] = $model->getTotal();
49
- break;
50
- case Socketware_Bmbleb_Model_Alert_Status::SKIPPED:
51
- $stats['skipped'] = $model->getTotal();
52
- break;
53
- case Socketware_Bmbleb_Model_Alert_Status::COMPLETED:
54
- $stats['completed'] = $model->getTotal();
55
- break;
56
- }
57
- $stats['total'] += $model->getTotal();
58
- }
59
- return $stats;
60
- }
61
-
62
-
63
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/Springbot/Bmbleb/Model/Alert/Priority.php DELETED
@@ -1,27 +0,0 @@
1
- <?php
2
- /**
3
- * Alert type model
4
- *
5
- * @category Bmbleb
6
- * @package Bmbleb_Alert
7
- * @author Jeremy Dost <jdost@sharpdotinc.com>
8
- */
9
- class Socketware_Bmbleb_Model_Alert_Priority extends Mage_Core_Model_Abstract
10
- {
11
- const LOW = 2;
12
- const MED = 3;
13
- const HI = 4;
14
-
15
- public function getOptions()
16
- {
17
- $options = new Varien_Object(array(
18
- self::LOW => Mage::helper('bmbleb')->__('Low'),
19
- self::MED => Mage::helper('bmbleb')->__('Medium'),
20
- self::HI => Mage::helper('bmbleb')->__('High'),
21
- ));
22
- return $options->getData();
23
- }
24
-
25
-
26
- }
27
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/Springbot/Bmbleb/Model/Alert/Status.php DELETED
@@ -1,27 +0,0 @@
1
- <?php
2
- /**
3
- * Alert type model
4
- *
5
- * @category Bmbleb
6
- * @package Bmbleb_Alert
7
- * @author Jeremy Dost <jdost@sharpdotinc.com>
8
- */
9
- class Socketware_Bmbleb_Model_Alert_Status extends Mage_Core_Model_Abstract
10
- {
11
- const UNOPENED = 0;
12
- const SKIPPED = 1;
13
- const COMPLETED = 2;
14
-
15
- public function getOptions()
16
- {
17
- $options = new Varien_Object(array(
18
- self::UNOPENED => Mage::helper('bmbleb')->__('New'),
19
- self::SKIPPED => Mage::helper('bmbleb')->__('Skipped'),
20
- self::COMPLETED => Mage::helper('bmbleb')->__('Completed'),
21
- ));
22
- return $options->getData();
23
- }
24
-
25
-
26
- }
27
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/Springbot/Bmbleb/Model/Alert/Type.php DELETED
@@ -1,45 +0,0 @@
1
- <?php
2
- /**
3
- * Alert type model
4
- *
5
- * @category Bmbleb
6
- * @package Bmbleb_Alert
7
- * @author Jeremy Dost <jdost@sharpdotinc.com>
8
- */
9
- class Socketware_Bmbleb_Model_Alert_Type extends Mage_Core_Model_Abstract
10
- {
11
- //These are the current possible alerttypeids
12
- const LENGTHOFRESIDENCERESET = 200;
13
- const OCCUPATION = 300;
14
- const HOMEOWNERSTATUSRENTTOOWN = 400;
15
- const HOMEOWNERSTATUSOWNTORENT = 410;
16
- const MARITALSTATUSSINGLETOMARRIED = 500;
17
- const MARITALSTATUSMARRIEDTOSINGLE = 510;
18
- const CHILDRENNOTOYES = 600;
19
- const EDUCATIONCOMPLETEDCOLLEGE = 700;
20
- const EDUCATIONCOMPLETEDHIGHSCHOOL = 710;
21
- const VEHICLENEW = 800;
22
- const HIGHNETWORTHNOTOYES = 900;
23
- const LOANTOVALUERATIOOVER80 = 1000;
24
- const LOANTOVALUERATIOUNDER80 = 1010;
25
- const TWITTERNEW = 1100;
26
- const FACEBOOKNEW = 1200;
27
- const LINKEDINNEW = 1300;
28
- const IMAGEURLNEW = 1400;
29
- const COMPANYCHANGE = 1500;
30
- const TITLECHANGE = 1600;
31
- const LOCATIONCHANGE = 1700;
32
-
33
- public function getOptions()
34
- {
35
- $options = new Varien_Object(array(
36
- self::TWITTERNEW => Mage::helper('bmbleb')->__('New Twitter'),
37
- self::FACEBOOKNEW => Mage::helper('bmbleb')->__('New Facebook'),
38
- self::LINKEDINNEW => Mage::helper('bmbleb')->__('New LinkedIn'),
39
- ));
40
- return $options->getData();
41
- }
42
-
43
-
44
- }
45
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/Springbot/Bmbleb/Model/Bmblebprops.php DELETED
@@ -1,38 +0,0 @@
1
- <?php
2
-
3
- class Socketware_Bmbleb_Model_Bmblebprops extends Mage_Core_Model_Abstract
4
- {
5
- public function _construct()
6
- {
7
- parent::_construct();
8
- $this->_init('bmbleb/bmblebprops');
9
- }
10
-
11
- public function getValueByKey($key) {
12
- $props = Mage::getModel('bmbleb/bmblebprops')->getCollection();
13
- foreach($props as $prop){
14
- if ($prop->getKey() == $key){
15
- return $prop->getValue();
16
- }
17
- }
18
-
19
- return null;
20
- }
21
-
22
- public function setValueByKey($key, $value) {
23
- //Delete any value for key currently present
24
- $props = Mage::getModel('bmbleb/bmblebprops')->getCollection();
25
- foreach($props as $prop){
26
- if ($prop->getKey() == $key){
27
- $prop->delete();
28
- }
29
- }
30
- //Insert key/value pair
31
- $prop = Mage::getModel('bmbleb/bmblebprops');
32
- $prop->setKey($key);
33
- $prop->setValue($value);
34
- return $prop->save();
35
- }
36
-
37
-
38
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/Springbot/Bmbleb/Model/Mysql4/Bmbleb/Collection.php DELETED
@@ -1,10 +0,0 @@
1
- <?php
2
-
3
- class Socketware_Bmbleb_Model_Mysql4_Bmbleb_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
4
- {
5
- public function _construct()
6
- {
7
- parent::_construct();
8
- $this->_init('bmbleb/bmbleb');
9
- }
10
- }
 
 
 
 
 
 
 
 
 
 
app/code/community/Springbot/Bmbleb/Model/Sync.php CHANGED
@@ -2,7 +2,6 @@
2
 
3
  class Socketware_Bmbleb_Model_Sync extends Mage_Core_Model_Abstract
4
  {
5
-
6
  const STATUS_STARTED = 0;
7
  const STATUS_PROCESSING = 1;
8
  const STATUS_PARTIALLY_COMPLETE = 2;
2
 
3
  class Socketware_Bmbleb_Model_Sync extends Mage_Core_Model_Abstract
4
  {
 
5
  const STATUS_STARTED = 0;
6
  const STATUS_PROCESSING = 1;
7
  const STATUS_PARTIALLY_COMPLETE = 2;
app/code/community/Springbot/Bmbleb/controllers/Adminhtml/LogsController.php CHANGED
@@ -10,7 +10,7 @@ class Springbot_Bmbleb_Adminhtml_LogsController extends Mage_Adminhtml_Controlle
10
 
11
  public function downloadAction() {
12
  $logName = $this->getRequest()->getParam('name');;
13
- $logPath = Mage::getBaseDir('log') . '/' . $logName;
14
  if (!is_file($logPath) || !is_readable($logPath)) {
15
  throw new Exception();
16
  }
10
 
11
  public function downloadAction() {
12
  $logName = $this->getRequest()->getParam('name');;
13
+ $logPath = Mage::getBaseDir('log') . DS . $logName;
14
  if (!is_file($logPath) || !is_readable($logPath)) {
15
  throw new Exception();
16
  }
app/code/community/Springbot/Bmbleb/controllers/Adminhtml/SettingsController.php CHANGED
@@ -1,33 +1,20 @@
1
  <?php
2
  class Springbot_Bmbleb_Adminhtml_SettingsController extends Mage_Adminhtml_Controller_Action
3
  {
4
- protected $_configVars;
5
-
6
- const CONFIG_VAR_FAMILY = 'springbot';
7
- const CONFIG_VAR_GROUP = 'config';
8
-
9
- protected function _init()
10
- {
11
- $this->_configVars = Mage::getStoreConfig(self::CONFIG_VAR_FAMILY.'/'.self::CONFIG_VAR_GROUP,Mage::app()->getStore());
12
- }
13
-
14
  public function indexAction()
15
  {
16
- $this->_init();
17
-
18
- $securityToken = $this->fetchConfigVariable('security_token');
19
-
20
- if(empty($securityToken)) {
21
  $auth = Mage::helper('bmbleb/Account')->authenticate(
22
- $this->fetchConfigVariable('account_email'),
23
- Mage::helper('core')->decrypt($this->fetchConfigVariable('account_password'))
24
  );
25
  } else {
26
  $auth = true;
27
  }
28
 
29
  if ($auth) {
30
- $bmbAcct=Mage::helper('bmbleb/Account');
31
  $bmbAcct->setIsLoggedIn(true);
32
  $this->_redirect('bmbleb/adminhtml_index/status');
33
  return;
@@ -36,22 +23,23 @@ class Springbot_Bmbleb_Adminhtml_SettingsController extends Mage_Adminhtml_Contr
36
  $this->_redirect('bmbleb/adminhtml_index/auth');
37
  return;
38
  }
 
39
  public function postAction()
40
  {
41
  if ($data = $this->getRequest()->getPost()) {
42
  // if both password fields are empty then do NOT attempt to update them
43
  $password = $data['password'];
44
  $passwordverify = $data['passwordverify'];
45
- if ($password != '' || $passwordverify != ''){
46
  // some extra validation
47
- if (strlen($password) <= 6){
48
  Mage::getSingleton('adminhtml/session')->addError('Passwords must be more than 6 characters long.');
49
- } else if ($password != $passwordverify){
50
  Mage::getSingleton('adminhtml/session')->addError('The passwords entered did not match.');
51
  } else {
52
  // validated - attempt save
53
  $result = Mage::helper('bmbleb/ChangePassword')->ChangePassword($password);
54
- if ($result === true){
55
  // update the saved and session password too
56
  $bmblebAccount = Mage::helper('bmbleb/Account');
57
  $account = $bmblebAccount->getAccount();
@@ -72,12 +60,5 @@ class Springbot_Bmbleb_Adminhtml_SettingsController extends Mage_Adminhtml_Contr
72
  $this->_redirect('*/*/index', array());
73
  return;
74
  }
75
- private function fetchConfigVariable($varName, $default_value = '')
76
- {
77
- if (isset($this->_configVars[$varName])) {
78
- return $this->_configVars[$varName];
79
- } else {
80
- return $default_value;
81
- }
82
- }
83
  }
1
  <?php
2
  class Springbot_Bmbleb_Adminhtml_SettingsController extends Mage_Adminhtml_Controller_Action
3
  {
 
 
 
 
 
 
 
 
 
 
4
  public function indexAction()
5
  {
6
+ $securityToken = Mage::getStoreConfig('springbot/config/security_token');
7
+ if (!$securityToken) {
 
 
 
8
  $auth = Mage::helper('bmbleb/Account')->authenticate(
9
+ Mage::getStoreConfig('springbot/config/account_email'),
10
+ Mage::helper('core')->decrypt(Mage::getStoreConfig('springbot/config/account_password'))
11
  );
12
  } else {
13
  $auth = true;
14
  }
15
 
16
  if ($auth) {
17
+ $bmbAcct = Mage::helper('bmbleb/Account');
18
  $bmbAcct->setIsLoggedIn(true);
19
  $this->_redirect('bmbleb/adminhtml_index/status');
20
  return;
23
  $this->_redirect('bmbleb/adminhtml_index/auth');
24
  return;
25
  }
26
+
27
  public function postAction()
28
  {
29
  if ($data = $this->getRequest()->getPost()) {
30
  // if both password fields are empty then do NOT attempt to update them
31
  $password = $data['password'];
32
  $passwordverify = $data['passwordverify'];
33
+ if ($password != '' || $passwordverify != '') {
34
  // some extra validation
35
+ if (strlen($password) <= 6) {
36
  Mage::getSingleton('adminhtml/session')->addError('Passwords must be more than 6 characters long.');
37
+ } else if ($password != $passwordverify) {
38
  Mage::getSingleton('adminhtml/session')->addError('The passwords entered did not match.');
39
  } else {
40
  // validated - attempt save
41
  $result = Mage::helper('bmbleb/ChangePassword')->ChangePassword($password);
42
+ if ($result === true) {
43
  // update the saved and session password too
44
  $bmblebAccount = Mage::helper('bmbleb/Account');
45
  $account = $bmblebAccount->getAccount();
60
  $this->_redirect('*/*/index', array());
61
  return;
62
  }
63
+
 
 
 
 
 
 
 
64
  }
app/code/community/Springbot/Bmbleb/controllers/LoginController.php CHANGED
@@ -1,39 +1,44 @@
1
  <?php
2
  class Springbot_Bmbleb_LoginController extends Mage_Adminhtml_Controller_Action
3
  {
4
- const CONFIG_VAR_FAMILY ="springbot";
5
- const CONFIG_VAR_GROUP ="config";
6
- private $configVars =array();
7
-
8
- protected function _initAction() {
9
  $this->loadLayout();
10
  return $this;
11
  }
12
- public function indexAction() {
13
- // $this->_forward('edit');
14
- $this->loadLayout()
15
- ->_addContent($this->getLayout()->createBlock('bmbleb/adminhtml_bmbleb_login'))
16
- ->renderLayout();
 
17
  }
18
- public function newAction() {
19
- // $this->_forward('edit');
20
- $this->loadLayout()
21
- ->_addContent($this->getLayout()->createBlock('bmbleb/adminhtml_bmbleb_login'))
22
- ->renderLayout();
 
23
  }
24
- public function editAction() {
 
 
25
  $this->loadLayout()
26
- ->_addContent($this->getLayout()->createBlock('bmbleb/adminhtml_bmbleb_login'))
27
- ->renderLayout();
28
  }
29
- public function loginAction() {
30
 
31
- $email = $this->getRequest()->getParam('email');
32
- $pass = $this->getRequest()->getParam('password');
 
 
33
 
34
  $bmblebAccount = Mage::helper('bmbleb/Account');
35
  $bmblebAccount->setIsLoggedIn(false);
36
- $url = $this->fetchConfigVariable('api_url','https://api.springbot.com/').'api/registration/login';
 
 
 
37
 
38
  try {
39
  $client = new Varien_Http_Client($url);
@@ -52,25 +57,15 @@ class Springbot_Bmbleb_LoginController extends Mage_Adminhtml_Controller_Action
52
  Mage::getSingleton('adminhtml/session')->addError($result['message'].' or service unavailable from '.$url);
53
  $this->_redirect('bmbleb/adminhtml_index/auth');
54
  } else {
55
- if ($result['token']=='') {
56
  Mage::getSingleton('adminhtml/session')->addError('Login denied by Springbot');
57
  $this->_redirect('bmbleb/adminhtml_index/auth');
58
  } else {
59
- Mage::log('Email->'.$email.' Token->'.$result['token']);
60
  $bmblebAccount->setSavedAccountInformation($email,$pass,$result['token']);
61
  $this->_redirect('bmbleb/adminhtml_index/index');
62
  }
63
  }
64
  }
65
- private function fetchConfigVariable($varName,$default_value='')
66
- {
67
- $this->configVars = Mage::getStoreConfig(self::CONFIG_VAR_FAMILY.'/'.self::CONFIG_VAR_GROUP, Mage::app()->getStore());
68
 
69
- if (isset($this->configVars[$varName])) {
70
- $rtnValue = $this->configVars[$varName];
71
- } else {
72
- $rtnValue = $default_value;
73
- }
74
- return $rtnValue;
75
- }
76
  }
1
  <?php
2
  class Springbot_Bmbleb_LoginController extends Mage_Adminhtml_Controller_Action
3
  {
4
+ protected function _initAction()
5
+ {
 
 
 
6
  $this->loadLayout();
7
  return $this;
8
  }
9
+
10
+ public function indexAction()
11
+ {
12
+ $this->loadLayout()
13
+ ->_addContent($this->getLayout()->createBlock('bmbleb/adminhtml_bmbleb_login'))
14
+ ->renderLayout();
15
  }
16
+
17
+ public function newAction()
18
+ {
19
+ $this->loadLayout()
20
+ ->_addContent($this->getLayout()->createBlock('bmbleb/adminhtml_bmbleb_login'))
21
+ ->renderLayout();
22
  }
23
+
24
+ public function editAction()
25
+ {
26
  $this->loadLayout()
27
+ ->_addContent($this->getLayout()->createBlock('bmbleb/adminhtml_bmbleb_login'))
28
+ ->renderLayout();
29
  }
 
30
 
31
+ public function loginAction()
32
+ {
33
+ $email = $this->getRequest()->getParam('email');
34
+ $pass = $this->getRequest()->getParam('password');
35
 
36
  $bmblebAccount = Mage::helper('bmbleb/Account');
37
  $bmblebAccount->setIsLoggedIn(false);
38
+ if (!($url = Mage::getStoreConfig('springbot/config/api_url'))) {
39
+ $url = 'https://api.springbot.com/';
40
+ }
41
+ $url .= 'api/registration/login';
42
 
43
  try {
44
  $client = new Varien_Http_Client($url);
57
  Mage::getSingleton('adminhtml/session')->addError($result['message'].' or service unavailable from '.$url);
58
  $this->_redirect('bmbleb/adminhtml_index/auth');
59
  } else {
60
+ if ($result['token'] == '') {
61
  Mage::getSingleton('adminhtml/session')->addError('Login denied by Springbot');
62
  $this->_redirect('bmbleb/adminhtml_index/auth');
63
  } else {
64
+ Mage::log('Email->' . $email.' Token->' . $result['token']);
65
  $bmblebAccount->setSavedAccountInformation($email,$pass,$result['token']);
66
  $this->_redirect('bmbleb/adminhtml_index/index');
67
  }
68
  }
69
  }
 
 
 
70
 
 
 
 
 
 
 
 
71
  }
app/code/community/Springbot/Bmbleb/controllers/RegisterController.php DELETED
@@ -1,350 +0,0 @@
1
- <?php
2
-
3
- class Springbot_Bmbleb_RegisterController extends Mage_Adminhtml_Controller_Action
4
- {
5
-
6
- protected function _initAction()
7
- {
8
- $domain = Mage::getBaseUrl();
9
- Mage::helper('bmbleb/ExternalLogging')->visibility("Registration Controller initiated", '', $domain);
10
-
11
- $regStatus = Mage::getStoreConfig('springbot/config/registration_status', Mage::app()->getStore());
12
-
13
- if ($regStatus == 'complete') {
14
- Mage::getSingleton('adminhtml/session')->addError(Mage::helper('bmbleb')->__('Please register for your free Springbot account.'));
15
- session_write_close();
16
- $this->_redirect('bmbleb/adminhtml_index/status');
17
- }
18
- Mage::helper('bmbleb/ExternalLogging')->visibility("Null Registration detected", '', $domain);
19
-
20
- $this->loadLayout()
21
- ->_setActiveMenu('bmbleb/register');
22
-
23
- return $this;
24
- }
25
-
26
- public function indexAction()
27
- {
28
- $this->_forward('edit');
29
- }
30
-
31
- public function editAction()
32
- {
33
-
34
- $this->_initAction();
35
- $this->loadLayout();
36
- $this->_addLeft(
37
- $this->getLayout()->createBlock('adminhtml/template')
38
- ->setTemplate('bmbleb/tabs.phtml'));
39
-
40
- $this->_addContent($this->getLayout()->createBlock('bmbleb/adminhtml_bmbleb_register'));
41
- $this->renderLayout();
42
- }
43
-
44
- public function newAction()
45
- {
46
- $this->_forward('edit');
47
- }
48
-
49
- public function registerAction()
50
- {
51
-
52
- $emptyString = 0;
53
- $minimumNAMELength = 3;
54
- $minimumPASSWORDLength = 6;
55
- $validationMessage = '';
56
-
57
- $uname = $this->getRequest()->getParam('uname');
58
- $email = $this->getRequest()->getParam('email');
59
- $password = $this->getRequest()->getParam('password');
60
- $passwordverify = $this->getRequest()->getParam('passwordverify');
61
-
62
- if (strlen($uname) == $emptyString) {
63
- $validationMessage = $this->saveMessage($validationMessage, 'Your name is required');
64
- }
65
- if (strlen($email) == $emptyString) {
66
- $validationMessage = $this->saveMessage($validationMessage, 'Email is required.');
67
- }
68
- if (strlen($password) == $emptyString) {
69
- $validationMessage = $this->saveMessage($validationMessage, 'Password is required.');
70
- }
71
- if (strlen($passwordverify) == $emptyString) {
72
- $validationMessage = $this->saveMessage($validationMessage, 'Confirm Password is required.');
73
- }
74
- if (strlen($uname) < $minimumNAMELength) {
75
- $validationMessage = $this->saveMessage($validationMessage, "Your name must be at least $minimumNAMELength characters long.");
76
- }
77
- if (!$this->check_email_address($email)) {
78
- $validationMessage = $this->saveMessage($validationMessage, 'Email is not valid.');
79
- }
80
- if (strlen($password) < $minimumPASSWORDLength) {
81
- $validationMessage = $this->saveMessage($validationMessage, "Your password must be at least $minimumPASSWORDLength characters long.");
82
- }
83
- if ($password != $passwordverify) {
84
- $validationMessage = $this->saveMessage($validationMessage, 'Your passwords must match.');
85
- }
86
- if ($validationMessage != '') {
87
- Mage::getSingleton('adminhtml/session')->addError(Mage::helper('bmbleb')->__($validationMessage));
88
- $this->_redirect('bmbleb/adminhtml_index/auth');
89
- return;
90
- }
91
- $payload = array();
92
- $payload['registeremail'] = $email;
93
- $payload['registerpassword'] = $password;
94
- $payload['verifypassword'] = $passwordverify;
95
- $payload['uname'] = $uname;
96
-
97
- $apiResponse = Mage::helper('bmbleb/ApiCall')->call("registration", $payload);
98
- if ($apiResponse->getResponsecode() == "200") {
99
- $msg = $this->parseBody($apiResponse->getFullresponse());
100
- if ($msg != '') {
101
- Mage::getSingleton('adminhtml/session')->addError(Mage::helper('bmbleb')->__($msg));
102
- $this->_redirect('bmbleb/adminhtml_index/auth');
103
- return;
104
- }
105
- Mage::getSingleton('core/session')->setBmblebJustRegistered(TRUE);
106
- Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('bmbleb')->__('Your Springbot Connect account has been created.'));
107
-
108
- $this->globalSettings($email, $password);
109
- $this->registerAllStores($email, $password);
110
-
111
- $this->_redirect('bmbleb/adminhtml_index/index');
112
-
113
- } else {
114
-
115
- Mage::getSingleton('adminhtml/session')->addError(Mage::helper('bmbleb')->__('We\'re sorry, there\'s been an error: '
116
- . '[' . $apiResponse->getResponsecode() . ']'
117
- . '-' . $apiResponse->getMessage()));
118
- $this->_redirect('bmbleb/adminhtml_index/auth');
119
- }
120
-
121
- }
122
-
123
- function parseBody($body)
124
- {
125
- $msg = '';
126
- $pos = strpos($body, '"status":"error"');
127
- if ($pos > 0) {
128
- $len = strlen($body);
129
- $pos = strpos($body, '"message"', $pos);
130
- $pos = $pos + 12;
131
- $siz = $len - $pos - 3;
132
- $msg = substr($body, $pos, $siz);
133
- }
134
- return $msg;
135
- }
136
-
137
- function saveMessage($msg, $newmsg)
138
- {
139
- if ($msg == '') {
140
- return $newmsg;
141
- } else {
142
- return $msg;
143
- }
144
- }
145
-
146
- function check_email_address($email)
147
- {
148
- if (filter_var($email, FILTER_VALIDATE_EMAIL)) {
149
- return true;
150
- } else {
151
- return false;
152
- }
153
- }
154
-
155
- function registerAllStores($email, $password)
156
- {
157
- Mage::app()->getWebsites();
158
- Mage::app()->getStores();
159
-
160
- foreach (Mage::app()->getWebsites() as $website) {
161
- foreach ($website->getGroups() as $group) {
162
- $stores = $group->getStores();
163
- foreach ($stores as $store) {
164
- $this->registerEachStore($email,
165
- $password,
166
- $store['website_id'],
167
- $store['store_id'],
168
- $store['name'],
169
- $store['code'],
170
- $store['is_active']);
171
- }
172
- }
173
- }
174
- $this->commitVars(array('registration_status' => 'complete'));
175
- }
176
-
177
- function registerEachStore($email, $pswd, $webId, $storeId, $storeName, $storeCode, $storeActive)
178
- {
179
- $logMsg = '>WebID->' . $webId
180
- . ' StoreID->' . $storeId
181
- . ' StoreName->' . $storeName
182
- . ' StoreCode->' . $storeCode
183
- . ' StoreActive->' . $storeActive;
184
-
185
- Mage::log('Register Store:' . $logMsg);
186
-
187
- $apiClass = 'stores';
188
- $baseUrl = Mage::getBaseUrl();
189
- $logo_src = Mage::getStoreConfig('design/header/logo_src');
190
- $logo_alt_tag = Mage::getStoreConfig('design/header/logo_alt');
191
- $media_url = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA);
192
-
193
- $url_components = explode('/', $baseUrl);
194
- $siteBaseURL = $url_components[0] . '//' . $url_components[2];
195
-
196
- $results = $this->RequestSecurityToken($email, $pswd);
197
-
198
- if ($results['status'] == 'error') {
199
- Mage::getSingleton('adminhtml/session')->addError(Mage::helper('bmbleb')->__("Error: " . $results['message']));
200
- $this->_redirect('bmbleb/adminhtml_index/auth');
201
- return;
202
- }
203
-
204
- if ($results['status'] == 'ok') {
205
- $securityToken = $results['token'];
206
- $charid = strtoupper(md5(uniqid(rand(), true)));
207
- $guid = substr($charid, 0, 8) . '-'
208
- . substr($charid, 8, 4) . '-'
209
- . substr($charid, 12, 4) . '-'
210
- . substr($charid, 16, 4) . '-'
211
- . substr($charid, 20, 12);
212
- $stores = array();
213
- $stores['guid'] = $guid;
214
- $stores['url'] = $siteBaseURL;
215
- $stores['name'] = $storeName;
216
- //ENABLE: In next release (after 1/19)
217
- //
218
- // $stores['logo_link'] =$media_url.'/'.$logo_src;
219
- // $stores['logo_alt_tag'] =$logo_alt_tag;
220
-
221
- $attributes = array();
222
- $attributes['web_id'] = $webId;
223
- $attributes['store_id'] = $storeId;
224
- $attributes['store_name'] = $storeName;
225
- $attributes['store_code'] = $storeCode;
226
- $attributes['store_active'] = $storeActive;
227
- $attributes['store_url'] = $siteBaseURL;
228
- $stores['json_data'] = $this->formatJSON('', $attributes);
229
- $rawData = '{"' . $apiClass . '": {"' . $guid . '":'
230
- . $this->formatJSON('', $stores)
231
- . '}}';
232
- Mage::log('Register this store->' . $stores['json_data']);
233
-
234
- $apiModel = Mage::getModel('combine/api');
235
- $apiUrl = $apiModel->getApiUrl('stores');
236
- $ch = curl_init($apiUrl);
237
- $options = array(
238
- CURLOPT_RETURNTRANSFER => true,
239
- CURLOPT_HTTPHEADER => array('Content-type: application/json', 'X-AUTH-TOKEN:' . $securityToken),
240
- CURLOPT_POSTFIELDS => $rawData
241
- );
242
- curl_setopt_array($ch, $options);
243
- $buffer = curl_exec($ch);
244
-
245
- $response = json_decode($buffer, true);
246
- if ($response['status'] == 'ok') {
247
- $springbot_storeId = array_search($guid, $response['stores']);
248
- $vars = array(
249
- 'store_guid' => $guid,
250
- 'store_id' => $springbot_storeId,
251
- 'product_cursor' => '0',
252
- 'category_cursor' => '0',
253
- 'security_token' => $securityToken
254
- );
255
- $this->commitVars($vars, $storeId);
256
- }
257
- }
258
- }
259
-
260
- function globalSettings($email, $password)
261
- {
262
- $encyptPswd = Mage::helper('core')->encrypt($password);
263
-
264
- $vars = array(
265
- 'initial_sync_inflight' => 'true',
266
- 'registration_status' => 'new',
267
- 'customer_sequence' => '5000000',
268
- 'purchase_cursor' => '0',
269
- 'account_email' => $email,
270
- 'prev_account_email' => $email,
271
- 'account_password' => $encyptPswd
272
- );
273
-
274
- $this->commitVars($vars);
275
-
276
- return;
277
- }
278
-
279
- function commitVars($vars, $storeID = '')
280
- {
281
- $config = new Mage_Core_Model_Config();
282
- foreach ($vars as $key => $val) {
283
- $config->saveConfig($this->makeConfigKey($key, $storeID), $val, 'default', 0);
284
- }
285
- return;
286
- }
287
-
288
- function makeConfigKey($dataClass, $storeId = '')
289
- {
290
- $cKey = 'springbot/config/' . $dataClass;
291
-
292
- if ($storeId != '') {
293
- $cKey = $cKey . '_' . $storeId;
294
- }
295
- return $cKey;
296
- }
297
-
298
- function RequestSecurityToken($email, $pswd)
299
- {
300
- $header = array('Content-type: application/json');
301
- $rawBuffer = '{"user_id":"' . $email . '", "password":"' . $pswd . '"}';
302
- Mage::log('Login ' . $rawBuffer);
303
-
304
- $apiModel = Mage::getModel('combine/api');
305
- $apiUrl = $apiModel->getApiUrl('registration/login');
306
- $ch = curl_init($apiUrl);
307
- $options = array(
308
- CURLOPT_RETURNTRANSFER => true,
309
- CURLOPT_HTTPHEADER => $header,
310
- CURLOPT_POSTFIELDS => $rawBuffer
311
- );
312
- curl_setopt_array($ch, $options);
313
- $rs = curl_exec($ch);
314
- curl_close($ch);
315
-
316
- return json_decode($rs, true);
317
-
318
- }
319
-
320
- function formatJSON($dataID, $content)
321
- {
322
- $prefixLength = 0;;
323
- $howMany = sizeof($content);
324
- $pairCount = 0;
325
- $closeArray = '';
326
-
327
- if ($dataID != '') {
328
- $json = '"' . $content[$dataID] . '":{';
329
- } else {
330
- $json = '{';
331
- $closeArray = '}';
332
- }
333
- $dlm = '"';
334
-
335
- foreach ($content as $key => $value) {
336
- $dlm = '"';
337
- $keySize = strlen($key);
338
- $keyNoPrefix = substr($key, $prefixLength, $keySize - $prefixLength);
339
- if ($keyNoPrefix == 'json_data' || $keyNoPrefix == 'line_items') {
340
- $dlm = '';
341
- }
342
- $json = $json . '"' . $keyNoPrefix . '":' . $dlm . $value . $dlm;
343
- $pairCount++;
344
- if ($pairCount < $howMany) {
345
- $json = $json . ',';
346
- }
347
- }
348
- return $json . $closeArray;
349
- }
350
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/Springbot/Bmbleb/etc/config.xml CHANGED
@@ -1,68 +1,60 @@
1
  <?xml version="1.0"?>
2
- <!--
3
- /**
4
- * @category Socketware
5
- * @package Socketware_Bmbleb
6
- * @author ModuleCreator
7
- * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
8
- */
9
- -->
10
  <config>
11
  <modules>
12
  <Springbot_Bmbleb>
13
- <version>0.1.0</version>
14
  </Springbot_Bmbleb>
15
  </modules>
16
- <admin>
17
  <routers>
18
- <bmbleb>
19
- <use>admin</use>
20
- <args>
21
- <module>Springbot_Bmbleb</module>
22
- <frontName>bmbleb</frontName>
23
- </args>
24
- </bmbleb>
25
  </routers>
26
  </admin>
27
  <adminhtml>
28
- <menu>
29
- <springbot_bmbleb module="bmbleb">
30
- <title>Springbot</title>
31
- <sort_order>71</sort_order>
32
- <children>
33
  <dashboard module="bmbleb">
34
  <title>Dashboard</title>
35
- <action>bmbleb/adminhtml_settings/index</action>
36
  </dashboard>
37
- </children>
38
- </springbot_bmbleb>
39
- </menu>
40
- <acl>
41
- <resources>
42
- <all><title>Allow Everything</title></all>
43
- <admin>
44
- <children>
45
- <springbot_bmbleb translate="title" module="bmbleb">
46
- <title>Springbot</title>
47
- <sort_order>300</sort_order>
48
- <children>
49
- <dashboard translate="title" module="bmbleb">
50
- <title>Dashboard</title>
51
- <sort_order>10</sort_order>
52
- </dashboard>
53
- </children>
54
- </springbot_bmbleb>
55
- </children>
56
- </admin>
57
- </resources>
58
- </acl>
59
- <layout>
60
- <updates>
61
- <bmbleb>
62
- <file>bmbleb.xml</file>
63
- </bmbleb>
64
- </updates>
65
- </layout>
66
  </adminhtml>
67
  <global>
68
  <models>
@@ -78,7 +70,7 @@
78
  <bmbleb_setup>
79
  <setup>
80
  <module>Springbot_Bmbleb</module>
81
- </setup>
82
  <connection>
83
  <use>core_setup</use>
84
  </connection>
@@ -106,9 +98,10 @@
106
  </helpers>
107
  </global>
108
  <default>
109
- <bmbleb>
110
- <config>
111
- </config>
112
- </bmbleb>
113
  </default>
114
  </config>
 
1
  <?xml version="1.0"?>
 
 
 
 
 
 
 
 
2
  <config>
3
  <modules>
4
  <Springbot_Bmbleb>
5
+ <version>0.2.0</version>
6
  </Springbot_Bmbleb>
7
  </modules>
8
+ <admin>
9
  <routers>
10
+ <bmbleb>
11
+ <use>admin</use>
12
+ <args>
13
+ <module>Springbot_Bmbleb</module>
14
+ <frontName>bmbleb</frontName>
15
+ </args>
16
+ </bmbleb>
17
  </routers>
18
  </admin>
19
  <adminhtml>
20
+ <menu>
21
+ <springbot_bmbleb module="bmbleb">
22
+ <title>Springbot</title>
23
+ <sort_order>71</sort_order>
24
+ <children>
25
  <dashboard module="bmbleb">
26
  <title>Dashboard</title>
27
+ <action>bmbleb/adminhtml_settings/index</action>
28
  </dashboard>
29
+ </children>
30
+ </springbot_bmbleb>
31
+ </menu>
32
+ <acl>
33
+ <resources>
34
+ <all><title>Allow Everything</title></all>
35
+ <admin>
36
+ <children>
37
+ <springbot_bmbleb translate="title" module="bmbleb">
38
+ <title>Springbot</title>
39
+ <sort_order>300</sort_order>
40
+ <children>
41
+ <dashboard translate="title" module="bmbleb">
42
+ <title>Dashboard</title>
43
+ <sort_order>10</sort_order>
44
+ </dashboard>
45
+ </children>
46
+ </springbot_bmbleb>
47
+ </children>
48
+ </admin>
49
+ </resources>
50
+ </acl>
51
+ <layout>
52
+ <updates>
53
+ <bmbleb>
54
+ <file>bmbleb.xml</file>
55
+ </bmbleb>
56
+ </updates>
57
+ </layout>
58
  </adminhtml>
59
  <global>
60
  <models>
70
  <bmbleb_setup>
71
  <setup>
72
  <module>Springbot_Bmbleb</module>
73
+ </setup>
74
  <connection>
75
  <use>core_setup</use>
76
  </connection>
98
  </helpers>
99
  </global>
100
  <default>
101
+ <bmbleb>
102
+ <config>
103
+ </config>
104
+ </bmbleb>
105
  </default>
106
  </config>
107
+
app/code/community/Springbot/BoneCollector/Model/HarvestAbstract.php CHANGED
@@ -45,17 +45,6 @@ class Springbot_BoneCollector_Model_HarvestAbstract
45
  return Mage::helper('combine/parser')->getTopLevelSku($product);
46
  }
47
 
48
- public function getCommand($method)
49
- {
50
- return $this->getPhpExec() . ' '
51
- . $magentoRootDir
52
- . self::SPRINGBOT_DIRECTORY
53
- . self::BOT_SERVICES_DIRECTORY
54
- . self::BOT_SERVICES . ' '
55
- . $method . ' '
56
- ;
57
- }
58
-
59
  public function doSend($object, $sessionKey)
60
  {
61
  $json = $object->toJson();
45
  return Mage::helper('combine/parser')->getTopLevelSku($product);
46
  }
47
 
 
 
 
 
 
 
 
 
 
 
 
48
  public function doSend($object, $sessionKey)
49
  {
50
  $json = $object->toJson();
app/code/community/Springbot/BoneCollector/Model/HarvestAttribute/Observer.php CHANGED
@@ -2,12 +2,11 @@
2
 
3
  class Springbot_BoneCollector_Model_HarvestAttribute_Observer extends Springbot_BoneCollector_Model_HarvestAbstract
4
  {
5
- public function attributeSave($observer)
6
  {
7
  try {
8
  $this->_initObserver($observer);
9
  $attribute = $observer->getEvent()->getAttribute();
10
-
11
  if($attribute->getIsUserDefined()) {
12
  if($this->doSend($attribute, 'sb_eav_entity_attribute_obs_hash')) {
13
  Springbot_Log::debug("Attempting to post parent attribute sets");
@@ -21,7 +20,7 @@ class Springbot_BoneCollector_Model_HarvestAttribute_Observer extends Springbot_
21
  }
22
  }
23
 
24
- public function attributeSetSave($observer)
25
  {
26
  try {
27
  $attribute = $observer->getEvent()->getAttribute();
@@ -41,8 +40,6 @@ class Springbot_BoneCollector_Model_HarvestAttribute_Observer extends Springbot_
41
 
42
  // invalidate cache as attributes are added to set
43
  $attrIds = $helper->getAttributesBySet($id)->getAllIds();
44
-
45
- return $helper->getAttributeSetById($id)
46
- ->setNestedAttributeIds($attrIds);
47
  }
48
  }
2
 
3
  class Springbot_BoneCollector_Model_HarvestAttribute_Observer extends Springbot_BoneCollector_Model_HarvestAbstract
4
  {
5
+ public function onAdminAttributeSaveAfter($observer)
6
  {
7
  try {
8
  $this->_initObserver($observer);
9
  $attribute = $observer->getEvent()->getAttribute();
 
10
  if($attribute->getIsUserDefined()) {
11
  if($this->doSend($attribute, 'sb_eav_entity_attribute_obs_hash')) {
12
  Springbot_Log::debug("Attempting to post parent attribute sets");
20
  }
21
  }
22
 
23
+ public function onAdminAttributeSetSaveAfter($observer)
24
  {
25
  try {
26
  $attribute = $observer->getEvent()->getAttribute();
40
 
41
  // invalidate cache as attributes are added to set
42
  $attrIds = $helper->getAttributesBySet($id)->getAllIds();
43
+ return $helper->getAttributeSetById($id)->setNestedAttributeIds($attrIds);
 
 
44
  }
45
  }
app/code/community/Springbot/BoneCollector/Model/HarvestCaptureSKU/Observer.php CHANGED
@@ -2,8 +2,6 @@
2
  /**
3
  * BoneCollector Event Listener (Capture SKU when Product Viewed)
4
  *
5
- * @version v1.0.0 - 5/28/2013
6
- *
7
  * @category Magento Integrations
8
  * @package springbot
9
  * @author William Seitz
@@ -16,32 +14,31 @@ class Springbot_BoneCollector_Model_HarvestCaptureSKU_Observer extends Springbot
16
  {
17
  const VERSION = '1.2.0';
18
  const METHOD = 'getsku';
19
- const LISTENER_PUBLIC_NAME = 'CaptureSKU Harvesting Listener: ';
20
- const ZERO = 0;
21
 
22
- public function captureskuharvest($observer)
23
  {
24
  $controllerName = Mage::app()->getRequest()->getControllerName();
25
  $actionName = Mage::app()->getRequest()->getActionName();
26
  $routerName = Mage::app()->getRequest()->getRouteName();
27
 
28
- if ($this->viewingProductDetailPage($controllerName,$actionName,$routerName)) {
29
  $this->_initObserver($observer);
30
  $productData = $observer->getEvent()->getProduct();
31
  $entityViewed = $productData['sku'];
32
  $eventDatetime = date("Y-m-d H:i:s");
33
  $openModeAppend = 'a';
34
- $eventHistoryFilename = Mage::getBaseDir().'/var/log/Springbot-EventHistory.csv';
35
  $urlViewed = Mage::helper('core/url')->getCurrentUrl();
36
- $user_agent = Mage::helper('core/http')->getHttpUserAgent();
37
 
38
- if ($this->qualifyURL($urlViewed,$user_agent)) {
39
  try {
40
  $lastCatId = $this->_getLastCategory();
41
  $visitorIP = Mage::helper('core/http')->getRemoteAddr(true);
42
  $storeId = Mage::app()->getStore()->getStoreId();
43
  $fHandle = fopen($eventHistoryFilename,$openModeAppend);
44
- $viewedMessage = array('view',
 
45
  $eventDatetime,
46
  $urlViewed,
47
  $entityViewed,
@@ -50,9 +47,8 @@ class Springbot_BoneCollector_Model_HarvestCaptureSKU_Observer extends Springbot
50
  $lastCatId
51
  );
52
  fputcsv($fHandle,$viewedMessage,',');
53
- fclose ($fHandle);
54
-
55
- } catch (Exception $e) {
56
  Mage::log('Unknown exception opening '.$eventHistoryFilename);
57
  }
58
  }
@@ -60,7 +56,7 @@ class Springbot_BoneCollector_Model_HarvestCaptureSKU_Observer extends Springbot
60
  return;
61
  }
62
 
63
- private function viewingProductDetailPage($controllerName,$actionName,$routerName)
64
  {
65
  if ($controllerName == 'product'
66
  && $actionName == 'view'
@@ -76,26 +72,26 @@ class Springbot_BoneCollector_Model_HarvestCaptureSKU_Observer extends Springbot
76
  return Mage::helper('combine')->getLastCategoryId();
77
  }
78
 
79
- private function qualifyURL($url,$user_agent)
80
  {
81
- $rtn = true;
82
-
83
- if (strpos($url,'/api') > self::ZERO
84
- || strpos($url,'/ajax') > self::ZERO
85
- || strpos($url,'/soap') > self::ZERO) {
86
- $rtn = false;
87
- } else {
88
- $rtn = false;
89
- if ($this->is_bot($user_agent) == false && $this->urlIsIPAddress($url)== false) {
90
- $rtn = true;
91
- }
92
- }
93
- return $rtn;
94
  }
95
 
96
  private function urlIsIPAddress($url)
97
  {
98
- $numericComponents = self::ZERO;
99
  $ipComponents = explode('.',$url);
100
 
101
  foreach($ipComponents as $ipVal) {
2
  /**
3
  * BoneCollector Event Listener (Capture SKU when Product Viewed)
4
  *
 
 
5
  * @category Magento Integrations
6
  * @package springbot
7
  * @author William Seitz
14
  {
15
  const VERSION = '1.2.0';
16
  const METHOD = 'getsku';
 
 
17
 
18
+ public function onFrontendProductView($observer)
19
  {
20
  $controllerName = Mage::app()->getRequest()->getControllerName();
21
  $actionName = Mage::app()->getRequest()->getActionName();
22
  $routerName = Mage::app()->getRequest()->getRouteName();
23
 
24
+ if ($this->_viewingProductDetailPage($controllerName,$actionName,$routerName)) {
25
  $this->_initObserver($observer);
26
  $productData = $observer->getEvent()->getProduct();
27
  $entityViewed = $productData['sku'];
28
  $eventDatetime = date("Y-m-d H:i:s");
29
  $openModeAppend = 'a';
30
+ $eventHistoryFilename = Mage::getBaseDir('log') . DS . 'Springbot-EventHistory.csv';
31
  $urlViewed = Mage::helper('core/url')->getCurrentUrl();
32
+ $userAgent = Mage::helper('core/http')->getHttpUserAgent();
33
 
34
+ if ($this->qualifyURL($urlViewed, $userAgent)) {
35
  try {
36
  $lastCatId = $this->_getLastCategory();
37
  $visitorIP = Mage::helper('core/http')->getRemoteAddr(true);
38
  $storeId = Mage::app()->getStore()->getStoreId();
39
  $fHandle = fopen($eventHistoryFilename,$openModeAppend);
40
+ $viewedMessage = array(
41
+ 'view',
42
  $eventDatetime,
43
  $urlViewed,
44
  $entityViewed,
47
  $lastCatId
48
  );
49
  fputcsv($fHandle,$viewedMessage,',');
50
+ fclose($fHandle);
51
+ } catch (Exception $e) {
 
52
  Mage::log('Unknown exception opening '.$eventHistoryFilename);
53
  }
54
  }
56
  return;
57
  }
58
 
59
+ private function _viewingProductDetailPage($controllerName,$actionName,$routerName)
60
  {
61
  if ($controllerName == 'product'
62
  && $actionName == 'view'
72
  return Mage::helper('combine')->getLastCategoryId();
73
  }
74
 
75
+ private function qualifyURL($url, $userAgent)
76
  {
77
+ if (
78
+ strpos($url,'/api') > 0 ||
79
+ strpos($url,'/ajax') > 0 ||
80
+ strpos($url,'/soap') > 0
81
+ ) {
82
+ return false;
83
+ }
84
+ else if ($this->is_bot($userAgent) == false && $this->urlIsIPAddress($url)== false) {
85
+ return true;
86
+ }
87
+ else {
88
+ return false;
89
+ }
90
  }
91
 
92
  private function urlIsIPAddress($url)
93
  {
94
+ $numericComponents = 0;
95
  $ipComponents = explode('.',$url);
96
 
97
  foreach($ipComponents as $ipVal) {
app/code/community/Springbot/BoneCollector/Model/HarvestCart/Observer.php CHANGED
@@ -36,7 +36,7 @@ class Springbot_BoneCollector_Model_HarvestCart_Observer extends Springbot_BoneC
36
  *
37
  * @param Varien_Event_Observer $observer
38
  */
39
- public function addToCartHarvest($observer)
40
  {
41
  try {
42
  $this->_initObserver($observer);
@@ -84,14 +84,14 @@ class Springbot_BoneCollector_Model_HarvestCart_Observer extends Springbot_BoneC
84
  *
85
  * @param Varien_Event_Observer $observer
86
  */
87
- public function captureSku($observer)
88
  {
89
  $this->_initObserver($observer);
90
  $quoteId = Mage::getSingleton("checkout/session")->getQuote()->getId();
91
 
92
  $eventDatetime = date("Y-m-d H:i:s");
93
  $openModeAppend = 'a';
94
- $eventHistoryFilename = Mage::getBaseDir().'/var/log/Springbot-EventHistory.csv';
95
 
96
  try {
97
  $storeId = Mage::app()->getStore()->getStoreId();
36
  *
37
  * @param Varien_Event_Observer $observer
38
  */
39
+ public function onFrontendQuoteSaveAfter($observer)
40
  {
41
  try {
42
  $this->_initObserver($observer);
84
  *
85
  * @param Varien_Event_Observer $observer
86
  */
87
+ public function onFrontendCartAddProduct($observer)
88
  {
89
  $this->_initObserver($observer);
90
  $quoteId = Mage::getSingleton("checkout/session")->getQuote()->getId();
91
 
92
  $eventDatetime = date("Y-m-d H:i:s");
93
  $openModeAppend = 'a';
94
+ $eventHistoryFilename = Mage::getBaseDir('log') . DS . 'Springbot-EventHistory.csv';
95
 
96
  try {
97
  $storeId = Mage::app()->getStore()->getStoreId();
app/code/community/Springbot/BoneCollector/Model/HarvestCategory/Observer.php CHANGED
@@ -2,23 +2,20 @@
2
 
3
  class Springbot_BoneCollector_Model_HarvestCategory_Observer extends Springbot_BoneCollector_Model_HarvestAbstract
4
  {
5
- public function saveCategory($observer)
6
  {
7
  $this->_initObserver($observer);
8
-
9
  $categoryId = $observer->getEvent()->getCategory()->getEntityId();
10
-
11
  if(!empty($categoryId)) {
12
  Springbot_Boss::scheduleJob('post:category', array('i' => $categoryId), Springbot_Services_Priority::LISTENER, 'listener');
13
  }
14
  }
15
 
16
 
17
- public function deleteCategory($observer)
18
  {
19
  try{
20
  $category = $observer->getEvent()->getCategory();
21
-
22
  $this->_initObserver($observer);
23
  foreach(Mage::helper('combine/harvest')->mapStoreIds($category) as $mapped) {
24
  $deleted = array(
@@ -27,7 +24,6 @@ class Springbot_BoneCollector_Model_HarvestCategory_Observer extends Springbot_B
27
  'is_deleted' => true,
28
  );
29
  }
30
-
31
  Mage::helper('combine/harvest')->deleteRemote($deleted, 'categories');
32
  } catch (Exception $e) {
33
  Mage::logException($e);
2
 
3
  class Springbot_BoneCollector_Model_HarvestCategory_Observer extends Springbot_BoneCollector_Model_HarvestAbstract
4
  {
5
+ public function onCategorySaveAfter($observer)
6
  {
7
  $this->_initObserver($observer);
 
8
  $categoryId = $observer->getEvent()->getCategory()->getEntityId();
 
9
  if(!empty($categoryId)) {
10
  Springbot_Boss::scheduleJob('post:category', array('i' => $categoryId), Springbot_Services_Priority::LISTENER, 'listener');
11
  }
12
  }
13
 
14
 
15
+ public function onCategoryDeleteAfter($observer)
16
  {
17
  try{
18
  $category = $observer->getEvent()->getCategory();
 
19
  $this->_initObserver($observer);
20
  foreach(Mage::helper('combine/harvest')->mapStoreIds($category) as $mapped) {
21
  $deleted = array(
24
  'is_deleted' => true,
25
  );
26
  }
 
27
  Mage::helper('combine/harvest')->deleteRemote($deleted, 'categories');
28
  } catch (Exception $e) {
29
  Mage::logException($e);
app/code/community/Springbot/BoneCollector/Model/HarvestCustomer/Observer.php CHANGED
@@ -4,7 +4,7 @@ class Springbot_BoneCollector_Model_HarvestCustomer_Observer extends Springbot_B
4
  {
5
  protected $_customer;
6
 
7
- public function saveCustomer($observer)
8
  {
9
  try {
10
  $this->_initObserver($observer);
@@ -19,12 +19,11 @@ class Springbot_BoneCollector_Model_HarvestCustomer_Observer extends Springbot_B
19
  }
20
  }
21
 
22
- public function deleteCustomer($observer)
23
  {
24
  try {
25
  // Runs blocking in session to guarantee record existence
26
  $customer = $observer->getEvent()->getCustomer();
27
-
28
  $this->_initObserver($observer);
29
  Mage::getModel('Springbot_Services_Post_Customer')->setData(array(
30
  'start_id' => $customer->getId(),
@@ -42,9 +41,15 @@ class Springbot_BoneCollector_Model_HarvestCustomer_Observer extends Springbot_B
42
  $h = Mage::helper('combine/attributes');
43
  $attributes = $h->getCustomerCustomAttributes($h->getCustomerAttributeSet());
44
 
45
- foreach($attributes as $attribute) {
46
- $codes[] = $attribute->getAttributeCode();
 
 
47
  }
 
 
 
 
48
 
49
  // Ensure we test for change in group
50
  $codes[] = 'group_id';
4
  {
5
  protected $_customer;
6
 
7
+ public function onCustomerSaveAfter($observer)
8
  {
9
  try {
10
  $this->_initObserver($observer);
19
  }
20
  }
21
 
22
+ public function onCustomerDeleteBefore($observer)
23
  {
24
  try {
25
  // Runs blocking in session to guarantee record existence
26
  $customer = $observer->getEvent()->getCustomer();
 
27
  $this->_initObserver($observer);
28
  Mage::getModel('Springbot_Services_Post_Customer')->setData(array(
29
  'start_id' => $customer->getId(),
41
  $h = Mage::helper('combine/attributes');
42
  $attributes = $h->getCustomerCustomAttributes($h->getCustomerAttributeSet());
43
 
44
+ try {
45
+ foreach($attributes as $attribute) {
46
+ $codes[] = $attribute->getAttributeCode();
47
+ }
48
  }
49
+ catch (Exception $e) {
50
+ Springbot_Log::debug('Exception caught during attribute iteration for customer observer');
51
+ }
52
+
53
 
54
  // Ensure we test for change in group
55
  $codes[] = 'group_id';
app/code/community/Springbot/BoneCollector/Model/HarvestProduct/Observer.php CHANGED
@@ -34,7 +34,7 @@ class Springbot_BoneCollector_Model_HarvestProduct_Observer extends Springbot_Bo
34
  'image_label',
35
  );
36
 
37
- public function harvestProduct($observer)
38
  {
39
  try {
40
  $this->_product = $observer->getEvent()->getProduct();
@@ -49,15 +49,12 @@ class Springbot_BoneCollector_Model_HarvestProduct_Observer extends Springbot_Bo
49
  }
50
  }
51
 
52
- public function deleteProduct($observer)
53
  {
54
  $this->_initObserver($observer);
55
-
56
  try{
57
  $this->_product = $observer->getEvent()->getProduct();
58
  $entity_id = $this->_product->getId();
59
- $storeIds = $this->_product->getStoreIds();
60
-
61
  foreach(Mage::helper('combine/harvest')->mapStoreIds($this->_product) as $mapped) {
62
  $post[] = array(
63
  'store_id' => $mapped->getStoreId(),
@@ -66,7 +63,6 @@ class Springbot_BoneCollector_Model_HarvestProduct_Observer extends Springbot_Bo
66
  'is_deleted' => true,
67
  );
68
  }
69
-
70
  Mage::helper('combine/harvest')->deleteRemote($post, 'products');
71
  } catch (Exception $e) {
72
  Mage::logException($e);
34
  'image_label',
35
  );
36
 
37
+ public function onProductSaveAfter($observer)
38
  {
39
  try {
40
  $this->_product = $observer->getEvent()->getProduct();
49
  }
50
  }
51
 
52
+ public function onProductDeleteBefore($observer)
53
  {
54
  $this->_initObserver($observer);
 
55
  try{
56
  $this->_product = $observer->getEvent()->getProduct();
57
  $entity_id = $this->_product->getId();
 
 
58
  foreach(Mage::helper('combine/harvest')->mapStoreIds($this->_product) as $mapped) {
59
  $post[] = array(
60
  'store_id' => $mapped->getStoreId(),
63
  'is_deleted' => true,
64
  );
65
  }
 
66
  Mage::helper('combine/harvest')->deleteRemote($post, 'products');
67
  } catch (Exception $e) {
68
  Mage::logException($e);
app/code/community/Springbot/BoneCollector/Model/HarvestPurchase/Observer.php CHANGED
@@ -20,7 +20,7 @@ class Springbot_BoneCollector_Model_HarvestPurchase_Observer extends Springbot_B
20
 
21
  protected $_order;
22
 
23
- public function purchaseHarvest($observer)
24
  {
25
  if($this->_getCheckoutSession()->getSpringbotLogPurchaseAction() === true) {
26
  $this->callPurchaseLogAction($observer);
@@ -32,12 +32,12 @@ class Springbot_BoneCollector_Model_HarvestPurchase_Observer extends Springbot_B
32
  }
33
  }
34
 
35
- public function purchaseHarvestAdmin($observer)
36
  {
37
  $this->_purchaseHarvest($observer, false);
38
  }
39
 
40
- public function purchaseLogAction($observer)
41
  {
42
  $this->_initObserver($observer);
43
  $this->_getCheckoutSession()->setSpringbotLogPurchaseAction(true);
20
 
21
  protected $_order;
22
 
23
+ public function onFrontendOrderSaveAfter($observer)
24
  {
25
  if($this->_getCheckoutSession()->getSpringbotLogPurchaseAction() === true) {
26
  $this->callPurchaseLogAction($observer);
32
  }
33
  }
34
 
35
+ public function onAdminOrderSaveAfter($observer)
36
  {
37
  $this->_purchaseHarvest($observer, false);
38
  }
39
 
40
+ public function onFrontendOrderPlaceAfter($observer)
41
  {
42
  $this->_initObserver($observer);
43
  $this->_getCheckoutSession()->setSpringbotLogPurchaseAction(true);
app/code/community/Springbot/BoneCollector/Model/HarvestRule/Observer.php ADDED
@@ -0,0 +1,78 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Springbot_BoneCollector_Model_HarvestRule_Observer extends Springbot_BoneCollector_Model_HarvestAbstract
4
+ {
5
+ protected $_coupon;
6
+ protected $_attributes = array(
7
+ 'is_active',
8
+ 'name' ,
9
+ 'coupon_code',
10
+ 'description',
11
+ 'conditions',
12
+ 'actions',
13
+ 'from_date',
14
+ 'to_date',
15
+ 'uses_per_coupon',
16
+ 'uses_per_customer',
17
+ 'stop_rules_processing',
18
+ 'is_advanced',
19
+ 'product_ids',
20
+ 'sort_order',
21
+ 'simple_action',
22
+ 'discount_amount',
23
+ 'discount_qty',
24
+ 'discount_step',
25
+ 'simple_free_shipping',
26
+ 'apply_to_shipping',
27
+ 'times_used',
28
+ 'is_rss',
29
+ 'website_ids',
30
+ 'customer_group_ids',
31
+ );
32
+
33
+ public function onSalesruleRuleSaveAfter($observer)
34
+ {
35
+ try {
36
+ $this->_initObserver($observer);
37
+ $this->_rule = $observer->getEvent()->getRule();
38
+
39
+ if ($this->_entityChanged($this->_rule)) {
40
+ $ruleId = $this->_rule->getId();
41
+ $websiteIds = explode(',', $this->_rule->getWebsiteIds());
42
+ foreach ($websiteIds as $websiteId) {
43
+ if ($website = Mage::app()->getWebsite($websiteId)) {
44
+ foreach ($website->getGroups() as $group) {
45
+ $stores = $group->getStores();
46
+ foreach ($stores as $store) {
47
+ die('storeId ' . $store->getId());
48
+ Springbot_Boss::scheduleJob('post:rule', array('i' => $ruleId, 's' => $store->getId()), Springbot_Services_Priority::LISTENER, 'listener');
49
+ }
50
+ }
51
+ }
52
+ }
53
+ }
54
+
55
+ } catch (Exception $e) {
56
+ Springbot_Log::error($e);
57
+ }
58
+
59
+ }
60
+
61
+ public function onSalesruleRuleDeleteBefore($observer)
62
+ {
63
+ try {
64
+ // Runs blocking in session to guarantee record existence
65
+ $rule = $observer->getEvent()->getRule()->getPrimaryCoupon();
66
+ $this->_initObserver($observer);
67
+ Mage::getModel('Springbot_Services_Post_Rule')->setData(array(
68
+ 'start_id' => $rule->getId(),
69
+ 'delete' => true,
70
+ ))->run();
71
+
72
+ } catch (Exception $e) {
73
+ Springbot_Log::error($e);
74
+ }
75
+ }
76
+
77
+ }
78
+
app/code/community/Springbot/BoneCollector/Model/HarvestSubscriber/Observer.php CHANGED
@@ -2,7 +2,7 @@
2
 
3
  class Springbot_BoneCollector_Model_HarvestSubscriber_Observer extends Springbot_BoneCollector_Model_HarvestAbstract
4
  {
5
- public function saveSubscriber($observer)
6
  {
7
  try {
8
  $this->_initObserver($observer);
@@ -20,7 +20,7 @@ class Springbot_BoneCollector_Model_HarvestSubscriber_Observer extends Springbot
20
  }
21
  }
22
 
23
- public function deleteSubscriber($observer)
24
  {
25
  try {
26
  // Runs blocking in session to guarantee record existence
2
 
3
  class Springbot_BoneCollector_Model_HarvestSubscriber_Observer extends Springbot_BoneCollector_Model_HarvestAbstract
4
  {
5
+ public function onSubscriberSaveAfter($observer)
6
  {
7
  try {
8
  $this->_initObserver($observer);
20
  }
21
  }
22
 
23
+ public function onSubscriberDeleteBefore($observer)
24
  {
25
  try {
26
  // Runs blocking in session to guarantee record existence
app/code/community/Springbot/BoneCollector/etc/config.xml CHANGED
@@ -8,7 +8,6 @@
8
  */
9
  -->
10
  <config>
11
-
12
  <global>
13
  <models>
14
  <bonecollector>
@@ -21,7 +20,7 @@
21
  <springbot_bonecollector_product_observer>
22
  <type>singleton</type>
23
  <class>Springbot_BoneCollector_Model_HarvestProduct_Observer</class>
24
- <method>harvestProduct</method>
25
  </springbot_bonecollector_product_observer>
26
  </observers>
27
  </catalog_product_save_after>
@@ -30,7 +29,7 @@
30
  <springbot_bonecollector_productdelete_observer>
31
  <type>singleton</type>
32
  <class>Springbot_BoneCollector_Model_HarvestProduct_Observer</class>
33
- <method>deleteProduct</method>
34
  </springbot_bonecollector_productdelete_observer>
35
  </observers>
36
  </catalog_product_delete_before>
@@ -39,7 +38,7 @@
39
  <springbot_bonecollector_categorysave_observer>
40
  <type>singleton</type>
41
  <class>Springbot_BoneCollector_Model_HarvestCategory_Observer</class>
42
- <method>saveCategory</method>
43
  </springbot_bonecollector_categorysave_observer>
44
  </observers>
45
  </catalog_category_save_after>
@@ -48,7 +47,7 @@
48
  <springbot_bonecollector_categorydelete_observer>
49
  <type>singleton</type>
50
  <class>Springbot_BoneCollector_Model_HarvestCategory_Observer</class>
51
- <method>deleteCategory</method>
52
  </springbot_bonecollector_categorydelete_observer>
53
  </observers>
54
  </catalog_category_delete_after>
@@ -57,7 +56,7 @@
57
  <springbot_bonecollector_customersave_observer>
58
  <type>singleton</type>
59
  <class>Springbot_BoneCollector_Model_HarvestCustomer_Observer</class>
60
- <method>saveCustomer</method>
61
  </springbot_bonecollector_customersave_observer>
62
  </observers>
63
  </customer_save_after>
@@ -66,7 +65,7 @@
66
  <springbot_bonecollector_customerdelete_observer>
67
  <type>singleton</type>
68
  <class>Springbot_BoneCollector_Model_HarvestCustomer_Observer</class>
69
- <method>deleteCustomer</method>
70
  </springbot_bonecollector_customerdelete_observer>
71
  </observers>
72
  </customer_delete_before>
@@ -75,7 +74,7 @@
75
  <springbot_bonecollector_customersave_observer>
76
  <type>singleton</type>
77
  <class>Springbot_BoneCollector_Model_HarvestSubscriber_Observer</class>
78
- <method>saveSubscriber</method>
79
  </springbot_bonecollector_customersave_observer>
80
  </observers>
81
  </newsletter_subscriber_save_after>
@@ -84,10 +83,28 @@
84
  <springbot_bonecollector_customerdelete_observer>
85
  <type>singleton</type>
86
  <class>Springbot_BoneCollector_Model_HarvestSubscriber_Observer</class>
87
- <method>deleteSubscriber</method>
88
  </springbot_bonecollector_customerdelete_observer>
89
  </observers>
90
  </newsletter_subscriber_delete_before>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
91
  </events>
92
  </global>
93
  <frontend>
@@ -97,7 +114,7 @@
97
  <springbot_bonecollector_purchase_log_observer>
98
  <type>singleton</type>
99
  <class>Springbot_BoneCollector_Model_HarvestPurchase_Observer</class>
100
- <method>purchaseLogAction</method>
101
  </springbot_bonecollector_purchase_log_observer>
102
  </observers>
103
  </sales_order_place_after>
@@ -106,7 +123,7 @@
106
  <springbot_bonecollector_purchase_observer>
107
  <type>singleton</type>
108
  <class>Springbot_BoneCollector_Model_HarvestPurchase_Observer</class>
109
- <method>purchaseHarvest</method>
110
  </springbot_bonecollector_purchase_observer>
111
  </observers>
112
  </sales_order_save_after>
@@ -115,7 +132,7 @@
115
  <springbot_bonecollector_addtocart_observer>
116
  <type>singleton</type>
117
  <class>Springbot_BoneCollector_Model_HarvestCart_Observer</class>
118
- <method>addToCartHarvest</method>
119
  </springbot_bonecollector_addtocart_observer>
120
  </observers>
121
  </sales_quote_save_after>
@@ -124,7 +141,7 @@
124
  <springbot_bonecollector_capturesku_observer>
125
  <type>singleton</type>
126
  <class>Springbot_BoneCollector_Model_HarvestCaptureSKU_Observer</class>
127
- <method>captureskuharvest</method>
128
  </springbot_bonecollector_capturesku_observer>
129
  </observers>
130
  </catalog_controller_product_view>
@@ -133,7 +150,7 @@
133
  <springbot_bonecollector_addskutocart_observer>
134
  <type>singleton</type>
135
  <class>Springbot_BoneCollector_Model_HarvestCart_Observer</class>
136
- <method>captureSku</method>
137
  </springbot_bonecollector_addskutocart_observer>
138
  </observers>
139
  </checkout_cart_add_product_complete>
@@ -146,7 +163,7 @@
146
  <springbot_bonecollector_purchase_admin_observer>
147
  <type>singleton</type>
148
  <class>Springbot_BoneCollector_Model_HarvestPurchase_Observer</class>
149
- <method>purchaseHarvestAdmin</method>
150
  </springbot_bonecollector_purchase_admin_observer>
151
  </observers>
152
  </sales_order_save_after>
@@ -155,7 +172,7 @@
155
  <springbot_bonecollector_attribute_observer>
156
  <type>singleton</type>
157
  <class>Springbot_BoneCollector_Model_HarvestAttribute_Observer</class>
158
- <method>attributeSave</method>
159
  </springbot_bonecollector_attribute_observer>
160
  </observers>
161
  </catalog_entity_attribute_save_commit_after>
@@ -164,7 +181,7 @@
164
  <springbot_bonecollector_attribute_set_observer>
165
  <type>singleton</type>
166
  <class>Springbot_BoneCollector_Model_HarvestAttribute_Observer</class>
167
- <method>attributeSetSave</method>
168
  </springbot_bonecollector_attribute_set_observer>
169
  </observers>
170
  </eav_entity_attribute_save_commit_after>
8
  */
9
  -->
10
  <config>
 
11
  <global>
12
  <models>
13
  <bonecollector>
20
  <springbot_bonecollector_product_observer>
21
  <type>singleton</type>
22
  <class>Springbot_BoneCollector_Model_HarvestProduct_Observer</class>
23
+ <method>onProductSaveAfter</method>
24
  </springbot_bonecollector_product_observer>
25
  </observers>
26
  </catalog_product_save_after>
29
  <springbot_bonecollector_productdelete_observer>
30
  <type>singleton</type>
31
  <class>Springbot_BoneCollector_Model_HarvestProduct_Observer</class>
32
+ <method>onProductDeleteBefore</method>
33
  </springbot_bonecollector_productdelete_observer>
34
  </observers>
35
  </catalog_product_delete_before>
38
  <springbot_bonecollector_categorysave_observer>
39
  <type>singleton</type>
40
  <class>Springbot_BoneCollector_Model_HarvestCategory_Observer</class>
41
+ <method>onCategorySaveAfter</method>
42
  </springbot_bonecollector_categorysave_observer>
43
  </observers>
44
  </catalog_category_save_after>
47
  <springbot_bonecollector_categorydelete_observer>
48
  <type>singleton</type>
49
  <class>Springbot_BoneCollector_Model_HarvestCategory_Observer</class>
50
+ <method>onCategoryDeleteAfter</method>
51
  </springbot_bonecollector_categorydelete_observer>
52
  </observers>
53
  </catalog_category_delete_after>
56
  <springbot_bonecollector_customersave_observer>
57
  <type>singleton</type>
58
  <class>Springbot_BoneCollector_Model_HarvestCustomer_Observer</class>
59
+ <method>onCustomerSaveAfter</method>
60
  </springbot_bonecollector_customersave_observer>
61
  </observers>
62
  </customer_save_after>
65
  <springbot_bonecollector_customerdelete_observer>
66
  <type>singleton</type>
67
  <class>Springbot_BoneCollector_Model_HarvestCustomer_Observer</class>
68
+ <method>onCustomerDeleteBefore</method>
69
  </springbot_bonecollector_customerdelete_observer>
70
  </observers>
71
  </customer_delete_before>
74
  <springbot_bonecollector_customersave_observer>
75
  <type>singleton</type>
76
  <class>Springbot_BoneCollector_Model_HarvestSubscriber_Observer</class>
77
+ <method>onSubscriberSaveAfter</method>
78
  </springbot_bonecollector_customersave_observer>
79
  </observers>
80
  </newsletter_subscriber_save_after>
83
  <springbot_bonecollector_customerdelete_observer>
84
  <type>singleton</type>
85
  <class>Springbot_BoneCollector_Model_HarvestSubscriber_Observer</class>
86
+ <method>onSubscriberDeleteBefore</method>
87
  </springbot_bonecollector_customerdelete_observer>
88
  </observers>
89
  </newsletter_subscriber_delete_before>
90
+ <salesrule_rule_save_after>
91
+ <observers>
92
+ <springbot_bonecollector_rulesave_observer>
93
+ <type>singleton</type>
94
+ <class>Springbot_BoneCollector_Model_HarvestRule_Observer</class>
95
+ <method>onSalesruleRuleSaveAfter</method>
96
+ </springbot_bonecollector_rulesave_observer>
97
+ </observers>
98
+ </salesrule_rule_save_after>
99
+ <salesrule_rule_delete_before>
100
+ <observers>
101
+ <springbot_bonecollector_coupondelete_observer>
102
+ <type>singleton</type>
103
+ <class>Springbot_BoneCollector_Model_HarvestCoupon_Observer</class>
104
+ <method>onSalesruleRuleDeleteBefore</method>
105
+ </springbot_bonecollector_coupondelete_observer>
106
+ </observers>
107
+ </salesrule_rule_delete_before>
108
  </events>
109
  </global>
110
  <frontend>
114
  <springbot_bonecollector_purchase_log_observer>
115
  <type>singleton</type>
116
  <class>Springbot_BoneCollector_Model_HarvestPurchase_Observer</class>
117
+ <method>onFrontendOrderPlaceAfter</method>
118
  </springbot_bonecollector_purchase_log_observer>
119
  </observers>
120
  </sales_order_place_after>
123
  <springbot_bonecollector_purchase_observer>
124
  <type>singleton</type>
125
  <class>Springbot_BoneCollector_Model_HarvestPurchase_Observer</class>
126
+ <method>onFrontendOrderSaveAfter</method>
127
  </springbot_bonecollector_purchase_observer>
128
  </observers>
129
  </sales_order_save_after>
132
  <springbot_bonecollector_addtocart_observer>
133
  <type>singleton</type>
134
  <class>Springbot_BoneCollector_Model_HarvestCart_Observer</class>
135
+ <method>onFrontendQuoteSaveAfter</method>
136
  </springbot_bonecollector_addtocart_observer>
137
  </observers>
138
  </sales_quote_save_after>
141
  <springbot_bonecollector_capturesku_observer>
142
  <type>singleton</type>
143
  <class>Springbot_BoneCollector_Model_HarvestCaptureSKU_Observer</class>
144
+ <method>onFrontendProductView</method>
145
  </springbot_bonecollector_capturesku_observer>
146
  </observers>
147
  </catalog_controller_product_view>
150
  <springbot_bonecollector_addskutocart_observer>
151
  <type>singleton</type>
152
  <class>Springbot_BoneCollector_Model_HarvestCart_Observer</class>
153
+ <method>onFrontendCartAddProduct</method>
154
  </springbot_bonecollector_addskutocart_observer>
155
  </observers>
156
  </checkout_cart_add_product_complete>
163
  <springbot_bonecollector_purchase_admin_observer>
164
  <type>singleton</type>
165
  <class>Springbot_BoneCollector_Model_HarvestPurchase_Observer</class>
166
+ <method>onAdminOrderSaveAfter</method>
167
  </springbot_bonecollector_purchase_admin_observer>
168
  </observers>
169
  </sales_order_save_after>
172
  <springbot_bonecollector_attribute_observer>
173
  <type>singleton</type>
174
  <class>Springbot_BoneCollector_Model_HarvestAttribute_Observer</class>
175
+ <method>onAdminAttributeSaveAfter</method>
176
  </springbot_bonecollector_attribute_observer>
177
  </observers>
178
  </catalog_entity_attribute_save_commit_after>
181
  <springbot_bonecollector_attribute_set_observer>
182
  <type>singleton</type>
183
  <class>Springbot_BoneCollector_Model_HarvestAttribute_Observer</class>
184
+ <method>onAdminAttributeSetSaveAfter</method>
185
  </springbot_bonecollector_attribute_set_observer>
186
  </observers>
187
  </eav_entity_attribute_save_commit_after>
app/code/community/Springbot/Boss.php CHANGED
@@ -2,7 +2,6 @@
2
 
3
  class Springbot_Boss
4
  {
5
- private static $_loggers;
6
  private static $_currentStore;
7
 
8
  const EVENT_FILENAME = 'Springbot-EventHistory.csv';
@@ -55,7 +54,6 @@ class Springbot_Boss
55
  }
56
 
57
  /**
58
- *
59
  *
60
  * @param string $method
61
  * @param array $args
@@ -71,9 +69,15 @@ class Springbot_Boss
71
  $log = Mage::helper('combine')->getSpringbotLog();
72
  $nohup = Mage::helper('combine')->nohup();
73
  $nice = Mage::helper('combine')->nice();
74
-
75
  $cmd = "{$nohup} {$nice} {$php} {$dir}/shell/springbot.php {$fmt} {$method} >> {$log} 2>> {$err} {$bkg}";
76
- return self::spawn($cmd);
 
 
 
 
 
 
 
77
  }
78
 
79
  /**
@@ -151,7 +155,7 @@ class Springbot_Boss
151
 
152
  public static function getEventHistoryFilename()
153
  {
154
- return Mage::getBaseDir('var') . DS . 'log' . DS . self::EVENT_FILENAME;
155
  }
156
 
157
  public static function isCron()
@@ -161,13 +165,9 @@ class Springbot_Boss
161
 
162
  public static function storeIdsExist()
163
  {
164
- $configValues = Mage::getStoreConfig('springbot/config');
165
- $storeIdStr = 'store_id_';
166
- foreach ($configValues as $configName => $configValue) {
167
- if(substr($configName, 0, strlen($storeIdStr)) == $storeIdStr) {
168
- if (!is_numeric($configValue)) {
169
- return false;
170
- }
171
  }
172
  }
173
  return true;
2
 
3
  class Springbot_Boss
4
  {
 
5
  private static $_currentStore;
6
 
7
  const EVENT_FILENAME = 'Springbot-EventHistory.csv';
54
  }
55
 
56
  /**
 
57
  *
58
  * @param string $method
59
  * @param array $args
69
  $log = Mage::helper('combine')->getSpringbotLog();
70
  $nohup = Mage::helper('combine')->nohup();
71
  $nice = Mage::helper('combine')->nice();
 
72
  $cmd = "{$nohup} {$nice} {$php} {$dir}/shell/springbot.php {$fmt} {$method} >> {$log} 2>> {$err} {$bkg}";
73
+
74
+ try {
75
+ $ret = self::spawn($cmd);
76
+ }
77
+ catch (Exception $e) {
78
+ $ret = null;
79
+ }
80
+ return $ret;
81
  }
82
 
83
  /**
155
 
156
  public static function getEventHistoryFilename()
157
  {
158
+ return Mage::getBaseDir('log') . DS . self::EVENT_FILENAME;
159
  }
160
 
161
  public static function isCron()
165
 
166
  public static function storeIdsExist()
167
  {
168
+ foreach (Mage::app()->getStores() as $store) {
169
+ if (!Mage::getStoreConfig('springbot/config/store_id_' . $store->getId())) {
170
+ return false;
 
 
 
 
171
  }
172
  }
173
  return true;
app/code/community/Springbot/Combine/Helper/Data.php CHANGED
@@ -8,6 +8,17 @@ class Springbot_Combine_Helper_Data extends Mage_Core_Helper_Abstract
8
  return $_date->format(DateTime::ATOM);
9
  }
10
 
 
 
 
 
 
 
 
 
 
 
 
11
  public function getStoreGuid($storeId)
12
  {
13
  $guid = Mage::getStoreConfig('springbot/config/store_guid_' . $storeId);
@@ -81,10 +92,23 @@ class Springbot_Combine_Helper_Data extends Mage_Core_Helper_Abstract
81
  public function doSendQuote($json)
82
  {
83
  $obj = json_decode($json);
84
- $items = sha1(json_encode((isset($obj->line_items)) ? $obj->line_items : array()));
 
 
 
 
 
 
 
 
 
 
 
 
 
85
 
86
- if(strcmp(Mage::getSingleton('core/session')->getSpringbotPostedQuoteItems(), $items) !== 0) {
87
- Mage::getSingleton('core/session')->setSpringbotPostedQuoteItems($items);
88
  return true;
89
  } else {
90
  return false;
@@ -181,12 +205,12 @@ class Springbot_Combine_Helper_Data extends Mage_Core_Helper_Abstract
181
 
182
  public function getSpringbotErrorLog()
183
  {
184
- return Mage::getBaseDir('var') . DS . 'log' . DS . Springbot_Log::ERRFILE;
185
  }
186
 
187
  public function getSpringbotLog()
188
  {
189
- return Mage::getBaseDir('var') . DS . 'log' . DS . Springbot_Log::LOGFILE;
190
  }
191
 
192
  public function isEmpty($obj)
@@ -209,10 +233,8 @@ class Springbot_Combine_Helper_Data extends Mage_Core_Helper_Abstract
209
  $maxRecSize = 65536;
210
  if (empty($logName)) {
211
  $fullFilename = Mage::getBaseDir('log') . DS . Springbot_Log::LOGFILE;
212
- } elseif (strpos($logName, '/') === 0){
213
- $fullFilename = $logName;
214
  } else {
215
- $fullFilename = Mage::getBaseDir('log') . '/' . $logName;
216
  }
217
 
218
  $buffer = '';
8
  return $_date->format(DateTime::ATOM);
9
  }
10
 
11
+ /**
12
+ * Converts a store guid into its alphanumeric-only representation if present.
13
+ */
14
+ public function getPublicGuid($storeId)
15
+ {
16
+ $guid = Mage::getStoreConfig('springbot/config/store_guid_' . $storeId);
17
+ if(isset($guid)) {
18
+ return str_replace('-', '', strtolower($guid));
19
+ }
20
+ }
21
+
22
  public function getStoreGuid($storeId)
23
  {
24
  $guid = Mage::getStoreConfig('springbot/config/store_guid_' . $storeId);
92
  public function doSendQuote($json)
93
  {
94
  $obj = json_decode($json);
95
+ $toHash = '';
96
+ if (isset($obj->customer_firstname)) {
97
+ $toHash .= $obj->customer_firstname;
98
+ }
99
+ if (isset($obj->customer_lastname)) {
100
+ $toHash .= $obj->customer_lastname;
101
+ }
102
+
103
+ if (isset($obj->line_items)) {
104
+ $hash = sha1($toHash . json_encode($obj->line_items));
105
+ }
106
+ else {
107
+ $hash = sha1($toHash . json_encode(array()));
108
+ }
109
 
110
+ if (Mage::getSingleton('core/session')->getSpringbotQuoteHash() !== $hash) {
111
+ Mage::getSingleton('core/session')->setSpringbotQuoteHash($hash);
112
  return true;
113
  } else {
114
  return false;
205
 
206
  public function getSpringbotErrorLog()
207
  {
208
+ return Mage::getBaseDir('log') . DS . Springbot_Log::ERRFILE;
209
  }
210
 
211
  public function getSpringbotLog()
212
  {
213
+ return Mage::getBaseDir('log') . DS . Springbot_Log::LOGFILE;
214
  }
215
 
216
  public function isEmpty($obj)
233
  $maxRecSize = 65536;
234
  if (empty($logName)) {
235
  $fullFilename = Mage::getBaseDir('log') . DS . Springbot_Log::LOGFILE;
 
 
236
  } else {
237
+ $fullFilename = Mage::getBaseDir('log') . DS . str_replace('../', '', $logName);
238
  }
239
 
240
  $buffer = '';
app/code/community/Springbot/Combine/Helper/Harvest.php CHANGED
@@ -71,23 +71,28 @@ class Springbot_Combine_Helper_Harvest extends Mage_Core_Helper_Abstract
71
  public function getPhpExec()
72
  {
73
  if(!isset($this->_phpExec)) {
74
- $php = Mage::getStoreConfig('springbot/config/php_exec');
 
75
 
76
- if((empty($php))) {
77
- // This prevents the system command from outputting to apache
78
- ob_start();
79
- if(empty($php) || !file_exists($php)) {
80
- $php = Springbot_Boss::spawn('which php5 2> /dev/null');
81
- }
82
- if(empty($php) || !file_exists($php)) {
83
- $php = Springbot_Boss::spawn('which php 2> /dev/null');
84
- }
85
- if(empty($php) || !file_exists($php)) {
86
- $php = 'php';
 
 
87
  }
88
- ob_end_clean();
 
 
 
89
  }
90
- $this->_phpExec = $php;
91
  }
92
  return $this->_phpExec;
93
  }
@@ -215,11 +220,14 @@ class Springbot_Combine_Helper_Harvest extends Mage_Core_Helper_Abstract
215
  ->reset(Zend_Db_Select::COLUMNS)
216
  ->reset(Zend_Db_Select::WHERE)
217
  ->reset(Zend_Db_Select::ORDER)
218
- ->columns($idFieldName)
219
- ->where("{$idFieldName} < {$lastId}")
220
  ->order("{$idFieldName} DESC")
221
  ->limit(1, $size);
222
 
 
 
 
 
223
  $result = $collection->getFirstItem();
224
  if ($result) {
225
  return $result[$idFieldName];
71
  public function getPhpExec()
72
  {
73
  if(!isset($this->_phpExec)) {
74
+ try {
75
+ $php = Mage::getStoreConfig('springbot/config/php_exec');
76
 
77
+ if((empty($php))) {
78
+ // This prevents the system command from outputting to apache
79
+ ob_start();
80
+ if(empty($php) || !file_exists($php)) {
81
+ $php = Springbot_Boss::spawn('which php5 2> /dev/null');
82
+ }
83
+ if(empty($php) || !file_exists($php)) {
84
+ $php = Springbot_Boss::spawn('which php 2> /dev/null');
85
+ }
86
+ if(empty($php) || !file_exists($php)) {
87
+ $php = 'php';
88
+ }
89
+ ob_end_clean();
90
  }
91
+ $this->_phpExec = $php;
92
+ }
93
+ catch (Exception $e) {
94
+ return '';
95
  }
 
96
  }
97
  return $this->_phpExec;
98
  }
220
  ->reset(Zend_Db_Select::COLUMNS)
221
  ->reset(Zend_Db_Select::WHERE)
222
  ->reset(Zend_Db_Select::ORDER)
223
+ ->columns("$idFieldName")
 
224
  ->order("{$idFieldName} DESC")
225
  ->limit(1, $size);
226
 
227
+ $collection->addFieldToFilter($idFieldName, array(
228
+ 'lt' => $lastId
229
+ ));
230
+
231
  $result = $collection->getFirstItem();
232
  if ($result) {
233
  return $result[$idFieldName];
app/code/community/Springbot/Combine/Helper/Parser.php CHANGED
@@ -59,7 +59,7 @@ class Springbot_Combine_Helper_Parser extends Mage_Core_Helper_Abstract
59
  }
60
 
61
  /**
62
- * Gets accessible sku, product is visbible from frontend
63
  *
64
  * @param Mage_Sales_Model_Order_Item
65
  * @return string
@@ -78,9 +78,12 @@ class Springbot_Combine_Helper_Parser extends Mage_Core_Helper_Abstract
78
 
79
  public function isAccessible($product)
80
  {
81
- return $product instanceof Mage_Catalog_Model_Product &&
82
- !($product->getVisibility() == Mage_Catalog_Model_Product_Visibility::VISIBILITY_NOT_VISIBLE ||
83
- $product->getStatus() == Mage_Catalog_Model_Product_Status::STATUS_DISABLED);
 
 
 
84
  }
85
 
86
  /**
59
  }
60
 
61
  /**
62
+ * Gets accessible sku, product is visible from frontend
63
  *
64
  * @param Mage_Sales_Model_Order_Item
65
  * @return string
78
 
79
  public function isAccessible($product)
80
  {
81
+ return
82
+ ($product instanceof Mage_Catalog_Model_Product) &&
83
+ !(
84
+ $product->getVisibility() == Mage_Catalog_Model_Product_Visibility::VISIBILITY_NOT_VISIBLE ||
85
+ $product->getStatus() == Mage_Catalog_Model_Product_Status::STATUS_DISABLED
86
+ );
87
  }
88
 
89
  /**
app/code/community/Springbot/Combine/Model/Api.php CHANGED
@@ -86,7 +86,7 @@ class Springbot_Combine_Model_Api extends Varien_Object
86
  public function hasToken()
87
  {
88
  $token = Mage::getStoreConfig('springbot/config/security_token');
89
- if(!empty($token)) {
90
  $this->_securityToken = $token;
91
  }
92
  return isset($this->_securityToken);
@@ -110,22 +110,20 @@ class Springbot_Combine_Model_Api extends Varien_Object
110
  public function getApiUrl($method = '')
111
  {
112
  if(!isset($this->_url)) {
113
- $url = Mage::getStoreConfig('springbot/config/api_url', Mage::app()->getStore());
114
- if(!isset($url)) {
115
- $url = 'https://api.springbot.com/';
116
  }
117
- $this->_url = $url . 'api/';
118
  }
119
  return $this->_url . $method;
120
  }
121
 
122
  public function getClient($method = Varien_Http_Client::POST)
123
  {
124
- if(!isset($this->_client)) {
125
- $this->_client = new Zend_Http_Client();
126
- $this->_client->setMethod($method);
127
- $this->_client->setHeaders(self::HTTP_CONTENT_TYPE);
128
- }
129
  return $this->_client;
130
  }
131
 
86
  public function hasToken()
87
  {
88
  $token = Mage::getStoreConfig('springbot/config/security_token');
89
+ if($token) {
90
  $this->_securityToken = $token;
91
  }
92
  return isset($this->_securityToken);
110
  public function getApiUrl($method = '')
111
  {
112
  if(!isset($this->_url)) {
113
+ $this->_url = Mage::getStoreConfig('springbot/config/api_url');
114
+ if(!$this->_url) {
115
+ $this->_url = 'https://api.springbot.com/';
116
  }
117
+ $this->_url .= 'api/';
118
  }
119
  return $this->_url . $method;
120
  }
121
 
122
  public function getClient($method = Varien_Http_Client::POST)
123
  {
124
+ $this->_client = new Zend_Http_Client();
125
+ $this->_client->setMethod($method);
126
+ $this->_client->setHeaders(self::HTTP_CONTENT_TYPE);
 
 
127
  return $this->_client;
128
  }
129
 
app/code/community/Springbot/Combine/Model/Cron/Queue/Batch.php CHANGED
@@ -22,7 +22,7 @@ class Springbot_Combine_Model_Cron_Queue_Batch extends Varien_Object
22
  $sql = $this->toSql();
23
  if($rows = $this->_rowCount()) {
24
  Springbot_Log::info("Inserting {$rows} rows into {$this->_getTablename()}");
25
- //Springbot_Log::debug("Running batch insert : {$sql}");
26
  $rows = $this->_getWriter()->exec($sql);
27
  }
28
  Springbot_Log::info("{$rows} rows inserted");
@@ -32,7 +32,7 @@ class Springbot_Combine_Model_Cron_Queue_Batch extends Varien_Object
32
  public function push($args)
33
  {
34
  if($this->_isValid($args)) {
35
- //Springbot_Log::debug("Pushing {$args['method']} : {$args['args']}");
36
  $row = $this->_getRowModel();
37
  $row->setData($args);
38
  $this->_stack[] = $row;
22
  $sql = $this->toSql();
23
  if($rows = $this->_rowCount()) {
24
  Springbot_Log::info("Inserting {$rows} rows into {$this->_getTablename()}");
25
+ #Springbot_Log::debug("Running batch insert : {$sql}");
26
  $rows = $this->_getWriter()->exec($sql);
27
  }
28
  Springbot_Log::info("{$rows} rows inserted");
32
  public function push($args)
33
  {
34
  if($this->_isValid($args)) {
35
+ #Springbot_Log::debug("Pushing {$args['method']} : {$args['args']}");
36
  $row = $this->_getRowModel();
37
  $row->setData($args);
38
  $this->_stack[] = $row;
app/code/community/Springbot/Combine/Model/Harvest/Abstract.php CHANGED
@@ -30,9 +30,9 @@ class Springbot_Combine_Model_Harvest_Abstract
30
  {
31
  if($this->getCount()) {
32
  $this->_getIterator()->walk(
33
- $this->getSelect(),
34
- array(array($this, 'step'))
35
- );
36
  // Post leftover segment
37
  $this->_total += count($this->_segmentQueue);
38
  $this->postSegment();
30
  {
31
  if($this->getCount()) {
32
  $this->_getIterator()->walk(
33
+ $this->getSelect(),
34
+ array(array($this, 'step'))
35
+ );
36
  // Post leftover segment
37
  $this->_total += count($this->_segmentQueue);
38
  $this->postSegment();
app/code/community/Springbot/Combine/Model/Harvest/Coupons.php ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Springbot_Combine_Model_Harvest_Coupons extends Springbot_Combine_Model_Harvest_Abstract implements Springbot_Combine_Model_Harvester
4
+ {
5
+ protected $_mageModel = 'salesrule/coupon';
6
+ protected $_parserModel = 'combine/parser_coupon';
7
+ protected $_apiController = 'coupons';
8
+ protected $_apiModel = 'coupons';
9
+ protected $_rowId = 'coupon_id';
10
+
11
+ public function loadMageModel($entityId)
12
+ {
13
+ $this->_model = Mage::getModel($this->_getMageModel());
14
+ $this->_model->setStoreId($this->_storeId);
15
+ $this->_model->load($entityId);
16
+ return $this->_model;
17
+ }
18
+
19
+ public function parse($model)
20
+ {
21
+ $model->setStoreId($this->_storeId);
22
+ $parser = $this->_getParser($model)->parse($model);
23
+ $parser->setDataSource($this->getDataSource());
24
+ return $parser->getData();
25
+ }
26
+
27
+ }
app/code/community/Springbot/Combine/Model/Harvest/Rules.php ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Springbot_Combine_Model_Harvest_Rules extends Springbot_Combine_Model_Harvest_Abstract implements Springbot_Combine_Model_Harvester
4
+ {
5
+ protected $_mageModel = 'salesrule/rule';
6
+ protected $_parserModel = 'combine/parser_rule';
7
+ protected $_apiController = 'promotions';
8
+ protected $_apiModel = 'promotions';
9
+ protected $_rowId = 'rule_id';
10
+
11
+ public function loadMageModel($entityId)
12
+ {
13
+ $this->_model = Mage::getModel($this->_getMageModel());
14
+ $this->_model->setStoreId($this->_storeId);
15
+ $this->_model->load($entityId);
16
+ return $this->_model;
17
+ }
18
+
19
+ public function parse($model)
20
+ {
21
+ $model->setStoreId($this->_storeId);
22
+ $parser = $this->_getParser($model)->parse($model);
23
+ $parser->setDataSource($this->getDataSource());
24
+ return $parser->getData();
25
+ }
26
+
27
+ }
app/code/community/Springbot/Combine/Model/Harvester.php CHANGED
@@ -3,14 +3,9 @@
3
  interface Springbot_Combine_Model_Harvester
4
  {
5
  public function getCollection();
6
-
7
  public function setCollection(Varien_Data_Collection $collection);
8
-
9
  public function harvest();
10
-
11
  public function step($args);
12
-
13
  public function parse($model);
14
-
15
  public function loadMageModel($entityId);
16
  }
3
  interface Springbot_Combine_Model_Harvester
4
  {
5
  public function getCollection();
 
6
  public function setCollection(Varien_Data_Collection $collection);
 
7
  public function harvest();
 
8
  public function step($args);
 
9
  public function parse($model);
 
10
  public function loadMageModel($entityId);
11
  }
app/code/community/Springbot/Combine/Model/Parser/Abstract.php CHANGED
@@ -171,11 +171,15 @@ class Springbot_Combine_Model_Parser_Abstract extends Varien_Object
171
 
172
  protected function _getSkuFailsafe($product)
173
  {
174
- if ($sku = $product->getSku()) {
175
- return $sku;
176
- }
177
- else {
178
- return Springbot_Boss::NO_SKU_PREFIX .$product->getEntityId();
 
 
 
 
179
  }
180
  }
181
 
171
 
172
  protected function _getSkuFailsafe($product)
173
  {
174
+ if($product instanceof Mage_Catalog_Model_Product) {
175
+ // Use array accessor here because getSku method
176
+ // use the type instance's sku (i.e. the child sku)
177
+ if ($sku = $product['sku']) {
178
+ return $sku;
179
+ }
180
+ else {
181
+ return Springbot_Boss::NO_SKU_PREFIX . $product->getEntityId();
182
+ }
183
  }
184
  }
185
 
app/code/community/Springbot/Combine/Model/Parser/Coupon.php ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Springbot_Combine_Model_Parser_Coupon extends Springbot_Combine_Model_Parser_Abstract
4
+ {
5
+ protected $_coupon;
6
+ protected $_accessor = '_coupon';
7
+
8
+ public function __construct(Mage_SalesRule_Model_Coupon $coupon)
9
+ {
10
+ $this->_coupon = $coupon;
11
+ $this->_parse();
12
+ }
13
+
14
+ public function parse($coupon)
15
+ {
16
+ $this->_coupon = $coupon;
17
+ $this->_parse();
18
+
19
+ return $this;
20
+ }
21
+
22
+ protected function _parse()
23
+ {
24
+ $this->setData(array(
25
+ 'coupon_id' => $this->_coupon->getCouponId(),
26
+ 'store_id' => Mage::helper('combine/harvest')->getSpringbotStoreId($this->_coupon->getStoreId()),
27
+ 'rule_id' => $this->_coupon->getRuleId(),
28
+ 'code' => $this->_coupon->getCode(),
29
+ 'usage_limit' => $this->_coupon->getUsageLimit(),
30
+ 'usage_per_customer' => $this->_coupon->getUsagePerCustomer(),
31
+ 'times_used' => $this->_coupon->getTimesUsed(),
32
+ 'expiration_date' => $this->_coupon->getExpirationDate(),
33
+ 'is_primary' => $this->_coupon->getIsPrimary(),
34
+ 'type' => $this->_coupon->getType(),
35
+ ));
36
+
37
+ return parent::_parse();
38
+ }
39
+
40
+ }
app/code/community/Springbot/Combine/Model/Parser/Purchase/Item.php CHANGED
@@ -59,16 +59,13 @@ class Springbot_Combine_Model_Parser_Purchase_Item extends Springbot_Combine_Mod
59
 
60
  if(!isset($this->_parentProduct))
61
  {
62
- if($config = $item->getProductOptionByCode('super_product_config'))
63
- {
64
  $parentProductId = isset($config['product_id']) ? $config['product_id'] : null;
65
  }
66
- else if($item->hasParentItemId())
67
- {
68
  $parentProductId = $item->getParentItem()->getProductId();
69
  }
70
- if(!isset($parentProductId))
71
- {
72
  $parentProductId = $item->getProductId();
73
  }
74
  $this->_parentProduct = $this->_getProduct($parentProductId);
59
 
60
  if(!isset($this->_parentProduct))
61
  {
62
+ if($config = $item->getProductOptionByCode('super_product_config')) {
 
63
  $parentProductId = isset($config['product_id']) ? $config['product_id'] : null;
64
  }
65
+ else if($item->hasParentItemId()) {
 
66
  $parentProductId = $item->getParentItem()->getProductId();
67
  }
68
+ if(!isset($parentProductId)) {
 
69
  $parentProductId = $item->getProductId();
70
  }
71
  $this->_parentProduct = $this->_getProduct($parentProductId);
app/code/community/Springbot/Combine/Model/Parser/Quote.php CHANGED
@@ -28,7 +28,13 @@ class Springbot_Combine_Model_Parser_Quote extends Springbot_Combine_Model_Parse
28
 
29
  public function hasCustomerData()
30
  {
31
- return $this->_getEmail();
 
 
 
 
 
 
32
  }
33
 
34
  protected function _parse()
@@ -48,10 +54,10 @@ class Springbot_Combine_Model_Parser_Quote extends Springbot_Combine_Model_Parse
48
  'customer_lastname' => $this->_quote->getCustomerLastname(),
49
  'customer_suffix' => $this->_quote->getCustomerSuffix(),
50
  'json_data' => array(
51
- 'checkout_method' => $this->_quote->getCheckoutMethod(),
52
- 'customer_is_guest' => $this->_quote->getCustomerIsGuest(),
53
- 'remote_ip' => $this->_quote->getRemoteIp(),
54
- ),
55
  'line_items' => $this->_getLineItems(),
56
  ));
57
 
28
 
29
  public function hasCustomerData()
30
  {
31
+ // Explicitly return true for test suite
32
+ if ($this->_getEmail()) {
33
+ return true;
34
+ }
35
+ else {
36
+ return false;
37
+ }
38
  }
39
 
40
  protected function _parse()
54
  'customer_lastname' => $this->_quote->getCustomerLastname(),
55
  'customer_suffix' => $this->_quote->getCustomerSuffix(),
56
  'json_data' => array(
57
+ 'checkout_method' => $this->_quote->getCheckoutMethod(),
58
+ 'customer_is_guest' => $this->_quote->getCustomerIsGuest(),
59
+ 'remote_ip' => $this->_quote->getRemoteIp(),
60
+ ),
61
  'line_items' => $this->_getLineItems(),
62
  ));
63
 
app/code/community/Springbot/Combine/Model/Parser/Quote/Item.php CHANGED
@@ -45,23 +45,18 @@ class Springbot_Combine_Model_Parser_Quote_Item extends Springbot_Combine_Model_
45
 
46
  public function getParentProduct()
47
  {
48
- if(!isset($this->_parentProduct))
49
- {
50
  $item = $this->_item;
51
 
52
- if($type = $item->getOptionByCode('product_type'))
53
- {
54
- if($parentProductId = $type->getProductId())
55
- {
56
  $this->_parentProduct = Mage::getModel('catalog/product')->load($parentProductId);
57
  }
58
  }
59
- else if($item->hasParentItemId())
60
- {
61
  $this->_parentProduct = $item->getParentItem()->getProduct();
62
  }
63
- else
64
- {
65
  $this->_parentProduct = $item->getProduct();
66
  }
67
  }
45
 
46
  public function getParentProduct()
47
  {
48
+ if(!isset($this->_parentProduct)) {
 
49
  $item = $this->_item;
50
 
51
+ if($type = $item->getOptionByCode('product_type')) {
52
+ if($parentProductId = $type->getProductId()) {
 
 
53
  $this->_parentProduct = Mage::getModel('catalog/product')->load($parentProductId);
54
  }
55
  }
56
+ else if($item->hasParentItemId()) {
 
57
  $this->_parentProduct = $item->getParentItem()->getProduct();
58
  }
59
+ else {
 
60
  $this->_parentProduct = $item->getProduct();
61
  }
62
  }
app/code/community/Springbot/Combine/Model/Parser/Rule.php ADDED
@@ -0,0 +1,60 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Springbot_Combine_Model_Parser_Rule extends Springbot_Combine_Model_Parser_Abstract
4
+ {
5
+ protected $_rule;
6
+ protected $_accessor = '_rule';
7
+
8
+ public function __construct(Mage_SalesRule_Model_Rule $rule)
9
+ {
10
+ $this->_rule = $rule;
11
+ $this->_parse();
12
+ }
13
+
14
+ public function parse($rule)
15
+ {
16
+ $this->_rule = $rule;
17
+ $this->_parse();
18
+
19
+ return $this;
20
+ }
21
+
22
+ protected function _parse()
23
+ {
24
+ $this->setData(array(
25
+ 'rule_id' => $this->_rule->getId(),
26
+ 'store_id' => Mage::helper('combine/harvest')->getSpringbotStoreId($this->_rule->getStoreId()),
27
+ 'is_active' => $this->_rule->getIsActive(),
28
+ 'name' => $this->_rule->getName(),
29
+ 'coupon_code' => $this->_rule->getCouponCode(),
30
+ 'description' => $this->_rule->getDescription(),
31
+ 'conditions' => $this->_serializedToJson($this->_rule->getConditionsSerialized()),
32
+ 'actions' => $this->_serializedToJson($this->_rule->getActionsSerialized()),
33
+ 'from_date' => $this->_rule->getFromDate(),
34
+ 'to_date' => $this->_rule->getToDate(),
35
+ 'uses_per_coupon' => $this->_rule->getUsesPerCoupon(),
36
+ 'uses_per_customer' => $this->_rule->getUsesPerCustomer(),
37
+ 'stop_rules_processing' => $this->_rule->getUsesPerCustomer(),
38
+ 'is_advanced' => $this->_rule->getUsesPerCustomer(),
39
+ 'product_ids' => $this->_rule->getProductIds(),
40
+ 'sort_order' => $this->_rule->getSortOrder(),
41
+ 'simple_action' => $this->_rule->getSimpleAction(),
42
+ 'discount_amount' => $this->_rule->getDiscountAmount(),
43
+ 'discount_qty' => $this->_rule->getDiscountQty(),
44
+ 'discount_step' => $this->_rule->getDiscountStep(),
45
+ 'simple_free_shipping' => $this->_rule->getSimpleFreeShipping(),
46
+ 'apply_to_shipping' => $this->_rule->getApplyToShipping(),
47
+ 'times_used' => $this->_rule->getTimesUsed(),
48
+ 'is_rss' => $this->_rule->getIsRss(),
49
+ 'website_ids' => $this->_rule->getWebsiteIds(),
50
+ 'customer_group_ids' => $this->_rule->getCustomerGroupIds(),
51
+ ));
52
+
53
+ return parent::_parse();
54
+ }
55
+
56
+ protected function _serializedToJson($arg)
57
+ {
58
+ return unserialize($arg);
59
+ }
60
+ }
app/code/community/Springbot/Combine/Model/Parser/Subscriber.php CHANGED
@@ -16,7 +16,6 @@ class Springbot_Combine_Model_Parser_Subscriber extends Springbot_Combine_Model_
16
  public function isCustomer()
17
  {
18
  $customerId = $this->_subscriber->getCustomerId();
19
-
20
  return !empty($customerId);
21
  }
22
 
16
  public function isCustomer()
17
  {
18
  $customerId = $this->_subscriber->getCustomerId();
 
19
  return !empty($customerId);
20
  }
21
 
app/code/community/Springbot/Combine/Model/Redirect.php CHANGED
@@ -24,9 +24,7 @@ class Springbot_Combine_Model_Redirect extends Springbot_Combine_Model_Abstract
24
  public function getAttributionIds()
25
  {
26
  $collection = Mage::getModel('combine/redirect')->getCollection()->loadByEmail($this->getEmail());
27
-
28
  $ids = $collection->getAllIds();
29
-
30
  return $ids;
31
  }
32
  }
24
  public function getAttributionIds()
25
  {
26
  $collection = Mage::getModel('combine/redirect')->getCollection()->loadByEmail($this->getEmail());
 
27
  $ids = $collection->getAllIds();
 
28
  return $ids;
29
  }
30
  }
app/code/community/Springbot/Combine/etc/config.xml CHANGED
@@ -10,7 +10,7 @@
10
  <config>
11
  <modules>
12
  <Springbot_Combine>
13
- <version>1.2.1.2</version>
14
  </Springbot_Combine>
15
  </modules>
16
  <global>
@@ -74,13 +74,15 @@
74
  <segment_size>25</segment_size>
75
  <show_notifications>1</show_notifications>
76
  <remote_update>0</remote_update>
77
- <use_cached_image>0</use_cached_image>
78
  <remote_update>0</remote_update>
79
  <stability>stable</stability>
80
  <email_selector>billing:email,login-email,newsletter</email_selector>
81
  <email_selector_classes>validate-email</email_selector_classes>
82
  <sent_store_noemail>0</sent_store_noemail>
83
  </config>
 
 
 
84
  <debug>
85
  <log_format>default</log_format>
86
  <log_level>6</log_level>
@@ -88,12 +90,13 @@
88
  <filesize_limit>104857600</filesize_limit>
89
  </debug>
90
  <advanced>
91
- <nice>1</nice>
92
- <nohup>1</nohup>
93
  <worker_count>5</worker_count>
94
  <sleep_interval>1</sleep_interval>
95
  <extended_config>0</extended_config>
96
  <product_url_type>default</product_url_type>
 
97
  </advanced>
98
  <cart_restore>
99
  <do_restore>1</do_restore>
10
  <config>
11
  <modules>
12
  <Springbot_Combine>
13
+ <version>1.3.0.6</version>
14
  </Springbot_Combine>
15
  </modules>
16
  <global>
74
  <segment_size>25</segment_size>
75
  <show_notifications>1</show_notifications>
76
  <remote_update>0</remote_update>
 
77
  <remote_update>0</remote_update>
78
  <stability>stable</stability>
79
  <email_selector>billing:email,login-email,newsletter</email_selector>
80
  <email_selector_classes>validate-email</email_selector_classes>
81
  <sent_store_noemail>0</sent_store_noemail>
82
  </config>
83
+ <images>
84
+ <use_cached_images>0</use_cached_images>
85
+ </images>
86
  <debug>
87
  <log_format>default</log_format>
88
  <log_level>6</log_level>
90
  <filesize_limit>104857600</filesize_limit>
91
  </debug>
92
  <advanced>
93
+ <nice>0</nice>
94
+ <nohup>0</nohup>
95
  <worker_count>5</worker_count>
96
  <sleep_interval>1</sleep_interval>
97
  <extended_config>0</extended_config>
98
  <product_url_type>default</product_url_type>
99
+ <assets_domain>assets.springbot.com</assets_domain>
100
  </advanced>
101
  <cart_restore>
102
  <do_restore>1</do_restore>
app/code/community/Springbot/Combine/sql/combine_setup/mysql4-upgrade-1.2.0.1-1.2.1.0.php CHANGED
@@ -9,7 +9,6 @@ $installer->getConnection()->beginTransaction();
9
 
10
  try {
11
  $installer->run("
12
- DROP TABLE IF EXISTS `{$installer->getTable('combine/cron_queue')}`;
13
  CREATE TABLE IF NOT EXISTS `{$installer->getTable('combine/cron_queue')}`
14
  (
15
  `id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
@@ -29,7 +28,6 @@ $installer->run("
29
  PRIMARY KEY (`id`),
30
  KEY `IDX_PRIORITY_CREATED_AT` (`priority`, `created_at`)
31
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
32
- DROP TABLE IF EXISTS `{$installer->getTable('combine/cron_count')}`;
33
  CREATE TABLE IF NOT EXISTS `{$installer->getTable('combine/cron_count')}`
34
  (
35
  `id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
9
 
10
  try {
11
  $installer->run("
 
12
  CREATE TABLE IF NOT EXISTS `{$installer->getTable('combine/cron_queue')}`
13
  (
14
  `id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
28
  PRIMARY KEY (`id`),
29
  KEY `IDX_PRIORITY_CREATED_AT` (`priority`, `created_at`)
30
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
 
31
  CREATE TABLE IF NOT EXISTS `{$installer->getTable('combine/cron_count')}`
32
  (
33
  `id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
app/code/community/Springbot/DataServices/HarvestingManager.php CHANGED
@@ -15,8 +15,7 @@
15
 
16
  class Springbot_DataServices_HarvestingManager
17
  {
18
- const MAGENTO_PACKAGE_VERSION = '1.2.1.4';
19
- const ZERO = 0;
20
  const SUCCESSFUL_RESPONSE = 'ok';
21
  const DATE_FORMAT = 'Y-m-d H:i:s';
22
 
@@ -143,12 +142,13 @@ class Springbot_DataServices_HarvestingManager
143
  $this->showMessage('['.__METHOD__.'] '.' '.$error_msg);
144
  }
145
 
146
- private function setConfigVar($varName,$varValue)
147
  {
 
148
  if(!preg_match('/.*\/.*\/.*/', $varName)) {
149
  $varName = 'springbot/config/' . $varName;
150
  }
151
- if (!empty($varName)) {
152
  $this->set_config($varName, $varValue);
153
  }
154
  return;
@@ -254,7 +254,7 @@ class Springbot_DataServices_HarvestingManager
254
  $this->showMessage('Store->'.$storeNumber.' had '.$actionCount.' actions extracted from '.$eventHistoryArchiveFilename);
255
  fclose($handle);
256
  }
257
- if (sizeof($logData)==self::ZERO) {
258
  $this->showMessage('Empty '.$eventHistoryArchiveFilename);
259
  } else {
260
  $this->showMessage('Delivering '.$eventHistoryArchiveFilename);
@@ -297,8 +297,7 @@ class Springbot_DataServices_HarvestingManager
297
  private function fileReplace($target,$source)
298
  {
299
  $openModeOutput = 'w';
300
- $origSize = self::ZERO;
301
- $newSize = self::ZERO;
302
 
303
  $magentoRootDir = $this->rootAppPath;
304
  if (substr($target,0,1) != '/') {
@@ -426,7 +425,7 @@ class Springbot_DataServices_HarvestingManager
426
  return Mage::getModel('core/config')->saveConfig($path, $value, $scope, $scope_id);
427
  }
428
 
429
- private function showMessage($msg,$abort=false,$ignoreMessage=true)
430
  {
431
  Springbot_Log::debug($msg);
432
  if ($ignoreMessage==false) {
15
 
16
  class Springbot_DataServices_HarvestingManager
17
  {
18
+ const MAGENTO_PACKAGE_VERSION = '1.3.0.7';
 
19
  const SUCCESSFUL_RESPONSE = 'ok';
20
  const DATE_FORMAT = 'Y-m-d H:i:s';
21
 
142
  $this->showMessage('['.__METHOD__.'] '.' '.$error_msg);
143
  }
144
 
145
+ private function setConfigVar($varName, $varValue)
146
  {
147
+ $varName = trim($varName);
148
  if(!preg_match('/.*\/.*\/.*/', $varName)) {
149
  $varName = 'springbot/config/' . $varName;
150
  }
151
+ if (!empty($varName) && ($varName != 'springbot/config/php_exec')) {
152
  $this->set_config($varName, $varValue);
153
  }
154
  return;
254
  $this->showMessage('Store->'.$storeNumber.' had '.$actionCount.' actions extracted from '.$eventHistoryArchiveFilename);
255
  fclose($handle);
256
  }
257
+ if (sizeof($logData) == 0) {
258
  $this->showMessage('Empty '.$eventHistoryArchiveFilename);
259
  } else {
260
  $this->showMessage('Delivering '.$eventHistoryArchiveFilename);
297
  private function fileReplace($target,$source)
298
  {
299
  $openModeOutput = 'w';
300
+ $origSize = 0;
 
301
 
302
  $magentoRootDir = $this->rootAppPath;
303
  if (substr($target,0,1) != '/') {
425
  return Mage::getModel('core/config')->saveConfig($path, $value, $scope, $scope_id);
426
  }
427
 
428
+ private function showMessage($msg, $abort=false, $ignoreMessage=true)
429
  {
430
  Springbot_Log::debug($msg);
431
  if ($ignoreMessage==false) {
app/code/community/Springbot/Log.php CHANGED
@@ -99,9 +99,6 @@ class Springbot_Log
99
  public static function remote($message, $id = 1, $priority = 5, $alert = false)
100
  {
101
  $id = (is_null($id)) ? 1 : $id;
102
-
103
- $struct = new stdClass;
104
-
105
  if($storeId = Mage::helper('combine/harvest')->getSpringbotStoreId($id)) {
106
  $ar = array(
107
  'store_id' => $storeId,
@@ -115,9 +112,7 @@ class Springbot_Log
115
  if($alert) {
116
  $ar['log_type'] = 'ALERT';
117
  }
118
-
119
- $struct->{$storeId} = (object) $ar;
120
-
121
  $api = Mage::getModel('combine/api');
122
  $payload = $api->wrap('logs', $struct);
123
  $api->reinit()->call('logs', $payload);
99
  public static function remote($message, $id = 1, $priority = 5, $alert = false)
100
  {
101
  $id = (is_null($id)) ? 1 : $id;
 
 
 
102
  if($storeId = Mage::helper('combine/harvest')->getSpringbotStoreId($id)) {
103
  $ar = array(
104
  'store_id' => $storeId,
112
  if($alert) {
113
  $ar['log_type'] = 'ALERT';
114
  }
115
+ $struct = array($storeId => $ar);
 
 
116
  $api = Mage::getModel('combine/api');
117
  $payload = $api->wrap('logs', $struct);
118
  $api->reinit()->call('logs', $payload);
app/code/community/Springbot/Services/Cmd/Harvest.php CHANGED
@@ -15,6 +15,8 @@ class Springbot_Services_Cmd_Harvest extends Springbot_Services_Abstract
15
  'customers',
16
  'guests',
17
  'subscribers',
 
 
18
  //'carts',
19
  );
20
 
@@ -198,7 +200,6 @@ class Springbot_Services_Cmd_Harvest extends Springbot_Services_Abstract
198
  Springbot_Log::harvest("Segmenting {$keyUpper}");
199
  $scheduler = Mage::getModel('combine/cron_queue_batch');
200
 
201
-
202
  $this->_reportHarvestStartTime($this->getHarvestId(), $storeId, $key);
203
 
204
  $count = 0;
15
  'customers',
16
  'guests',
17
  'subscribers',
18
+ 'coupons',
19
+ 'rules',
20
  //'carts',
21
  );
22
 
200
  Springbot_Log::harvest("Segmenting {$keyUpper}");
201
  $scheduler = Mage::getModel('combine/cron_queue_batch');
202
 
 
203
  $this->_reportHarvestStartTime($this->getHarvestId(), $storeId, $key);
204
 
205
  $count = 0;
app/code/community/Springbot/Services/Harvest/Coupons.php ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Springbot_Services_Harvest_Coupons extends Springbot_Services_Harvest
4
+ {
5
+ protected $_type = 'coupons';
6
+
7
+ public function run()
8
+ {
9
+ $collection = self::getCollection($this->getStoreId())
10
+ ->addFieldToFilter('coupon_id', array('gt' => $this->getStartId()));
11
+ $stopId = $this->getStopId();
12
+ if ($stopId !== null) {
13
+ $collection->addFieldToFilter('coupon_id', array('lteq' => $this->getStopId()));
14
+ }
15
+
16
+ $this->_harvester = Mage::getModel('combine/harvest_coupons')
17
+ ->setStoreId($this->getStoreId())
18
+ ->setDataSource($this->getDataSource())
19
+ ->setCollection($collection)
20
+ ->harvest();
21
+
22
+ return parent::run();
23
+ }
24
+
25
+ public static function getCollection($storeId, $partition = null)
26
+ {
27
+ // Filter based on the website_ids string
28
+ $collection = Mage::getModel('salesrule/coupon')->getCollection();
29
+
30
+ if($partition) {
31
+ $collection = parent::limitCollection($collection, $partition, 'coupon_id');
32
+ }
33
+ return $collection;
34
+ }
35
+ }
app/code/community/Springbot/Services/Harvest/Rules.php ADDED
@@ -0,0 +1,46 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Springbot_Services_Harvest_Rules extends Springbot_Services_Harvest
4
+ {
5
+ protected $_type = 'rules';
6
+
7
+ public function run()
8
+ {
9
+ $collection = self::getCollection($this->getStoreId())
10
+ ->addFieldToFilter('rule_id', array('gt' => $this->getStartId()));
11
+ $stopId = $this->getStopId();
12
+ if ($stopId !== null) {
13
+ $collection->addFieldToFilter('rule_id', array('lteq' => $this->getStopId()));
14
+ }
15
+
16
+ $this->_harvester = Mage::getModel('combine/harvest_rules')
17
+ ->setStoreId($this->getStoreId())
18
+ ->setDataSource($this->getDataSource())
19
+ ->setCollection($collection)
20
+ ->harvest();
21
+
22
+ return parent::run();
23
+ }
24
+
25
+ public static function getCollection($storeId, $partition = null)
26
+ {
27
+ $websiteId = Mage::getModel('core/store')->load($storeId)->getWebsiteId();
28
+
29
+ // Filter based on the website_ids string
30
+ $collection = Mage::getModel('salesrule/rule')
31
+ ->getCollection()
32
+ ->addFieldToFilter('website_ids',
33
+ array(
34
+ array('like' => "%,{$websiteId},%"),
35
+ array('like' => "{$websiteId},%"),
36
+ array('like' => "%,{$websiteId}"),
37
+ array('like' => "{$websiteId}"),
38
+ )
39
+ );
40
+
41
+ if($partition) {
42
+ $collection = parent::limitCollection($collection, $partition, 'rule_id');
43
+ }
44
+ return $collection;
45
+ }
46
+ }
app/code/community/Springbot/Services/Post/Coupon.php ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Springbot_Services_Post_Coupon extends Springbot_Services_Post
4
+ {
5
+ public function run()
6
+ {
7
+ $coupon = Mage::getModel('salesrule/coupon')->load($this->getEntityId());
8
+ $coupon->setStoreId($this->getStoreId());
9
+ $harvester = Mage::getModel('combine/harvest_coupons');
10
+ $harvester->push($coupon);
11
+ $harvester->postSegment();
12
+ }
13
+ }
14
+
app/code/community/Springbot/Services/Post/Rule.php ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Springbot_Services_Post_Rule extends Springbot_Services_Post
4
+ {
5
+ public function run()
6
+ {
7
+ $rule = Mage::getModel('salesrule/rule')->load($this->getEntityId());
8
+ $rule->setStoreId($this->getStoreId());
9
+ $harvester = Mage::getModel('combine/harvest_rules');
10
+ $harvester->push($rule);
11
+ $harvester->postSegment();
12
+ }
13
+ }
14
+
app/code/community/Springbot/Services/Work/Report.php CHANGED
@@ -20,7 +20,7 @@ class Springbot_Services_Work_Report extends Springbot_Services_Abstract
20
  );
21
 
22
  Mage::helper('combine/harvest')->reportHarvestCount($params, $this->getHarvestId());
23
- Springbot_Log::remote("Harvested '{$count} {$keyUpper}s from store " . $this->getStoreId());
24
  }
25
 
26
  }
20
  );
21
 
22
  Mage::helper('combine/harvest')->reportHarvestCount($params, $this->getHarvestId());
23
+ Springbot_Log::remote("Harvested '{$count} {$keyUpper} from store " . $this->getStoreId());
24
  }
25
 
26
  }
app/code/community/Springbot/Shadow/Block/Js/Boot.php ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Springbot_Shadow_Block_Js_Boot extends Mage_Core_Block_Template
4
+ {
5
+ public function getSpringbotStoreId()
6
+ {
7
+ return Mage::helper('combine/harvest')->getSpringbotStoreId($this->_getStoreId());
8
+ }
9
+
10
+ public function getAssetsDomain()
11
+ {
12
+ return Mage::getStoreConfig('springbot/advanced/assets_domain');
13
+ }
14
+
15
+ public function getPublicId()
16
+ {
17
+ return Mage::helper('combine')->getPublicGuid($this->_getStoreId());
18
+ }
19
+
20
+ private function _getStoreId()
21
+ {
22
+ return Mage::app()->getStore()->getStoreId();
23
+ }
24
+ }
app/code/community/Springbot/Shadow/Model/Listeners/Observer.php CHANGED
@@ -57,6 +57,7 @@ class Springbot_Shadow_Model_Listeners_Observer {
57
  $storeId = Mage::app()->getStore()->getStoreId();
58
 
59
  $this->runHealthcheck($storeId);
 
60
 
61
  $this->runQueueCleanup();
62
 
@@ -68,8 +69,7 @@ class Springbot_Shadow_Model_Listeners_Observer {
68
 
69
  public function runQueueCleanup()
70
  {
71
- // global scope, no need for store_id
72
- // run every hour
73
  if (Springbot_Shadow_Model_Timer::fire('cleanup', 0, 60)) {
74
  Springbot_Boss::internalCallback('work:cleanup');
75
  }
@@ -85,6 +85,29 @@ class Springbot_Shadow_Model_Listeners_Observer {
85
  }
86
  }
87
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
88
  public function getTrackables()
89
  {
90
  $params = $this->_getParams();
@@ -128,8 +151,7 @@ class Springbot_Shadow_Model_Listeners_Observer {
128
  $referer = isset($parsed['host']) ? $parsed['host'] : null;
129
 
130
  if($referer != $host) {
131
- Springbot_Log::debug("refered by $referer");
132
- if($host) {
133
  $params->sb_referer_host = $referer;
134
  }
135
  }
@@ -146,19 +168,21 @@ class Springbot_Shadow_Model_Listeners_Observer {
146
  protected function _setSpringbotRedirectQueueCookie($param)
147
  {
148
  $redirectQueue = Mage::getModel('core/cookie')->get(self::COOKIE_NAME);
149
- $cookieValues = explode(self::TOKEN_DELIMITER,$redirectQueue);
150
 
151
- if (count($cookieValues) >= self::MAXIMUM_IDS_SAVED) {
152
- $oldestValue = array_shift($cookieValues);
153
- }
154
 
155
- if (end($cookieValues) != $param) {
156
- $cookieValues[] = $param;
157
- }
158
 
159
- $redirectQueue = implode(self::TOKEN_DELIMITER, $cookieValues);
 
 
160
 
161
- $this->_setCookie(self::COOKIE_NAME, $redirectQueue);
 
 
162
  }
163
 
164
  protected function _setCookie($name, $value)
57
  $storeId = Mage::app()->getStore()->getStoreId();
58
 
59
  $this->runHealthcheck($storeId);
60
+ $this->scrapeEntities($storeId);
61
 
62
  $this->runQueueCleanup();
63
 
69
 
70
  public function runQueueCleanup()
71
  {
72
+ // global scope, no need for store_id, run every hour
 
73
  if (Springbot_Shadow_Model_Timer::fire('cleanup', 0, 60)) {
74
  Springbot_Boss::internalCallback('work:cleanup');
75
  }
85
  }
86
  }
87
 
88
+ public function scrapeEntities($storeId)
89
+ {
90
+ if (Springbot_Shadow_Model_Timer::fire('scrape', $storeId, 10)) {
91
+ $lastPostedCouponId = Mage::getStoreConfig('springbot/tmp/last_coupon_id');
92
+ if (!$lastPostedCouponId) {
93
+ $lastPostedCouponId = 0;
94
+ }
95
+ $couponsToPost = Mage::getModel('salesrule/coupon')->getCollection()
96
+ ->addFieldToFilter('coupon_id', array('gt' => $lastPostedCouponId));
97
+
98
+ $couponsToPost->getSelect()->order('coupon_id', 'ASC');
99
+ $lastFoundCouponId = null;
100
+ foreach ($couponsToPost as $couponToPost) {
101
+ Springbot_Boss::scheduleJob('post:coupon', array('i' => $couponToPost->getId()), Springbot_Services_Priority::LISTENER, 'listener');
102
+ $lastFoundCouponId = $couponToPost->getId();
103
+ }
104
+ if (($lastFoundCouponId) && ($lastPostedCouponId != $lastFoundCouponId)) {
105
+ Mage::getModel('core/config')->saveConfig('springbot/tmp/last_coupon_id', $lastFoundCouponId, 'default', 0);
106
+ Mage::getConfig()->cleanCache();
107
+ }
108
+ }
109
+ }
110
+
111
  public function getTrackables()
112
  {
113
  $params = $this->_getParams();
151
  $referer = isset($parsed['host']) ? $parsed['host'] : null;
152
 
153
  if($referer != $host) {
154
+ Springbot_Log::debug("refered by $referer"); if($host) {
 
155
  $params->sb_referer_host = $referer;
156
  }
157
  }
168
  protected function _setSpringbotRedirectQueueCookie($param)
169
  {
170
  $redirectQueue = Mage::getModel('core/cookie')->get(self::COOKIE_NAME);
 
171
 
172
+ if(!empty($redirectQueue)) {
173
+ $cookieValues = explode(self::TOKEN_DELIMITER, $redirectQueue);
 
174
 
175
+ if (count($cookieValues) >= self::MAXIMUM_IDS_SAVED) {
176
+ $oldestValue = array_shift($cookieValues);
177
+ }
178
 
179
+ if (end($cookieValues) != $param) {
180
+ $cookieValues[] = $param;
181
+ }
182
 
183
+ $redirectQueue = implode(self::TOKEN_DELIMITER, $cookieValues);
184
+ $this->_setCookie(self::COOKIE_NAME, $redirectQueue);
185
+ }
186
  }
187
 
188
  protected function _setCookie($name, $value)
app/code/community/Springbot/Shadow/etc/config.xml CHANGED
@@ -8,59 +8,65 @@
8
  */
9
  -->
10
  <config>
11
- <modules>
12
- <Springbot_Shadow>
13
- <version>0.1.0</version>
14
- </Springbot_Shadow>
15
- </modules>
16
- <global>
17
- <models>
18
- <shadow>
19
- <class>Springbot_Shadow_Model</class>
20
- </shadow>
21
- </models>
22
- <helpers>
23
- <shadow>
24
- <class>Springbot_Shadow_Helper</class>
25
- </shadow>
26
- </helpers>
27
- </global>
28
- <frontend>
29
- <routers>
30
- <shadow>
31
- <use>standard</use>
32
- <args>
33
- <module>Springbot_Shadow</module>
34
- <frontName>springbot_update</frontName>
35
- </args>
36
- </shadow>
37
- </routers>
38
- <layout>
39
- <updates>
40
- <shadow>
41
- <file>shadow.xml</file>
42
- </shadow>
43
- </updates>
44
- </layout>
45
- <events>
46
- <controller_action_predispatch>
47
- <observers>
48
- <springbot_shadow_observer>
49
- <type>singleton</type>
50
- <class>shadow/listeners_observer</class>
51
- <method>escort</method>
52
- </springbot_shadow_observer>
53
- </observers>
54
- </controller_action_predispatch>
55
- <controller_action_postdispatch>
56
- <observers>
57
- <springbot_shadow_observer>
58
- <type>singleton</type>
59
- <class>shadow/listeners_observer</class>
60
- <method>post</method>
61
- </springbot_shadow_observer>
62
- </observers>
63
- </controller_action_postdispatch>
64
- </events>
65
- </frontend>
 
 
 
 
 
66
  </config>
 
8
  */
9
  -->
10
  <config>
11
+ <modules>
12
+ <Springbot_Shadow>
13
+ <version>0.1.0</version>
14
+ </Springbot_Shadow>
15
+ </modules>
16
+ <global>
17
+ <models>
18
+ <shadow>
19
+ <class>Springbot_Shadow_Model</class>
20
+ </shadow>
21
+ </models>
22
+ <helpers>
23
+ <shadow>
24
+ <class>Springbot_Shadow_Helper</class>
25
+ </shadow>
26
+ </helpers>
27
+ <blocks>
28
+ <shadow>
29
+ <class>Springbot_Shadow_Block</class>
30
+ </shadow>
31
+ </blocks>
32
+ </global>
33
+ <frontend>
34
+ <routers>
35
+ <shadow>
36
+ <use>standard</use>
37
+ <args>
38
+ <module>Springbot_Shadow</module>
39
+ <frontName>springbot_update</frontName>
40
+ </args>
41
+ </shadow>
42
+ </routers>
43
+ <layout>
44
+ <updates>
45
+ <shadow>
46
+ <file>shadow.xml</file>
47
+ </shadow>
48
+ </updates>
49
+ </layout>
50
+ <events>
51
+ <controller_action_predispatch>
52
+ <observers>
53
+ <springbot_shadow_observer>
54
+ <type>singleton</type>
55
+ <class>shadow/listeners_observer</class>
56
+ <method>escort</method>
57
+ </springbot_shadow_observer>
58
+ </observers>
59
+ </controller_action_predispatch>
60
+ <controller_action_postdispatch>
61
+ <observers>
62
+ <springbot_shadow_observer>
63
+ <type>singleton</type>
64
+ <class>shadow/listeners_observer</class>
65
+ <method>post</method>
66
+ </springbot_shadow_observer>
67
+ </observers>
68
+ </controller_action_postdispatch>
69
+ </events>
70
+ </frontend>
71
  </config>
72
+
app/code/community/Springbot/Util/Categories.php CHANGED
@@ -6,7 +6,7 @@ class Springbot_Util_Categories
6
  protected $_paths = array();
7
  protected $_pathsBuilt = false;
8
 
9
- public function __construct($product)
10
  {
11
  $this->_product = $product;
12
  }
@@ -40,7 +40,7 @@ class Springbot_Util_Categories
40
  protected function _getPaths()
41
  {
42
  if(!$this->_pathsBuilt) {
43
- $_paths = $this->_product->getCategoryCollection()->getColumnValues('path');
44
  foreach($_paths as $_path) {
45
  $path = explode('/', $_path);
46
  if(count($path) > 2) {
@@ -51,4 +51,21 @@ class Springbot_Util_Categories
51
  }
52
  return $this->_paths;
53
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
54
  }
6
  protected $_paths = array();
7
  protected $_pathsBuilt = false;
8
 
9
+ public function __construct(Mage_Catalog_Model_Product $product)
10
  {
11
  $this->_product = $product;
12
  }
40
  protected function _getPaths()
41
  {
42
  if(!$this->_pathsBuilt) {
43
+ $_paths = $this->_getColumnValues();
44
  foreach($_paths as $_path) {
45
  $path = explode('/', $_path);
46
  if(count($path) > 2) {
51
  }
52
  return $this->_paths;
53
  }
54
+
55
+ /*
56
+ * This might not happen in practice, but we were seeing
57
+ * tests return the CategoryCollection as an object of
58
+ * type Varien_Data_Tree_Node_Collection, which does not
59
+ * have getColumnValues. This is mostly so the tests will
60
+ * pass, but it doesn't hurt anyting to leave it in.
61
+ */
62
+ protected function _getColumnValues()
63
+ {
64
+ $collection = $this->_product->getCategoryCollection();
65
+ if(method_exists($collection, 'getColumnValues')) {
66
+ return $collection->getColumnValues('path');
67
+ } else {
68
+ return [];
69
+ }
70
+ }
71
  }
app/code/community/Springbot/Util/Logger.php CHANGED
@@ -65,9 +65,11 @@ class Springbot_Util_Logger
65
  }
66
 
67
  $format = $this->_format . PHP_EOL;
 
68
  $formatter = new Zend_Log_Formatter_Simple($format);
69
  $writer = new Zend_Log_Writer_Stream($logFile);
70
  $writer->setFormatter($formatter);
71
  self::$_loggers[$file] = new Zend_Log($writer);
 
72
  }
73
  }
65
  }
66
 
67
  $format = $this->_format . PHP_EOL;
68
+
69
  $formatter = new Zend_Log_Formatter_Simple($format);
70
  $writer = new Zend_Log_Writer_Stream($logFile);
71
  $writer->setFormatter($formatter);
72
  self::$_loggers[$file] = new Zend_Log($writer);
73
+
74
  }
75
  }
app/code/community/Springbot/Util/Partition.php CHANGED
@@ -18,6 +18,7 @@ class Springbot_Util_Partition
18
 
19
  public function __toString()
20
  {
21
- return $this->start . ':' . $this->stop;
 
22
  }
23
  }
18
 
19
  public function __toString()
20
  {
21
+ // We are non-inclusive from the start
22
+ return ($this->start - 1) . ':' . $this->stop;
23
  }
24
  }
app/design/adminhtml/default/default/template/bmbleb/alert/finished.phtml DELETED
@@ -1,9 +0,0 @@
1
- <div id="bmbleb-alerts-item" style="width:600px;">
2
- <h2>All Done!</h2>
3
- <div class="j-box-left">
4
- <div class="upgrade-box pad12">
5
- <p style="text-align:center;">You've responded to all of your open alerts.</p>
6
- <a href="<?php echo $this->getUrl('bmbleb/index/index'); ?>" class="upg-btn jbtn">Back to the Dashboard</a>
7
- </div>
8
- </div>
9
- </div>
 
 
 
 
 
 
 
 
 
app/design/adminhtml/default/default/template/bmbleb/alert/index.phtml DELETED
@@ -1,32 +0,0 @@
1
- <div class="j-content">
2
- <h3 class="alert-head"><span class="head">Alerts</span></h3>
3
-
4
- <?php
5
- $stats = Mage::getModel('bmbleb/alert')->getStatusCounts();
6
- $countTotal = intval($stats['total']);
7
- $countNew = intval($stats['new']);
8
- $countDone = intval($stats['completed']);
9
-
10
- ?>
11
-
12
- <div class="headline orng"><span><?php echo $countNew; ?> New Alert<?php if ($countNew != 1){ print 's'; } ?>!</span></div>
13
-
14
- <div class="j-box-left">
15
- <div class="upgrade-box" style="margin-bottom:20px;">
16
- <?php if ($countNew > 0): ?>
17
- <a class="upg-btn jbtn" href="<?php echo $this->getUrl('*/*/respond'); ?>">See your New Alerts</a>
18
- <span>or <a href="<?php echo $this->getUrl('*/*/sync'); ?>">check for new ones now</a></span>
19
- <?php else: ?>
20
- <a class="upg-btn jbtn" href="<?php echo $this->getUrl('*/*/sync'); ?>">Check for New Alerts</a>
21
- <?php endif; ?>
22
- </div>
23
-
24
- <?php if ($countTotal > 0) : ?>
25
- <p><a href="<?php echo $this->getUrl('*/*/grid'); ?>">view all as a list</a></p>
26
- <?php endif; ?>
27
- </div>
28
-
29
- <?php if ($countDone > 5) : ?>
30
- <div class="headline"><span><?php echo $countDone; ?> completed so far!
31
- <?php endif; ?>
32
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/design/adminhtml/default/default/template/bmbleb/alert/next/form.phtml DELETED
@@ -1,65 +0,0 @@
1
- <?php
2
- /**
3
- * Magento
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Academic Free License (AFL 3.0)
8
- * that is bundled with this package in the file LICENSE_AFL.txt.
9
- * It is also available through the world-wide-web at this URL:
10
- * http://opensource.org/licenses/afl-3.0.php
11
- * If you did not receive a copy of the license and are unable to
12
- * obtain it through the world-wide-web, please send an email
13
- * to license@magentocommerce.com so we can send you a copy immediately.
14
- *
15
- * DISCLAIMER
16
- *
17
- * Do not edit or add to this file if you wish to upgrade Magento to newer
18
- * versions in the future. If you wish to customize Magento for your
19
- * needs please refer to http://www.magentocommerce.com for more information.
20
- *
21
- * @category design
22
- * @package default_default
23
- * @copyright Copyright (c) 2010 Magento Inc. (http://www.magentocommerce.com)
24
- * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
- */
26
- ?>
27
- <?php
28
- $alert = Mage::registry('current_bmbleb_alert');
29
- ?>
30
-
31
- <div id="bmbleb-alerts-item" style="width:600px;">
32
- <div class="pad12left">
33
- <div class="to-do"> <!--<span class="ttl">Current Alert:</span>-->
34
- <!--<?php if ($alert->getStatus() == 0) { ?><p><em>NEW ALERT!</em></p>-->
35
- <!--<?php } else if ($alert->getStatus() == 1) { ?><p><em>previously skipped</em></p><?php } ?>-->
36
- <h2><?php echo $alert->getBody(); ?></h2>
37
- </div>
38
- </div>
39
- </div>
40
-
41
- <div class="w100per">
42
-
43
- <div class="jleft-box">
44
- <div class="pad12">
45
- <div class="to-do"><?php echo $alert->getDescription(); ?></div>
46
- <!--<div class="to-do"><span class="ttl">We suggest:</span> <?php echo $alert->getResponse(); ?></div>-->
47
- <div class="clear"></div>
48
- </div>
49
- </div>
50
-
51
- <div class="clear"></div>
52
-
53
- <div class="pad12">
54
- <?php echo $this->getFormHtml();?>
55
-
56
- <!--<p class="msg-row">Did you do this? Or would you like to skip </p>-->
57
- <div class="w100per">
58
- <a id="bmbleb-alert-complete" class="jbtn btn1" href="<?php print $this->getUrl('bmbleb/adminhtml_alert/complete', array('id' => $alert->getId())); ?>">Done</a> <a id="bmbleb-alert-skip" class="cancle" href="<?php print $this->getUrl('bmbleb/adminhtml_alert/skip', array('id' => $alert->getId())); ?>">Skip</a>
59
- </div>
60
- <div class="clear"></div>
61
- </div>
62
-
63
- </div>
64
-
65
- <?php echo $this->getChildHtml('form_after');?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/design/adminhtml/default/default/template/bmbleb/index/terms.phtml CHANGED
@@ -1,9 +1,8 @@
1
- <div id="tc-content" class="tc-content">
2
- <div class="tc-content-inner">
3
- <p class="close-btn"><a href="#" title="Close window" onclick="Modalbox.hide(); return false;">Close</a></p>
4
- <h3>springbot Terms &amp; Conditions</h3>
5
- <?php
6
- print nl2br(Mage::helper('bmbleb/GetTermsOfService')->getTermsOfService());
7
- ?>
8
- </div>
9
- </div>
1
+ <div id="tc-content" class="tc-content">
2
+ <div class="tc-content-inner">
3
+ <p class="close-btn"><a href="#" title="Close window" onclick="Modalbox.hide(); return false;">Close</a></p>
4
+
5
+ <h3>springbot Terms &amp; Conditions</h3>
6
+ <?php echo nl2br(Mage::helper('bmbleb/GetTermsOfService')->getTermsOfService()); ?>
7
+ </div>
8
+ </div>
 
app/etc/modules/Springbot.xml CHANGED
@@ -18,31 +18,4 @@
18
  <codePool>community</codePool>
19
  </Springbot_Shadow>
20
  </modules>
21
-
22
- <!--
23
-
24
- <global>
25
- <resources>
26
- <Springbot_setup>
27
- <setup>
28
- <module>Springbot</module>
29
- <class>Springbot_Model_Installers_Setup</class>
30
- </setup>
31
- <connection>
32
- <use>core_setup</use>
33
- </connection>
34
- </Springbot_setup>
35
- <Springbot_write>
36
- <connection>
37
- <use>core_write</use>
38
- </connection>
39
- </Springbot_write>
40
- <Springbot_read>
41
- <connection>
42
- <use>core_read</use>
43
- </connection>
44
- </Springbot_read>
45
- </resources>
46
- </global>
47
- -->
48
  </config>
18
  <codePool>community</codePool>
19
  </Springbot_Shadow>
20
  </modules>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
21
  </config>
package.xml CHANGED
@@ -1,7 +1,7 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Springbot</name>
4
- <version>1.2.1.4</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/osl-3.0.php">Open Software License (OSL)</license>
7
  <channel>community</channel>
@@ -47,11 +47,11 @@ Social Media Alerts example: Ted Smith Tweeted about your company &#xD;
47
  Proclivity to Buy Alerts example: Sally Avalon bought a house recently &#xD;
48
  &#xD;
49
  For support information, features and pricing and more details visit springbot.com</description>
50
- <notes>Re-added gallery image fix</notes>
51
  <authors><author><name>Springbot </name><user>Springbot</user><email>bseitz@springbot.com</email></author></authors>
52
- <date>2014-09-03</date>
53
- <time>00:42:31</time>
54
- <contents><target name="mageetc"><dir name="modules"><file name="Springbot.xml" hash="cf640afd5be296dd9736b152247703a8"/></dir></target><target name="magecommunity"><dir name="Springbot"><dir name="Bmbleb"><dir name="Block"><dir name="Adminhtml"><file name="Auth.php" hash="41b76e63e15d51f697a1378b9e904061"/><dir name="Bmbleb"><dir name="Login"><file name="Form.php" hash="4076e0de77169b9aadc793b53353ee6b"/></dir><file name="Login.php" hash="81a3dbbf4dd4f51599b6f7eb01bc8f1e"/><dir name="Register"><file name="Form.php" hash="f0936c29356624200541a4f67fd096ab"/></dir><file name="Register.php" hash="8c1dc7d214022497f9ac56313a449f66"/></dir><file name="Connected.php" hash="f5378fd914cc36264376a987b7ce96c8"/><file name="Help.php" hash="a756092bca1a4a5bd96f0f652a37de3c"/><dir name="Index"><file name="Messages.php" hash="2294dd16a061b1c35b8f7991c7f42d8c"/><file name="Terms.php" hash="ae2667e078aef09dbe35fe4d45783616"/></dir><file name="Index.php" hash="7c11054e36a4658564938ae8e71e00db"/><dir name="Jobs"><file name="Grid.php" hash="d027f3e93522ce932f0056714993ba95"/><file name="Status.php" hash="f1b197bf6fdc392bed93ff0734a54ad6"/></dir><file name="Jobs.php" hash="23d8bdfa6d0fbcabba2b17445effb248"/><file name="Login.php" hash="7d5022345a00b051422cd09915a9ddf9"/><file name="Logout.php" hash="5332e08d0d18b38f1175c1f0cb48f2f8"/><file name="Logs.php" hash="b6cd90251b4b1919af019f7cd93040de"/><file name="Notifications.php" hash="7ad224da80a68fa8334c1d26b9ad4907"/><file name="Problems.php" hash="9840cf49dc25237815ce4275264d4640"/><dir name="Settings"><dir name="Edit"><file name="Form.php" hash="429cc1dd30cf303591bb7a1bd26c30ab"/></dir></dir><file name="Settings.php" hash="3a59b0eb20b7359944c73c9005058739"/><file name="Status.php" hash="a7d1f735d1ed476672ec80fbcb2af16a"/><file name="Tabs.php" hash="8cc4c162985f479461ce2beda582c1c2"/></dir></dir><dir name="Helper"><file name="Account.php" hash="a7368f189cc2536aceec0e023d3d0aee"/><file name="Alerts.php" hash="172e06b4fa099a301b920d0e363c2005"/><file name="ApiCall.php" hash="9040a1002f1706a86d8d1af814314c8b"/><file name="ApiResponse.php" hash="7fd44a77bce45074bd97aaba4ddc135d"/><file name="BmblebProps.php" hash="32af63b204ead1ef06c5cc08c73cf34d"/><file name="ChangePassword.php" hash="8d4eec87843fc60c6642ed8214a8ea42"/><file name="Data.php" hash="62a4dc31da79d87f272c115ad131fe29"/><file name="ExternalLogging.php" hash="6eb1acae916965bb656869f447166e76"/><file name="GetTermsOfService.php" hash="af8ea4a9f2c506e356667273e3c4f8d1"/><file name="PluginStatus.php" hash="6034f9a89bb09ec995b4a07bbd7a5d59"/></dir><dir name="Model"><dir name="Alert"><file name="Priority.php" hash="3f6b3a1ae75007ec8dee2df93480ff85"/><file name="Status.php" hash="701abcb929f68362354b7a8e5085db58"/><file name="Type.php" hash="976018f681012f6b815a921e9c515e22"/></dir><file name="Alert.php" hash="760c3d8737b85c9af9bc6385acdf4ed0"/><file name="Bmbleb.php" hash="700d11c3006f2dcd2e80cd8bbbab15f9"/><file name="Bmblebprops.php" hash="8a87b5625f62cd3060d0ddec84b5d16c"/><dir name="Mysql4"><dir name="Bmbleb"><file name="Collection.php" hash="a0981b543c972b39ab2e59baec9806cc"/></dir></dir><file name="Status.php" hash="9409d26c7884be6b8075ba97dbf71f78"/><file name="Sync.php" hash="a2c4d9761c52055ba8dfbd7d9a33c2e7"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="HelpController.php" hash="087e7868dafe9dd2df89a642d405424a"/><file name="IndexController.php" hash="6b1059484b2d46453e0a429e2d4c8d71"/><file name="JobsController.php" hash="4e912a8fafd2f58235cb2299a83a128b"/><file name="LogsController.php" hash="27461bcdd3bba759b3e31604181bcc37"/><file name="ProblemsController.php" hash="a257b10a90bd3924d2396c1a7c272a38"/><file name="SettingsController.php" hash="64568fca522817ae77ef5015decd5a21"/></dir><file name="HelpController.php" hash="2df4608a957f151bf1d01dbde2113680"/><file name="IndexController.php" hash="ea5fa5e2b305f46b222cb2fc2a44f6a5"/><file name="LoginController.php" hash="e5e8516a27f7e61083182457017ec013"/><file name="LogoutController.php" hash="140c9d32f5557aa1169fd1b85cd5cc9f"/><file name="RegisterController.php" hash="15511b8a249557a11583446b6a2ee747"/></dir><dir name="etc"><file name="config.xml" hash="c64e84f64b6f46453605e181167287a1"/></dir></dir><dir name="BoneCollector"><dir name="Model"><file name="HarvestAbstract.php" hash="c033a6bfeed3a494b61df594c44facc4"/><dir name="HarvestAttribute"><file name="Observer.php" hash="780800606f3fa556962d3dbcd6afa7e4"/></dir><dir name="HarvestCaptureSKU"><file name="Observer.php" hash="5e9d22e60265a29ed742e161bc9b6b6e"/></dir><dir name="HarvestCart"><file name="Observer.php" hash="cea5b393881d7cb82092cbd7e7ca58ef"/></dir><dir name="HarvestCategory"><file name="Observer.php" hash="f6657dc3941f2ea20a0051357128e796"/></dir><dir name="HarvestCustomer"><file name="Observer.php" hash="036f6499bc1b029e6081fa61b7d72973"/></dir><dir name="HarvestProduct"><file name="Observer.php" hash="422c087f79ef3df48cc1f1a8afa34892"/></dir><dir name="HarvestPurchase"><file name="Observer.php" hash="6e52c4b1a5909cdae81cc9fc6968d6b6"/></dir><dir name="HarvestSubscriber"><file name="Observer.php" hash="d5c988abc6bc697fd8d1d9c78eb89de5"/></dir></dir><dir name="etc"><file name="config.xml" hash="2553082fe41b30d839a04a841a9f0e75"/></dir></dir><file name="Boss.php" hash="cbc7365b26f8f06b59a33767de92c545"/><dir name="Combine"><dir name="Helper"><file name="Attributes.php" hash="5fb06e7cc89bb710039a79fb16e2a998"/><file name="Cart.php" hash="07ce5f461ecded3b9b00ed5c30faa266"/><file name="Data.php" hash="5fedff48d6efc495aa824592eed9a0ab"/><file name="Harvest.php" hash="1a662a08a3f1ab865f1376a5bd238989"/><file name="Parser.php" hash="4b0f4023ce8099615db908736c73386b"/><file name="Redirect.php" hash="3b81406f5105040d17699ad1e0d7cd5d"/><file name="Store.php" hash="8db94d157d7e497e7612844da43a6c11"/><file name="Trackable.php" hash="8bc28aa708be61d4d0d1f79b3ad51a78"/></dir><dir name="Model"><file name="Abstract.php" hash="77bc1e853f03ca6a12ddd1dda12feda2"/><file name="Api.php" hash="73062689fd74716e639bb3145e98c8d9"/><dir name="Cron"><file name="Count.php" hash="06824a092141baf29222607a2dcb3d9c"/><dir name="Manager"><file name="Status.php" hash="d3e0e732a3512bb95214f33fa9f08457"/></dir><dir name="Queue"><dir name="Batch"><file name="Row.php" hash="f703a1bf9e14ef428ade448febc9d35b"/></dir><file name="Batch.php" hash="658522bd3e0eef3afa1e0107ff9f858a"/></dir><file name="Queue.php" hash="fa0d2bfd3fbb879442e0edd4ea7915a9"/><file name="Worker.php" hash="f83199c1491083b68eaea08467114d4f"/></dir><dir name="File"><file name="Io.php" hash="6d1f79eaf45897bf0525b0f3f3ac69d2"/><file name="Path.php" hash="24900b670c07fcdc4e54bae585f20002"/></dir><dir name="Harvest"><file name="Abstract.php" hash="76ac23999160edfdd86a2c6b5c8d1569"/><file name="AttributeSets.php" hash="2799ee325cd5bdcae597e482ef96551a"/><file name="Carts.php" hash="27e992f0f8cc4b274cd05efc7ce3a7f2"/><file name="Categories.php" hash="ab5bd7e91444fd7cb8bfeae376cd3ea7"/><file name="CustomerAttributeSets.php" hash="9be018cc3cbb0f495aec4f1c3a9013c8"/><file name="Customers.php" hash="f31427406c56f2dcde5a4f7d04a773c9"/><file name="Guests.php" hash="bcb1fbdfb7b5bf822934d300c423e17f"/><file name="Products.php" hash="2261f2c79b59e59977d050630d0fe92f"/><file name="Purchases.php" hash="585b1cf18e857850920abc7425830388"/><file name="Subscribers.php" hash="0c6f8ce380f036599141c9231562aaa9"/></dir><file name="Harvester.php" hash="b13a9b2dec995bc53335a5c35f67c035"/><dir name="Mysql4"><dir name="Cron"><file name="Count.php" hash="acbbb7ec28afbbe98101f5d114cb30b3"/><dir name="Queue"><file name="Collection.php" hash="b26806c9e7cefd052bb784f5a6ce814c"/></dir><file name="Queue.php" hash="4add10644bfc94b88ef5042b23c82ae7"/></dir><dir name="Redirect"><file name="Collection.php" hash="3bbe4f8729c603f8d8131154a0a117c1"/><dir name="Order"><file name="Collection.php" hash="88c0cfcce31b0eed8c035dee4e7e86df"/></dir><file name="Order.php" hash="852bea330edac3372ec5c168111301a8"/></dir><file name="Redirect.php" hash="842e4ba35c6b049c8eaa64704588ca76"/><file name="Setup.php" hash="3fdec335980846a4c3adbc6f4e3478eb"/><dir name="Trackable"><file name="Collection.php" hash="8799c5bf630d267b551cf9dba986cbb0"/></dir><file name="Trackable.php" hash="b38749697b641874b42dceae38ab4a30"/></dir><dir name="Parser"><file name="Abstract.php" hash="90a77c771599b3f6ee290586cc7c7d34"/><file name="AttributeSet.php" hash="fcb90beeebb921b349b28cadf354786c"/><file name="Category.php" hash="352b6ed7328c94524f4a7c3042949295"/><file name="Customer.php" hash="083edca18fbdf0c496e6ad22775f596e"/><file name="CustomerAttributeSet.php" hash="f926ec29d1ae837c0ae3c0a9257438d4"/><file name="Guest.php" hash="cbcbf7532c67c72d7e3b77022abc76c3"/><file name="Product.php" hash="2a0d3822877074b2258cd10f9d230cb1"/><dir name="Purchase"><file name="Item.php" hash="c7e563921e7876016a1197c2ec0c245b"/></dir><file name="Purchase.php" hash="4f161bc021af1851c92bb1c9c33a26ee"/><dir name="Quote"><file name="Item.php" hash="d7648174b642ae02cb225bb96b932286"/></dir><file name="Quote.php" hash="498cd2b6b39e4ca519d2b4652324cdd4"/><file name="Subscriber.php" hash="51e6e8e3152c2d94d52706582f1fa204"/></dir><file name="Parser.php" hash="72b273215802ee5244fd9e24c223beb8"/><dir name="Redirect"><file name="Order.php" hash="0c31dee69473751d95e5c52f5c60ea48"/></dir><file name="Redirect.php" hash="1248d0c43fb6f273ec48d8f2b91dcbdd"/><dir name="Resource"><file name="Abstract.php" hash="a50723654e084875378838b89ffb74ce"/><dir name="Cron"><dir name="Count"><file name="Collection.php" hash="c5cb4ab406c1d008c1bc22bb95b3ba28"/></dir><file name="Count.php" hash="6a356b5d92b509945c4567f479b9bfdd"/><dir name="Queue"><file name="Collection.php" hash="c182c6f6f7d29ee26ddf2900a8497cdb"/></dir><file name="Queue.php" hash="01d35c9491516f7f4ef7d9cccb7b6202"/></dir><dir name="Redirect"><file name="Collection.php" hash="0f9db83ade4c50c2f7bbe40deae1c065"/><dir name="Order"><file name="Collection.php" hash="162359ed9499b6f976f5c341fd0585c3"/></dir><file name="Order.php" hash="7ea4477380a5215dc0efe561ede359d9"/></dir><file name="Redirect.php" hash="d239af442388bb9fa80db81a7fc43711"/><file name="Setup.php" hash="46cc5ec83478021a1fe7251d73ee568e"/><dir name="Trackable"><file name="Collection.php" hash="6f060c3537b49710302e38e881885a69"/></dir><file name="Trackable.php" hash="764b0d21c492dd69b9f85ae3c647666e"/></dir><dir name="System"><dir name="Config"><dir name="Source"><file name="LogFormat.php" hash="828680dafe5a7042221900cb6d9dfa17"/><file name="LogLevel.php" hash="b86c793ca04205f045efd9ea42d02a10"/><file name="Stability.php" hash="830e5bc4e8ce9657221224dbaf99cee6"/><file name="UrlType.php" hash="28f9a5bc024afe5526685d429a751ad8"/></dir></dir></dir><file name="Trackable.php" hash="710d298645c0a809a1b70b936b0e4d09"/></dir><dir name="etc"><file name="adminhtml.xml" hash="794fc8a1d67ac3e6b5d71c707a0c7cad"/><file name="config.xml" hash="8faddfe50bd946db66efa5ed2c6941a1"/><file name="system.xml" hash="12f0f05be054854c29751767a3c8ef97"/></dir><dir name="sql"><dir name="combine_setup"><file name="mysql4-install-1.0.0.70.php" hash="607957cf80927e2575e455074fea17ec"/><file name="mysql4-upgrade-1.0.0.70-1.0.0.84.php" hash="e51deaff9e65f43483ab00573605329d"/><file name="mysql4-upgrade-1.0.0.84-1.0.0.88.php" hash="89bd8a585c0d351aae6838ace48f608d"/><file name="mysql4-upgrade-1.0.0.88-1.2.0.0.php" hash="09f98d701b5030ccc27d9ca1503212c4"/><file name="mysql4-upgrade-1.2.0.0-1.2.0.1.php" hash="01a7ef2466b9f676884db4d7a7c562a9"/><file name="mysql4-upgrade-1.2.0.1-1.2.1.0.php" hash="d8e9568d81d9efbb215d3a46e1d3212c"/></dir></dir></dir><dir name="DataServices"><file name="HarvestingManager.php" hash="120d2d4f900640aad5885d08c8e67ac9"/></dir><file name="Log.php" hash="52878fa6de3392b58974e2c8a5fb2031"/><dir name="Services"><file name="Abstract.php" hash="f779d8f0a1eaaa20364ccbf400c9e0ae"/><dir name="Cmd"><file name="Forecast.php" hash="3ac2b917db8c05ac085f213640b7be14"/><file name="Halt.php" hash="af1a47f7e9940c29b9c8380fbc69a447"/><file name="Harvest.php" hash="18236a9b3c56c46e2a7981d0f0b1de55"/><file name="Healthcheck.php" hash="a51b3b7766afa1e6cca60fc3b206fb85"/><file name="Parse.php" hash="dbf89d3e1395511728063128703e3e97"/><file name="Update.php" hash="804da06229cc47eb850291847883c96d"/></dir><dir name="Harvest"><file name="AttributeSets.php" hash="c37c4c0642a06a27c6a28bee27e20b14"/><file name="Carts.php" hash="9496d5150a9b5e1282adb78d96f846fc"/><file name="Categories.php" hash="fc1b5b26d612d3232838c975c3e55646"/><file name="CustomerAttributeSets.php" hash="67368d6ba001310912d39df0bd9037ad"/><file name="Customers.php" hash="9ae9805bb89a7546ad7c126281ce5220"/><file name="Guests.php" hash="940bcfd10c656195953b77159a4ace10"/><file name="Products.php" hash="d249ec369bdaa38964906f9998d77d4b"/><file name="Purchases.php" hash="859c8af86ee44a896d94ac69decb851a"/><file name="Subscribers.php" hash="8fa28e316d7396ca79300813ea9bd7ca"/></dir><file name="Harvest.php" hash="1ed4efb9aa1f0ae30a3a4afb2cbf98f6"/><dir name="Log"><file name="Installer.php" hash="584f730627201a9e73f1d4101ad3fedd"/><file name="Purchase.php" hash="6060265974fe6b45768617f96ebba6b1"/></dir><dir name="Post"><file name="Attribute.php" hash="7e7a307180eb9b9cd7f5b9137e4bd647"/><file name="AttributeSet.php" hash="66968b3ea659253789bbf96ec828afcc"/><file name="Cart.php" hash="7465d7587762b82ffaefef6f27b40a58"/><file name="Category.php" hash="68be39b090f46f3f438ad2ed9f97f09f"/><file name="Customer.php" hash="ecce6d30d3458e0786d4c6335a4c02cc"/><file name="Json.php" hash="86a5f26aa5367d8c4c66d278e4c02546"/><file name="Jsonstring.php" hash="9dfb5761d1a7835bf35040a073fa8fc4"/><file name="Product.php" hash="787e33146cc39d5f5eecd2d3a4ea842b"/><file name="Purchase.php" hash="80480bf01d11b1068d481c6ed50c2e1f"/><file name="Subscriber.php" hash="4d18235c4c0d11a8650b3e60c098908f"/></dir><file name="Post.php" hash="df362d5839aa050daa7b23660603b16d"/><file name="Priority.php" hash="d8fc0b57442d8e2e2ff7ba789c3d1fc9"/><file name="Registry.php" hash="c4f17c52b0814c29b7ab93e911a2de28"/><dir name="Store"><file name="Finalize.php" hash="6f61c4cd23ef3cd815b7eee545ecaa23"/><file name="Register.php" hash="523100a10a3ac39fa444801551bdbf25"/></dir><dir name="Update"><file name="Abstract.php" hash="7b9a1d36b4486e250587820731b7fb7c"/><file name="Connect.php" hash="3e4366a42e563ec3406a0fcb9a5f77bf"/><file name="Downloader.php" hash="934ef5788acb45ce94e0a32c1d705df1"/><file name="Installer.php" hash="a09ec2e9f7bbf12c117c8950e46072b0"/><file name="Package.php" hash="b025fa1c27aed03454e7d45d09705b3a"/></dir><dir name="Work"><file name="Cleanup.php" hash="d0915a0cde6d9cd4287a2f9fc4bc0056"/><file name="Manager.php" hash="507608c3fc9d34170e7326cb075d3b71"/><file name="Report.php" hash="2f56d51277b75d30e043d2151abcfc79"/><file name="Restart.php" hash="43af836b8950852efe62996facf4ad87"/><file name="Runner.php" hash="a2929a0e03dc99ac0ad5702b623eeb56"/><file name="Stop.php" hash="5e51ecf333282ad5d8dd6d40243c5e8e"/></dir></dir><dir name="Shadow"><dir name="Helper"><file name="Listeners.php" hash="432794c308714015009014a2620fca16"/></dir><dir name="Model"><dir name="Listeners"><file name="Observer.php" hash="27dae36d9c35a5176aeb4ee2b054a5bc"/></dir><file name="Timer.php" hash="bfdaef5388bfc7faf48544c18cee6854"/></dir><dir name="controllers"><file name="IndexController.php" hash="7740556a1a409412075fd3d1ce3514c5"/></dir><dir name="etc"><file name="config.xml" hash="b218e310272c92cacf78ca325975a954"/></dir></dir><dir name="Util"><file name="Caller.php" hash="7674f6d3f6d0fc5e238c7e31e0516c52"/><file name="Categories.php" hash="24333b598d8caab3bc796e4bd0e34559"/><dir name="Log"><file name="Rollover.php" hash="47ecb75b56743147d77b33219ac657ac"/></dir><file name="Logger.php" hash="9e9bcd3272bd908d8962a31ae5f5f998"/><file name="Partition.php" hash="5a8e39c1b54f4b8d5bc8793ea5f729be"/></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="bmbleb.xml" hash="aa390e236576f79375b407262961043e"/></dir><dir name="template"><dir name="bmbleb"><dir name="alert"><file name="finished.phtml" hash="cc41edbaf3d492afbfe63efa2a17ac48"/><file name="index.phtml" hash="0308f889169436921999cdec62706676"/><dir name="next"><file name="form.phtml" hash="f6acfc69d606c397f717f97a331e7f2c"/></dir></dir><file name="auth.phtml" hash="2fc86d90ab53799e7309d3f88afff077"/><file name="dashboard_loggedout.phtml" hash="19281143b19a544d4e3072dc754ada2d"/><dir name="help"><file name="index.phtml" hash="e9d3f11c623c735c3e699e406ff9e0e7"/></dir><dir name="index"><file name="messages.phtml" hash="fcbbb47d2cc30c493ed2316a8b888f5d"/><file name="terms.phtml" hash="47772def9e3490041d9374dde594aa34"/></dir><file name="index.phtml" hash="86ad04e7c0f91dad8e2a08a3f5d70b64"/><dir name="jobs"><file name="status.phtml" hash="77f0b0ae7c3c6c42031675cfc959e270"/></dir><file name="jobs.phtml" hash="961ac83f56bf8703dbc433894da4933e"/><file name="login.phtml" hash="0a1a20dfaffe8646bb56323ab811d46a"/><file name="logout.phtml" hash="09b92790c5e124a01086d6929ed7e8de"/><dir name="logs"><file name="index.phtml" hash="17e773a761a24e292b09fe7da1bd7662"/></dir><file name="notifications.phtml" hash="45f8767a090a4f7a7e177151bbc43f4f"/><dir name="problems"><file name="index.phtml" hash="2027d07eed8848a4ed8e801d67072796"/></dir><file name="status.phtml" hash="4c6d8cd43e39184f35c715b785c8595a"/><file name="tabs.phtml" hash="778b686fb073a8aeb973db3bfb0302aa"/></dir></dir></dir></dir><dir name="base"><dir name="default"><dir name="layout"><file name="bmbleb.xml" hash="df1c52c006a507e5c9bc73e66adf8ae8"/></dir></dir></dir></dir></target><target name="mageskin"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="bmbleb"><file name="bmbleb.css" hash="8aea7d5d46e2a0d0ece11abca6ef5d3f"/><dir name="images"><file name="arrows_up-down-large.png" hash="72c27995e1ab1d182891dad0a4d1dae2"/><file name="bmb-ctl.png" hash="de59a694a82b8699560df5146b2e315f"/><file name="check.png" hash="126f33ed483549e79a16186b7499c190"/><file name="grn-bg.png" hash="f681a524e2b4561dbe94152a2d24d60b"/><file name="h3-bg.png" hash="b93df0b0bdba8e8f6e0a07cc31fcc180"/><file name="icon-alert.png" hash="ac2e70efdcebc3813222d0d3ee62a6d9"/><file name="icon-bmbleb.png" hash="fb5574b5e63ee33b84eee26b3d8ef8e3"/><file name="icon-insights.png" hash="725fd29fe1b705e358c9080408693d3d"/><file name="icon-status.png" hash="bd13429f23166a6d431739010ea1b2cd"/><file name="left-ico1.png" hash="7d188f5e6021569750756f58067f0a3b"/><file name="left-ico2.png" hash="d2f6379a73290a8ffa4cb3e19a809d25"/><file name="left-ico3.png" hash="73bc75f7a746e54a75f14eda7a28a6b9"/><file name="left-ico4.png" hash="1da2c26187fed26b6c61599682b2dc4b"/><file name="left-ico5.png" hash="ada61cb32805f2cb8e8dace46361613e"/><file name="left-ico6.png" hash="1e62822267f72589ffa0771352a002da"/><file name="left-ico7.png" hash="16118412d581f0c83ce45c44f62f25a1"/><file name="left-ico8.png" hash="c7de2fe523c892b432b575648cc05631"/><file name="left-ico_demographics.png" hash="3fe23a2dea68f6c65114f248a8bdaa5e"/><file name="login-icn-b.png" hash="64e72070f595e215ece79736ac77ee2f"/><file name="login-icn.png" hash="6142cc2fc8ee2d1c40bf3c8f9ac1fa85"/><file name="logo.png" hash="8fb783f7d68fca3914123f56b8c066a4"/><file name="orng-bg.png" hash="074a6912ca2a139df537e3d15b6bc9b2"/><file name="plugin_dashboard_syncing.jpg" hash="8511648541f6f1b96ff1c53dda3a439b"/><file name="register.png" hash="f73fe51cf7df27ab11089385fa50714e"/><file name="registration-bg-25.png" hash="9d2cf77619cc8fce3ae4d44b0aae30c1"/><file name="registration-bg-50.png" hash="99942fdc8c3f88b0d4b09f87c9e39045"/><file name="registration-bg.png" hash="96365b39495e56ffe491dd9930fe221d"/><file name="spinner.gif" hash="add667817f25bce331a213ab3cc9621f"/><file name="springbot-ctl.png" hash="de59a694a82b8699560df5146b2e315f"/><file name="submit-btn-bg.png" hash="d98aa287b7b73dad9f780b22cb53fbdb"/><file name="sync_icon.png" hash="cb12f2e8943c8e324e3456375f953c86"/><file name="white-check.png" hash="126f33ed483549e79a16186b7499c190"/></dir></dir></dir></dir></dir></target><target name="mageweb"><dir name="shell"><file name="springbot.php" hash="1d00d3ab7a7e161628d6a8a9d3d43836"/></dir></target></contents>
55
  <compatible/>
56
  <dependencies><required><php><min>5.0.0</min><max>6.0.0</max></php></required></dependencies>
57
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Springbot</name>
4
+ <version>1.3.0.7</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/osl-3.0.php">Open Software License (OSL)</license>
7
  <channel>community</channel>
47
  Proclivity to Buy Alerts example: Sally Avalon bought a house recently &#xD;
48
  &#xD;
49
  For support information, features and pricing and more details visit springbot.com</description>
50
+ <notes>Added asynchronous javascript loader</notes>
51
  <authors><author><name>Springbot </name><user>Springbot</user><email>bseitz@springbot.com</email></author></authors>
52
+ <date>2014-09-10</date>
53
+ <time>21:27:03</time>
54
+ <contents><target name="mageetc"><dir name="modules"><file name="Springbot.xml" hash="69a4e2c056502cd8539b4f66a2c8b1bc"/></dir></target><target name="magecommunity"><dir name="Springbot"><dir name="Bmbleb"><dir name="Block"><dir name="Adminhtml"><file name="Auth.php" hash="7dc661bbe9ec85f700a22b319981114d"/><dir name="Bmbleb"><dir name="Login"><file name="Form.php" hash="92cb0b61cce7726f20eec7d5ba8b08a8"/></dir><file name="Login.php" hash="7232e8225f5b21de5675c0d84cb452bd"/></dir><file name="Connected.php" hash="833cef8e351f5efa7a4d104b1c51ca7f"/><file name="Help.php" hash="b280b3292ed778140b751b6426ef56fb"/><dir name="Index"><file name="Messages.php" hash="1e247e31194447de32e54f49dafc3ccc"/><file name="Terms.php" hash="739e5a9ebe204f1f9ac433557c994ae6"/></dir><file name="Index.php" hash="eb7bbef5fa26a53748596e145c3677c4"/><dir name="Jobs"><file name="Grid.php" hash="67255d982ac3d50b38d7a2a525c2b922"/><file name="Status.php" hash="f1b197bf6fdc392bed93ff0734a54ad6"/></dir><file name="Jobs.php" hash="84801c6008802496e168e763a7e6d71f"/><file name="Login.php" hash="2e4d8baead482d404ed40f7d5f3d902c"/><file name="Logout.php" hash="b75af51891b751b9d070e1e784dd6914"/><file name="Logs.php" hash="686e958b553c1e3fcf74841eab30fffb"/><file name="Notifications.php" hash="b9e103d6c255078274c2f3047d944d0e"/><file name="Problems.php" hash="d88e7f1ce79746a306e9b0ff7d0e49bd"/><file name="Status.php" hash="9b67a20f0ee00608029d24850cefda4d"/><file name="Tabs.php" hash="6f93d5c6bd5208a99637c06118c6c630"/></dir></dir><dir name="Helper"><file name="Account.php" hash="b6b8a7623c221d00b3bd142d2ee30e4a"/><file name="Data.php" hash="dca14b137de1e2734a377ca645eeddbe"/><file name="PluginStatus.php" hash="1423679a7e9636aaec854f617da81fe8"/></dir><dir name="Model"><file name="Bmbleb.php" hash="700d11c3006f2dcd2e80cd8bbbab15f9"/><file name="Status.php" hash="9409d26c7884be6b8075ba97dbf71f78"/><file name="Sync.php" hash="a800b6064a88f37957392cd967f2b3cb"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="HelpController.php" hash="087e7868dafe9dd2df89a642d405424a"/><file name="IndexController.php" hash="6b1059484b2d46453e0a429e2d4c8d71"/><file name="JobsController.php" hash="4e912a8fafd2f58235cb2299a83a128b"/><file name="LogsController.php" hash="20a0ce2f584f08480399b7a5ecbd9207"/><file name="ProblemsController.php" hash="a257b10a90bd3924d2396c1a7c272a38"/><file name="SettingsController.php" hash="f75a7a8ef28a296cbd46b04ae9dd5539"/></dir><file name="HelpController.php" hash="2df4608a957f151bf1d01dbde2113680"/><file name="IndexController.php" hash="ea5fa5e2b305f46b222cb2fc2a44f6a5"/><file name="LoginController.php" hash="fc5f7211f7d87c3b8d32bcf502dc1b3f"/><file name="LogoutController.php" hash="140c9d32f5557aa1169fd1b85cd5cc9f"/></dir><dir name="etc"><file name="config.xml" hash="45f7218274a3eed0086761942a95f27b"/></dir></dir><dir name="BoneCollector"><dir name="Model"><file name="HarvestAbstract.php" hash="cd3c3ebcd5c2f4d77d37147e3c722a47"/><dir name="HarvestAttribute"><file name="Observer.php" hash="50a54c290e468d584442c867e866c81b"/></dir><dir name="HarvestCaptureSKU"><file name="Observer.php" hash="428be8c5ac0c676ed4cf84cb3b94a35f"/></dir><dir name="HarvestCart"><file name="Observer.php" hash="63095a580cf0405685104d87cd4868ca"/></dir><dir name="HarvestCategory"><file name="Observer.php" hash="5983ae5a8a8a4d60594cfd081fa9541f"/></dir><dir name="HarvestCustomer"><file name="Observer.php" hash="b55ee79bb112671719e213abce02ecb5"/></dir><dir name="HarvestProduct"><file name="Observer.php" hash="2eb2c80e731d3142ef232bfd8a9035d4"/></dir><dir name="HarvestPurchase"><file name="Observer.php" hash="3310deefacb8d5d47f58bb7bdf3a2488"/></dir><dir name="HarvestRule"><file name="Observer.php" hash="442dcc1718048d97d1a6966d78112919"/></dir><dir name="HarvestSubscriber"><file name="Observer.php" hash="5e4ebcf718ff8ad9d12c9a2cb110c7d1"/></dir></dir><dir name="etc"><file name="config.xml" hash="9d23397da44604157d4370b27708c99d"/></dir></dir><file name="Boss.php" hash="1bf233aaf41168f5a4c37f79e02d9635"/><dir name="Combine"><dir name="Helper"><file name="Attributes.php" hash="5fb06e7cc89bb710039a79fb16e2a998"/><file name="Cart.php" hash="07ce5f461ecded3b9b00ed5c30faa266"/><file name="Data.php" hash="a014e541ad0af82eede3dd5500c6aa4a"/><file name="Harvest.php" hash="1844c637796109da078feee668ba5c51"/><file name="Parser.php" hash="de4ae8ca9d83a371586fe1424f7edbcd"/><file name="Redirect.php" hash="3b81406f5105040d17699ad1e0d7cd5d"/><file name="Store.php" hash="8db94d157d7e497e7612844da43a6c11"/><file name="Trackable.php" hash="8bc28aa708be61d4d0d1f79b3ad51a78"/></dir><dir name="Model"><file name="Abstract.php" hash="77bc1e853f03ca6a12ddd1dda12feda2"/><file name="Api.php" hash="7dc599eb13f12ec51a99af1f5893790a"/><dir name="Cron"><file name="Count.php" hash="06824a092141baf29222607a2dcb3d9c"/><dir name="Manager"><file name="Status.php" hash="d3e0e732a3512bb95214f33fa9f08457"/></dir><dir name="Queue"><dir name="Batch"><file name="Row.php" hash="f703a1bf9e14ef428ade448febc9d35b"/></dir><file name="Batch.php" hash="ec4a31552a5f94a16478057637645dfb"/></dir><file name="Queue.php" hash="fa0d2bfd3fbb879442e0edd4ea7915a9"/><file name="Worker.php" hash="f83199c1491083b68eaea08467114d4f"/></dir><dir name="File"><file name="Io.php" hash="6d1f79eaf45897bf0525b0f3f3ac69d2"/><file name="Path.php" hash="24900b670c07fcdc4e54bae585f20002"/></dir><dir name="Harvest"><file name="Abstract.php" hash="0cdc8ab7db784c9d1a0d0524b68e2d0f"/><file name="AttributeSets.php" hash="2799ee325cd5bdcae597e482ef96551a"/><file name="Carts.php" hash="27e992f0f8cc4b274cd05efc7ce3a7f2"/><file name="Categories.php" hash="ab5bd7e91444fd7cb8bfeae376cd3ea7"/><file name="Coupons.php" hash="d168fba39963899e60a166d1eae2634c"/><file name="CustomerAttributeSets.php" hash="9be018cc3cbb0f495aec4f1c3a9013c8"/><file name="Customers.php" hash="f31427406c56f2dcde5a4f7d04a773c9"/><file name="Guests.php" hash="bcb1fbdfb7b5bf822934d300c423e17f"/><file name="Products.php" hash="2261f2c79b59e59977d050630d0fe92f"/><file name="Purchases.php" hash="585b1cf18e857850920abc7425830388"/><file name="Rules.php" hash="1614bc2a6b69f69acd3edc6fa09def7a"/><file name="Subscribers.php" hash="0c6f8ce380f036599141c9231562aaa9"/></dir><file name="Harvester.php" hash="0578a78bb29782d6fba8fcfb5bcc30ce"/><dir name="Mysql4"><dir name="Cron"><file name="Count.php" hash="acbbb7ec28afbbe98101f5d114cb30b3"/><dir name="Queue"><file name="Collection.php" hash="b26806c9e7cefd052bb784f5a6ce814c"/></dir><file name="Queue.php" hash="4add10644bfc94b88ef5042b23c82ae7"/></dir><dir name="Redirect"><file name="Collection.php" hash="3bbe4f8729c603f8d8131154a0a117c1"/><dir name="Order"><file name="Collection.php" hash="88c0cfcce31b0eed8c035dee4e7e86df"/></dir><file name="Order.php" hash="852bea330edac3372ec5c168111301a8"/></dir><file name="Redirect.php" hash="842e4ba35c6b049c8eaa64704588ca76"/><file name="Setup.php" hash="3fdec335980846a4c3adbc6f4e3478eb"/><dir name="Trackable"><file name="Collection.php" hash="8799c5bf630d267b551cf9dba986cbb0"/></dir><file name="Trackable.php" hash="b38749697b641874b42dceae38ab4a30"/></dir><dir name="Parser"><file name="Abstract.php" hash="bb7ed7476afbdd115876be43108aa149"/><file name="AttributeSet.php" hash="fcb90beeebb921b349b28cadf354786c"/><file name="Category.php" hash="352b6ed7328c94524f4a7c3042949295"/><file name="Coupon.php" hash="53b3d28470146b03e8be2f828dfa92f1"/><file name="Customer.php" hash="083edca18fbdf0c496e6ad22775f596e"/><file name="CustomerAttributeSet.php" hash="f926ec29d1ae837c0ae3c0a9257438d4"/><file name="Guest.php" hash="cbcbf7532c67c72d7e3b77022abc76c3"/><file name="Product.php" hash="2a0d3822877074b2258cd10f9d230cb1"/><dir name="Purchase"><file name="Item.php" hash="f997c74c97f79054ba22e342eab88928"/></dir><file name="Purchase.php" hash="4f161bc021af1851c92bb1c9c33a26ee"/><dir name="Quote"><file name="Item.php" hash="4763cfb492dc6d60575154d8624d256f"/></dir><file name="Quote.php" hash="63c0899564e14208042ac64e371ce71d"/><file name="Rule.php" hash="1069dc15f2c30ec462eb1af51aeceb85"/><file name="Subscriber.php" hash="7cce4dbb928983be6444ce5ef369ffb0"/></dir><file name="Parser.php" hash="72b273215802ee5244fd9e24c223beb8"/><dir name="Redirect"><file name="Order.php" hash="0c31dee69473751d95e5c52f5c60ea48"/></dir><file name="Redirect.php" hash="4abc597d06bd9fa223218ee19be66e0c"/><dir name="Resource"><file name="Abstract.php" hash="a50723654e084875378838b89ffb74ce"/><dir name="Cron"><dir name="Count"><file name="Collection.php" hash="c5cb4ab406c1d008c1bc22bb95b3ba28"/></dir><file name="Count.php" hash="6a356b5d92b509945c4567f479b9bfdd"/><dir name="Queue"><file name="Collection.php" hash="c182c6f6f7d29ee26ddf2900a8497cdb"/></dir><file name="Queue.php" hash="01d35c9491516f7f4ef7d9cccb7b6202"/></dir><dir name="Redirect"><file name="Collection.php" hash="0f9db83ade4c50c2f7bbe40deae1c065"/><dir name="Order"><file name="Collection.php" hash="162359ed9499b6f976f5c341fd0585c3"/></dir><file name="Order.php" hash="7ea4477380a5215dc0efe561ede359d9"/></dir><file name="Redirect.php" hash="d239af442388bb9fa80db81a7fc43711"/><file name="Setup.php" hash="46cc5ec83478021a1fe7251d73ee568e"/><dir name="Trackable"><file name="Collection.php" hash="6f060c3537b49710302e38e881885a69"/></dir><file name="Trackable.php" hash="764b0d21c492dd69b9f85ae3c647666e"/></dir><dir name="System"><dir name="Config"><dir name="Source"><file name="LogFormat.php" hash="828680dafe5a7042221900cb6d9dfa17"/><file name="LogLevel.php" hash="b86c793ca04205f045efd9ea42d02a10"/><file name="Stability.php" hash="830e5bc4e8ce9657221224dbaf99cee6"/><file name="UrlType.php" hash="28f9a5bc024afe5526685d429a751ad8"/></dir></dir></dir><file name="Trackable.php" hash="710d298645c0a809a1b70b936b0e4d09"/></dir><dir name="etc"><file name="adminhtml.xml" hash="794fc8a1d67ac3e6b5d71c707a0c7cad"/><file name="config.xml" hash="faa027ffb7e40a78110f367b6a9e550d"/><file name="system.xml" hash="12f0f05be054854c29751767a3c8ef97"/></dir><dir name="sql"><dir name="combine_setup"><file name="mysql4-install-1.0.0.70.php" hash="607957cf80927e2575e455074fea17ec"/><file name="mysql4-upgrade-1.0.0.70-1.0.0.84.php" hash="e51deaff9e65f43483ab00573605329d"/><file name="mysql4-upgrade-1.0.0.84-1.0.0.88.php" hash="89bd8a585c0d351aae6838ace48f608d"/><file name="mysql4-upgrade-1.0.0.88-1.2.0.0.php" hash="09f98d701b5030ccc27d9ca1503212c4"/><file name="mysql4-upgrade-1.2.0.0-1.2.0.1.php" hash="01a7ef2466b9f676884db4d7a7c562a9"/><file name="mysql4-upgrade-1.2.0.1-1.2.1.0.php" hash="ca68ef04700f892ae847aaf20155cb6a"/></dir></dir></dir><dir name="DataServices"><file name="HarvestingManager.php" hash="f40116dacdafaeafd0c22f0c146360c6"/></dir><file name="Log.php" hash="742aa65d2a2eb1d9cb4b203b0141e2aa"/><dir name="Services"><file name="Abstract.php" hash="f779d8f0a1eaaa20364ccbf400c9e0ae"/><dir name="Cmd"><file name="Forecast.php" hash="3ac2b917db8c05ac085f213640b7be14"/><file name="Halt.php" hash="af1a47f7e9940c29b9c8380fbc69a447"/><file name="Harvest.php" hash="34eb715d51953451b4d082f0a141275c"/><file name="Healthcheck.php" hash="a51b3b7766afa1e6cca60fc3b206fb85"/><file name="Parse.php" hash="dbf89d3e1395511728063128703e3e97"/><file name="Update.php" hash="804da06229cc47eb850291847883c96d"/></dir><dir name="Harvest"><file name="AttributeSets.php" hash="c37c4c0642a06a27c6a28bee27e20b14"/><file name="Carts.php" hash="9496d5150a9b5e1282adb78d96f846fc"/><file name="Categories.php" hash="fc1b5b26d612d3232838c975c3e55646"/><file name="Coupons.php" hash="933ac544b0438b7b6e5c26f1d94b369a"/><file name="CustomerAttributeSets.php" hash="67368d6ba001310912d39df0bd9037ad"/><file name="Customers.php" hash="9ae9805bb89a7546ad7c126281ce5220"/><file name="Guests.php" hash="940bcfd10c656195953b77159a4ace10"/><file name="Products.php" hash="d249ec369bdaa38964906f9998d77d4b"/><file name="Purchases.php" hash="859c8af86ee44a896d94ac69decb851a"/><file name="Rules.php" hash="8da50acb7c2bfa0551dcc7727bb958d5"/><file name="Subscribers.php" hash="8fa28e316d7396ca79300813ea9bd7ca"/></dir><file name="Harvest.php" hash="1ed4efb9aa1f0ae30a3a4afb2cbf98f6"/><dir name="Log"><file name="Installer.php" hash="584f730627201a9e73f1d4101ad3fedd"/><file name="Purchase.php" hash="6060265974fe6b45768617f96ebba6b1"/></dir><dir name="Post"><file name="Attribute.php" hash="7e7a307180eb9b9cd7f5b9137e4bd647"/><file name="AttributeSet.php" hash="66968b3ea659253789bbf96ec828afcc"/><file name="Cart.php" hash="7465d7587762b82ffaefef6f27b40a58"/><file name="Category.php" hash="68be39b090f46f3f438ad2ed9f97f09f"/><file name="Coupon.php" hash="1c5484e6f2fd1d68e4a25a429f74376b"/><file name="Customer.php" hash="ecce6d30d3458e0786d4c6335a4c02cc"/><file name="Json.php" hash="86a5f26aa5367d8c4c66d278e4c02546"/><file name="Jsonstring.php" hash="9dfb5761d1a7835bf35040a073fa8fc4"/><file name="Product.php" hash="787e33146cc39d5f5eecd2d3a4ea842b"/><file name="Purchase.php" hash="80480bf01d11b1068d481c6ed50c2e1f"/><file name="Rule.php" hash="24c4c0bea020dbb3a4ff5420888d1f22"/><file name="Subscriber.php" hash="4d18235c4c0d11a8650b3e60c098908f"/></dir><file name="Post.php" hash="df362d5839aa050daa7b23660603b16d"/><file name="Priority.php" hash="d8fc0b57442d8e2e2ff7ba789c3d1fc9"/><file name="Registry.php" hash="c4f17c52b0814c29b7ab93e911a2de28"/><dir name="Store"><file name="Finalize.php" hash="6f61c4cd23ef3cd815b7eee545ecaa23"/><file name="Register.php" hash="523100a10a3ac39fa444801551bdbf25"/></dir><dir name="Update"><file name="Abstract.php" hash="7b9a1d36b4486e250587820731b7fb7c"/><file name="Connect.php" hash="3e4366a42e563ec3406a0fcb9a5f77bf"/><file name="Downloader.php" hash="934ef5788acb45ce94e0a32c1d705df1"/><file name="Installer.php" hash="a09ec2e9f7bbf12c117c8950e46072b0"/><file name="Package.php" hash="b025fa1c27aed03454e7d45d09705b3a"/></dir><dir name="Work"><file name="Cleanup.php" hash="d0915a0cde6d9cd4287a2f9fc4bc0056"/><file name="Manager.php" hash="507608c3fc9d34170e7326cb075d3b71"/><file name="Report.php" hash="688df023f8e1518d15e297b030618254"/><file name="Restart.php" hash="43af836b8950852efe62996facf4ad87"/><file name="Runner.php" hash="a2929a0e03dc99ac0ad5702b623eeb56"/><file name="Stop.php" hash="5e51ecf333282ad5d8dd6d40243c5e8e"/></dir></dir><dir name="Shadow"><dir name="Block"><dir name="Js"><file name="Boot.php" hash="3dec841c75ca7d3605681080aa19798b"/></dir></dir><dir name="Helper"><file name="Listeners.php" hash="432794c308714015009014a2620fca16"/></dir><dir name="Model"><dir name="Listeners"><file name="Observer.php" hash="3326cfb14a374c039f639bd74947c4fb"/></dir><file name="Timer.php" hash="bfdaef5388bfc7faf48544c18cee6854"/></dir><dir name="controllers"><file name="IndexController.php" hash="7740556a1a409412075fd3d1ce3514c5"/></dir><dir name="etc"><file name="config.xml" hash="6f8002880ac72e062ff1a22ddcc346ee"/></dir></dir><dir name="Util"><file name="Caller.php" hash="7674f6d3f6d0fc5e238c7e31e0516c52"/><file name="Categories.php" hash="52f9174384a500c28d44a6e09c0032f7"/><dir name="Log"><file name="Rollover.php" hash="47ecb75b56743147d77b33219ac657ac"/></dir><file name="Logger.php" hash="59abca8cb07ef933ca8ef2ac824591b5"/><file name="Partition.php" hash="b9296b086003ba58ba12f8b8b0373c50"/></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="bmbleb.xml" hash="aa390e236576f79375b407262961043e"/></dir><dir name="template"><dir name="bmbleb"><file name="auth.phtml" hash="2fc86d90ab53799e7309d3f88afff077"/><file name="dashboard_loggedout.phtml" hash="19281143b19a544d4e3072dc754ada2d"/><dir name="help"><file name="index.phtml" hash="e9d3f11c623c735c3e699e406ff9e0e7"/></dir><dir name="index"><file name="messages.phtml" hash="fcbbb47d2cc30c493ed2316a8b888f5d"/><file name="terms.phtml" hash="dfff1182d2fe7d8eee69b9b302c4cbc7"/></dir><file name="index.phtml" hash="86ad04e7c0f91dad8e2a08a3f5d70b64"/><dir name="jobs"><file name="status.phtml" hash="77f0b0ae7c3c6c42031675cfc959e270"/></dir><file name="jobs.phtml" hash="961ac83f56bf8703dbc433894da4933e"/><file name="login.phtml" hash="0a1a20dfaffe8646bb56323ab811d46a"/><file name="logout.phtml" hash="09b92790c5e124a01086d6929ed7e8de"/><dir name="logs"><file name="index.phtml" hash="17e773a761a24e292b09fe7da1bd7662"/></dir><file name="notifications.phtml" hash="45f8767a090a4f7a7e177151bbc43f4f"/><dir name="problems"><file name="index.phtml" hash="2027d07eed8848a4ed8e801d67072796"/></dir><file name="status.phtml" hash="4c6d8cd43e39184f35c715b785c8595a"/><file name="tabs.phtml" hash="778b686fb073a8aeb973db3bfb0302aa"/></dir></dir></dir></dir><dir name="base"><dir name="default"><dir name="layout"><file name="bmbleb.xml" hash="df1c52c006a507e5c9bc73e66adf8ae8"/></dir></dir></dir></dir></target><target name="mageskin"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="bmbleb"><file name="bmbleb.css" hash="8aea7d5d46e2a0d0ece11abca6ef5d3f"/><dir name="images"><file name="arrows_up-down-large.png" hash="72c27995e1ab1d182891dad0a4d1dae2"/><file name="bmb-ctl.png" hash="de59a694a82b8699560df5146b2e315f"/><file name="check.png" hash="126f33ed483549e79a16186b7499c190"/><file name="grn-bg.png" hash="f681a524e2b4561dbe94152a2d24d60b"/><file name="h3-bg.png" hash="b93df0b0bdba8e8f6e0a07cc31fcc180"/><file name="icon-alert.png" hash="ac2e70efdcebc3813222d0d3ee62a6d9"/><file name="icon-bmbleb.png" hash="fb5574b5e63ee33b84eee26b3d8ef8e3"/><file name="icon-insights.png" hash="725fd29fe1b705e358c9080408693d3d"/><file name="icon-status.png" hash="bd13429f23166a6d431739010ea1b2cd"/><file name="left-ico1.png" hash="7d188f5e6021569750756f58067f0a3b"/><file name="left-ico2.png" hash="d2f6379a73290a8ffa4cb3e19a809d25"/><file name="left-ico3.png" hash="73bc75f7a746e54a75f14eda7a28a6b9"/><file name="left-ico4.png" hash="1da2c26187fed26b6c61599682b2dc4b"/><file name="left-ico5.png" hash="ada61cb32805f2cb8e8dace46361613e"/><file name="left-ico6.png" hash="1e62822267f72589ffa0771352a002da"/><file name="left-ico7.png" hash="16118412d581f0c83ce45c44f62f25a1"/><file name="left-ico8.png" hash="c7de2fe523c892b432b575648cc05631"/><file name="left-ico_demographics.png" hash="3fe23a2dea68f6c65114f248a8bdaa5e"/><file name="login-icn-b.png" hash="64e72070f595e215ece79736ac77ee2f"/><file name="login-icn.png" hash="6142cc2fc8ee2d1c40bf3c8f9ac1fa85"/><file name="logo.png" hash="8fb783f7d68fca3914123f56b8c066a4"/><file name="orng-bg.png" hash="074a6912ca2a139df537e3d15b6bc9b2"/><file name="plugin_dashboard_syncing.jpg" hash="8511648541f6f1b96ff1c53dda3a439b"/><file name="register.png" hash="f73fe51cf7df27ab11089385fa50714e"/><file name="registration-bg-25.png" hash="9d2cf77619cc8fce3ae4d44b0aae30c1"/><file name="registration-bg-50.png" hash="99942fdc8c3f88b0d4b09f87c9e39045"/><file name="registration-bg.png" hash="96365b39495e56ffe491dd9930fe221d"/><file name="spinner.gif" hash="add667817f25bce331a213ab3cc9621f"/><file name="springbot-ctl.png" hash="de59a694a82b8699560df5146b2e315f"/><file name="submit-btn-bg.png" hash="d98aa287b7b73dad9f780b22cb53fbdb"/><file name="sync_icon.png" hash="cb12f2e8943c8e324e3456375f953c86"/><file name="white-check.png" hash="126f33ed483549e79a16186b7499c190"/></dir></dir></dir></dir></dir></target><target name="mageweb"><dir name="shell"><file name="springbot.php" hash="4de4684c57c242cbcb661cd6bc98844a"/></dir></target></contents>
55
  <compatible/>
56
  <dependencies><required><php><min>5.0.0</min><max>6.0.0</max></php></required></dependencies>
57
  </package>
shell/springbot.php CHANGED
@@ -6,15 +6,10 @@
6
  class Springbot_Shell
7
  {
8
  protected $_action;
9
-
10
  protected $_type;
11
-
12
  protected $_appCode = 'admin';
13
-
14
  protected $_appType = 'store';
15
-
16
  protected $_magentoRootDir;
17
-
18
  protected $_args;
19
 
20
  protected $_registry = array(
@@ -22,11 +17,13 @@ class Springbot_Shell
22
  'attributeSets' => 'Springbot_Services_Harvest_AttributeSets',
23
  'carts' => 'Springbot_Services_Harvest_Carts',
24
  'categories' => 'Springbot_Services_Harvest_Categories',
 
25
  'customerAttributeSets' => 'Springbot_Services_Harvest_CustomerAttributeSets',
26
  'customers' => 'Springbot_Services_Harvest_Customers',
27
  'guests' => 'Springbot_Services_Harvest_Guests',
28
  'products' => 'Springbot_Services_Harvest_Products',
29
  'purchases' => 'Springbot_Services_Harvest_Purchases',
 
30
  'subscribers' => 'Springbot_Services_Harvest_Subscribers',
31
  ),
32
  'post' => array(
@@ -34,10 +31,12 @@ class Springbot_Shell
34
  'attributeSet' => 'Springbot_Services_Post_AttributeSet',
35
  'cart' => 'Springbot_Services_Post_Cart',
36
  'category' => 'Springbot_Services_Post_Category',
 
37
  'customer' => 'Springbot_Services_Post_Customer',
38
  'json' => 'Springbot_Services_Post_Json',
39
  'product' => 'Springbot_Services_Post_Product',
40
  'purchase' => 'Springbot_Services_Post_Purchase',
 
41
  'subscriber' => 'Springbot_Services_Post_Subscriber',
42
  'jsonstring' => 'Springbot_Services_Post_Jsonstring'
43
  ),
6
  class Springbot_Shell
7
  {
8
  protected $_action;
 
9
  protected $_type;
 
10
  protected $_appCode = 'admin';
 
11
  protected $_appType = 'store';
 
12
  protected $_magentoRootDir;
 
13
  protected $_args;
14
 
15
  protected $_registry = array(
17
  'attributeSets' => 'Springbot_Services_Harvest_AttributeSets',
18
  'carts' => 'Springbot_Services_Harvest_Carts',
19
  'categories' => 'Springbot_Services_Harvest_Categories',
20
+ 'coupons' => 'Springbot_Services_Harvest_Coupons',
21
  'customerAttributeSets' => 'Springbot_Services_Harvest_CustomerAttributeSets',
22
  'customers' => 'Springbot_Services_Harvest_Customers',
23
  'guests' => 'Springbot_Services_Harvest_Guests',
24
  'products' => 'Springbot_Services_Harvest_Products',
25
  'purchases' => 'Springbot_Services_Harvest_Purchases',
26
+ 'rules' => 'Springbot_Services_Harvest_Rules',
27
  'subscribers' => 'Springbot_Services_Harvest_Subscribers',
28
  ),
29
  'post' => array(
31
  'attributeSet' => 'Springbot_Services_Post_AttributeSet',
32
  'cart' => 'Springbot_Services_Post_Cart',
33
  'category' => 'Springbot_Services_Post_Category',
34
+ 'coupon' => 'Springbot_Services_Post_Coupon',
35
  'customer' => 'Springbot_Services_Post_Customer',
36
  'json' => 'Springbot_Services_Post_Json',
37
  'product' => 'Springbot_Services_Post_Product',
38
  'purchase' => 'Springbot_Services_Post_Purchase',
39
+ 'rule' => 'Springbot_Services_Post_Rule',
40
  'subscriber' => 'Springbot_Services_Post_Subscriber',
41
  'jsonstring' => 'Springbot_Services_Post_Jsonstring'
42
  ),