Bluefish_Connection - Version 1.1.1

Version Notes

This extension can be used by the users of bluefishretail,by providing appropriate credentials,given to them by bluefishretail.

Download this release

Release Info

Developer J Doyle
Extension Bluefish_Connection
Version 1.1.1
Comparing to
See all releases


Code changes from version 1.1.0 to 1.1.1

Files changed (28) hide show
  1. app/code/local/Bluefish/Connection/Block/Adminhtml/Bluestorecron.php +34 -0
  2. app/code/local/Bluefish/Connection/Block/Adminhtml/Bluestorecron/Grid.php +112 -0
  3. app/code/local/Bluefish/Connection/Block/Adminhtml/Bluestorescheduler.php +32 -0
  4. app/code/local/Bluefish/Connection/Block/Adminhtml/Bluestorescheduler/Grid.php +117 -0
  5. app/code/local/Bluefish/Connection/Block/Databasemapping.php +2 -2
  6. app/code/local/Bluefish/Connection/Block/Productdatabasemapping.php +2 -1
  7. app/code/local/Bluefish/Connection/Helper/Data.php +81 -1
  8. app/code/local/Bluefish/Connection/Model/Bluestoreschedule.php +78 -0
  9. app/code/local/Bluefish/Connection/Model/Collection/Crons.php +59 -0
  10. app/code/local/Bluefish/Connection/Model/Configuration.php +99 -0
  11. app/code/local/Bluefish/Connection/Model/Validationcrontime.php +71 -46
  12. app/code/local/Bluefish/Connection/controllers/Adminhtml/BluestorecronController.php +44 -0
  13. app/code/local/Bluefish/Connection/controllers/Adminhtml/BluestoreschedulerController.php +23 -0
  14. app/code/local/Bluefish/Connection/controllers/Adminhtml/CategorydataController.php +7 -6
  15. app/code/local/Bluefish/Connection/controllers/Adminhtml/MyformController.php +6 -3
  16. app/code/local/Bluefish/Connection/controllers/Adminhtml/MyformexportController.php +4 -3
  17. app/code/local/Bluefish/Connection/controllers/Adminhtml/ProductdataController.php +7 -6
  18. app/code/local/Bluefish/Connection/controllers/Adminhtml/Xml.php +102 -82
  19. app/code/local/Bluefish/Connection/etc/config.xml +21 -5
  20. app/code/local/Bluefish/Connection/etc/system.xml +28 -2
  21. app/code/local/Bluefish/Connection/sql/connection_setup/{mysql4-upgrade-0.1.0-1.1.0.php → mysql4-upgrade-0.1.0-1.1.1.php} +0 -0
  22. app/design/adminhtml/default/default/layout/connection.xml +10 -0
  23. app/design/adminhtml/default/default/template/connection/array_dropdown.phtml +23 -4
  24. app/design/adminhtml/default/default/template/connection/cronschedule.phtml +2 -1
  25. app/design/adminhtml/default/default/template/connection/custom_product_radioinput.phtml +3 -2
  26. app/design/adminhtml/default/default/template/connection/custom_radioinput.phtml +2 -1
  27. app/design/adminhtml/default/default/template/connection/myform.phtml +1 -1
  28. package.xml +12 -12
app/code/local/Bluefish/Connection/Block/Adminhtml/Bluestorecron.php ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Cron block
5
+ *
6
+ * @author Yuvraj Singh
7
+ */
8
+ class Bluefish_Connection_Block_Adminhtml_Bluestorecron extends Mage_Adminhtml_Block_Widget_Grid_Container {
9
+
10
+
11
+ /**
12
+ * Constructor for Cron Adminhtml Block
13
+ */
14
+ public function __construct() {
15
+ $this->_controller = 'adminhtml_bluestorecron';
16
+ $this->_blockGroup = 'connection';
17
+ $this->_headerText = Mage::helper('connection')->__('Activate / Deactivate Bluestore Crons');
18
+ parent::__construct();
19
+ }
20
+
21
+ /**
22
+ * Prepare layout
23
+ *
24
+ * @return connection_Block_Adminhtml_Cron
25
+ */
26
+ protected function _prepareLayout() {
27
+ $this->removeButton('add');
28
+ $this->_addButton('configure', array(
29
+ 'label' => Mage::helper('connection')->__('Cron Setting'),
30
+ 'onclick' => "setLocation('{$this->getUrl('adminhtml/system_config/edit', array('section' => 'system'))}#system_cron')",
31
+ ));
32
+ return parent::_prepareLayout();
33
+ }
34
+ }
app/code/local/Bluefish/Connection/Block/Adminhtml/Bluestorecron/Grid.php ADDED
@@ -0,0 +1,112 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Block: Cron grid
5
+ *
6
+ * @author Yuvraj Singh
7
+ */
8
+ class Bluefish_Connection_Block_Adminhtml_Bluestorecron_Grid extends Mage_Adminhtml_Block_Widget_Grid {
9
+
10
+ /**
11
+ * Constructor
12
+ */
13
+ public function __construct() {
14
+ parent::__construct();
15
+ $this->setId('cron_grid');
16
+ $this->_filterVisibility = false;
17
+ $this->_pagerVisibility = false;
18
+ }
19
+
20
+
21
+
22
+ /**
23
+ * Grid Data Colloction
24
+ *
25
+ */
26
+ protected function _prepareCollection() {
27
+ $collection = Mage::getModel('connection/collection_crons');
28
+ $this->setCollection($collection);
29
+ return parent::_prepareCollection();
30
+ }
31
+
32
+ /**
33
+ * Add actions to cron grid
34
+ *
35
+ */
36
+
37
+ protected function _prepareMassaction() {
38
+ $this->setMassactionIdField('id');
39
+ $this->getMassactionBlock()->setFormFieldName('codes');
40
+ $this->getMassactionBlock()->addItem('deactivatecron', array(
41
+ 'label' => Mage::helper('connection')->__('Deactivate'),
42
+ 'url' => $this->getUrl('*/*/deactivatecron'),
43
+ ));
44
+ $this->getMassactionBlock()->addItem('activatecron', array(
45
+ 'label' => Mage::helper('connection')->__('Activate'),
46
+ 'url' => $this->getUrl('*/*/activatecron'),
47
+ ));
48
+ return $this;
49
+ }
50
+
51
+ /**
52
+ * Generate columns of the grid
53
+ *
54
+ */
55
+
56
+ protected function _prepareColumns() {
57
+ $this->addColumn('id', array (
58
+ 'header' => Mage::helper('connection')->__('Bluestore Code'),
59
+ 'index' => 'id',
60
+ 'sortable' => false,
61
+ ));
62
+ $this->addColumn('cron_expr', array (
63
+ 'header' => Mage::helper('connection')->__('Cron Schedule Syntax'),
64
+ 'index' => 'cron_expr',
65
+ 'sortable' => false,
66
+ ));
67
+ $this->addColumn('model', array (
68
+ 'header' => Mage::helper('connection')->__('Model'),
69
+ 'index' => 'model',
70
+ 'sortable' => false,
71
+ ));
72
+ $this->addColumn('status', array (
73
+ 'header' => Mage::helper('connection')->__('Cron Status'),
74
+ 'index' => 'status',
75
+ 'sortable' => false,
76
+ 'frame_callback' => array($this, 'decorateStatus'),
77
+ ));
78
+ return parent::_prepareColumns();
79
+ }
80
+
81
+ /**
82
+ * Decorate status column values
83
+ *
84
+ */
85
+ public function decorateStatus($value) {
86
+ $cell = sprintf('<span class="grid-severity-%s"><span>%s</span></span>',
87
+ ($value == Bluefish_Connection_Model_Configuration::STATUS_DISABLED) ? 'critical' : 'notice',
88
+ Mage::helper('connection')->__($value)
89
+ );
90
+ return $cell;
91
+ }
92
+
93
+ /**
94
+ * Helper function to add store filter
95
+ *
96
+ */
97
+ protected function _filterStoreCondition($collection, $column) {
98
+ if (!$value = $column->getFilter()->getValue()) {
99
+ return;
100
+ }
101
+ $this->getCollection()->addStoreFilter($value);
102
+ }
103
+
104
+ /**
105
+ * Helper function to receive grid functionality urls for current grid
106
+ *
107
+ */
108
+ public function getGridUrl() {
109
+ return $this->getUrl('adminhtml/connection/bluestorecron', array('_current' => true));
110
+ }
111
+
112
+ }
app/code/local/Bluefish/Connection/Block/Adminhtml/Bluestorescheduler.php ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Scheduler Block
5
+ *
6
+ */
7
+ class Bluefish_Connection_Block_Adminhtml_Bluestorescheduler extends Mage_Adminhtml_Block_Widget_Grid_Container {
8
+
9
+ /**
10
+ * Constructor for Scheduler Adminhtml Block
11
+ */
12
+ public function __construct() {
13
+ $this->_controller = 'adminhtml_bluestorescheduler';
14
+ $this->_blockGroup = 'connection';
15
+ $this->_headerText = Mage::helper('connection')->__('Monitor Scheduled Tasks');
16
+ parent::__construct();
17
+ }
18
+
19
+ /**
20
+ * Prepare layout
21
+ *
22
+ */
23
+ protected function _prepareLayout() {
24
+ $this->removeButton('add');
25
+ $this->_addButton('configure', array(
26
+ 'label' => Mage::helper('connection')->__('Cron Setting'),
27
+ 'onclick' => "setLocation('{$this->getUrl('adminhtml/system_config/edit', array('section' => 'system'))}#system_cron')",
28
+ ));
29
+ return parent::_prepareLayout();
30
+ }
31
+
32
+ }
app/code/local/Bluefish/Connection/Block/Adminhtml/Bluestorescheduler/Grid.php ADDED
@@ -0,0 +1,117 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Block: Scheduler Grid
5
+ *
6
+ */
7
+ class Bluefish_Connection_Block_Adminhtml_Bluestorescheduler_Grid extends Mage_Adminhtml_Block_Widget_Grid {
8
+
9
+ /**
10
+ * Constructor. Set basic parameters
11
+ */
12
+ public function __construct() {
13
+ parent::__construct();
14
+ $this->setId('bluestorescheduler_grid');
15
+ $this->setUseAjax(false);
16
+ $this->setDefaultSort('scheduled_at');
17
+ $this->setDefaultDir('DESC');
18
+ $this->setSaveParametersInSession(true);
19
+ }
20
+
21
+ /**
22
+ * Preparation of the data that is displayed by the grid.
23
+ *
24
+ */
25
+ protected function _prepareCollection() {
26
+ $collection = Mage::getModel('cron/schedule')->getCollection();
27
+ $collection->addFieldToFilter('job_code',array('in'=>array("bluefish_connection_category","bluefish_connection_customer","bluefish_connection_customerexport","bluefish_connection_orderexport","bluefish_connection_product","bluefish_connection_stock")));
28
+ $this->setCollection($collection);
29
+ return parent::_prepareCollection();
30
+ }
31
+
32
+ /**
33
+ * Add mass-actions to grid
34
+ */
35
+ protected function _prepareMassaction() {
36
+ $this->setMassactionIdField('schedule_id');
37
+ $this->getMassactionBlock()->setFormFieldName('schedule_ids');
38
+ $this->getMassactionBlock()->addItem('delete', array(
39
+ 'label' => Mage::helper('connection')->__('Delete'),
40
+ 'url' => $this->getUrl('*/*/delete'),
41
+ ));
42
+ return $this;
43
+ }
44
+
45
+ /**
46
+ * Preparation of the requested columns of the grid
47
+ *
48
+ */
49
+ protected function _prepareColumns() {
50
+
51
+ $viewHelper = $this->helper('connection/data');
52
+ $this->addColumn('job_code', array (
53
+ 'header' => Mage::helper('connection')->__('Bluestore Cron Code'),
54
+ 'index' => 'job_code',
55
+ 'type' => 'options',
56
+ 'options' => Mage::getModel('connection/collection_crons')->toOptionHash()
57
+ ));
58
+ $this->addColumn('scheduled_at', array (
59
+ 'header' => Mage::helper('connection')->__('Scheduled Time'),
60
+ 'index' => 'scheduled_at',
61
+ 'frame_callback' => array($viewHelper, 'decorateTimeFrameCallBack')
62
+ ));
63
+ $this->addColumn('executed_at', array (
64
+ 'header' => Mage::helper('connection')->__('Executed Time'),
65
+ 'index' => 'executed_at',
66
+ 'frame_callback' => array($viewHelper, 'decorateTimeFrameCallBack')
67
+ ));
68
+ $this->addColumn('finished_at', array (
69
+ 'header' => Mage::helper('connection')->__('Finished Time'),
70
+ 'index' => 'finished_at',
71
+ 'frame_callback' => array($viewHelper, 'decorateTimeFrameCallBack')
72
+ ));
73
+ $this->addColumn('status', array (
74
+ 'header' => Mage::helper('connection')->__('Cron Status'),
75
+ 'index' => 'status',
76
+ 'frame_callback' => array($viewHelper, 'decorateStatus'),
77
+ 'type' => 'options',
78
+ 'options' => array(
79
+ Mage_Cron_Model_Schedule::STATUS_PENDING => Mage_Cron_Model_Schedule::STATUS_PENDING,
80
+ Mage_Cron_Model_Schedule::STATUS_SUCCESS => Mage_Cron_Model_Schedule::STATUS_SUCCESS,
81
+ Mage_Cron_Model_Schedule::STATUS_ERROR => Mage_Cron_Model_Schedule::STATUS_ERROR,
82
+ Mage_Cron_Model_Schedule::STATUS_MISSED => Mage_Cron_Model_Schedule::STATUS_MISSED,
83
+ Mage_Cron_Model_Schedule::STATUS_RUNNING => Mage_Cron_Model_Schedule::STATUS_RUNNING,
84
+ )
85
+ ));
86
+
87
+ return parent::_prepareColumns();
88
+ }
89
+
90
+ /**
91
+ * Helper function to do after load modifications
92
+ *
93
+ */
94
+ protected function _afterLoadCollection() {
95
+ $this->getCollection()->walk('afterLoad');
96
+ parent::_afterLoadCollection();
97
+ }
98
+
99
+ /**
100
+ * Helper function to add store filter condition
101
+ */
102
+ protected function _filterStoreCondition($collection, $column) {
103
+ if (!$value = $column->getFilter()->getValue()) {
104
+ return;
105
+ }
106
+ $this->getCollection()->addStoreFilter($value);
107
+ }
108
+
109
+
110
+ /**
111
+ * Helper function to receive grid functionality urls for current grid
112
+ */
113
+ public function getGridUrl() {
114
+ return $this->getUrl('*/*/*', array('_current' => true));
115
+ }
116
+
117
+ }
app/code/local/Bluefish/Connection/Block/Databasemapping.php CHANGED
@@ -49,8 +49,8 @@ class Bluefish_Connection_Block_Databasemapping extends Mage_Adminhtml_Block_Sys
49
  protected function _renderCellTemplate($columnName)
50
  {
51
  $connection = Mage::getSingleton('core/resource')->getConnection('core_write');
52
-
53
- $resultPath = $connection->query("select value from core_config_data WHERE path = 'mycustom_section/mycustom_category_group/mycustom_category_mapping_direct'");
54
  $resultCronPath = $resultPath->fetchAll(PDO::FETCH_ASSOC);
55
  $numberRows = count($resultCronPath);
56
 
49
  protected function _renderCellTemplate($columnName)
50
  {
51
  $connection = Mage::getSingleton('core/resource')->getConnection('core_write');
52
+ $prefix = Mage::getConfig()->getTablePrefix();
53
+ $resultPath = $connection->query("select value from ".$prefix."core_config_data WHERE path = 'mycustom_section/mycustom_category_group/mycustom_category_mapping_direct'");
54
  $resultCronPath = $resultPath->fetchAll(PDO::FETCH_ASSOC);
55
  $numberRows = count($resultCronPath);
56
 
app/code/local/Bluefish/Connection/Block/Productdatabasemapping.php CHANGED
@@ -49,8 +49,9 @@ class Bluefish_Connection_Block_Productdatabasemapping extends Mage_Adminhtml_Bl
49
  protected function _renderCellTemplate($columnName)
50
  {
51
  $connection = Mage::getSingleton('core/resource')->getConnection('core_write');
 
52
 
53
- $resultPath = $connection->query("select value from core_config_data WHERE path = 'mycustom_section/mycustom_product_group/mycustom_product_mapping_direct'");
54
  $resultCronPath = $resultPath->fetchAll(PDO::FETCH_ASSOC);
55
  $numberRows = count($resultCronPath);
56
 
49
  protected function _renderCellTemplate($columnName)
50
  {
51
  $connection = Mage::getSingleton('core/resource')->getConnection('core_write');
52
+ $prefix = Mage::getConfig()->getTablePrefix();
53
 
54
+ $resultPath = $connection->query("select value from ".$prefix."core_config_data WHERE path = 'mycustom_section/mycustom_product_group/mycustom_product_mapping_direct'");
55
  $resultCronPath = $resultPath->fetchAll(PDO::FETCH_ASSOC);
56
  $numberRows = count($resultCronPath);
57
 
app/code/local/Bluefish/Connection/Helper/Data.php CHANGED
@@ -1,6 +1,86 @@
1
  <?php
2
-
3
  class Bluefish_Connection_Helper_Data extends Mage_Core_Helper_Abstract
4
  {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6
  }
1
  <?php
 
2
  class Bluefish_Connection_Helper_Data extends Mage_Core_Helper_Abstract
3
  {
4
+ /**
5
+ * Explodes a string and trims all values for whitespace in the ends.
6
+ */
7
+
8
+ public function trimExplode($delim, $string, $removeEmptyValues=false) {
9
+ $explodedValues = explode($delim, $string);
10
+
11
+ $result = array_map('trim', $explodedValues);
12
+
13
+ if ($removeEmptyValues) {
14
+ $temp = array();
15
+ foreach ($result as $value) {
16
+ if ($value !== '') {
17
+ $temp[] = $value;
18
+ }
19
+ }
20
+ $result = $temp;
21
+ }
22
+ return $result;
23
+ }
24
+
25
+ /**
26
+ * Decorate status values
27
+ *
28
+ * @return string
29
+ */
30
+ public function decorateStatus($status) {
31
+ switch ($status) {
32
+
33
+ case Mage_Cron_Model_Schedule::STATUS_SUCCESS:
34
+ $class = 'notice';
35
+ $result = $status;
36
+ break;
37
+ case Mage_Cron_Model_Schedule::STATUS_PENDING:
38
+ $class = 'minor';
39
+ $result = $status;
40
+ break;
41
+ case Mage_Cron_Model_Schedule::STATUS_RUNNING:
42
+ $class = 'minor';
43
+ $result = $status;
44
+ break;
45
+ case Mage_Cron_Model_Schedule::STATUS_MISSED:
46
+ $class = 'major';
47
+ $result = $status;
48
+ break;
49
+ case Mage_Cron_Model_Schedule::STATUS_ERROR:
50
+ $class = 'critical';
51
+ $result = $status;
52
+ break;
53
+ default:
54
+ $result = $status;
55
+ break;
56
+ }
57
+ return '<span class="grid-severity-' . $class . '"><span>' .$result. '</span></span>';;
58
+ }
59
+
60
+ /**
61
+ * Wrapepr for decorateCronTime to be used a frame_callback
62
+ */
63
+
64
+ public function decorateTimeFrameCallBack($value) {
65
+ return $this->decorateCronTime($value, false, NULL);
66
+ }
67
 
68
+ /**
69
+ * Decorate time values
70
+ *
71
+ */
72
+ public function decorateCronTime($value, $echoToday=false, $dateFormat=NULL) {
73
+ if (empty($value) || $value == '0000-00-00 00:00:00') {
74
+ $value = '';
75
+ } else {
76
+ $value = Mage::getModel('core/date')->date($dateFormat, $value);
77
+ $replace = array(
78
+ Mage::getModel('core/date')->date('Y-m-d ', time()) => $echoToday ? Mage::helper('connection')->__('Today') . ', ' : '',
79
+ Mage::getModel('core/date')->date('Y-m-d ', strtotime('+1 day')) => Mage::helper('connection')->__('Tomorrow') . ', ',
80
+ Mage::getModel('core/date')->date('Y-m-d ', strtotime('-1 day')) => Mage::helper('connection')->__('Yesterday') . ', ',
81
+ );
82
+ $value = str_replace(array_keys($replace), array_values($replace), $value);
83
+ }
84
+ return $value;
85
+ }
86
  }
app/code/local/Bluefish/Connection/Model/Bluestoreschedule.php ADDED
@@ -0,0 +1,78 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * @method
5
+ */
6
+ class Bluefish_Connection_Model_Bluestoreschedule extends Mage_connection_Model_Schedule {
7
+
8
+ protected $_jobConfiguration;
9
+
10
+
11
+ /**
12
+ * Schedule this task to be executed as soon as possible
13
+ *
14
+ */
15
+ public function scheduleNow() {
16
+ return $this->schedule();
17
+ }
18
+
19
+
20
+
21
+ /**
22
+ * Schedule this task to be executed at a given time
23
+ *
24
+ */
25
+ public function schedule($time=NULL) {
26
+ if (is_null($time)) {
27
+ $time = time();
28
+ }
29
+ $this->setStatus(Mage_connection_Model_Schedule::STATUS_PENDING)
30
+ ->setCreatedAt(strftime('%Y-%m-%d %H:%M:%S', time()))
31
+ ->setScheduledAt(strftime('%Y-%m-%d %H:%M:%S', $time));
32
+ return $this;
33
+ }
34
+
35
+
36
+
37
+ /**
38
+ * Get job configuration
39
+ *
40
+ */
41
+ public function getJobConfiguration() {
42
+ if (is_null($this->_jobConfiguration)) {
43
+ $this->_jobConfiguration = Mage::getModel('connection/configuration')->loadByCode($this->getJobCode());
44
+ }
45
+ return $this->_jobConfiguration;
46
+ }
47
+
48
+
49
+
50
+ /**
51
+ *
52
+ * @return string
53
+ */
54
+ public function getStarttime() {
55
+ $starttime = $this->getExecutedAt();
56
+ if (empty($starttime) || $starttime == '0000-00-00 00:00:00') {
57
+ $starttime = $this->getScheduledAt();
58
+ }
59
+ return $starttime;
60
+ }
61
+
62
+
63
+
64
+ /**
65
+ * Get job duration
66
+ *
67
+ */
68
+ public function getDuration() {
69
+ $duration = false;
70
+ if ($this->getExecutedAt() && ($this->getExecutedAt() != '0000-00-00 00:00:00')
71
+ && $this->getFinishedAt() && ($this->getFinishedAt() != '0000-00-00 00:00:00')) {
72
+ $duration = strtotime($this->getFinishedAt()) - strtotime($this->getExecutedAt());
73
+ }
74
+ return $duration;
75
+ }
76
+
77
+
78
+ }
app/code/local/Bluefish/Connection/Model/Collection/Crons.php ADDED
@@ -0,0 +1,59 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Collection of available cron tasks
5
+ */
6
+ class Bluefish_Connection_Model_Collection_Crons extends Varien_Data_Collection {
7
+
8
+ protected $_dataLoaded = false;
9
+
10
+ /**
11
+ * Load data
12
+ */
13
+ public function loadData($printQuery = false, $logQuery = false) {
14
+
15
+ if ($this->_dataLoaded) {
16
+ return $this;
17
+ }
18
+
19
+ foreach ($this->getAllCodes() as $code) {
20
+ $Bluefish = substr($code, 0, 8);
21
+ if($Bluefish == "bluefish")
22
+ {
23
+ $configuration = Mage::getModel('connection/configuration')->loadBluestoreCronData($code);
24
+ $this->addItem($configuration);
25
+ }
26
+ }
27
+
28
+ $this->_dataLoaded = true;
29
+ return $this;
30
+ }
31
+
32
+
33
+
34
+ /**
35
+ * Get all available codes
36
+ */
37
+ protected function getAllCodes() {
38
+ $codes = array();
39
+ $config = Mage::getConfig()->getNode('crontab/jobs');
40
+ if ($config instanceof Mage_Core_Model_Config_Element) {
41
+ foreach ($config->children() as $key => $tmp) {
42
+ if (!in_array($key, $codes)) {
43
+ $codes[] = $key;
44
+ }
45
+ }
46
+ }
47
+ $config = Mage::getConfig()->getNode('default/crontab/jobs');
48
+ if ($config instanceof Mage_Core_Model_Config_Element) {
49
+ foreach ($config->children() as $key => $tmp) {
50
+ if (!in_array($key, $codes)) {
51
+ $codes[] = $key;
52
+ }
53
+ }
54
+ }
55
+ sort($codes);
56
+ return $codes;
57
+ }
58
+
59
+ }
app/code/local/Bluefish/Connection/Model/Configuration.php ADDED
@@ -0,0 +1,99 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ *
4
+ * Configuration model that returns data
5
+ */
6
+ class Bluefish_Connection_Model_Configuration extends Mage_Core_Model_Abstract {
7
+
8
+ const STATUS_DISABLED = 'Deactivated';
9
+ const STATUS_ENABLED = 'Activated';
10
+
11
+ /**
12
+ * Override method.
13
+ */
14
+ protected function _getResource() {
15
+ return false;
16
+ }
17
+
18
+ /**
19
+ * Get id field name
20
+ */
21
+ public function getIdFieldName() {
22
+ return 'id';
23
+ }
24
+
25
+ /**
26
+ * Load configuration object by code
27
+ *
28
+ */
29
+ public function loadBluestoreCronData($code) {
30
+ $this->setId($code);
31
+ $this->setName($code);
32
+
33
+ $global = $this->getBluestoreCronJobXmlData();
34
+ $cronExpr = null;
35
+ if ($global && $global->schedule && $global->schedule->config_path) {
36
+ $cronExpr = Mage::getStoreConfig((string)$global->schedule->config_path);
37
+ }
38
+ if (empty($cronExpr) && $global && $global->schedule && $global->schedule->cron_expr) {
39
+ $cronExpr = (string)$global->schedule->cron_expr;
40
+ }
41
+ if ($cronExpr) {
42
+ $this->setCronExpr($cronExpr);
43
+ }
44
+ if ($global && $global->run && $global->run->model) {
45
+ $this->setModel((string)$global->run->model);
46
+ }
47
+
48
+ $configurable = $this->bluestoreConfigurableCronJobXmlData();
49
+ if ($configurable) {
50
+ if (is_object($configurable->schedule)) {
51
+ if ($configurable && $configurable->schedule && $configurable->schedule->cron_expr) {
52
+ $this->setCronExpr((string)$configurable->schedule->cron_expr);
53
+ }
54
+ }
55
+ if (is_object($configurable->run)) {
56
+ if ($configurable && $configurable->run && $configurable->run->model) {
57
+ $this->setModel((string)$configurable->run->model);
58
+ }
59
+ }
60
+ }
61
+
62
+ if (!$this->getModel()) {
63
+ Mage::throwException(sprintf('No configuration found for code "%s"', $code));
64
+ }
65
+
66
+ $disabledCrons = Mage::helper('connection')->trimExplode(',', Mage::getStoreConfig('system/cron/disabled_crons'), true);
67
+ $this->setStatus(in_array($this->getId(), $disabledCrons) ? self::STATUS_DISABLED : self::STATUS_ENABLED);
68
+
69
+ return $this;
70
+ }
71
+
72
+ /**
73
+ * Get global crontab job xml configuration
74
+ */
75
+ protected function getBluestoreCronJobXmlData() {
76
+ return $this->getJobXmlConfig('crontab/jobs');
77
+ }
78
+
79
+ /**
80
+ * Get configurable crontab job xml configuration
81
+ */
82
+ protected function bluestoreConfigurableCronJobXmlData() {
83
+ return $this->getJobXmlConfig('default/crontab/jobs');
84
+ }
85
+
86
+ /**
87
+ * Get job xml configuration
88
+ *
89
+ */
90
+ protected function getJobXmlConfig($path) {
91
+ $xmlConfig = false;
92
+ $config = Mage::getConfig()->getNode($path);
93
+ if ($config instanceof Mage_Core_Model_Config_Element) {
94
+ $xmlConfig = $config->{$this->getId()};
95
+ }
96
+ return $xmlConfig;
97
+ }
98
+
99
+ }
app/code/local/Bluefish/Connection/Model/Validationcrontime.php CHANGED
@@ -37,7 +37,8 @@ class Bluefish_Connection_Model_Validationcrontime extends Mage_Adminhtml_Model_
37
  protected function _beforeSave()
38
  {
39
  $value = $this->getValue();
40
- $connection = Mage::getSingleton('core/resource')->getConnection('core_write');
 
41
 
42
  if (is_array($value)) {
43
  unset($value['__empty']);
@@ -46,54 +47,56 @@ class Bluefish_Connection_Model_Validationcrontime extends Mage_Adminhtml_Model_
46
  $cronPath = $this->getPath();
47
  $loopCounter = count($value);
48
 
49
- $resultPath = $connection->query("select id,loopCounter from bluefish_cron_schedule WHERE cronPath = '".$cronPath."'");
50
  $resultCronPath = $resultPath->fetchAll(PDO::FETCH_ASSOC);
51
 
52
- if(count($resultCronPath) == 0 || $resultCronPath[0][loopCounter] == '0')
53
- {
54
- $doc = new DOMDocument();
55
- $varpath = dirname(dirname(dirname(__FILE__)));
56
- $xmlFile = "$varpath/Connection/etc/config.xml";
57
- $doc->load($xmlFile);
58
 
59
- switch ($cronPath)
60
- {
61
- case "mycustom_section/mycustom_category_group/mycustom_category_defaultminuteschedule":
62
- $markers = $doc->getElementsByTagName('bluefish_connection_category');
63
- break;
64
- case "mycustom_section/mycustom_product_group/mycustom_product_commonschedule":
65
- $markers = $doc->getElementsByTagName('bluefish_connection_product');
66
- break;
67
- case "mycustom_section/mycustom_stock_group/mycustom_stock_commonschedule":
68
- $markers = $doc->getElementsByTagName('bluefish_connection_stock');
69
- break;
70
- case "mycustom_section/mycustom_customer_group/mycustom_customer_commonschedule":
71
- $markers = $doc->getElementsByTagName('bluefish_connection_customer');
72
- $markersCustomer = $doc->getElementsByTagName('bluefish_connection_customerexport');
73
- break;
74
- case "mycustom_section/mycustom_sales_group/mycustom_sales_commonschedule":
75
- $markers = $doc->getElementsByTagName('bluefish_connection_orderexport');
76
- break;
77
- }
78
- $countNum = 0;
79
- foreach($value as $key => $valueconfig)
80
- {
81
- if($countNum == 0)
82
- {
83
- $Hourcronconfig = $valueconfig['Hourcronconfig'];
84
- $Minutecronconfig = $valueconfig['Minutecronconfig'];
85
- }
86
- $countNum++;
87
- }
88
- if($Minutecronconfig == "" && $Hourcronconfig == "")
89
- {
90
- $cron_schedule_time = "0 0 * * *";
91
- }
92
- else
93
  {
94
- $cron_schedule_time = $Minutecronconfig." ".$Hourcronconfig." * * *";
 
95
  }
 
 
 
 
 
 
 
 
 
 
96
 
 
 
 
97
  foreach($markersCustomer as $marker)
98
  {
99
  $type = $marker->getElementsByTagName('cron_expr')->item(0)->nodeValue = $cron_schedule_time;
@@ -108,17 +111,39 @@ class Bluefish_Connection_Model_Validationcrontime extends Mage_Adminhtml_Model_
108
 
109
  if($resultCronPath[0][loopCounter] != '0')
110
  {
111
- $connection->query("INSERT INTO bluefish_cron_schedule(id,cronPath,loopCounter,loopIteration)
112
  VALUES('','".$cronPath."','".$loopCounter."','".$loopIteration."')");
113
  }
114
  else
115
  {
116
- $connection->query("UPDATE bluefish_cron_schedule SET loopCounter= '".$loopCounter."' where cronPath = '".$cronPath."'");
 
 
 
 
117
  }
118
  }
119
  else
120
  {
121
- $connection->query("UPDATE bluefish_cron_schedule SET loopCounter= '".$loopCounter."' where cronPath = '".$cronPath."'");
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
122
  }
123
 
124
  $this->setValue($value);
37
  protected function _beforeSave()
38
  {
39
  $value = $this->getValue();
40
+ $connection = Mage::getSingleton('core/resource')->getConnection('core_write');
41
+ $prefix = Mage::getConfig()->getTablePrefix();
42
 
43
  if (is_array($value)) {
44
  unset($value['__empty']);
47
  $cronPath = $this->getPath();
48
  $loopCounter = count($value);
49
 
50
+ $resultPath = $connection->query("select id,loopCounter,loopIteration from ".$prefix."bluefish_cron_schedule WHERE cronPath = '".$cronPath."'");
51
  $resultCronPath = $resultPath->fetchAll(PDO::FETCH_ASSOC);
52
 
53
+
54
+ $doc = new DOMDocument();
55
+ $varpath = dirname(dirname(dirname(__FILE__)));
56
+ $xmlFile = "$varpath/Connection/etc/config.xml";
57
+ $doc->load($xmlFile);
 
58
 
59
+ switch ($cronPath)
60
+ {
61
+ case "mycustom_section/mycustom_category_group/mycustom_category_defaultminuteschedule":
62
+ $markers = $doc->getElementsByTagName('bluefish_connection_category');
63
+ break;
64
+ case "mycustom_section/mycustom_product_group/mycustom_product_commonschedule":
65
+ $markers = $doc->getElementsByTagName('bluefish_connection_product');
66
+ break;
67
+ case "mycustom_section/mycustom_stock_group/mycustom_stock_commonschedule":
68
+ $markers = $doc->getElementsByTagName('bluefish_connection_stock');
69
+ break;
70
+ case "mycustom_section/mycustom_customer_group/mycustom_customer_commonschedule":
71
+ $markers = $doc->getElementsByTagName('bluefish_connection_customer');
72
+ $markersCustomer = $doc->getElementsByTagName('bluefish_connection_customerexport');
73
+ break;
74
+ case "mycustom_section/mycustom_sales_group/mycustom_sales_commonschedule":
75
+ $markers = $doc->getElementsByTagName('bluefish_connection_orderexport');
76
+ break;
77
+ }
78
+ $countNum = 0;
79
+ foreach($value as $key => $valueconfig)
80
+ {
81
+ if($countNum == 0)
 
 
 
 
 
 
 
 
 
 
 
82
  {
83
+ $Hourcronconfig = $valueconfig['Hourcronconfig'];
84
+ $Minutecronconfig = $valueconfig['Minutecronconfig'];
85
  }
86
+ $countNum++;
87
+ }
88
+ if($Minutecronconfig == "" && $Hourcronconfig == "")
89
+ {
90
+ $cron_schedule_time = "0 0 * * *";
91
+ }
92
+ else
93
+ {
94
+ $cron_schedule_time = $Minutecronconfig." ".$Hourcronconfig." * * *";
95
+ }
96
 
97
+
98
+ if(count($resultCronPath) == 0 || $resultCronPath[0][loopCounter] == '0')
99
+ {
100
  foreach($markersCustomer as $marker)
101
  {
102
  $type = $marker->getElementsByTagName('cron_expr')->item(0)->nodeValue = $cron_schedule_time;
111
 
112
  if($resultCronPath[0][loopCounter] != '0')
113
  {
114
+ $connection->query("INSERT INTO ".$prefix."bluefish_cron_schedule(id,cronPath,loopCounter,loopIteration)
115
  VALUES('','".$cronPath."','".$loopCounter."','".$loopIteration."')");
116
  }
117
  else
118
  {
119
+ if(($loopCounter == '0') || ($resultCronPath[0][loopIteration] > $loopCounter ))
120
+ {
121
+ $connection->query("UPDATE ".$prefix."bluefish_cron_schedule SET loopIteration= '".$loopIteration."' where cronPath = '".$cronPath."'");
122
+ }
123
+ $connection->query("UPDATE ".$prefix."bluefish_cron_schedule SET loopCounter= '".$loopCounter."' where cronPath = '".$cronPath."'");
124
  }
125
  }
126
  else
127
  {
128
+ if(($loopCounter == '0') || ($resultCronPath[0][loopIteration] > $loopCounter ))
129
+ {
130
+ $connection->query("UPDATE ".$prefix."bluefish_cron_schedule SET loopIteration= '0' where cronPath = '".$cronPath."'");
131
+ }
132
+ else if($loopCounter == '1')
133
+ {
134
+ foreach($markersCustomer as $marker)
135
+ {
136
+ $type = $marker->getElementsByTagName('cron_expr')->item(0)->nodeValue = $cron_schedule_time;
137
+ }
138
+ foreach($markers as $marker)
139
+ {
140
+ $type = $marker->getElementsByTagName('cron_expr')->item(0)->nodeValue = $cron_schedule_time;
141
+ }
142
+ $doc->saveXML();
143
+ $doc->save($xmlFile);
144
+ }
145
+
146
+ $connection->query("UPDATE ".$prefix."bluefish_cron_schedule SET loopCounter= '".$loopCounter."' where cronPath = '".$cronPath."'");
147
  }
148
 
149
  $this->setValue($value);
app/code/local/Bluefish/Connection/controllers/Adminhtml/BluestorecronController.php ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Bluefish_Connection_Adminhtml_BluestorecronController extends Mage_Adminhtml_Controller_Action
3
+ {
4
+ public function indexAction() {
5
+ $this->loadLayout();
6
+ $this->_setActiveMenu('connection');
7
+ $this->renderLayout();
8
+ }
9
+
10
+ /**
11
+ * Action for deactivate cron
12
+ */
13
+ public function deactivatecronAction() {
14
+ $codes = $this->getRequest()->getParam('codes');
15
+ $disabledCrons = Mage::helper('connection')->trimExplode(',', Mage::getStoreConfig('system/cron/disabled_crons'), true);
16
+ foreach ($codes as $code) {
17
+ if (!in_array($code, $disabledCrons)) {
18
+ $disabledCrons[] = $code;
19
+ Mage::getSingleton('adminhtml/session')->addSuccess($this->__('"%s" Cron Deactivated', $code));
20
+ }
21
+ }
22
+ Mage::getModel('core/config')->saveConfig('system/cron/disabled_crons/', implode(',', $disabledCrons));
23
+ Mage::app()->getCache()->clean(Zend_Cache::CLEANING_MODE_MATCHING_TAG, array(Mage_Core_Model_Config::CACHE_TAG));
24
+ $this->_redirect('*/*/index');
25
+ }
26
+
27
+ /**
28
+ * Action for Activate cron
29
+ */
30
+ public function activatecronAction() {
31
+ $codes = $this->getRequest()->getParam('codes');
32
+ $disabledCrons = Mage::helper('connection')->trimExplode(',', Mage::getStoreConfig('system/cron/disabled_crons'), true);
33
+ foreach ($codes as $key => $code) {
34
+ if (in_array($code, $disabledCrons)) {
35
+ unset($disabledCrons[array_search($code, $disabledCrons)]);
36
+ Mage::getSingleton('adminhtml/session')->addSuccess($this->__('"%s" Cron Activated', $code));
37
+ }
38
+ }
39
+ Mage::getModel('core/config')->saveConfig('system/cron/disabled_crons/', implode(',', $disabledCrons));
40
+ Mage::app()->getCache()->clean(Zend_Cache::CLEANING_MODE_MATCHING_TAG, array(Mage_Core_Model_Config::CACHE_TAG));
41
+ $this->_redirect('*/*/index');
42
+ }
43
+
44
+ }
app/code/local/Bluefish/Connection/controllers/Adminhtml/BluestoreschedulerController.php ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Monitor Schedule Task controller
4
+ *
5
+ * @author Yuvarj Singh
6
+ */
7
+ class Bluefish_Connection_Adminhtml_BluestoreschedulerController extends Mage_Adminhtml_Controller_Action {
8
+
9
+ public function indexAction() {
10
+ $this->loadLayout();
11
+ $this->_setActiveMenu('connection');
12
+ $this->renderLayout();
13
+
14
+ }
15
+ public function deleteAction() {
16
+ $ids = $this->getRequest()->getParam('schedule_ids');
17
+ foreach ($ids as $id) {
18
+ $schedule = Mage::getModel('cron/schedule')->load($id)->delete();
19
+ }
20
+ Mage::getSingleton('adminhtml/session')->addSuccess($this->__('Deleted task(s) "%s"', implode(', ', $ids)));
21
+ $this->_redirect('*/*/index');
22
+ }
23
+ }
app/code/local/Bluefish/Connection/controllers/Adminhtml/CategorydataController.php CHANGED
@@ -8,6 +8,7 @@ class Bluefish_Connection_Adminhtml_CategorydataController extends Mage_Adminhtm
8
  public function indexAction()
9
  {
10
  $connection = Mage::getSingleton('core/resource')->getConnection('core_write');
 
11
  extract($_GET);
12
  extract($_REQUEST);
13
  $error = "";
@@ -22,13 +23,13 @@ class Bluefish_Connection_Adminhtml_CategorydataController extends Mage_Adminhtm
22
  $error .= "Please enter Magento Category ID.<br>";
23
  if($error == "")
24
  {
25
- $resultExist = $connection->query("select * from bluefish_category WHERE (code = '".$txtAddCode."' OR category_id = '".$txtAddCategoryID."')");
26
  $resultExistSet = $resultExist->fetchAll(PDO::FETCH_ASSOC);
27
  $numberExistRows = count($resultExistSet);
28
 
29
  if($numberExistRows == 0)
30
  {
31
- $connection->query("INSERT INTO bluefish_category(connection_id,code,category_id,created_time,update_time)
32
  VALUES('','".$txtAddCode."','".$txtAddCategoryID."','".now()."','')");
33
  $txtAddCode = "";
34
  $txtAddCategoryID = "";
@@ -48,13 +49,13 @@ class Bluefish_Connection_Adminhtml_CategorydataController extends Mage_Adminhtm
48
  $errorupdate .= "Please enter Magento Category ID.<br>";
49
  if($errorupdate == "")
50
  {
51
- $resultupdate = $connection->query("select * from bluefish_category WHERE (code = '".$txtEditCode."' OR category_id = '".$txtEditCategoryID."') and connection_id != '".$hdnEditCustomerID."'");
52
  $resultUpdateSet = $resultupdate->fetchAll(PDO::FETCH_ASSOC);
53
  $numberUpdateRows = count($resultUpdateSet);
54
 
55
  if($numberUpdateRows == 0)
56
  {
57
- $connection->query("UPDATE bluefish_category SET code= '".$txtEditCode."',category_id= '".$txtEditCategoryID."' where connection_id = '".$hdnEditCustomerID."'");
58
  $success .= "Record successfully Updated.<br>";
59
  }
60
  else
@@ -65,10 +66,10 @@ class Bluefish_Connection_Adminhtml_CategorydataController extends Mage_Adminhtm
65
  ##### Delete Condition
66
  if($_GET["Action"] == "Del")
67
  {
68
- $connection->query("DELETE FROM bluefish_category where connection_id = '".$_GET[ConnectionID]."'");
69
  }
70
 
71
- $result = $connection->query("select * from bluefish_category");
72
  $resultSet = $result->fetchAll(PDO::FETCH_ASSOC);
73
  $numberRows = count($resultSet);
74
  ?>
8
  public function indexAction()
9
  {
10
  $connection = Mage::getSingleton('core/resource')->getConnection('core_write');
11
+ $prefix = Mage::getConfig()->getTablePrefix();
12
  extract($_GET);
13
  extract($_REQUEST);
14
  $error = "";
23
  $error .= "Please enter Magento Category ID.<br>";
24
  if($error == "")
25
  {
26
+ $resultExist = $connection->query("select * from ".$prefix."bluefish_category WHERE (code = '".$txtAddCode."' OR category_id = '".$txtAddCategoryID."')");
27
  $resultExistSet = $resultExist->fetchAll(PDO::FETCH_ASSOC);
28
  $numberExistRows = count($resultExistSet);
29
 
30
  if($numberExistRows == 0)
31
  {
32
+ $connection->query("INSERT INTO ".$prefix."bluefish_category(connection_id,code,category_id,created_time,update_time)
33
  VALUES('','".$txtAddCode."','".$txtAddCategoryID."','".now()."','')");
34
  $txtAddCode = "";
35
  $txtAddCategoryID = "";
49
  $errorupdate .= "Please enter Magento Category ID.<br>";
50
  if($errorupdate == "")
51
  {
52
+ $resultupdate = $connection->query("select * from ".$prefix."bluefish_category WHERE (code = '".$txtEditCode."' OR category_id = '".$txtEditCategoryID."') and connection_id != '".$hdnEditCustomerID."'");
53
  $resultUpdateSet = $resultupdate->fetchAll(PDO::FETCH_ASSOC);
54
  $numberUpdateRows = count($resultUpdateSet);
55
 
56
  if($numberUpdateRows == 0)
57
  {
58
+ $connection->query("UPDATE ".$prefix."bluefish_category SET code= '".$txtEditCode."',category_id= '".$txtEditCategoryID."' where connection_id = '".$hdnEditCustomerID."'");
59
  $success .= "Record successfully Updated.<br>";
60
  }
61
  else
66
  ##### Delete Condition
67
  if($_GET["Action"] == "Del")
68
  {
69
+ $connection->query("DELETE FROM ".$prefix."bluefish_category where connection_id = '".$_GET[ConnectionID]."'");
70
  }
71
 
72
+ $result = $connection->query("select * from ".$prefix."bluefish_category");
73
  $resultSet = $result->fetchAll(PDO::FETCH_ASSOC);
74
  $numberRows = count($resultSet);
75
  ?>
app/code/local/Bluefish/Connection/controllers/Adminhtml/MyformController.php CHANGED
@@ -287,6 +287,7 @@ class Bluefish_Connection_Adminhtml_MyformController extends Mage_Adminhtml_Cont
287
  $xmlData = $xmlObj->getNode();
288
 
289
  $connection = Mage::getSingleton('core/resource')->getConnection('core_write');
 
290
 
291
  $ResposeData = $xmlData->transactionsBatch;
292
 
@@ -296,7 +297,7 @@ class Bluefish_Connection_Adminhtml_MyformController extends Mage_Adminhtml_Cont
296
  if($row->batchSuccess == "true")
297
  {
298
  $code = strval($row->transaction['docNo']);
299
- $connection->query("INSERT INTO bluefish_sale_post(id,order_id,posted_time)
300
  VALUES('','".$code."','".now()."')");
301
  $countSuccess++;
302
  }
@@ -370,6 +371,7 @@ class Bluefish_Connection_Adminhtml_MyformController extends Mage_Adminhtml_Cont
370
  $xmlData = $xmlObj->getNode();
371
 
372
  $connection = Mage::getSingleton('core/resource')->getConnection('core_write');
 
373
 
374
  $responseCode = $xmlData->transactionsBatch->batchSuccess;
375
  $ResposeData = $xmlData->transactionsBatch;
@@ -378,7 +380,7 @@ class Bluefish_Connection_Adminhtml_MyformController extends Mage_Adminhtml_Cont
378
  {
379
  $code = strval($row->transaction['docNo']);
380
  $bluestoreRef = $row->transaction->bluestoreRef;
381
- $CustomerUpdate = $connection->query("UPDATE bluefish_customer SET customer_code= '".$bluestoreRef."' where customer_id = '".$code."'");
382
  }
383
  return $responseCode;
384
  }
@@ -546,8 +548,9 @@ class Bluefish_Connection_Adminhtml_MyformController extends Mage_Adminhtml_Cont
546
  $extraStoreCode = $stock_credentials['mycustom_bluestorecode'];
547
 
548
  $connection = Mage::getSingleton('core/resource')->getConnection('core_write');
 
549
 
550
- $resultCoreConfig = $connection->query("select value from core_config_data where path = 'mycustom_section/mycustom_stock_group/mycustom_currentstockversion'");
551
  $resultSetCoreConfig = $resultCoreConfig->fetchAll(PDO::FETCH_ASSOC);
552
 
553
  $numberCoreConfig = count($resultSetCoreConfig);
287
  $xmlData = $xmlObj->getNode();
288
 
289
  $connection = Mage::getSingleton('core/resource')->getConnection('core_write');
290
+ $prefix = Mage::getConfig()->getTablePrefix();
291
 
292
  $ResposeData = $xmlData->transactionsBatch;
293
 
297
  if($row->batchSuccess == "true")
298
  {
299
  $code = strval($row->transaction['docNo']);
300
+ $connection->query("INSERT INTO ".$prefix."bluefish_sale_post(id,order_id,posted_time)
301
  VALUES('','".$code."','".now()."')");
302
  $countSuccess++;
303
  }
371
  $xmlData = $xmlObj->getNode();
372
 
373
  $connection = Mage::getSingleton('core/resource')->getConnection('core_write');
374
+ $prefix = Mage::getConfig()->getTablePrefix();
375
 
376
  $responseCode = $xmlData->transactionsBatch->batchSuccess;
377
  $ResposeData = $xmlData->transactionsBatch;
380
  {
381
  $code = strval($row->transaction['docNo']);
382
  $bluestoreRef = $row->transaction->bluestoreRef;
383
+ $CustomerUpdate = $connection->query("UPDATE ".$prefix."bluefish_customer SET customer_code= '".$bluestoreRef."' where customer_id = '".$code."'");
384
  }
385
  return $responseCode;
386
  }
548
  $extraStoreCode = $stock_credentials['mycustom_bluestorecode'];
549
 
550
  $connection = Mage::getSingleton('core/resource')->getConnection('core_write');
551
+ $prefix = Mage::getConfig()->getTablePrefix();
552
 
553
+ $resultCoreConfig = $connection->query("select value from ".$prefix."core_config_data where path = 'mycustom_section/mycustom_stock_group/mycustom_currentstockversion'");
554
  $resultSetCoreConfig = $resultCoreConfig->fetchAll(PDO::FETCH_ASSOC);
555
 
556
  $numberCoreConfig = count($resultSetCoreConfig);
app/code/local/Bluefish/Connection/controllers/Adminhtml/MyformexportController.php CHANGED
@@ -84,7 +84,7 @@ class Bluefish_Connection_Adminhtml_MyformexportController extends Mage_Adminhtm
84
  $xmlData = $xmlObj->getNode();
85
 
86
  $connection = Mage::getSingleton('core/resource')->getConnection('core_write');
87
-
88
  $ResposeData = $xmlData->transactionsBatch;
89
 
90
  $countSuccess = 0;
@@ -93,7 +93,7 @@ class Bluefish_Connection_Adminhtml_MyformexportController extends Mage_Adminhtm
93
  if($row->batchSuccess == "true")
94
  {
95
  $code = strval($row->transaction['docNo']);
96
- $connection->query("INSERT INTO bluefish_sale_post(id,order_id,posted_time)
97
  VALUES('','".$code."','".now()."')");
98
  $countSuccess++;
99
  }
@@ -167,6 +167,7 @@ class Bluefish_Connection_Adminhtml_MyformexportController extends Mage_Adminhtm
167
  $xmlData = $xmlObj->getNode();
168
 
169
  $connection = Mage::getSingleton('core/resource')->getConnection('core_write');
 
170
 
171
  $responseCode = $xmlData->transactionsBatch->batchSuccess;
172
  $ResposeData = $xmlData->transactionsBatch;
@@ -175,7 +176,7 @@ class Bluefish_Connection_Adminhtml_MyformexportController extends Mage_Adminhtm
175
  {
176
  $code = strval($row->transaction['docNo']);
177
  $bluestoreRef = $row->transaction->bluestoreRef;
178
- $CustomerUpdate = $connection->query("UPDATE bluefish_customer SET customer_code= '".$bluestoreRef."' where customer_id = '".$code."'");
179
  }
180
  return $responseCode;
181
  }
84
  $xmlData = $xmlObj->getNode();
85
 
86
  $connection = Mage::getSingleton('core/resource')->getConnection('core_write');
87
+ $prefix = Mage::getConfig()->getTablePrefix();
88
  $ResposeData = $xmlData->transactionsBatch;
89
 
90
  $countSuccess = 0;
93
  if($row->batchSuccess == "true")
94
  {
95
  $code = strval($row->transaction['docNo']);
96
+ $connection->query("INSERT INTO ".$prefix."bluefish_sale_post(id,order_id,posted_time)
97
  VALUES('','".$code."','".now()."')");
98
  $countSuccess++;
99
  }
167
  $xmlData = $xmlObj->getNode();
168
 
169
  $connection = Mage::getSingleton('core/resource')->getConnection('core_write');
170
+ $prefix = Mage::getConfig()->getTablePrefix();
171
 
172
  $responseCode = $xmlData->transactionsBatch->batchSuccess;
173
  $ResposeData = $xmlData->transactionsBatch;
176
  {
177
  $code = strval($row->transaction['docNo']);
178
  $bluestoreRef = $row->transaction->bluestoreRef;
179
+ $CustomerUpdate = $connection->query("UPDATE ".$prefix."bluefish_customer SET customer_code= '".$bluestoreRef."' where customer_id = '".$code."'");
180
  }
181
  return $responseCode;
182
  }
app/code/local/Bluefish/Connection/controllers/Adminhtml/ProductdataController.php CHANGED
@@ -8,6 +8,7 @@ class Bluefish_Connection_Adminhtml_ProductdataController extends Mage_Adminhtml
8
  public function indexAction()
9
  {
10
  $connection = Mage::getSingleton('core/resource')->getConnection('core_write');
 
11
  extract($_GET);
12
  extract($_REQUEST);
13
  $error = "";
@@ -25,13 +26,13 @@ class Bluefish_Connection_Adminhtml_ProductdataController extends Mage_Adminhtml
25
 
26
  if($error == "")
27
  {
28
- $resultExist = $connection->query("select * from bluefish_product WHERE (product_code = '".$txtAddCode."' OR product_id = '".$txtAddCategoryID."')");
29
  $resultExistSet = $resultExist->fetchAll(PDO::FETCH_ASSOC);
30
  $numberExistRows = count($resultExistSet);
31
 
32
  if($numberExistRows == 0)
33
  {
34
- $connection->query("INSERT INTO bluefish_product(id,product_code,category_id,product_id,created_time,update_time)
35
  VALUES('','".$txtAddCode."' ,'".$txtAddMagentoCategoryID."' ,'".$txtAddCategoryID."','".now()."','')");
36
  $txtAddCode = "";
37
  $txtAddCategoryID = "";
@@ -54,13 +55,13 @@ class Bluefish_Connection_Adminhtml_ProductdataController extends Mage_Adminhtml
54
 
55
  if($errorupdate == "")
56
  {
57
- $resultupdate = $connection->query("select * from bluefish_product WHERE (product_code = '".$txtEditCode."' OR product_id = '".$txtEditCategoryID."') and id != '".$hdnEditCustomerID."'");
58
  $resultUpdateSet = $resultupdate->fetchAll(PDO::FETCH_ASSOC);
59
  $numberUpdateRows = count($resultUpdateSet);
60
 
61
  if($numberUpdateRows == 0)
62
  {
63
- $connection->query("UPDATE bluefish_product SET product_code= '".$txtEditCode."',category_id= '".$txtMagentoCategoryID."',product_id= '".$txtEditCategoryID."' where id = '".$hdnEditCustomerID."'");
64
  $success .= "Record successfully Updated.<br>";
65
  }
66
  else
@@ -71,10 +72,10 @@ class Bluefish_Connection_Adminhtml_ProductdataController extends Mage_Adminhtml
71
  ##### Delete Condition
72
  if($_GET["Action"] == "Del")
73
  {
74
- $connection->query("DELETE FROM bluefish_product where id = '".$_GET[ConnectionID]."'");
75
  }
76
 
77
- $result = $connection->query("select * from bluefish_product");
78
  $resultSet = $result->fetchAll(PDO::FETCH_ASSOC);
79
  $numberRows = count($resultSet);
80
  ?>
8
  public function indexAction()
9
  {
10
  $connection = Mage::getSingleton('core/resource')->getConnection('core_write');
11
+ $prefix = Mage::getConfig()->getTablePrefix();
12
  extract($_GET);
13
  extract($_REQUEST);
14
  $error = "";
26
 
27
  if($error == "")
28
  {
29
+ $resultExist = $connection->query("select * from ".$prefix."bluefish_product WHERE (product_code = '".$txtAddCode."' OR product_id = '".$txtAddCategoryID."')");
30
  $resultExistSet = $resultExist->fetchAll(PDO::FETCH_ASSOC);
31
  $numberExistRows = count($resultExistSet);
32
 
33
  if($numberExistRows == 0)
34
  {
35
+ $connection->query("INSERT INTO ".$prefix."bluefish_product(id,product_code,category_id,product_id,created_time,update_time)
36
  VALUES('','".$txtAddCode."' ,'".$txtAddMagentoCategoryID."' ,'".$txtAddCategoryID."','".now()."','')");
37
  $txtAddCode = "";
38
  $txtAddCategoryID = "";
55
 
56
  if($errorupdate == "")
57
  {
58
+ $resultupdate = $connection->query("select * from ".$prefix."bluefish_product WHERE (product_code = '".$txtEditCode."' OR product_id = '".$txtEditCategoryID."') and id != '".$hdnEditCustomerID."'");
59
  $resultUpdateSet = $resultupdate->fetchAll(PDO::FETCH_ASSOC);
60
  $numberUpdateRows = count($resultUpdateSet);
61
 
62
  if($numberUpdateRows == 0)
63
  {
64
+ $connection->query("UPDATE ".$prefix."bluefish_product SET product_code= '".$txtEditCode."',category_id= '".$txtMagentoCategoryID."',product_id= '".$txtEditCategoryID."' where id = '".$hdnEditCustomerID."'");
65
  $success .= "Record successfully Updated.<br>";
66
  }
67
  else
72
  ##### Delete Condition
73
  if($_GET["Action"] == "Del")
74
  {
75
+ $connection->query("DELETE FROM ".$prefix."bluefish_product where id = '".$_GET[ConnectionID]."'");
76
  }
77
 
78
+ $result = $connection->query("select * from ".$prefix."bluefish_product");
79
  $resultSet = $result->fetchAll(PDO::FETCH_ASSOC);
80
  $numberRows = count($resultSet);
81
  ?>
app/code/local/Bluefish/Connection/controllers/Adminhtml/Xml.php CHANGED
@@ -13,8 +13,9 @@ function cron_insert_update2()
13
  $xmlFile = "$varpath/etc/config.xml";
14
  $doc->load($xmlFile);
15
  $connection = Mage::getSingleton('core/resource')->getConnection('core_write');
 
16
 
17
- $resultStock = $connection->query("select id,loopCounter,loopIteration from bluefish_cron_schedule WHERE cronPath = 'mycustom_section/mycustom_stock_group/mycustom_stock_commonschedule'");
18
  $resultStockIteration = $resultStock->fetchAll(PDO::FETCH_ASSOC);
19
  $StockIterationCounter = $resultStockIteration[0][loopCounter];
20
  $StockCounterDB = $resultStockIteration[0][loopIteration];
@@ -49,7 +50,7 @@ function cron_insert_update2()
49
 
50
  $Stock_cron_schedule_time = $Minutecronconfig." ".$Hourcronconfig." * * *";
51
 
52
- $connection->query("UPDATE bluefish_cron_schedule SET loopIteration= '".$counterDB."' where id = '".$resultStockIteration[0][id]."'");
53
 
54
  $markers=$doc->getElementsByTagName('bluefish_connection_stock');
55
  foreach ($markers as $marker)
@@ -79,8 +80,9 @@ function cron_insert_update1()
79
  $xmlFile = "$varpath/etc/config.xml";
80
  $doc->load($xmlFile);
81
  $connection = Mage::getSingleton('core/resource')->getConnection('core_write');
 
82
 
83
- $resultProduct = $connection->query("select id,loopCounter,loopIteration from bluefish_cron_schedule WHERE cronPath = 'mycustom_section/mycustom_product_group/mycustom_product_commonschedule'");
84
  $resultProductIteration = $resultProduct->fetchAll(PDO::FETCH_ASSOC);
85
  $ProductIterationCounter = $resultProductIteration[0][loopCounter];
86
  $ProductCounterDB = $resultProductIteration[0][loopIteration];
@@ -115,7 +117,7 @@ function cron_insert_update1()
115
 
116
  $Product_cron_schedule_time = $Minutecronconfig." ".$Hourcronconfig." * * *";
117
 
118
- $connection->query("UPDATE bluefish_cron_schedule SET loopIteration= '".$counterDB."' where id = '".$resultProductIteration[0][id]."'");
119
 
120
  $markers=$doc->getElementsByTagName('bluefish_connection_product');
121
  foreach ($markers as $marker)
@@ -144,8 +146,9 @@ function cron_insert_update()
144
  $xmlFile = "$varpath/etc/config.xml";
145
  $doc->load($xmlFile);
146
  $connection = Mage::getSingleton('core/resource')->getConnection('core_write');
 
147
 
148
- $resultCategory = $connection->query("select id,loopCounter,loopIteration from bluefish_cron_schedule WHERE cronPath = 'mycustom_section/mycustom_category_group/mycustom_category_defaultminuteschedule'");
149
  $resultCategoryIteration = $resultCategory->fetchAll(PDO::FETCH_ASSOC);
150
  $categoryIterationCounter = $resultCategoryIteration[0][loopCounter];
151
  $categoryCounterDB = $resultCategoryIteration[0][loopIteration];
@@ -180,7 +183,7 @@ function cron_insert_update()
180
 
181
  $category_cron_schedule_time = $Minutecronconfig." ".$Hourcronconfig." * * *";
182
 
183
- $connection->query("UPDATE bluefish_cron_schedule SET loopIteration= '".$counterDB."' where id = '".$resultCategoryIteration[0][id]."'");
184
 
185
  $markers = $doc->getElementsByTagName('bluefish_connection_category');
186
 
@@ -211,8 +214,9 @@ try
211
  $xmlFile = "$varpath/etc/config.xml";
212
  $doc->load($xmlFile);
213
  $connection = Mage::getSingleton('core/resource')->getConnection('core_write');
 
214
 
215
- $resultCustomer = $connection->query("select id,loopCounter,loopIteration from bluefish_cron_schedule WHERE cronPath = 'mycustom_section/mycustom_customer_group/mycustom_customer_commonschedule'");
216
  $resultCustomerIteration = $resultCustomer->fetchAll(PDO::FETCH_ASSOC);
217
  $CustomerIterationCounter = $resultCustomerIteration[0][loopCounter];
218
  $CustomerCounterDB = $resultCustomerIteration[0][loopIteration];
@@ -247,7 +251,7 @@ try
247
 
248
  $Customer_cron_schedule_time = $Minutecronconfig." ".$Hourcronconfig." * * *";
249
 
250
- $connection->query("UPDATE bluefish_cron_schedule SET loopIteration= '".$counterDB."' where id = '".$resultCustomerIteration[0][id]."'");
251
 
252
  $markers=$doc->getElementsByTagName('bluefish_connection_customer');
253
  $markersexport =$doc->getElementsByTagName('bluefish_connection_customerexport');
@@ -393,7 +397,8 @@ function insert_update_database2()
393
  if(count($xmlData) > 0)
394
  {
395
  $versionVal = max($updatesversionVal);
396
- $coreConfigUpdate = $connection->query("UPDATE core_config_data SET value = '".$versionVal."' where path = 'mycustom_section/mycustom_stock_group/mycustom_currentstockversion'");
 
397
  }
398
 
399
  $flag = "success";
@@ -423,8 +428,9 @@ function insert_update_database1()
423
  Mage::log('Product Import started ......', null, './Bluestore_product.log.text');
424
 
425
  $connection = Mage::getSingleton('core/resource')->getConnection('core_write');
 
426
 
427
- $resultPath = $connection->query("select value from core_config_data WHERE path = 'mycustom_section/mycustom_category_group/mycustom_category_mapping_direct'");
428
  $resultCronPath = $resultPath->fetchAll(PDO::FETCH_ASSOC);
429
  $numberRowsConfig= count($resultCronPath);
430
 
@@ -453,7 +459,7 @@ function insert_update_database1()
453
  {
454
  if($unserielVal['#{_id}']['Dbmapping'] == 'Mapping')
455
  {
456
- $result = $connection->query("select code,category_id from bluefish_category WHERE code = '".$categoryCode."'");
457
  $resultSet = $result->fetchAll(PDO::FETCH_ASSOC);
458
  $numberRows = count($resultSet);
459
 
@@ -461,7 +467,7 @@ function insert_update_database1()
461
  {
462
  try
463
  {
464
- $resultProduct = $connection->query("select product_code,product_id,category_id from bluefish_product WHERE product_code = '".$codeSKU."'");
465
  $resultSetProduct = $resultProduct->fetchAll(PDO::FETCH_ASSOC);
466
  $numberProductRows = count($resultSetProduct);
467
 
@@ -502,7 +508,7 @@ function insert_update_database1()
502
  'tax_class_id' => 1
503
  )));
504
 
505
- $resultInSert = $connection->query("INSERT INTO bluefish_product(id,category_id,product_id,product_code,created_time,update_time)
506
  VALUES('','".$resultSet[0][category_id]."','".$ProductID."','".$codeSKU."','".now()."','')");
507
  }
508
  catch(Exception $e)
@@ -523,14 +529,14 @@ function insert_update_database1()
523
  'name' => "$name",
524
  'price' => "$price"
525
  )));
526
- $resultUpdate = $connection->query("UPDATE bluefish_product SET update_time= '".now()."' where product_code = '".$codeSKU."'");
527
  }
528
  catch(Exception $e)
529
  {
530
  $flag = $e->getMessage();
531
  if($flag == "Product not exists.")
532
  {
533
- $result = $connection->query("delete from bluefish_product WHERE product_code = '".$codeSKU."'");
534
 
535
  try
536
  {
@@ -549,7 +555,7 @@ function insert_update_database1()
549
  'tax_class_id' => 1
550
  )));
551
 
552
- $resultInSert = $connection->query("INSERT INTO bluefish_product(id,category_id,product_id,product_code,created_time,update_time)
553
  VALUES('','".$resultSet[0][category_id]."','".$ProductID."','".$codeSKU."','".now()."','')");
554
  }
555
  catch(Exception $e)
@@ -575,7 +581,7 @@ function insert_update_database1()
575
  }
576
  if($unserielVal['#{_id}']['Dbmapping'] == 'Direct')
577
  {
578
- $resultDirect = $connection->query("select code,category_id from bluefish_category WHERE code = '".$categoryCode."'");
579
  $resultSetDirect = $resultDirect->fetchAll(PDO::FETCH_ASSOC);
580
  $numberRowsDirect = count($resultSetDirect);
581
 
@@ -692,8 +698,9 @@ function insert_update_database()
692
  Mage::log('Category Import started ......', null, './Bluestore_category.log.text');
693
 
694
  $connection = Mage::getSingleton('core/resource')->getConnection('core_write');
 
695
 
696
- $resultPath = $connection->query("select value from core_config_data WHERE path = 'mycustom_section/mycustom_category_group/mycustom_category_mapping_direct'");
697
  $resultCronPath = $resultPath->fetchAll(PDO::FETCH_ASSOC);
698
  $numberRows = count($resultCronPath);
699
 
@@ -733,7 +740,7 @@ function insert_update_database()
733
 
734
  if($deleted == "false")
735
  {
736
- $result = $connection->query("select code,category_id from bluefish_category WHERE code = '".$code."'");
737
  $resultSet = $result->fetchAll(PDO::FETCH_ASSOC);
738
  $numberRows = count($resultSet);
739
 
@@ -751,7 +758,7 @@ function insert_update_database()
751
  'available_sort_by'=>'price',
752
  'default_sort_by'=>'price'
753
  )));
754
- $result = $connection->query("INSERT INTO bluefish_category(connection_id,code,category_id,created_time,update_time)
755
  VALUES('','".$code."','".$newCategoryId."','".now()."','')");
756
  }
757
  catch(Exception $e)
@@ -771,14 +778,14 @@ function insert_update_database()
771
  'available_sort_by'=>'price',
772
  'default_sort_by'=>'price'
773
  )));
774
- $result = $connection->query("UPDATE bluefish_category SET update_time= '".now()."' where code = '".$code."'");
775
  }
776
  catch(Exception $e)
777
  {
778
  $flag = $e->getMessage();
779
  if($flag == "Category not exists.")
780
  {
781
- $result = $connection->query("delete from bluefish_category WHERE code = '".$code."'");
782
 
783
  try
784
  {
@@ -790,7 +797,7 @@ function insert_update_database()
790
  'available_sort_by'=>'price',
791
  'default_sort_by'=>'price'
792
  )));
793
- $result = $connection->query("INSERT INTO bluefish_category(connection_id,code,category_id,created_time,update_time)
794
  VALUES('','".$code."','".$newCategoryId."','".now()."','')");
795
  }
796
  catch(Exception $e)
@@ -826,7 +833,7 @@ function insert_update_database()
826
  'available_sort_by'=>'price',
827
  'default_sort_by'=>'price'
828
  )));
829
- $result = $connection->query("INSERT INTO bluefish_category(connection_id,code,category_id,created_time,update_time)
830
  VALUES('','".$code."','".$newCategoryId."','".now()."','')");
831
  }
832
  catch(Exception $e)
@@ -863,7 +870,7 @@ function insert_update_database()
863
  'available_sort_by'=>'price',
864
  'default_sort_by'=>'price'
865
  )));
866
- $result = $connection->query("INSERT INTO bluefish_category(connection_id,code,category_id,created_time,update_time)
867
  VALUES('','".$code."','".$newCategoryId."','".now()."','')");
868
  }
869
  catch(Exception $e)
@@ -890,14 +897,14 @@ function insert_update_database()
890
  'default_sort_by'=>'price'
891
  )));
892
 
893
- $result = $connection->query("UPDATE bluefish_category SET update_time= '".now()."' where code = '".$code."'");
894
  }
895
  catch(Exception $e)
896
  {
897
  $flag = $e->getMessage();
898
  if($flag == "Category not exists.")
899
  {
900
- $result = $connection->query("delete from bluefish_category WHERE code = '".$code."'");
901
 
902
  try
903
  {
@@ -909,7 +916,7 @@ function insert_update_database()
909
  'available_sort_by'=>'price',
910
  'default_sort_by'=>'price'
911
  )));
912
- $result = $connection->query("INSERT INTO bluefish_category(connection_id,code,category_id,created_time,update_time)
913
  VALUES('','".$code."','".$newCategoryId."','".now()."','')");
914
  }
915
  catch(Exception $e)
@@ -988,7 +995,9 @@ function insert_update_database3()
988
  $email = $xmlData->customer[$i]->address->email;
989
 
990
  $connection = Mage::getSingleton('core/resource')->getConnection('core_write');
991
- $result = $connection->query("SELECT id,customer_id,address_id FROM `bluefish_customer` WHERE customer_code = '".$code."'");
 
 
992
 
993
  $resultSet = $result->fetchAll(PDO::FETCH_ASSOC);
994
  $numberRows = count($resultSet);
@@ -997,7 +1006,7 @@ function insert_update_database3()
997
  {
998
  try
999
  {
1000
- $customerID = $soap->call($sessionId,'customer.create',array(array('email' => "$email", 'firstname' => "$firstName", 'lastname' => "$lastName", 'website_id' => 1, 'store_id' => 1, 'group_id' => 1,'created_at'=> "$createdOn")));
1001
  $address_id = "";
1002
 
1003
  if(($city != "") && ($postalCode !="") && ($phone1 != "") && ($street1 != ""))
@@ -1017,7 +1026,7 @@ function insert_update_database3()
1017
  Mage::log('Customer : '.$customerID.' address not created. City, Postal Code, Phone Number OR Street address is blank.', null, './Bluestore_customer.log.text');
1018
  }
1019
 
1020
- $InsertCus = $connection->query("INSERT INTO bluefish_customer(id,customer_id,address_id,customer_code,created_time,update_time)
1021
  VALUES('','".$customerID."','".$address_id."','".$code."','".now()."','')");
1022
 
1023
  Mage::log('Customer '.$customerID.' Created.', null, './Bluestore_customer.log.text');
@@ -1037,14 +1046,14 @@ function insert_update_database3()
1037
  $customerIdForupadte = $resultSet[0]['customer_id'];
1038
  $addressIdForupadte = $resultSet[0]['address_id'];
1039
 
1040
- $customerUpdate = $soap->call($sessionId,'customer.update',array('customerId' => "$customerIdForupadte",'customerData' => array('email' => "$email", 'firstname' => "$firstName", 'lastname' => "$lastName")));
1041
 
1042
  if(($addressIdForupadte > 0) && ($city != "") && ($postalCode !="") && ($phone1 != "") && ($street1 != ""))
1043
  {
1044
  $soap->call($sessionId,'customer_address.update',array('addressId' => "$addressIdForupadte",'addressdata' => array('firstname' => "$firstName", 'lastname' => "$lastName", 'street' => array("$street1", "$street2", "$street3"), 'city' => "$city", 'country_id' => "$country", 'region' => "$stateOrRegion", 'postcode' => "$postalCode", 'telephone' => "$phone1", 'is_default_billing' => "$isBilling", 'is_default_shipping' => "$isDelivery", 'company' => "$companyName", 'prefix' => "$title")));
1045
  }
1046
 
1047
- $CustomerUpdate = $connection->query("UPDATE bluefish_customer SET update_time= '".now()."' where customer_code = '".$code."'");
1048
 
1049
  Mage::log('Customer '.$customerID.' Updated.', null, './Bluestore_customer.log.text');
1050
  $flag = "success";
@@ -1055,11 +1064,11 @@ function insert_update_database3()
1055
 
1056
  if($flag == "Customer not exists.")
1057
  {
1058
- $result = $connection->query("delete from bluefish_customer WHERE customer_code = '".$code."'");
1059
 
1060
  try
1061
  {
1062
- $customerID = $soap->call($sessionId,'customer.create',array(array('email' => "$email", 'firstname' => "$firstName", 'lastname' => "$lastName", 'website_id' => 1, 'store_id' => 1, 'group_id' => 1,'created_at'=> "$createdOn")));
1063
  $address_id = "";
1064
 
1065
  if(($city != "") && ($postalCode !="") && ($phone1 != "") && ($street1 != ""))
@@ -1075,7 +1084,7 @@ function insert_update_database3()
1075
  }
1076
  }
1077
 
1078
- $InsertCus = $connection->query("INSERT INTO bluefish_customer(id,customer_id,address_id,customer_code,created_time,update_time)
1079
  VALUES('','".$customerID."','".$address_id."','".$code."','".now()."','')");
1080
 
1081
  Mage::log('Customer '.$customerID.' Created.', null, './Bluestore_customer.log.text');
@@ -1114,8 +1123,6 @@ function ExportOrderData()
1114
  $credentials_storecode = Mage::getStoreConfig('mycustom_section/mycustom_stock_group');
1115
  $mycustom_bluestorecode = $credentials_storecode['mycustom_bluestorecode'];
1116
 
1117
- $connection = Mage::getSingleton('core/resource')->getConnection('core_write');
1118
-
1119
  $soap = new SoapClient($mage_url);
1120
  $sessionId = $soap->login($mage_user, $mage_api_key);
1121
 
@@ -1128,8 +1135,9 @@ function ExportOrderData()
1128
  $xmlFile = "$varpath/etc/config.xml";
1129
  $doc->load($xmlFile);
1130
  $connection = Mage::getSingleton('core/resource')->getConnection('core_write');
 
1131
 
1132
- $resultSale = $connection->query("select id,loopCounter,loopIteration from bluefish_cron_schedule WHERE cronPath = 'mycustom_section/mycustom_sales_group/mycustom_sales_commonschedule'");
1133
  $resultSaleIteration = $resultSale->fetchAll(PDO::FETCH_ASSOC);
1134
 
1135
  $SaleIterationCounter = $resultSaleIteration[0][loopCounter];
@@ -1165,7 +1173,7 @@ function ExportOrderData()
1165
 
1166
  $Sale_cron_schedule_time = $Minutecronconfig." ".$Hourcronconfig." * * *";
1167
 
1168
- $connection->query("UPDATE bluefish_cron_schedule SET loopIteration= '".$counterDB."' where id = '".$resultSaleIteration[0][id]."'");
1169
 
1170
  $markers=$doc->getElementsByTagName('bluefish_connection_orderexport');
1171
  foreach ($markers as $marker)
@@ -1178,7 +1186,11 @@ function ExportOrderData()
1178
 
1179
  try
1180
  {
1181
- $resultOrderList = $soap->call($sessionId, 'order.list',array(array('status'=>array('eq'=>'complete'))));
 
 
 
 
1182
  }
1183
  catch(Exception $e)
1184
  {
@@ -1200,12 +1212,12 @@ function ExportOrderData()
1200
 
1201
  #if($resultOrderList[$i][increment_id] == "100000002") # This one
1202
  #{ # and this one
1203
- $result = $connection->query("SELECT id FROM `bluefish_sale_post` WHERE order_id = '".$resultOrderList[$i][increment_id]."'");
1204
 
1205
  $resultSet = $result->fetchAll(PDO::FETCH_ASSOC);
1206
  $numberRows = count($resultSet);
1207
 
1208
- $resultCustomer = $connection->query("SELECT id,customer_code FROM `bluefish_customer` WHERE customer_id = '".$resultOrderList[$i][customer_id]."'");
1209
 
1210
  $resultSetCustomer = $resultCustomer->fetchAll(PDO::FETCH_ASSOC);
1211
 
@@ -1250,7 +1262,7 @@ function ExportOrderData()
1250
  }
1251
  }
1252
  }
1253
- if($catchError != "fail")
1254
  {
1255
  if($zz == 0)
1256
  {
@@ -1264,10 +1276,11 @@ function ExportOrderData()
1264
  $customerFullName = $resultOrderList[$i][customer_firstname]." ".$resultOrderList[$i][customer_lastname];
1265
  $docNO = $zz+1;
1266
 
1267
- $AmountsIncludeTax = ($resultOrderList[$i][tax_amount] > 0)?'TRUE':'FALSE';
1268
  $saleAmountIncludeTax = $resultOrderList[$i][total_paid];
1269
 
1270
  $xmlRequest .= "<batch batchNo=\"".$docNO."\">
 
1271
  <transactionSale docNo=\"".$resultOrderList[$i][increment_id]."\">
1272
  <postStockMovements>true</postStockMovements>
1273
  <saleHeader>
@@ -1278,9 +1291,6 @@ function ExportOrderData()
1278
  <endDateTime>".$resultOrderList[$i][updated_at]."</endDateTime>
1279
  <sessionID>".$sessionId."</sessionID>
1280
  <userCode>".$resultcustomer_id."</userCode>
1281
- <userName></userName>
1282
- <userFullName></userFullName>
1283
- <originalTxnCode></originalTxnCode>
1284
  <orderCurrencyCode>".$resultOrderList[$i][base_currency_code]."</orderCurrencyCode>
1285
  <saleAmount>".$saleAmountIncludeTax."</saleAmount>
1286
  <totalTax>".$resultOrderList[$i][tax_amount]."</totalTax>
@@ -1299,21 +1309,24 @@ function ExportOrderData()
1299
  $flag = $e->getMessage();
1300
  Mage::log('Problem in sales_order.info '.$flag.' Exported.', null, './Bluestore_salesorder.log.text');
1301
  }
1302
-
 
 
1303
  $street1Addr = str_ireplace("&", "&#x26;", $resultSalesOrder[shipping_address][street]);
 
1304
  $xmlRequest .= "<customer>
1305
  <countryCode>".$resultSalesOrder[shipping_address][country_id]."</countryCode>
1306
  <customerCode>".$customerCodeafterCheck."</customerCode>
1307
  <email>".$resultSalesOrder[customer_email]."</email>
1308
- <firstName>".$resultSalesOrder[customer_firstname]."</firstName>
1309
- <lastName>".$resultSalesOrder[customer_lastname]."</lastName>
1310
  <postalZipCode>".$resultSalesOrder[shipping_address][postcode]."</postalZipCode>
1311
  <street1>".$street1Addr."</street1>
1312
  <telephone1>".$resultSalesOrder[shipping_address][telephone]."</telephone1>
1313
  <title>".$resultSalesOrder[customer_prefix]."</title>
1314
  <townCity>".$resultSalesOrder[shipping_address][city]."</townCity>
1315
  </customer>
1316
- ";
1317
 
1318
  $ITEM_NUMBER = 0;
1319
  $saleItemChargeAmt = $resultSalesOrder[base_shipping_amount]/count($resultSalesOrder[items]);
@@ -1328,6 +1341,7 @@ function ExportOrderData()
1328
  {
1329
  $flag = $e->getMessage();
1330
  Mage::log('Product for sale item '.$resultSalesOrder[items][$j][product_id].' does not exist. Order# is '.$resultOrderList[$i][increment_id], null, './Bluestore_salesorder.log.text');
 
1331
  }
1332
 
1333
  try
@@ -1340,9 +1354,10 @@ function ExportOrderData()
1340
  {
1341
  $flag = $e->getMessage();
1342
  Mage::log('Problem in catalog_category.info '.$flag.' => '.$resultProduct[categories][0].' Exported.', null, './Bluestore_salesorder.log.text');
 
1343
  }
1344
 
1345
- $resultCategoryCode = $connection->query("SELECT code FROM `bluefish_category` WHERE category_id = '".$resultCategory[category_id]."'");
1346
  $resultSetCatCode = $resultCategoryCode->fetchAll(PDO::FETCH_ASSOC);
1347
  $updateCategoryCode = ($resultSetCatCode[0][code] == "")?$resultCategory[category_id]:$resultSetCatCode[0][code];
1348
 
@@ -1369,6 +1384,11 @@ function ExportOrderData()
1369
 
1370
  $productDescription = str_ireplace("&", "&#x26;", $resultProduct[name]);
1371
  $categoryDescription = str_ireplace("&", "&#x26;", $resultCategory[name]);
 
 
 
 
 
1372
  $xmlRequest .= "<saleItem>
1373
  <itemNumber>".$ITEM_NUMBER."</itemNumber>
1374
  <productCode>".$resultProduct[sku]."</productCode>
@@ -1377,20 +1397,23 @@ function ExportOrderData()
1377
  <categoryDescription>".$categoryDescription."</categoryDescription>
1378
  <price>".$resultSalesOrder[items][$j][price]."</price>
1379
  <currencyCode>".$resultSalesOrder[order_currency_code]."</currencyCode>
1380
- <quantity>".$resultSalesOrder[items][$j][qty_invoiced]."</quantity>
1381
  <unitOfMeasure>EA</unitOfMeasure>
1382
  <finalAmount>".$TotalfinalAmount."</finalAmount>
 
1383
  <saleItemTax>
1384
  <saleItemTaxNo>1</saleItemTaxNo>
1385
  <taxCode>".$TAXCODE_VAL."</taxCode>
1386
  <baseAmount>".$resultSalesOrder[base_tax_amount]."</baseAmount>
1387
  <currencyCode>".$resultSalesOrder[order_currency_code]."</currencyCode>
1388
- <taxRate>".$resultSalesOrder[items][$j][tax_percent]."</taxRate>
1389
- <taxAmount>".$resultSalesOrder[items][$j][tax_amount]."</taxAmount>
1390
  </saleItemTax>
 
 
1391
  <saleItemCharge>
1392
  <saleItemChargeNo>".$ITEM_NUMBER."</saleItemChargeNo>
1393
- <chargeCode>4</chargeCode>
1394
  <chargeDescription>".$resultSalesOrder[shipping_description]."</chargeDescription>
1395
  <level>1</level>
1396
  <type>2</type>
@@ -1400,8 +1423,8 @@ function ExportOrderData()
1400
  <baseAmountCurrency>".$resultSalesOrder[order_currency_code]."</baseAmountCurrency>
1401
  <amount>".$saleItemChargeAmt."</amount>
1402
  </saleItemCharge>
1403
- </saleItem>
1404
- ";
1405
  }
1406
 
1407
  $credentialsPayCode = Mage::getStoreConfig('mycustom_section/mycustom_payment_group');
@@ -1421,16 +1444,19 @@ function ExportOrderData()
1421
  if($PAYMENTCODE_VAL == "")
1422
  $PAYMENTCODE_VAL = "1";
1423
 
1424
- $xmlRequest .= "<payment>
 
 
1425
  <paymentNo>".$resultSalesOrder[increment_id]."</paymentNo>
1426
  <tenderType>2</tenderType>
1427
  <paymentMethodCode>".$PAYMENTCODE_VAL."</paymentMethodCode>
1428
  <amount>".$resultSalesOrder[payment][amount_ordered]."</amount>
1429
  <currencyCode>".$resultSalesOrder[order_currency_code]."</currencyCode>
1430
  </payment>
 
1431
  </transactionSale>
1432
- </batch>
1433
- ";
1434
  $zz++;
1435
  }
1436
 
@@ -1469,7 +1495,6 @@ function ExportCustomerData()
1469
  $mage_api_key = $credentials_auth['mycustom_password'];
1470
  $enterprise_code = '';
1471
 
1472
- $connection = Mage::getSingleton('core/resource')->getConnection('core_write');
1473
  $soap = new SoapClient($mage_url);
1474
  $sessionId = $soap->login($mage_user, $mage_api_key);
1475
 
@@ -1482,8 +1507,9 @@ function ExportCustomerData()
1482
  $xmlFile = "$varpath/etc/config.xml";
1483
  $doc->load($xmlFile);
1484
  $connection = Mage::getSingleton('core/resource')->getConnection('core_write');
 
1485
 
1486
- $resultCustomer = $connection->query("select id,loopCounter,loopIteration from bluefish_cron_schedule WHERE cronPath = 'mycustom_section/mycustom_customer_group/mycustom_customer_commonschedule'");
1487
  $resultCustomerIteration = $resultCustomer->fetchAll(PDO::FETCH_ASSOC);
1488
  $CustomerIterationCounter = $resultCustomerIteration[0][loopCounter];
1489
  $CustomerCounterDB = $resultCustomerIteration[0][loopIteration];
@@ -1518,7 +1544,7 @@ function ExportCustomerData()
1518
 
1519
  $Customer_cron_schedule_time = $Minutecronconfig." ".$Hourcronconfig." * * *";
1520
 
1521
- $connection->query("UPDATE bluefish_cron_schedule SET loopIteration= '".$counterDB."' where id = '".$resultCustomerIteration[0][id]."'");
1522
 
1523
  $markersexport=$doc->getElementsByTagName('bluefish_connection_customerexport');
1524
  $markers=$doc->getElementsByTagName('bluefish_connection_customer');
@@ -1540,12 +1566,12 @@ function ExportCustomerData()
1540
  #exit;
1541
  for($i=0;$i<count($customerList);$i++)
1542
  {
1543
- $result = $connection->query("SELECT id,customer_code FROM `bluefish_customer` WHERE customer_id = '".$customerList[$i][customer_id]."'");
1544
 
1545
  $resultSet = $result->fetchAll(PDO::FETCH_ASSOC);
1546
  $numberRows = count($resultSet);
1547
 
1548
- #if($numberRows == 0)
1549
  #{
1550
  if($zz == 0)
1551
  {
@@ -1564,26 +1590,18 @@ function ExportCustomerData()
1564
  $isCorrespondence = ($customerAddressInfo[0][is_default_shipping] == '1')?'true':'false';
1565
 
1566
  $xmlRequest .= "<batch batchNo=\"".$docNO."\">
 
1567
  <customer docNo=\"".$customerList[$i][customer_id]."\">";
1568
- if($numberRows == 0)
1569
- {
1570
- $xmlRequest .= "<code></code>";
1571
- }
1572
- else
1573
  {
1574
  $xmlRequest .= "<code>".$resultSet[0][customer_code]."</code>";
1575
- }
 
1576
  $xmlRequest .= "<externalRef></externalRef>
1577
  <taxOrVatRef></taxOrVatRef>
 
1578
  <address>";
1579
- if($numberRows == 0)
1580
- {
1581
- $xmlRequest .= "<code></code>";
1582
- }
1583
- else
1584
- {
1585
- $xmlRequest .= "<code>".$resultSet[0][customer_code]."</code>";
1586
- }
1587
  $xmlRequest .= "<isCorrespondence>true</isCorrespondence>
1588
  <isBilling>true</isBilling>
1589
  <isDelivery>true</isDelivery>
@@ -1599,7 +1617,9 @@ function ExportCustomerData()
1599
  <phone1>".$customerAddressInfo[0][telephone]."</phone1>
1600
  <email>".$customerList[$i][email]."</email>
1601
  </address>
 
1602
  </customer>
 
1603
  </batch>
1604
  ";
1605
 
@@ -1611,7 +1631,7 @@ function ExportCustomerData()
1611
 
1612
  if($customerList[$i][firstname] != "" && $customerList[$i][lastname] != "" && $customerList[$i][email] !="" && $numberRows == 0)
1613
  {
1614
- $InsertCustomer = $connection->query("INSERT INTO bluefish_customer(id,customer_id,address_id,created_time)
1615
  VALUES('','".$customerList[$i][customer_id]."','".$customerAddressInfo[0][customer_address_id]."','".now()."')");
1616
  }
1617
  #}
13
  $xmlFile = "$varpath/etc/config.xml";
14
  $doc->load($xmlFile);
15
  $connection = Mage::getSingleton('core/resource')->getConnection('core_write');
16
+ $prefix = Mage::getConfig()->getTablePrefix();
17
 
18
+ $resultStock = $connection->query("select id,loopCounter,loopIteration from ".$prefix."bluefish_cron_schedule WHERE cronPath = 'mycustom_section/mycustom_stock_group/mycustom_stock_commonschedule'");
19
  $resultStockIteration = $resultStock->fetchAll(PDO::FETCH_ASSOC);
20
  $StockIterationCounter = $resultStockIteration[0][loopCounter];
21
  $StockCounterDB = $resultStockIteration[0][loopIteration];
50
 
51
  $Stock_cron_schedule_time = $Minutecronconfig." ".$Hourcronconfig." * * *";
52
 
53
+ $connection->query("UPDATE ".$prefix."bluefish_cron_schedule SET loopIteration= '".$counterDB."' where id = '".$resultStockIteration[0][id]."'");
54
 
55
  $markers=$doc->getElementsByTagName('bluefish_connection_stock');
56
  foreach ($markers as $marker)
80
  $xmlFile = "$varpath/etc/config.xml";
81
  $doc->load($xmlFile);
82
  $connection = Mage::getSingleton('core/resource')->getConnection('core_write');
83
+ $prefix = Mage::getConfig()->getTablePrefix();
84
 
85
+ $resultProduct = $connection->query("select id,loopCounter,loopIteration from ".$prefix."bluefish_cron_schedule WHERE cronPath = 'mycustom_section/mycustom_product_group/mycustom_product_commonschedule'");
86
  $resultProductIteration = $resultProduct->fetchAll(PDO::FETCH_ASSOC);
87
  $ProductIterationCounter = $resultProductIteration[0][loopCounter];
88
  $ProductCounterDB = $resultProductIteration[0][loopIteration];
117
 
118
  $Product_cron_schedule_time = $Minutecronconfig." ".$Hourcronconfig." * * *";
119
 
120
+ $connection->query("UPDATE ".$prefix."bluefish_cron_schedule SET loopIteration= '".$counterDB."' where id = '".$resultProductIteration[0][id]."'");
121
 
122
  $markers=$doc->getElementsByTagName('bluefish_connection_product');
123
  foreach ($markers as $marker)
146
  $xmlFile = "$varpath/etc/config.xml";
147
  $doc->load($xmlFile);
148
  $connection = Mage::getSingleton('core/resource')->getConnection('core_write');
149
+ $prefix = Mage::getConfig()->getTablePrefix();
150
 
151
+ $resultCategory = $connection->query("select id,loopCounter,loopIteration from ".$prefix."bluefish_cron_schedule WHERE cronPath = 'mycustom_section/mycustom_category_group/mycustom_category_defaultminuteschedule'");
152
  $resultCategoryIteration = $resultCategory->fetchAll(PDO::FETCH_ASSOC);
153
  $categoryIterationCounter = $resultCategoryIteration[0][loopCounter];
154
  $categoryCounterDB = $resultCategoryIteration[0][loopIteration];
183
 
184
  $category_cron_schedule_time = $Minutecronconfig." ".$Hourcronconfig." * * *";
185
 
186
+ $connection->query("UPDATE ".$prefix."bluefish_cron_schedule SET loopIteration= '".$counterDB."' where id = '".$resultCategoryIteration[0][id]."'");
187
 
188
  $markers = $doc->getElementsByTagName('bluefish_connection_category');
189
 
214
  $xmlFile = "$varpath/etc/config.xml";
215
  $doc->load($xmlFile);
216
  $connection = Mage::getSingleton('core/resource')->getConnection('core_write');
217
+ $prefix = Mage::getConfig()->getTablePrefix();
218
 
219
+ $resultCustomer = $connection->query("select id,loopCounter,loopIteration from ".$prefix."bluefish_cron_schedule WHERE cronPath = 'mycustom_section/mycustom_customer_group/mycustom_customer_commonschedule'");
220
  $resultCustomerIteration = $resultCustomer->fetchAll(PDO::FETCH_ASSOC);
221
  $CustomerIterationCounter = $resultCustomerIteration[0][loopCounter];
222
  $CustomerCounterDB = $resultCustomerIteration[0][loopIteration];
251
 
252
  $Customer_cron_schedule_time = $Minutecronconfig." ".$Hourcronconfig." * * *";
253
 
254
+ $connection->query("UPDATE ".$prefix."bluefish_cron_schedule SET loopIteration= '".$counterDB."' where id = '".$resultCustomerIteration[0][id]."'");
255
 
256
  $markers=$doc->getElementsByTagName('bluefish_connection_customer');
257
  $markersexport =$doc->getElementsByTagName('bluefish_connection_customerexport');
397
  if(count($xmlData) > 0)
398
  {
399
  $versionVal = max($updatesversionVal);
400
+ $prefix = Mage::getConfig()->getTablePrefix();
401
+ $coreConfigUpdate = $connection->query("UPDATE ".$prefix."core_config_data SET value = '".$versionVal."' where path = 'mycustom_section/mycustom_stock_group/mycustom_currentstockversion'");
402
  }
403
 
404
  $flag = "success";
428
  Mage::log('Product Import started ......', null, './Bluestore_product.log.text');
429
 
430
  $connection = Mage::getSingleton('core/resource')->getConnection('core_write');
431
+ $prefix = Mage::getConfig()->getTablePrefix();
432
 
433
+ $resultPath = $connection->query("select value from ".$prefix."core_config_data WHERE path = 'mycustom_section/mycustom_category_group/mycustom_category_mapping_direct'");
434
  $resultCronPath = $resultPath->fetchAll(PDO::FETCH_ASSOC);
435
  $numberRowsConfig= count($resultCronPath);
436
 
459
  {
460
  if($unserielVal['#{_id}']['Dbmapping'] == 'Mapping')
461
  {
462
+ $result = $connection->query("select code,category_id from ".$prefix."bluefish_category WHERE code = '".$categoryCode."'");
463
  $resultSet = $result->fetchAll(PDO::FETCH_ASSOC);
464
  $numberRows = count($resultSet);
465
 
467
  {
468
  try
469
  {
470
+ $resultProduct = $connection->query("select product_code,product_id,category_id from ".$prefix."bluefish_product WHERE product_code = '".$codeSKU."'");
471
  $resultSetProduct = $resultProduct->fetchAll(PDO::FETCH_ASSOC);
472
  $numberProductRows = count($resultSetProduct);
473
 
508
  'tax_class_id' => 1
509
  )));
510
 
511
+ $resultInSert = $connection->query("INSERT INTO ".$prefix."bluefish_product(id,category_id,product_id,product_code,created_time,update_time)
512
  VALUES('','".$resultSet[0][category_id]."','".$ProductID."','".$codeSKU."','".now()."','')");
513
  }
514
  catch(Exception $e)
529
  'name' => "$name",
530
  'price' => "$price"
531
  )));
532
+ $resultUpdate = $connection->query("UPDATE ".$prefix."bluefish_product SET update_time= '".now()."' where product_code = '".$codeSKU."'");
533
  }
534
  catch(Exception $e)
535
  {
536
  $flag = $e->getMessage();
537
  if($flag == "Product not exists.")
538
  {
539
+ $result = $connection->query("delete from ".$prefix."bluefish_product WHERE product_code = '".$codeSKU."'");
540
 
541
  try
542
  {
555
  'tax_class_id' => 1
556
  )));
557
 
558
+ $resultInSert = $connection->query("INSERT INTO ".$prefix."bluefish_product(id,category_id,product_id,product_code,created_time,update_time)
559
  VALUES('','".$resultSet[0][category_id]."','".$ProductID."','".$codeSKU."','".now()."','')");
560
  }
561
  catch(Exception $e)
581
  }
582
  if($unserielVal['#{_id}']['Dbmapping'] == 'Direct')
583
  {
584
+ $resultDirect = $connection->query("select code,category_id from ".$prefix."bluefish_category WHERE code = '".$categoryCode."'");
585
  $resultSetDirect = $resultDirect->fetchAll(PDO::FETCH_ASSOC);
586
  $numberRowsDirect = count($resultSetDirect);
587
 
698
  Mage::log('Category Import started ......', null, './Bluestore_category.log.text');
699
 
700
  $connection = Mage::getSingleton('core/resource')->getConnection('core_write');
701
+ $prefix = Mage::getConfig()->getTablePrefix();
702
 
703
+ $resultPath = $connection->query("select value from ".$prefix."core_config_data WHERE path = 'mycustom_section/mycustom_category_group/mycustom_category_mapping_direct'");
704
  $resultCronPath = $resultPath->fetchAll(PDO::FETCH_ASSOC);
705
  $numberRows = count($resultCronPath);
706
 
740
 
741
  if($deleted == "false")
742
  {
743
+ $result = $connection->query("select code,category_id from ".$prefix."bluefish_category WHERE code = '".$code."'");
744
  $resultSet = $result->fetchAll(PDO::FETCH_ASSOC);
745
  $numberRows = count($resultSet);
746
 
758
  'available_sort_by'=>'price',
759
  'default_sort_by'=>'price'
760
  )));
761
+ $result = $connection->query("INSERT INTO ".$prefix."bluefish_category(connection_id,code,category_id,created_time,update_time)
762
  VALUES('','".$code."','".$newCategoryId."','".now()."','')");
763
  }
764
  catch(Exception $e)
778
  'available_sort_by'=>'price',
779
  'default_sort_by'=>'price'
780
  )));
781
+ $result = $connection->query("UPDATE ".$prefix."bluefish_category SET update_time= '".now()."' where code = '".$code."'");
782
  }
783
  catch(Exception $e)
784
  {
785
  $flag = $e->getMessage();
786
  if($flag == "Category not exists.")
787
  {
788
+ $result = $connection->query("delete from ".$prefix."bluefish_category WHERE code = '".$code."'");
789
 
790
  try
791
  {
797
  'available_sort_by'=>'price',
798
  'default_sort_by'=>'price'
799
  )));
800
+ $result = $connection->query("INSERT INTO ".$prefix."bluefish_category(connection_id,code,category_id,created_time,update_time)
801
  VALUES('','".$code."','".$newCategoryId."','".now()."','')");
802
  }
803
  catch(Exception $e)
833
  'available_sort_by'=>'price',
834
  'default_sort_by'=>'price'
835
  )));
836
+ $result = $connection->query("INSERT INTO ".$prefix."bluefish_category(connection_id,code,category_id,created_time,update_time)
837
  VALUES('','".$code."','".$newCategoryId."','".now()."','')");
838
  }
839
  catch(Exception $e)
870
  'available_sort_by'=>'price',
871
  'default_sort_by'=>'price'
872
  )));
873
+ $result = $connection->query("INSERT INTO ".$prefix."bluefish_category(connection_id,code,category_id,created_time,update_time)
874
  VALUES('','".$code."','".$newCategoryId."','".now()."','')");
875
  }
876
  catch(Exception $e)
897
  'default_sort_by'=>'price'
898
  )));
899
 
900
+ $result = $connection->query("UPDATE ".$prefix."bluefish_category SET update_time= '".now()."' where code = '".$code."'");
901
  }
902
  catch(Exception $e)
903
  {
904
  $flag = $e->getMessage();
905
  if($flag == "Category not exists.")
906
  {
907
+ $result = $connection->query("delete from ".$prefix."bluefish_category WHERE code = '".$code."'");
908
 
909
  try
910
  {
916
  'available_sort_by'=>'price',
917
  'default_sort_by'=>'price'
918
  )));
919
+ $result = $connection->query("INSERT INTO ".$prefix."bluefish_category(connection_id,code,category_id,created_time,update_time)
920
  VALUES('','".$code."','".$newCategoryId."','".now()."','')");
921
  }
922
  catch(Exception $e)
995
  $email = $xmlData->customer[$i]->address->email;
996
 
997
  $connection = Mage::getSingleton('core/resource')->getConnection('core_write');
998
+ $prefix = Mage::getConfig()->getTablePrefix();
999
+
1000
+ $result = $connection->query("SELECT id,customer_id,address_id FROM ".$prefix."bluefish_customer WHERE customer_code = '".$code."'");
1001
 
1002
  $resultSet = $result->fetchAll(PDO::FETCH_ASSOC);
1003
  $numberRows = count($resultSet);
1006
  {
1007
  try
1008
  {
1009
+ $customerID = $soap->call($sessionId,'customer.create',array(array('email' => "$email", 'firstname' => "$firstName", 'lastname' => "$lastName", 'prefix' => "$title", 'website_id' => 1, 'store_id' => 1, 'group_id' => 1,'created_at'=> "$createdOn")));
1010
  $address_id = "";
1011
 
1012
  if(($city != "") && ($postalCode !="") && ($phone1 != "") && ($street1 != ""))
1026
  Mage::log('Customer : '.$customerID.' address not created. City, Postal Code, Phone Number OR Street address is blank.', null, './Bluestore_customer.log.text');
1027
  }
1028
 
1029
+ $InsertCus = $connection->query("INSERT INTO ".$prefix."bluefish_customer(id,customer_id,address_id,customer_code,created_time,update_time)
1030
  VALUES('','".$customerID."','".$address_id."','".$code."','".now()."','')");
1031
 
1032
  Mage::log('Customer '.$customerID.' Created.', null, './Bluestore_customer.log.text');
1046
  $customerIdForupadte = $resultSet[0]['customer_id'];
1047
  $addressIdForupadte = $resultSet[0]['address_id'];
1048
 
1049
+ $customerUpdate = $soap->call($sessionId,'customer.update',array('customerId' => "$customerIdForupadte",'customerData' => array('email' => "$email", 'firstname' => "$firstName", 'lastname' => "$lastName", 'prefix' => "$title")));
1050
 
1051
  if(($addressIdForupadte > 0) && ($city != "") && ($postalCode !="") && ($phone1 != "") && ($street1 != ""))
1052
  {
1053
  $soap->call($sessionId,'customer_address.update',array('addressId' => "$addressIdForupadte",'addressdata' => array('firstname' => "$firstName", 'lastname' => "$lastName", 'street' => array("$street1", "$street2", "$street3"), 'city' => "$city", 'country_id' => "$country", 'region' => "$stateOrRegion", 'postcode' => "$postalCode", 'telephone' => "$phone1", 'is_default_billing' => "$isBilling", 'is_default_shipping' => "$isDelivery", 'company' => "$companyName", 'prefix' => "$title")));
1054
  }
1055
 
1056
+ $CustomerUpdate = $connection->query("UPDATE ".$prefix."bluefish_customer SET update_time= '".now()."' where customer_code = '".$code."'");
1057
 
1058
  Mage::log('Customer '.$customerID.' Updated.', null, './Bluestore_customer.log.text');
1059
  $flag = "success";
1064
 
1065
  if($flag == "Customer not exists.")
1066
  {
1067
+ $result = $connection->query("delete from ".$prefix."bluefish_customer WHERE customer_code = '".$code."'");
1068
 
1069
  try
1070
  {
1071
+ $customerID = $soap->call($sessionId,'customer.create',array(array('email' => "$email", 'firstname' => "$firstName", 'lastname' => "$lastName", 'prefix' => "$title", 'website_id' => 1, 'store_id' => 1, 'group_id' => 1,'created_at'=> "$createdOn")));
1072
  $address_id = "";
1073
 
1074
  if(($city != "") && ($postalCode !="") && ($phone1 != "") && ($street1 != ""))
1084
  }
1085
  }
1086
 
1087
+ $InsertCus = $connection->query("INSERT INTO ".$prefix."bluefish_customer(id,customer_id,address_id,customer_code,created_time,update_time)
1088
  VALUES('','".$customerID."','".$address_id."','".$code."','".now()."','')");
1089
 
1090
  Mage::log('Customer '.$customerID.' Created.', null, './Bluestore_customer.log.text');
1123
  $credentials_storecode = Mage::getStoreConfig('mycustom_section/mycustom_stock_group');
1124
  $mycustom_bluestorecode = $credentials_storecode['mycustom_bluestorecode'];
1125
 
 
 
1126
  $soap = new SoapClient($mage_url);
1127
  $sessionId = $soap->login($mage_user, $mage_api_key);
1128
 
1135
  $xmlFile = "$varpath/etc/config.xml";
1136
  $doc->load($xmlFile);
1137
  $connection = Mage::getSingleton('core/resource')->getConnection('core_write');
1138
+ $prefix = Mage::getConfig()->getTablePrefix();
1139
 
1140
+ $resultSale = $connection->query("select id,loopCounter,loopIteration from ".$prefix."bluefish_cron_schedule WHERE cronPath = 'mycustom_section/mycustom_sales_group/mycustom_sales_commonschedule'");
1141
  $resultSaleIteration = $resultSale->fetchAll(PDO::FETCH_ASSOC);
1142
 
1143
  $SaleIterationCounter = $resultSaleIteration[0][loopCounter];
1173
 
1174
  $Sale_cron_schedule_time = $Minutecronconfig." ".$Hourcronconfig." * * *";
1175
 
1176
+ $connection->query("UPDATE ".$prefix."bluefish_cron_schedule SET loopIteration= '".$counterDB."' where id = '".$resultSaleIteration[0][id]."'");
1177
 
1178
  $markers=$doc->getElementsByTagName('bluefish_connection_orderexport');
1179
  foreach ($markers as $marker)
1186
 
1187
  try
1188
  {
1189
+ $thedate = date("Y-m-d", strtotime("-2 month"));
1190
+ $thesearch =array(array('updated_at'=>array('from'=>"$thedate"), 'status'=>array('eq'=>"complete")));
1191
+ $resultOrderList = $soap->call($sessionId, 'order.list', $thesearch);
1192
+
1193
+ #$thesearch =array(array('updated_at'=>array('from'=>"$thedate"),'increment_id'=>array('200002634'), 'status'=>array('eq'=>"complete")));
1194
  }
1195
  catch(Exception $e)
1196
  {
1212
 
1213
  #if($resultOrderList[$i][increment_id] == "100000002") # This one
1214
  #{ # and this one
1215
+ $result = $connection->query("SELECT id FROM ".$prefix."bluefish_sale_post WHERE order_id = '".$resultOrderList[$i][increment_id]."'");
1216
 
1217
  $resultSet = $result->fetchAll(PDO::FETCH_ASSOC);
1218
  $numberRows = count($resultSet);
1219
 
1220
+ $resultCustomer = $connection->query("SELECT id,customer_code FROM ".$prefix."bluefish_customer WHERE customer_id = '".$resultOrderList[$i][customer_id]."'");
1221
 
1222
  $resultSetCustomer = $resultCustomer->fetchAll(PDO::FETCH_ASSOC);
1223
 
1262
  }
1263
  }
1264
  }
1265
+ if($catchProductError == "")
1266
  {
1267
  if($zz == 0)
1268
  {
1276
  $customerFullName = $resultOrderList[$i][customer_firstname]." ".$resultOrderList[$i][customer_lastname];
1277
  $docNO = $zz+1;
1278
 
1279
+ $AmountsIncludeTax = ($resultOrderList[$i][tax_amount] > 0)?'true':'false';
1280
  $saleAmountIncludeTax = $resultOrderList[$i][total_paid];
1281
 
1282
  $xmlRequest .= "<batch batchNo=\"".$docNO."\">
1283
+ <transactionSales>
1284
  <transactionSale docNo=\"".$resultOrderList[$i][increment_id]."\">
1285
  <postStockMovements>true</postStockMovements>
1286
  <saleHeader>
1291
  <endDateTime>".$resultOrderList[$i][updated_at]."</endDateTime>
1292
  <sessionID>".$sessionId."</sessionID>
1293
  <userCode>".$resultcustomer_id."</userCode>
 
 
 
1294
  <orderCurrencyCode>".$resultOrderList[$i][base_currency_code]."</orderCurrencyCode>
1295
  <saleAmount>".$saleAmountIncludeTax."</saleAmount>
1296
  <totalTax>".$resultOrderList[$i][tax_amount]."</totalTax>
1309
  $flag = $e->getMessage();
1310
  Mage::log('Problem in sales_order.info '.$flag.' Exported.', null, './Bluestore_salesorder.log.text');
1311
  }
1312
+
1313
+ $SalefirstName = str_ireplace("&", "&#x26;", $resultSalesOrder[customer_firstname]);
1314
+ $SalelastName = str_ireplace("&", "&#x26;", $resultSalesOrder[customer_lastname]);
1315
  $street1Addr = str_ireplace("&", "&#x26;", $resultSalesOrder[shipping_address][street]);
1316
+
1317
  $xmlRequest .= "<customer>
1318
  <countryCode>".$resultSalesOrder[shipping_address][country_id]."</countryCode>
1319
  <customerCode>".$customerCodeafterCheck."</customerCode>
1320
  <email>".$resultSalesOrder[customer_email]."</email>
1321
+ <firstName>".$SalefirstName."</firstName>
1322
+ <lastName>".$SalelastName."</lastName>
1323
  <postalZipCode>".$resultSalesOrder[shipping_address][postcode]."</postalZipCode>
1324
  <street1>".$street1Addr."</street1>
1325
  <telephone1>".$resultSalesOrder[shipping_address][telephone]."</telephone1>
1326
  <title>".$resultSalesOrder[customer_prefix]."</title>
1327
  <townCity>".$resultSalesOrder[shipping_address][city]."</townCity>
1328
  </customer>
1329
+ <saleItems>";
1330
 
1331
  $ITEM_NUMBER = 0;
1332
  $saleItemChargeAmt = $resultSalesOrder[base_shipping_amount]/count($resultSalesOrder[items]);
1341
  {
1342
  $flag = $e->getMessage();
1343
  Mage::log('Product for sale item '.$resultSalesOrder[items][$j][product_id].' does not exist. Order# is '.$resultOrderList[$i][increment_id], null, './Bluestore_salesorder.log.text');
1344
+ $catchError = "fail";
1345
  }
1346
 
1347
  try
1354
  {
1355
  $flag = $e->getMessage();
1356
  Mage::log('Problem in catalog_category.info '.$flag.' => '.$resultProduct[categories][0].' Exported.', null, './Bluestore_salesorder.log.text');
1357
+ $catchError = "fail";
1358
  }
1359
 
1360
+ $resultCategoryCode = $connection->query("SELECT code FROM ".$prefix."bluefish_category WHERE category_id = '".$resultCategory[category_id]."'");
1361
  $resultSetCatCode = $resultCategoryCode->fetchAll(PDO::FETCH_ASSOC);
1362
  $updateCategoryCode = ($resultSetCatCode[0][code] == "")?$resultCategory[category_id]:$resultSetCatCode[0][code];
1363
 
1384
 
1385
  $productDescription = str_ireplace("&", "&#x26;", $resultProduct[name]);
1386
  $categoryDescription = str_ireplace("&", "&#x26;", $resultCategory[name]);
1387
+
1388
+ $taxRate = ($resultSalesOrder[items][$j][tax_percent] == "")?'0.0000':$resultSalesOrder[items][$j][tax_percent];
1389
+ $taxAmount = ($resultSalesOrder[items][$j][tax_amount] == "")?'0.0000':$resultSalesOrder[items][$j][tax_amount];
1390
+
1391
+ $config_chargescode = $credentials['mycustom_sale_chargescode'];
1392
  $xmlRequest .= "<saleItem>
1393
  <itemNumber>".$ITEM_NUMBER."</itemNumber>
1394
  <productCode>".$resultProduct[sku]."</productCode>
1397
  <categoryDescription>".$categoryDescription."</categoryDescription>
1398
  <price>".$resultSalesOrder[items][$j][price]."</price>
1399
  <currencyCode>".$resultSalesOrder[order_currency_code]."</currencyCode>
1400
+ <quantity>".number_format($resultSalesOrder[items][$j][qty_invoiced])."</quantity>
1401
  <unitOfMeasure>EA</unitOfMeasure>
1402
  <finalAmount>".$TotalfinalAmount."</finalAmount>
1403
+ <saleItemTaxes>
1404
  <saleItemTax>
1405
  <saleItemTaxNo>1</saleItemTaxNo>
1406
  <taxCode>".$TAXCODE_VAL."</taxCode>
1407
  <baseAmount>".$resultSalesOrder[base_tax_amount]."</baseAmount>
1408
  <currencyCode>".$resultSalesOrder[order_currency_code]."</currencyCode>
1409
+ <taxRate>".$taxRate."</taxRate>
1410
+ <taxAmount>".$taxAmount."</taxAmount>
1411
  </saleItemTax>
1412
+ </saleItemTaxes>
1413
+ <saleItemCharges>
1414
  <saleItemCharge>
1415
  <saleItemChargeNo>".$ITEM_NUMBER."</saleItemChargeNo>
1416
+ <chargeCode>".$config_chargescode."</chargeCode>
1417
  <chargeDescription>".$resultSalesOrder[shipping_description]."</chargeDescription>
1418
  <level>1</level>
1419
  <type>2</type>
1423
  <baseAmountCurrency>".$resultSalesOrder[order_currency_code]."</baseAmountCurrency>
1424
  <amount>".$saleItemChargeAmt."</amount>
1425
  </saleItemCharge>
1426
+ </saleItemCharges>
1427
+ </saleItem>";
1428
  }
1429
 
1430
  $credentialsPayCode = Mage::getStoreConfig('mycustom_section/mycustom_payment_group');
1444
  if($PAYMENTCODE_VAL == "")
1445
  $PAYMENTCODE_VAL = "1";
1446
 
1447
+ $xmlRequest .= "</saleItems>
1448
+ <payments>
1449
+ <payment>
1450
  <paymentNo>".$resultSalesOrder[increment_id]."</paymentNo>
1451
  <tenderType>2</tenderType>
1452
  <paymentMethodCode>".$PAYMENTCODE_VAL."</paymentMethodCode>
1453
  <amount>".$resultSalesOrder[payment][amount_ordered]."</amount>
1454
  <currencyCode>".$resultSalesOrder[order_currency_code]."</currencyCode>
1455
  </payment>
1456
+ </payments>
1457
  </transactionSale>
1458
+ </transactionSales>
1459
+ </batch>";
1460
  $zz++;
1461
  }
1462
 
1495
  $mage_api_key = $credentials_auth['mycustom_password'];
1496
  $enterprise_code = '';
1497
 
 
1498
  $soap = new SoapClient($mage_url);
1499
  $sessionId = $soap->login($mage_user, $mage_api_key);
1500
 
1507
  $xmlFile = "$varpath/etc/config.xml";
1508
  $doc->load($xmlFile);
1509
  $connection = Mage::getSingleton('core/resource')->getConnection('core_write');
1510
+ $prefix = Mage::getConfig()->getTablePrefix();
1511
 
1512
+ $resultCustomer = $connection->query("select id,loopCounter,loopIteration from ".$prefix."bluefish_cron_schedule WHERE cronPath = 'mycustom_section/mycustom_customer_group/mycustom_customer_commonschedule'");
1513
  $resultCustomerIteration = $resultCustomer->fetchAll(PDO::FETCH_ASSOC);
1514
  $CustomerIterationCounter = $resultCustomerIteration[0][loopCounter];
1515
  $CustomerCounterDB = $resultCustomerIteration[0][loopIteration];
1544
 
1545
  $Customer_cron_schedule_time = $Minutecronconfig." ".$Hourcronconfig." * * *";
1546
 
1547
+ $connection->query("UPDATE ".$prefix."bluefish_cron_schedule SET loopIteration= '".$counterDB."' where id = '".$resultCustomerIteration[0][id]."'");
1548
 
1549
  $markersexport=$doc->getElementsByTagName('bluefish_connection_customerexport');
1550
  $markers=$doc->getElementsByTagName('bluefish_connection_customer');
1566
  #exit;
1567
  for($i=0;$i<count($customerList);$i++)
1568
  {
1569
+ $result = $connection->query("SELECT id,customer_code FROM ".$prefix."bluefish_customer WHERE customer_id = '".$customerList[$i][customer_id]."'");
1570
 
1571
  $resultSet = $result->fetchAll(PDO::FETCH_ASSOC);
1572
  $numberRows = count($resultSet);
1573
 
1574
+ #if($customerList[$i][customer_id] == 2)
1575
  #{
1576
  if($zz == 0)
1577
  {
1590
  $isCorrespondence = ($customerAddressInfo[0][is_default_shipping] == '1')?'true':'false';
1591
 
1592
  $xmlRequest .= "<batch batchNo=\"".$docNO."\">
1593
+ <customers>
1594
  <customer docNo=\"".$customerList[$i][customer_id]."\">";
1595
+ if($numberRows > 0)
 
 
 
 
1596
  {
1597
  $xmlRequest .= "<code>".$resultSet[0][customer_code]."</code>";
1598
+ }
1599
+
1600
  $xmlRequest .= "<externalRef></externalRef>
1601
  <taxOrVatRef></taxOrVatRef>
1602
+ <addresses>
1603
  <address>";
1604
+
 
 
 
 
 
 
 
1605
  $xmlRequest .= "<isCorrespondence>true</isCorrespondence>
1606
  <isBilling>true</isBilling>
1607
  <isDelivery>true</isDelivery>
1617
  <phone1>".$customerAddressInfo[0][telephone]."</phone1>
1618
  <email>".$customerList[$i][email]."</email>
1619
  </address>
1620
+ </addresses>
1621
  </customer>
1622
+ </customers>
1623
  </batch>
1624
  ";
1625
 
1631
 
1632
  if($customerList[$i][firstname] != "" && $customerList[$i][lastname] != "" && $customerList[$i][email] !="" && $numberRows == 0)
1633
  {
1634
+ $InsertCustomer = $connection->query("INSERT INTO ".$prefix."bluefish_customer(id,customer_id,address_id,created_time)
1635
  VALUES('','".$customerList[$i][customer_id]."','".$customerAddressInfo[0][customer_address_id]."','".now()."')");
1636
  }
1637
  #}
app/code/local/Bluefish/Connection/etc/config.xml CHANGED
@@ -2,7 +2,7 @@
2
  <config>
3
  <modules>
4
  <Bluefish_Connection>
5
- <version>1.1.0</version>
6
  </Bluefish_Connection>
7
  </modules>
8
  <frontend>
@@ -42,7 +42,7 @@
42
  <children>
43
  <items module="connection">
44
  <title>Import</title>
45
- <sort_order>0</sort_order>
46
  <action>connection/adminhtml_myform</action>
47
  </items>
48
  <export module="connection">
@@ -50,6 +50,16 @@
50
  <sort_order>20</sort_order>
51
  <action>connection/adminhtml_myformexport</action>
52
  </export>
 
 
 
 
 
 
 
 
 
 
53
  </children>
54
  </connection>
55
  </menu>
@@ -138,11 +148,11 @@
138
  <crontab>
139
  <jobs>
140
  <bluefish_connection_category>
141
- <schedule><cron_expr>15 23 * * *</cron_expr></schedule>
142
  <run><model>connection/observer::categoryImport</model></run>
143
  </bluefish_connection_category>
144
  <bluefish_connection_product>
145
- <schedule><cron_expr>30 0 * * *</cron_expr></schedule>
146
  <run><model>connection/observer::productImport</model></run>
147
  </bluefish_connection_product>
148
  <bluefish_connection_stock>
@@ -179,7 +189,13 @@
179
  </mycustom_sales_group>
180
  </mycustom_section>
181
  </default>
182
-
 
 
 
 
 
 
183
 
184
  <default>
185
  <mycustom_section>
2
  <config>
3
  <modules>
4
  <Bluefish_Connection>
5
+ <version>1.1.1</version>
6
  </Bluefish_Connection>
7
  </modules>
8
  <frontend>
42
  <children>
43
  <items module="connection">
44
  <title>Import</title>
45
+ <sort_order>10</sort_order>
46
  <action>connection/adminhtml_myform</action>
47
  </items>
48
  <export module="connection">
50
  <sort_order>20</sort_order>
51
  <action>connection/adminhtml_myformexport</action>
52
  </export>
53
+ <enablecron module="connection">
54
+ <title>Enable/Disable Bluestore Cron Jobs</title>
55
+ <sort_order>30</sort_order>
56
+ <action>connection/adminhtml_bluestorecron</action>
57
+ </enablecron>
58
+ <monitorcron module="connection">
59
+ <title>Monitor Scheduled Tasks</title>
60
+ <sort_order>40</sort_order>
61
+ <action>connection/adminhtml_bluestorescheduler</action>
62
+ </monitorcron>
63
  </children>
64
  </connection>
65
  </menu>
148
  <crontab>
149
  <jobs>
150
  <bluefish_connection_category>
151
+ <schedule><cron_expr>0 17 * * *</cron_expr></schedule>
152
  <run><model>connection/observer::categoryImport</model></run>
153
  </bluefish_connection_category>
154
  <bluefish_connection_product>
155
+ <schedule><cron_expr>47 11 * * *</cron_expr></schedule>
156
  <run><model>connection/observer::productImport</model></run>
157
  </bluefish_connection_product>
158
  <bluefish_connection_stock>
189
  </mycustom_sales_group>
190
  </mycustom_section>
191
  </default>
192
+ <default>
193
+ <mycustom_section>
194
+ <mycustom_sales_group>
195
+ <mycustom_sale_chargescode>1</mycustom_sale_chargescode>
196
+ </mycustom_sales_group>
197
+ </mycustom_section>
198
+ </default>
199
 
200
  <default>
201
  <mycustom_section>
app/code/local/Bluefish/Connection/etc/system.xml CHANGED
@@ -168,7 +168,15 @@
168
  <show_in_default>1</show_in_default>
169
  <show_in_website>1</show_in_website>
170
  <show_in_store>1</show_in_store>
171
- </mycustom_customer_number>
 
 
 
 
 
 
 
 
172
  </fields>
173
  </mycustom_sales_group>
174
 
@@ -265,8 +273,26 @@
265
  </mycustom_payment_group>
266
 
267
 
268
-
269
  </groups>
270
  </mycustom_section>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
271
  </sections>
272
  </config>
168
  <show_in_default>1</show_in_default>
169
  <show_in_website>1</show_in_website>
170
  <show_in_store>1</show_in_store>
171
+ </mycustom_customer_number>
172
+ <mycustom_sale_chargescode translate="label">
173
+ <label>Bluestore Charge Code for Delivery Charges</label>
174
+ <frontend_type>text</frontend_type>
175
+ <sort_order>60</sort_order>
176
+ <show_in_default>1</show_in_default>
177
+ <show_in_website>1</show_in_website>
178
+ <show_in_store>1</show_in_store>
179
+ </mycustom_sale_chargescode>
180
  </fields>
181
  </mycustom_sales_group>
182
 
273
  </mycustom_payment_group>
274
 
275
 
 
276
  </groups>
277
  </mycustom_section>
278
+
279
+ <system>
280
+ <groups>
281
+ <cron translate="label comment" module="cron">
282
+ <fields>
283
+ <disabled_crons translate="label">
284
+ <label>Disabled cron tasks</label>
285
+ <frontend_type>text</frontend_type>
286
+ <comment><![CDATA[Do not edit this field manually.]]></comment>
287
+ <sort_order>100</sort_order>
288
+ <show_in_default>1</show_in_default>
289
+ <show_in_website>0</show_in_website>
290
+ <show_in_store>0</show_in_store>
291
+ </disabled_crons>
292
+ </fields>
293
+ </cron>
294
+ </groups>
295
+ </system>
296
+
297
  </sections>
298
  </config>
app/code/local/Bluefish/Connection/sql/connection_setup/{mysql4-upgrade-0.1.0-1.1.0.php → mysql4-upgrade-0.1.0-1.1.1.php} RENAMED
File without changes
app/design/adminhtml/default/default/layout/connection.xml CHANGED
@@ -10,4 +10,14 @@
10
  <block type="adminhtml/template" name="myform" template="connection/myformexport.phtml"/>
11
  </reference>
12
  </connection_adminhtml_myformexport_index>
 
 
 
 
 
 
 
 
 
 
13
  </layout>
10
  <block type="adminhtml/template" name="myform" template="connection/myformexport.phtml"/>
11
  </reference>
12
  </connection_adminhtml_myformexport_index>
13
+ <connection_adminhtml_bluestorecron_index>
14
+ <reference name="content">
15
+ <block type="connection/adminhtml_bluestorecron" name="bluestorecron" />
16
+ </reference>
17
+ </connection_adminhtml_bluestorecron_index>
18
+ <connection_adminhtml_bluestorescheduler_index>
19
+ <reference name="content">
20
+ <block type="connection/adminhtml_bluestorescheduler" name="bluestorescheduler" />
21
+ </reference>
22
+ </connection_adminhtml_bluestorescheduler_index>
23
  </layout>
app/design/adminhtml/default/default/template/connection/array_dropdown.phtml CHANGED
@@ -44,14 +44,20 @@ switch ($blockElement) {
44
  case (stristr($blockElement, "mycustom_taxcode_group") == true):
45
  $blockName = "mycustom_taxcode_group";
46
  $categoryDefaultTime = Array("0.0000::UK0","20.0000::UK1");
47
- break;
 
 
 
 
48
  }
49
 
50
- $connection = Mage::getSingleton('core/resource')->getConnection('core_write');
 
51
 
52
- $resultPath = $connection->query("select value from core_config_data WHERE path = 'mycustom_section/mycustom_auth_group/mycustom_login'");
53
  $resultCronPath = $resultPath->fetchAll(PDO::FETCH_ASSOC);
54
  $numberRows = count($resultCronPath);
 
55
  ?>
56
 
57
  <div class="grid" id="grid<?php echo $_htmlId ?>">
@@ -256,8 +262,21 @@ Event.observe(window, 'load', function () {
256
  <?php
257
  } ?>
258
  });
259
- <?php } ?>
 
 
 
260
 
 
 
 
 
 
 
 
 
 
 
261
 
262
 
263
 
44
  case (stristr($blockElement, "mycustom_taxcode_group") == true):
45
  $blockName = "mycustom_taxcode_group";
46
  $categoryDefaultTime = Array("0.0000::UK0","20.0000::UK1");
47
+ break;
48
+ case (stristr($blockElement, "mycustom_chargecode_group") == true):
49
+ $blockName = "mycustom_chargecode_group";
50
+ $categoryDefaultTime = Array("Fixed amount::1","Percentage::2");
51
+ break;
52
  }
53
 
54
+ $connection = Mage::getSingleton('core/resource')->getConnection('core_write');
55
+ $prefix = Mage::getConfig()->getTablePrefix();
56
 
57
+ $resultPath = $connection->query("select value from ".$prefix."core_config_data WHERE path = 'mycustom_section/mycustom_auth_group/mycustom_login'");
58
  $resultCronPath = $resultPath->fetchAll(PDO::FETCH_ASSOC);
59
  $numberRows = count($resultCronPath);
60
+ $numberRows = 0;
61
  ?>
62
 
63
  <div class="grid" id="grid<?php echo $_htmlId ?>">
262
  <?php
263
  } ?>
264
  });
265
+ <?php } elseif (!$this->getArrayRows() && ($numberRows == 0) && ($blockName == "mycustom_chargecode_group")){?>
266
+ Event.observe(window, 'load', function () {
267
+ $('grid<?php echo $_htmlId ?>').show();
268
+ $('empty<?php echo $_htmlId ?>').hide();
269
 
270
+ <?php
271
+
272
+ for($i=0;$i<count($categoryDefaultTime);$i++)
273
+ {
274
+ ?>
275
+ arrayRow<?php echo $_htmlId ?>.add('', '','<?php echo $categoryDefaultTime[$i] ?>');
276
+ <?php
277
+ } ?>
278
+ });
279
+ <?php } ?>
280
 
281
 
282
 
app/design/adminhtml/default/default/template/connection/cronschedule.phtml CHANGED
@@ -60,8 +60,9 @@ switch ($blockElement) {
60
  }
61
 
62
  $connection = Mage::getSingleton('core/resource')->getConnection('core_write');
 
63
 
64
- $resultPath = $connection->query("select value from core_config_data WHERE path = 'mycustom_section/mycustom_auth_group/mycustom_login'");
65
  $resultCronPath = $resultPath->fetchAll(PDO::FETCH_ASSOC);
66
  $numberRows = count($resultCronPath);
67
 
60
  }
61
 
62
  $connection = Mage::getSingleton('core/resource')->getConnection('core_write');
63
+ $prefix = Mage::getConfig()->getTablePrefix();
64
 
65
+ $resultPath = $connection->query("select value from ".$prefix."core_config_data WHERE path = 'mycustom_section/mycustom_auth_group/mycustom_login'");
66
  $resultCronPath = $resultPath->fetchAll(PDO::FETCH_ASSOC);
67
  $numberRows = count($resultCronPath);
68
 
app/design/adminhtml/default/default/template/connection/custom_product_radioinput.phtml CHANGED
@@ -35,9 +35,10 @@ if (!$this->_addAfter) {
35
  $_colspan = $_colspan > 1 ? 'colspan="' . $_colspan . '"' : '';
36
  $url = $this->getUrl('bluefish/adminhtml_productdata');
37
 
38
- $connection = Mage::getSingleton('core/resource')->getConnection('core_write');
 
39
 
40
- $resultPath = $connection->query("select value from core_config_data WHERE path = 'mycustom_section/mycustom_product_group/mycustom_product_mapping_direct'");
41
  $resultCronPath = $resultPath->fetchAll(PDO::FETCH_ASSOC);
42
  $numberRows = count($resultCronPath);
43
 
35
  $_colspan = $_colspan > 1 ? 'colspan="' . $_colspan . '"' : '';
36
  $url = $this->getUrl('bluefish/adminhtml_productdata');
37
 
38
+ $connection = Mage::getSingleton('core/resource')->getConnection('core_write');
39
+ $prefix = Mage::getConfig()->getTablePrefix();
40
 
41
+ $resultPath = $connection->query("select value from ".$prefix."core_config_data WHERE path = 'mycustom_section/mycustom_product_group/mycustom_product_mapping_direct'");
42
  $resultCronPath = $resultPath->fetchAll(PDO::FETCH_ASSOC);
43
  $numberRows = count($resultCronPath);
44
 
app/design/adminhtml/default/default/template/connection/custom_radioinput.phtml CHANGED
@@ -36,8 +36,9 @@ $_colspan = $_colspan > 1 ? 'colspan="' . $_colspan . '"' : '';
36
  $url = $this->getUrl('bluefish/adminhtml_categorydata');
37
 
38
  $connection = Mage::getSingleton('core/resource')->getConnection('core_write');
 
39
 
40
- $resultPath = $connection->query("select value from core_config_data WHERE path = 'mycustom_section/mycustom_category_group/mycustom_category_mapping_direct'");
41
  $resultCronPath = $resultPath->fetchAll(PDO::FETCH_ASSOC);
42
  $numberRows = count($resultCronPath);
43
 
36
  $url = $this->getUrl('bluefish/adminhtml_categorydata');
37
 
38
  $connection = Mage::getSingleton('core/resource')->getConnection('core_write');
39
+ $prefix = Mage::getConfig()->getTablePrefix();
40
 
41
+ $resultPath = $connection->query("select value from ".$prefix."core_config_data WHERE path = 'mycustom_section/mycustom_category_group/mycustom_category_mapping_direct'");
42
  $resultCronPath = $resultPath->fetchAll(PDO::FETCH_ASSOC);
43
  $numberRows = count($resultCronPath);
44
 
app/design/adminhtml/default/default/template/connection/myform.phtml CHANGED
@@ -2,7 +2,7 @@
2
  function checkForm(form)
3
  {
4
  document.edit_form.button_name.value = form.value;
5
- editForm.submit();
6
  }
7
  </script>
8
 
2
  function checkForm(form)
3
  {
4
  document.edit_form.button_name.value = form.value;
5
+ editForm.submit();
6
  }
7
  </script>
8
 
package.xml CHANGED
@@ -1,26 +1,26 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Bluefish_Connection</name>
4
- <version>1.1.0</version>
5
  <stability>stable</stability>
6
  <license uri="http://www.opensource.org/licenses/osl-3.0.php">OSL v3.0</license>
7
  <channel>community</channel>
8
  <extends/>
9
  <summary>Integrate Magento with Bluestore Live POS. Bring your online and real world shop together - categories, products, customers, inventory and sales.</summary>
10
- <description>The connector works with your Bluestore Live subscription :&#xD;
11
- &#xD;
12
- - Send category, product and customer information from Bluestore Live&#xD;
13
- to your magento install&#xD;
14
- - Inventory and customer information is exchanged between Bluestore&#xD;
15
- Live and Magento&#xD;
16
- - Completed online sales are passed back to Bluestore Live and&#xD;
17
- recorded with your POS sales so you can see your full business&#xD;
18
  statistics in the Bluestore Live console</description>
19
  <notes>This extension can be used by the users of bluefishretail,by providing appropriate credentials,given to them by bluefishretail.</notes>
20
  <authors><author><name>JDoyle</name><user>jdoyle</user><email>jdoyle@bluefishretail.com</email></author></authors>
21
- <date>2013-11-12</date>
22
- <time>10:40:28</time>
23
- <contents><target name="mageetc"><dir name="modules"><file name="Bluefish_Connection.xml" hash="8a56080fa4bf7795eb323e120cf7c0e8"/></dir></target><target name="magelocal"><dir name="Bluefish"><dir name="Connection"><dir name="Block"><file name="Bluestoretaxcode.php" hash="a969e969aab9846a9019072162d215ab"/><file name="Cronschedule.php" hash="4062fd7c8fac5605670b559734767188"/><file name="Databasemapping.php" hash="637a4780534eec0a1e8301250857662d"/><file name="Paymentmethodcode.php" hash="fd4c33ee96330ee1d75841aa09de8774"/><file name="Productdatabasemapping.php" hash="f9b78cd742b94afa8a29c57bf2a75757"/></dir><dir name="Helper"><file name="Data.php" hash="f294ccca467b49e7a394789ff87d32b4"/></dir><dir name="Model"><file name="Connection.php" hash="76da5fa34acfb6294ca712e76b22e223"/><dir name="Mysql4"><dir name="Connection"><file name="Collection.php" hash="0c9166e76131a7092872871b2444754b"/></dir><file name="Connection.php" hash="2c982c25bb2dc863a2693433063a0050"/></dir><file name="Observer.php" hash="875b82967b8885c8d62913de2f64221f"/><file name="Status.php" hash="4fdeede680b4420331aae6fda74d36d9"/><file name="Validationcrontime.php" hash="52680c1924dc81f37072fcd8d4916235"/><file name="Validationpaymentmap.php" hash="15abb09f8091f557b0a05dc14f3b7d10"/><file name="Validationtaxcode.php" hash="f5aa1a5b23323ce5462093269ba321cf"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="Bluefish_API.php" hash="82d92e2f1dbb6300b3f32fd7b1d6d511"/><file name="Bluefish_Error_Reporting.php" hash="8662f6698cedf9ccb3dd368e43b5b9f6"/><file name="CategorydataController.php" hash="6d09813221e08bcedf9d254b31ce09cf"/><file name="MyformController.php" hash="da02fce65d147e0ae14126f04a6d9569"/><file name="MyformexportController.php" hash="714a3464980349a5e50dd861f2e4ff85"/><file name="ProductdataController.php" hash="4693bc7dd9d3a73e1c92a13da7c08b41"/><file name="Xml.php" hash="71adbdfef919d1a88127080c5512f587"/></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="f958df2fe25675db0cfa466a13d21317"/><file name="config.xml" hash="f5874b345e8afecf6f45f155e70f6b0a"/><file name="system.xml" hash="776ab5d8610dec726b97fa26d8eb27bc"/></dir><dir name="sql"><dir name="connection_setup"><file name="mysql4-install-0.1.0.php" hash="6badacdb48b9a868da95e2c1761732c4"/><file name="mysql4-upgrade-0.1.0-1.1.0.php" hash="f4d1a592ab45d034f6b40c3712accb63"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="template"><dir name="connection"><file name="array_dropdown.phtml" hash="0a306e06062fcd7974cfe650b5a62c4f"/><file name="cronschedule.phtml" hash="c351b46ee16f1aa324406933080c83e1"/><file name="custom_product_radioinput.phtml" hash="f7aa8c413715978a93b23f07c2d2ccb8"/><file name="custom_radioinput.phtml" hash="a36b30731bdc7cb0cc294aa4b5ea2059"/><file name="myform.phtml" hash="56eecea46c021b961a9a7908b46d79c1"/><file name="myformexport.phtml" hash="8a7e24498503d21c43bbc20b1f951923"/></dir></dir><dir name="layout"><file name="connection.xml" hash="ae4ce33181a0c92a3a31b2bf0547c007"/></dir></dir></dir></dir></target></contents>
24
  <compatible/>
25
  <dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php></required></dependencies>
26
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Bluefish_Connection</name>
4
+ <version>1.1.1</version>
5
  <stability>stable</stability>
6
  <license uri="http://www.opensource.org/licenses/osl-3.0.php">OSL v3.0</license>
7
  <channel>community</channel>
8
  <extends/>
9
  <summary>Integrate Magento with Bluestore Live POS. Bring your online and real world shop together - categories, products, customers, inventory and sales.</summary>
10
+ <description>The connector works with your Bluestore Live subscription :&amp;#xD;&#xD;
11
+ &amp;#xD;&#xD;
12
+ - Send category, product and customer information from Bluestore Live&amp;#xD;&#xD;
13
+ to your magento install&amp;#xD;&#xD;
14
+ - Inventory and customer information is exchanged between Bluestore&amp;#xD;&#xD;
15
+ Live and Magento&amp;#xD;&#xD;
16
+ - Completed online sales are passed back to Bluestore Live and&amp;#xD;&#xD;
17
+ recorded with your POS sales so you can see your full business&amp;#xD;&#xD;
18
  statistics in the Bluestore Live console</description>
19
  <notes>This extension can be used by the users of bluefishretail,by providing appropriate credentials,given to them by bluefishretail.</notes>
20
  <authors><author><name>JDoyle</name><user>jdoyle</user><email>jdoyle@bluefishretail.com</email></author></authors>
21
+ <date>2014-01-31</date>
22
+ <time>13:12:36</time>
23
+ <contents><target name="mageetc"><dir name="modules"><file name="Bluefish_Connection.xml" hash="8a56080fa4bf7795eb323e120cf7c0e8"/></dir></target><target name="magelocal"><dir name="Bluefish"><dir name="Connection"><dir name="Block"><dir name="Adminhtml"><dir name="Bluestorecron"><file name="Grid.php" hash="607f11628693a178bf3b24a1fa00d186"/></dir><file name="Bluestorecron.php" hash="9ed58d66971718270d9bedffe3f577fa"/><dir name="Bluestorescheduler"><file name="Grid.php" hash="478a781514739244a784a8f62ee1d645"/></dir><file name="Bluestorescheduler.php" hash="15aaa462a00aea87da5c7606767c7d26"/></dir><file name="Bluestoretaxcode.php" hash="a969e969aab9846a9019072162d215ab"/><file name="Cronschedule.php" hash="4062fd7c8fac5605670b559734767188"/><file name="Databasemapping.php" hash="0dc46ab6705733cdba99562a2637c4c8"/><file name="Paymentmethodcode.php" hash="fd4c33ee96330ee1d75841aa09de8774"/><file name="Productdatabasemapping.php" hash="ef2bca03781168f0fd5da4910e300e45"/></dir><dir name="Helper"><file name="Data.php" hash="f9651d2121bf971714707f42cea1f0b7"/></dir><dir name="Model"><file name="Bluestoreschedule.php" hash="840d1c3dadd60eeb4787a43b4d870d66"/><dir name="Collection"><file name="Crons.php" hash="86aba02a88fc122f9641c89a4fcd434c"/></dir><file name="Configuration.php" hash="7dd9b00e905b7f260c4a9becc82438ff"/><file name="Connection.php" hash="76da5fa34acfb6294ca712e76b22e223"/><dir name="Mysql4"><dir name="Connection"><file name="Collection.php" hash="0c9166e76131a7092872871b2444754b"/></dir><file name="Connection.php" hash="2c982c25bb2dc863a2693433063a0050"/></dir><file name="Observer.php" hash="875b82967b8885c8d62913de2f64221f"/><file name="Status.php" hash="4fdeede680b4420331aae6fda74d36d9"/><file name="Validationcrontime.php" hash="633ab9405ab9bd8db04024e48e90f0e5"/><file name="Validationpaymentmap.php" hash="15abb09f8091f557b0a05dc14f3b7d10"/><file name="Validationtaxcode.php" hash="f5aa1a5b23323ce5462093269ba321cf"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="Bluefish_API.php" hash="82d92e2f1dbb6300b3f32fd7b1d6d511"/><file name="Bluefish_Error_Reporting.php" hash="8662f6698cedf9ccb3dd368e43b5b9f6"/><file name="BluestorecronController.php" hash="371f55c62d4d19151ee11211e82e85c2"/><file name="BluestoreschedulerController.php" hash="198366aa10c1f2bea714a587dc0fb10a"/><file name="CategorydataController.php" hash="8110d788c6dfc1cdb3de0c2fd5510afd"/><file name="MyformController.php" hash="824bc300e8f555d1d40fac88c871666f"/><file name="MyformexportController.php" hash="a18e080b54dbf421b1bdb07ad7efd68f"/><file name="ProductdataController.php" hash="1090cb4a532f51038f494d17b43e8b46"/><file name="Xml.php" hash="593e844bb6c4e0f9db042819d4eb1ca7"/></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="f958df2fe25675db0cfa466a13d21317"/><file name="config.xml" hash="bc21a904c796f0c056eae3cea3bde548"/><file name="system.xml" hash="02e27d9bb429632a38e968b56405d1fa"/></dir><dir name="sql"><dir name="connection_setup"><file name="mysql4-install-0.1.0.php" hash="6badacdb48b9a868da95e2c1761732c4"/><file name="mysql4-upgrade-0.1.0-1.1.1.php" hash="f4d1a592ab45d034f6b40c3712accb63"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="template"><dir name="connection"><file name="array_dropdown.phtml" hash="20fda03d2a00f742a8cbe28169aa942d"/><file name="cronschedule.phtml" hash="cc79f9d4576fe82e94abb790d8eacf1f"/><file name="custom_product_radioinput.phtml" hash="3ce47b1b464741896bf3b3da86d70264"/><file name="custom_radioinput.phtml" hash="098722c4e4547b62d7109be8284e7ce3"/><file name="myform.phtml" hash="e0170b5cafea6eafc8205646c332c655"/><file name="myformexport.phtml" hash="8a7e24498503d21c43bbc20b1f951923"/></dir></dir><dir name="layout"><file name="connection.xml" hash="c04acab938ef8c19cd8505117849e1c8"/></dir></dir></dir></dir></target></contents>
24
  <compatible/>
25
  <dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php></required></dependencies>
26
  </package>