Magmodules_Kiyoh - Version 1.0.0

Version Notes

First stable release

Download this release

Release Info

Developer Magento Core Team
Extension Magmodules_Kiyoh
Version 1.0.0
Comparing to
See all releases


Version 1.0.0

Files changed (59) hide show
  1. app/code/local/Magmodules/Kiyoh/Block/Adminhtml/Kiyohlog.php +40 -0
  2. app/code/local/Magmodules/Kiyoh/Block/Adminhtml/Kiyohlog/Grid.php +127 -0
  3. app/code/local/Magmodules/Kiyoh/Block/Adminhtml/Kiyohreviews.php +40 -0
  4. app/code/local/Magmodules/Kiyoh/Block/Adminhtml/Kiyohreviews/Grid.php +148 -0
  5. app/code/local/Magmodules/Kiyoh/Block/Adminhtml/Kiyohreviews/Renderer/Experience.php +37 -0
  6. app/code/local/Magmodules/Kiyoh/Block/Adminhtml/Widget/Buttons/Process.php +38 -0
  7. app/code/local/Magmodules/Kiyoh/Block/Adminhtml/Widget/Buttons/Test.php +36 -0
  8. app/code/local/Magmodules/Kiyoh/Block/Adminhtml/Widget/Form/Heading.php +31 -0
  9. app/code/local/Magmodules/Kiyoh/Block/Adminhtml/Widget/Grid/Log.php +59 -0
  10. app/code/local/Magmodules/Kiyoh/Block/Adminhtml/Widget/Grid/Seconds.php +34 -0
  11. app/code/local/Magmodules/Kiyoh/Block/Adminhtml/Widget/Grid/Stars.php +96 -0
  12. app/code/local/Magmodules/Kiyoh/Block/Adminhtml/Widget/Info/Info.php +54 -0
  13. app/code/local/Magmodules/Kiyoh/Block/Custom.php +40 -0
  14. app/code/local/Magmodules/Kiyoh/Block/Reviews.php +64 -0
  15. app/code/local/Magmodules/Kiyoh/Block/Sidebar.php +126 -0
  16. app/code/local/Magmodules/Kiyoh/Block/Snippets.php +47 -0
  17. app/code/local/Magmodules/Kiyoh/Helper/Data.php +54 -0
  18. app/code/local/Magmodules/Kiyoh/Model/Api.php +121 -0
  19. app/code/local/Magmodules/Kiyoh/Model/Log.php +61 -0
  20. app/code/local/Magmodules/Kiyoh/Model/Mysql4/Log.php +28 -0
  21. app/code/local/Magmodules/Kiyoh/Model/Mysql4/Log/Collection.php +29 -0
  22. app/code/local/Magmodules/Kiyoh/Model/Mysql4/Reviews.php +28 -0
  23. app/code/local/Magmodules/Kiyoh/Model/Mysql4/Reviews/Collection.php +29 -0
  24. app/code/local/Magmodules/Kiyoh/Model/Mysql4/Stats.php +28 -0
  25. app/code/local/Magmodules/Kiyoh/Model/Mysql4/Stats/Collection.php +29 -0
  26. app/code/local/Magmodules/Kiyoh/Model/Observer.php +120 -0
  27. app/code/local/Magmodules/Kiyoh/Model/Reviews.php +137 -0
  28. app/code/local/Magmodules/Kiyoh/Model/Stats.php +134 -0
  29. app/code/local/Magmodules/Kiyoh/Model/System/Config/Source/Cronfrequency.php +35 -0
  30. app/code/local/Magmodules/Kiyoh/Model/System/Config/Source/Kiyoh.php +31 -0
  31. app/code/local/Magmodules/Kiyoh/Model/System/Config/Source/Orderstatus.php +39 -0
  32. app/code/local/Magmodules/Kiyoh/Model/System/Config/Source/Position.php +31 -0
  33. app/code/local/Magmodules/Kiyoh/Model/System/Config/Source/Sidebarlink.php +32 -0
  34. app/code/local/Magmodules/Kiyoh/controllers/Adminhtml/KiyohlogController.php +68 -0
  35. app/code/local/Magmodules/Kiyoh/controllers/Adminhtml/KiyohreviewsController.php +143 -0
  36. app/code/local/Magmodules/Kiyoh/controllers/IndexController.php +52 -0
  37. app/code/local/Magmodules/Kiyoh/etc/adminhtml.xml +92 -0
  38. app/code/local/Magmodules/Kiyoh/etc/config.xml +231 -0
  39. app/code/local/Magmodules/Kiyoh/etc/system.xml +544 -0
  40. app/code/local/Magmodules/Kiyoh/sql/kiyoh_setup/mysql4-install-1.0.0.php +102 -0
  41. app/design/adminhtml/default/default/layout/magmodules_kiyoh.xml +16 -0
  42. app/design/frontend/base/default/layout/magmodules_kiyoh.xml +36 -0
  43. app/design/frontend/base/default/template/magmodules/kiyoh/index.phtml +148 -0
  44. app/design/frontend/base/default/template/magmodules/kiyoh/sidebar/left.phtml +71 -0
  45. app/design/frontend/base/default/template/magmodules/kiyoh/sidebar/right.phtml +71 -0
  46. app/design/frontend/base/default/template/magmodules/kiyoh/widget/custom.phtml +39 -0
  47. app/design/frontend/base/default/template/magmodules/kiyoh/widget/richsnippets.phtml +34 -0
  48. app/etc/modules/Magmodules_Kiyoh.xml +9 -0
  49. package.xml +18 -0
  50. skin/adminhtml/default/default/magmodules/kiyoh/grid.css +96 -0
  51. skin/adminhtml/default/default/magmodules/kiyoh/star.png +0 -0
  52. skin/frontend/base/default/magmodules/kiyoh/images/5-stars-empty.png +0 -0
  53. skin/frontend/base/default/magmodules/kiyoh/images/5-stars-full.png +0 -0
  54. skin/frontend/base/default/magmodules/kiyoh/images/greystar.png +0 -0
  55. skin/frontend/base/default/magmodules/kiyoh/images/logo.png +0 -0
  56. skin/frontend/base/default/magmodules/kiyoh/images/star.png +0 -0
  57. skin/frontend/base/default/magmodules/kiyoh/richsnippets.css +41 -0
  58. skin/frontend/base/default/magmodules/kiyoh/sidebar.css +54 -0
  59. skin/frontend/base/default/magmodules/kiyoh/style.css +134 -0
app/code/local/Magmodules/Kiyoh/Block/Adminhtml/Kiyohlog.php ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magmodules.eu
4
+ * http://www.magmodules.eu
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Open Software License (OSL 3.0)
9
+ * that is bundled with this package in the file LICENSE.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/osl-3.0.php
12
+ * If you did not receive a copy of the license and are unable to
13
+ * obtain it through the world-wide-web, please send an email
14
+ * to info@magmodules.eu so we can send you a copy immediately.
15
+ *
16
+ * @category Magmodules
17
+ * @package Magmodules_Kiyoh
18
+ * @author Magmodules <info@magmodules.eu)
19
+ * @copyright Copyright (c) 2015 (http://www.magmodules.eu)
20
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
21
+ */
22
+
23
+ class Magmodules_Kiyoh_Block_Adminhtml_Kiyohlog extends Mage_Adminhtml_Block_Widget_Grid_Container {
24
+
25
+ public function __construct() {
26
+ $this->_controller = 'adminhtml_kiyohlog';
27
+ $this->_blockGroup = 'kiyoh';
28
+ $this->_headerText = Mage::helper('kiyoh')->__('Kiyoh Logs');
29
+ parent::__construct();
30
+ $this->_removeButton('add');
31
+
32
+ $this->_addButton('module_controller', array(
33
+ 'label' => Mage::helper('kiyoh')->__('Cleanup Log'),
34
+ 'onclick' => "setLocation('{$this->getUrl('adminhtml/kiyohlog/clean')}')",
35
+ 'confirm' => Mage::helper('kiyoh')->__('Are you sure you want to cleanup logfiles?'),
36
+ ));
37
+
38
+ }
39
+
40
+ }
app/code/local/Magmodules/Kiyoh/Block/Adminhtml/Kiyohlog/Grid.php ADDED
@@ -0,0 +1,127 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magmodules.eu
4
+ * http://www.magmodules.eu
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Open Software License (OSL 3.0)
9
+ * that is bundled with this package in the file LICENSE.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/osl-3.0.php
12
+ * If you did not receive a copy of the license and are unable to
13
+ * obtain it through the world-wide-web, please send an email
14
+ * to info@magmodules.eu so we can send you a copy immediately.
15
+ *
16
+ * @category Magmodules
17
+ * @package Magmodules_Kiyoh
18
+ * @author Magmodules <info@magmodules.eu)
19
+ * @copyright Copyright (c) 2015 (http://www.magmodules.eu)
20
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
21
+ */
22
+
23
+ class Magmodules_Kiyoh_Block_Adminhtml_Kiyohlog_Grid extends Mage_Adminhtml_Block_Widget_Grid {
24
+
25
+ public function __construct() {
26
+ parent::__construct();
27
+ $this->setId('kiyohlogGrid');
28
+ $this->setDefaultSort('date');
29
+ $this->setDefaultDir('DESC');
30
+ $this->setSaveParametersInSession(true);
31
+ }
32
+
33
+ protected function _prepareCollection() {
34
+ $collection = Mage::getModel('kiyoh/log')->getCollection();
35
+ $this->setCollection($collection);
36
+ return parent::_prepareCollection();
37
+ }
38
+
39
+ protected function _prepareColumns() {
40
+
41
+ $this->addColumn('company', array(
42
+ 'header' => Mage::helper('kiyoh')->__('Shop'),
43
+ 'index' => 'company',
44
+ 'width' => '120px',
45
+ ));
46
+
47
+ $this->addColumn('type', array(
48
+ 'header' => Mage::helper('kiyoh')->__('Type'),
49
+ 'align' => 'left',
50
+ 'index' => 'type',
51
+ 'width' => '120',
52
+ 'type' => 'options',
53
+ 'options'=> array(
54
+ 'reviews' => Mage::helper('kiyoh')->__('Reviews'),
55
+ 'invitation' => Mage::helper('kiyoh')->__('Invitation Call'),
56
+ ),
57
+ ));
58
+
59
+ if(Mage::app()->getRequest()->getParam('showapiurl')) {
60
+ $this->addColumn('api_url', array(
61
+ 'header' => Mage::helper('kiyoh')->__('Api URL'),
62
+ 'align' => 'left',
63
+ 'index' => 'api_url',
64
+ 'filter' => false,
65
+ 'sortable' => false,
66
+ ));
67
+ }
68
+
69
+ $this->addColumn('qty', array(
70
+ 'header' => Mage::helper('kiyoh')->__('Description'),
71
+ 'align' => 'left',
72
+ 'index' => 'qty',
73
+ 'renderer' => 'kiyoh/adminhtml_widget_grid_log',
74
+ 'filter' => false,
75
+ 'sortable' => false,
76
+ ));
77
+
78
+ $this->addColumn('cron', array(
79
+ 'header' => Mage::helper('kiyoh')->__('Cron'),
80
+ 'align' => 'left',
81
+ 'index' => 'cron',
82
+ 'width' => '120',
83
+ 'type' => 'options',
84
+ 'options' => array(
85
+ '' => Mage::helper('kiyoh')->__('Manual'),
86
+ 'stats' => Mage::helper('kiyoh')->__('Stats Cron'),
87
+ 'reviews' => Mage::helper('kiyoh')->__('Reviews Cron'),
88
+ 'orderupdate' => Mage::helper('kiyoh')->__('Invitation'),
89
+ ),
90
+ ));
91
+
92
+ $this->addColumn('time', array(
93
+ 'header' => Mage::helper('kiyoh')->__('Time'),
94
+ 'align' => 'left',
95
+ 'index' => 'time',
96
+ 'width' => '60',
97
+ 'renderer' => 'kiyoh/adminhtml_widget_grid_seconds',
98
+ ));
99
+
100
+ $this->addColumn('date', array(
101
+ 'header' => Mage::helper('kiyoh')->__('Date'),
102
+ 'align' => 'left',
103
+ 'type' => 'datetime',
104
+ 'index' => 'date',
105
+ 'width' => '140',
106
+ ));
107
+
108
+ return parent::_prepareColumns();
109
+ }
110
+
111
+ protected function _prepareMassaction() {
112
+ $this->setMassactionIdField('id');
113
+ $this->getMassactionBlock()->setFormFieldName('logids');
114
+
115
+ $this->getMassactionBlock()->addItem('hide', array(
116
+ 'label' => Mage::helper('kiyoh')->__('Delete'),
117
+ 'url' => $this->getUrl('*/*/massDelete'),
118
+ ));
119
+ return $this;
120
+ }
121
+
122
+ public function getRowUrl($row)
123
+ {
124
+ return;
125
+ }
126
+
127
+ }
app/code/local/Magmodules/Kiyoh/Block/Adminhtml/Kiyohreviews.php ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magmodules.eu
4
+ * http://www.magmodules.eu
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Open Software License (OSL 3.0)
9
+ * that is bundled with this package in the file LICENSE.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/osl-3.0.php
12
+ * If you did not receive a copy of the license and are unable to
13
+ * obtain it through the world-wide-web, please send an email
14
+ * to info@magmodules.eu so we can send you a copy immediately.
15
+ *
16
+ * @category Magmodules
17
+ * @package Magmodules_Kiyoh
18
+ * @author Magmodules <info@magmodules.eu)
19
+ * @copyright Copyright (c) 2015 (http://www.magmodules.eu)
20
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
21
+ */
22
+
23
+ class Magmodules_Kiyoh_Block_Adminhtml_Kiyohreviews extends Mage_Adminhtml_Block_Widget_Grid_Container {
24
+
25
+ public function __construct() {
26
+ $this->_controller = 'adminhtml_kiyohreviews';
27
+ $this->_blockGroup = 'kiyoh';
28
+ $this->_headerText = Mage::helper('kiyoh')->__('Kiyoh Reviews');
29
+ parent::__construct();
30
+ $this->_removeButton('add');
31
+
32
+ $this->_addButton('module_controller', array(
33
+ 'label' => Mage::helper('kiyoh')->__('Delete all reviews'),
34
+ 'onclick' => "setLocation('{$this->getUrl('adminhtml/kiyohreviews/truncate')}')",
35
+ 'confirm' => Mage::helper('kiyoh')->__('Are you sure you want to delete all reviews?'),
36
+ ));
37
+
38
+ }
39
+
40
+ }
app/code/local/Magmodules/Kiyoh/Block/Adminhtml/Kiyohreviews/Grid.php ADDED
@@ -0,0 +1,148 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magmodules.eu - http://www.magmodules.eu
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to info@magmodules.eu so we can send you a copy immediately.
14
+ *
15
+ * @category Magmodules
16
+ * @package Magmodules_Kiyoh
17
+ * @author Magmodules <info@magmodules.eu)
18
+ * @copyright Copyright (c) 2015 (http://www.magmodules.eu)
19
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
20
+ */
21
+
22
+ class Magmodules_Kiyoh_Block_Adminhtml_Kiyohreviews_Grid extends Mage_Adminhtml_Block_Widget_Grid {
23
+
24
+ public function __construct() {
25
+ parent::__construct();
26
+ $this->setId('reviewsGrid');
27
+ $this->setDefaultSort('date_created');
28
+ $this->setDefaultDir('DESC');
29
+ $this->setSaveParametersInSession(true);
30
+ }
31
+
32
+ protected function _prepareCollection() {
33
+ $collection = Mage::getModel('kiyoh/reviews')->getCollection();
34
+ $this->setCollection($collection);
35
+ return parent::_prepareCollection();
36
+ }
37
+
38
+ protected function _prepareColumns() {
39
+
40
+ $this->addColumn('company', array(
41
+ 'header' => Mage::helper('kiyoh')->__('Shop'),
42
+ 'index' => 'company',
43
+ 'width' => '120px',
44
+ ));
45
+
46
+ $this->addColumn('customer_name', array(
47
+ 'header' => Mage::helper('kiyoh')->__('User'),
48
+ 'align' => 'left',
49
+ 'index' => 'customer_name',
50
+ ));
51
+
52
+ $this->addColumn('customer_place', array(
53
+ 'header' => Mage::helper('kiyoh')->__('City'),
54
+ 'align' => 'left',
55
+ 'index' => 'customer_place',
56
+ ));
57
+
58
+ $this->addColumn('score', array(
59
+ 'header' => Mage::helper('kiyoh')->__('Score'),
60
+ 'align' => 'left',
61
+ 'index' => 'score',
62
+ 'renderer' => 'kiyoh/adminhtml_widget_grid_stars',
63
+ 'width' => '110',
64
+ 'filter' => false,
65
+ 'sortable' => true,
66
+ ));
67
+
68
+ $this->addColumn('customer_email', array(
69
+ 'header' => Mage::helper('kiyoh')->__('Email'),
70
+ 'align' => 'left',
71
+ 'index' => 'customer_email',
72
+ ));
73
+
74
+ $this->addColumn('recommendation', array(
75
+ 'header' => Mage::helper('kiyoh')->__('Recommendation'),
76
+ 'align' => 'left',
77
+ 'index' => 'recommendation',
78
+ 'width' => '80px',
79
+ 'type' => 'options',
80
+ 'options' => array(
81
+ 0 => Mage::helper('kiyoh')->__('No'),
82
+ 1 => Mage::helper('kiyoh')->__('Yes'),
83
+ ),
84
+ ));
85
+
86
+ $this->addColumn('date_created', array(
87
+ 'header' => Mage::helper('kiyoh')->__('Date'),
88
+ 'align' => 'left',
89
+ 'type' => 'date',
90
+ 'index' => 'date_created',
91
+ 'width' => '140',
92
+ ));
93
+
94
+ $this->addColumn('sidebar', array(
95
+ 'header' => Mage::helper('kiyoh')->__('Sidebar'),
96
+ 'align' => 'left',
97
+ 'width' => '80px',
98
+ 'index' => 'sidebar',
99
+ 'type' => 'options',
100
+ 'options' => array(
101
+ 0 => Mage::helper('kiyoh')->__('No'),
102
+ 1 => Mage::helper('kiyoh')->__('Yes'),
103
+ ),
104
+ ));
105
+
106
+ $this->addColumn('status', array(
107
+ 'header' => Mage::helper('kiyoh')->__('Active'),
108
+ 'align' => 'left',
109
+ 'width' => '80px',
110
+ 'index' => 'status',
111
+ 'type' => 'options',
112
+ 'options' => array(
113
+ 0 => Mage::helper('kiyoh')->__('No'),
114
+ 1 => Mage::helper('kiyoh')->__('Yes'),
115
+ ),
116
+ ));
117
+
118
+ return parent::_prepareColumns();
119
+ }
120
+
121
+ protected function _prepareMassaction() {
122
+ $this->setMassactionIdField('review_id');
123
+ $this->getMassactionBlock()->setFormFieldName('reviewids');
124
+
125
+ $this->getMassactionBlock()->addItem('hide', array(
126
+ 'label' => Mage::helper('kiyoh')->__('Set to invisible'),
127
+ 'url' => $this->getUrl('*/*/massDisable'),
128
+ ));
129
+ $this->getMassactionBlock()->addItem('visible', array(
130
+ 'label' => Mage::helper('kiyoh')->__('Set to visible'),
131
+ 'url' => $this->getUrl('*/*/massEnable'),
132
+ ));
133
+ $this->getMassactionBlock()->addItem('addsidebar', array(
134
+ 'label' => Mage::helper('kiyoh')->__('Add to Sidebar'),
135
+ 'url' => $this->getUrl('*/*/massEnableSidebar'),
136
+ ));
137
+ $this->getMassactionBlock()->addItem('removesidebar', array(
138
+ 'label' => Mage::helper('kiyoh')->__('Remove from Sidebar'),
139
+ 'url' => $this->getUrl('*/*/massDisableSidebar'),
140
+ ));
141
+ return $this;
142
+ }
143
+
144
+ public function getRowUrl($row) {
145
+ return false;
146
+ }
147
+
148
+ }
app/code/local/Magmodules/Kiyoh/Block/Adminhtml/Kiyohreviews/Renderer/Experience.php ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magmodules.eu
4
+ * http://www.magmodules.eu
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Open Software License (OSL 3.0)
9
+ * that is bundled with this package in the file LICENSE.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/osl-3.0.php
12
+ * If you did not receive a copy of the license and are unable to
13
+ * obtain it through the world-wide-web, please send an email
14
+ * to info@magmodules.eu so we can send you a copy immediately.
15
+ *
16
+ * @category Magmodules
17
+ * @package Magmodules_Kiyoh
18
+ * @author Magmodules <info@magmodules.eu)
19
+ * @copyright Copyright (c) 2015 (http://www.magmodules.eu)
20
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
21
+ */
22
+
23
+ class Magmodules_Kiyoh_Block_Adminhtml_Feedbackreviews_Renderer_Experience extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract {
24
+
25
+ public function render(Varien_Object $row) {
26
+ $value = $row->getData($this->getColumn()->getIndex());
27
+ $char_limit = '100';
28
+ if(strlen($value) > $char_limit) {
29
+ $content_small = Mage::helper('core/string')->truncate($value, $char_limit, ' ... <a href="#" class="magtooltip" alt="">(meer)', $_remainder, true);
30
+ $content = $content_small . '<span>' . $value . '</span></a>';
31
+ return $content;
32
+ } else {
33
+ return $value;
34
+ }
35
+ }
36
+
37
+ }
app/code/local/Magmodules/Kiyoh/Block/Adminhtml/Widget/Buttons/Process.php ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magmodules.eu - http://www.magmodules.eu
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to info@magmodules.eu so we can send you a copy immediately.
14
+ *
15
+ * @category Magmodules
16
+ * @package Magmodules_Kiyoh
17
+ * @author Magmodules <info@magmodules.eu)
18
+ * @copyright Copyright (c) 2015 (http://www.magmodules.eu)
19
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
20
+ */
21
+
22
+ class Magmodules_Kiyoh_Block_Adminhtml_Widget_Buttons_Process extends Mage_Adminhtml_Block_System_Config_Form_Field {
23
+
24
+ protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element) {
25
+ $this->setElement($element);
26
+ $url = $this->getUrl('*/kiyohreviews/process');
27
+
28
+ $html = $this->getLayout()->createBlock('adminhtml/widget_button')
29
+ ->setType('button')
30
+ ->setClass('scalable')
31
+ ->setLabel(Mage::helper('kiyoh')->__('Process Manually'))
32
+ ->setOnClick("setLocation('$url')")
33
+ ->toHtml();
34
+
35
+ return $html;
36
+ }
37
+
38
+ }
app/code/local/Magmodules/Kiyoh/Block/Adminhtml/Widget/Buttons/Test.php ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magmodules.eu - http://www.magmodules.eu
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to info@magmodules.eu so we can send you a copy immediately.
14
+ *
15
+ * @category Magmodules
16
+ * @package Magmodules_Kiyoh
17
+ * @author Magmodules <info@magmodules.eu)
18
+ * @copyright Copyright (c) 2015 (http://www.magmodules.eu)
19
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
20
+ */
21
+
22
+ class Magmodules_Kiyoh_Block_Adminhtml_Widget_Buttons_Test extends Mage_Adminhtml_Block_System_Config_Form_Field {
23
+
24
+ protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element) {
25
+ $this->setElement($element);
26
+ $url = $this->getUrl('*/kiyohreviews/testapi');
27
+ $html = $this->getLayout()->createBlock('adminhtml/widget_button')
28
+ ->setType('button')
29
+ ->setClass('scalable')
30
+ ->setLabel(Mage::helper('kiyoh')->__('Test API'))
31
+ ->setOnClick("setLocation('$url')")
32
+ ->toHtml();
33
+ return $html;
34
+ }
35
+
36
+ }
app/code/local/Magmodules/Kiyoh/Block/Adminhtml/Widget/Form/Heading.php ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magmodules.eu - http://www.magmodules.eu
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to info@magmodules.eu so we can send you a copy immediately.
14
+ *
15
+ * @category Magmodules
16
+ * @package Magmodules_Kiyoh
17
+ * @author Magmodules <info@magmodules.eu)
18
+ * @copyright Copyright (c) 2015 (http://www.magmodules.eu)
19
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
20
+ */
21
+
22
+ class Magmodules_Kiyoh_Block_Adminhtml_Widget_Form_Heading extends Mage_Adminhtml_Block_Abstract implements Varien_Data_Form_Element_Renderer_Interface {
23
+
24
+ public function render(Varien_Data_Form_Element_Abstract $element) {
25
+ $useContainerId = $element->getData('use_container_id');
26
+ return sprintf('<tr class="system-fieldset-sub-head" id="row_%s"><td colspan="5"><h4>%s</h4></td></tr>',
27
+ $element->getHtmlId(), $element->getLabel()
28
+ );
29
+ }
30
+
31
+ }
app/code/local/Magmodules/Kiyoh/Block/Adminhtml/Widget/Grid/Log.php ADDED
@@ -0,0 +1,59 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magmodules.eu - http://www.magmodules.eu
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to info@magmodules.eu so we can send you a copy immediately.
14
+ *
15
+ * @category Magmodules
16
+ * @package Magmodules_Kiyoh
17
+ * @author Magmodules <info@magmodules.eu)
18
+ * @copyright Copyright (c) 2015 (http://www.magmodules.eu)
19
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
20
+ */
21
+
22
+ class Magmodules_Kiyoh_Block_Adminhtml_Widget_Grid_Log extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Action {
23
+
24
+ public function render(Varien_Object $row) {
25
+ $type = $row->getType();
26
+ $msg = '';
27
+
28
+ if($type == 'reviews') {
29
+ $updates = '';
30
+ if($row->getReviewNew() > 0) {
31
+ $msg .= Mage::helper('kiyoh')->__('%s new review(s)', $row->getReviewNew());
32
+ $updates++;
33
+ }
34
+ if($row->getReviewUpdate() > 0) {
35
+ if($updates > 0) {
36
+ $msg .= ', ';
37
+ }
38
+ $msg .= Mage::helper('kiyoh')->__('%s review(s) updated', $row->getReviewUpdate());
39
+ $updates++;
40
+ }
41
+ if($updates > 0) {
42
+ $msg .= ' & ';
43
+ }
44
+ $msg .= Mage::helper('kiyoh')->__('total score updated');
45
+ }
46
+
47
+ if($type == 'invitation') {
48
+ if($row->getOrderId()) {
49
+ $order = Mage::getModel('sales/order')->load($row->getOrderId());
50
+ $increment_id = $order->getIncrementId();
51
+ $order_url = Mage::helper('adminhtml')->getUrl("adminhtml/sales_order/view", array('order_id'=> $row->getOrderId()));
52
+ $msg = Mage::helper('kiyoh')->__('%s - Repsonse: %s', '<a href="' . $order_url . '">#' . $increment_id .'</a>', $row->getResponse());
53
+ }
54
+ }
55
+
56
+ return ucfirst($msg);
57
+ }
58
+
59
+ }
app/code/local/Magmodules/Kiyoh/Block/Adminhtml/Widget/Grid/Seconds.php ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magmodules.eu - http://www.magmodules.eu
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to info@magmodules.eu so we can send you a copy immediately.
14
+ *
15
+ * @category Magmodules
16
+ * @package Magmodules_Kiyoh
17
+ * @author Magmodules <info@magmodules.eu)
18
+ * @copyright Copyright (c) 2015 (http://www.magmodules.eu)
19
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
20
+ */
21
+
22
+ class Magmodules_Kiyoh_Block_Adminhtml_Widget_Grid_Seconds extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Action {
23
+
24
+ public function render(Varien_Object $row) {
25
+ $value = $row->getData($this->getColumn()->getIndex());
26
+
27
+ if($value > 0) {
28
+ $value = number_format($value, 3, '.', '');
29
+ }
30
+
31
+ return $value;
32
+ }
33
+
34
+ }
app/code/local/Magmodules/Kiyoh/Block/Adminhtml/Widget/Grid/Stars.php ADDED
@@ -0,0 +1,96 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magmodules.eu - http://www.magmodules.eu
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to info@magmodules.eu so we can send you a copy immediately.
14
+ *
15
+ * @category Magmodules
16
+ * @package Magmodules_Kiyoh
17
+ * @author Magmodules <info@magmodules.eu)
18
+ * @copyright Copyright (c) 2015 (http://www.magmodules.eu)
19
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
20
+ */
21
+
22
+ class Magmodules_Kiyoh_Block_Adminhtml_Widget_Grid_Stars extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Action {
23
+
24
+ public function render(Varien_Object $row) {
25
+ $value = $row->getData($this->getColumn()->getIndex());
26
+
27
+ if($value == '0') {
28
+ $output = '';
29
+ } else {
30
+ $o = 0;
31
+ $output = '<span class="rating-empty"><span class="rating-star-' . $value . '"></span></span>';
32
+ $output .= '<a href="#" class="magtooltip" alt="">(i)<span>';
33
+
34
+ $shop_id = $row->getData('shop_id');
35
+ $review_stats = Mage::getModel('kiyoh/stats')->load($shop_id, 'shop_id');
36
+
37
+ $output .= '<strong>' . Mage::helper('kiyoh')->__('Overall') . ':</strong> ' . $row->getData('score') . '/10<br>';
38
+
39
+ if($row->getData('score_q2') > 0) {
40
+ $output .= '<strong>' . $review_stats->getScoreQ2Title() . ':</strong> ' . $row->getData('score_q2') . '/10<br>';
41
+ $o++;
42
+ }
43
+ if($row->getData('score_q3') > 0) {
44
+ $output .= '<strong>' . $review_stats->getScoreQ3Title(). '</strong> ' . $row->getData('score_q3') . '/10<br>';
45
+ $o++;
46
+ }
47
+ if($row->getData('score_q4' > 0)) {
48
+ $output .= '<strong>' . $review_stats->getScoreQ4Title() . '</strong> ' . $row->getData('score_q4') . '/10<br>';
49
+ $o++;
50
+ }
51
+ if($row->getData('score_q5') > 0) {
52
+ $output .= '<strong>' . $review_stats->getScoreQ5Title() . '</strong> ' . $row->getData('score_q5') . '/10<br>';
53
+ $o++;
54
+ }
55
+ if($row->getData('score_q6') > 0) {
56
+ $output .= '<strong>' . $review_stats->getScoreQ6Title() . '</strong> ' . $row->getData('score_q6') . '/10<br>';
57
+ $o++;
58
+ }
59
+ if($row->getData('score_q7') > 0) {
60
+ $output .= '<strong>' . $review_stats->getScoreQ7Title() . '</strong> ' . $row->getData('score_q7') . '/10<br>';
61
+ $o++;
62
+ }
63
+ if($row->getData('score_q8') > 0) {
64
+ $output .= '<strong>' . $review_stats->getScoreQ8Title() . '</strong> ' . $row->getData('score_q8') . '/10<br>';
65
+ $o++;
66
+ }
67
+ if($row->getData('score_q9') > 0) {
68
+ $output .= '<strong>' . $review_stats->getScoreQ9Title() . '</strong> ' . $row->getData('score_q9') . '/10<br>';
69
+ $o++;
70
+ }
71
+ if($row->getData('score_q10') > 0) {
72
+ $output .= '<strong>' . $review_stats->getScoreQ10Title() . '</strong> ' . $row->getData('score_q10') . '/10<br>';
73
+ $o++;
74
+ }
75
+
76
+ if($o > 0) {
77
+ $output .= '<br/>';
78
+ }
79
+
80
+ if($row->getData('positive')) {
81
+ $output .= '<strong>' . Mage::helper('kiyoh')->__('Positive') . ':</strong> ' . $row->getData('positive') .'<br>';
82
+ }
83
+ if($row->getData('negative')) {
84
+ $output .= '<strong>' . Mage::helper('kiyoh')->__('Negative') . ':</strong> ' . $row->getData('negative') .'<br>';
85
+ }
86
+ if($row->getData('reaction')) {
87
+ $output .= '<strong>' . Mage::helper('kiyoh')->__('Reaction') . ':</strong> ' . $row->getData('reaction') .'<br>';
88
+ }
89
+
90
+ $output .= '</span></a>';
91
+ }
92
+
93
+ return $output;
94
+ }
95
+
96
+ }
app/code/local/Magmodules/Kiyoh/Block/Adminhtml/Widget/Info/Info.php ADDED
@@ -0,0 +1,54 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magmodules.eu - http://www.magmodules.eu
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to info@magmodules.eu so we can send you a copy immediately.
14
+ *
15
+ * @category Magmodules
16
+ * @package Magmodules_Kiyoh
17
+ * @author Magmodules <info@magmodules.eu)
18
+ * @copyright Copyright (c) 2015 (http://www.magmodules.eu)
19
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
20
+ */
21
+
22
+ class Magmodules_Kiyoh_Block_Adminhtml_Widget_Info_Info extends Mage_Adminhtml_Block_Abstract implements Varien_Data_Form_Element_Renderer_Interface {
23
+
24
+ public function render(Varien_Data_Form_Element_Abstract $element) {
25
+ $html = '<div style="background:url(\'http://www.magmodules.eu/_logo.png\') no-repeat scroll 15px center #EAF0EE;border:1px solid #CCCCCC;margin-bottom:10px;padding:10px 5px 5px 200px;">
26
+ <h4>About Magmodules.eu</h4>
27
+ <p>We are a Magento only E-commerce Agency located in the Netherlands.<br>
28
+ <br />
29
+ <table width="500px" border="0">
30
+ <tr>
31
+ <td width="58%">View more extensions from us:</td>
32
+ <td width="42%"><a href="http://www.magentocommerce.com/magento-connect/developer/Magmodules" target="_blank">Magento Connect</a></td>
33
+ </tr>
34
+ <td>Send us an E-mail:
35
+ <td><a href="mailto:info@magmodules.eu">info@magmodules.eu</a></td>
36
+ </tr>
37
+ <tr>
38
+ <td height="30">Visit our website:</td>
39
+ <td><a href="http://www.magmodules.eu" target="_blank">www.magmodules.eu</a></td>
40
+ </tr>
41
+ <tr>
42
+ <td>&nbsp;</td>
43
+ <td>&nbsp;</td>
44
+ </tr>
45
+ <tr>
46
+ <td height="30"><strong>Need help?</strong></td>
47
+ <td><strong><a href="http://www.magmodules.eu/help/kiyoh" target="_blank">Online manual</a></strong></td>
48
+ </tr>
49
+ </table>
50
+ </div>';
51
+ return $html;
52
+ }
53
+
54
+ }
app/code/local/Magmodules/Kiyoh/Block/Custom.php ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magmodules.eu
4
+ * http://www.magmodules.eu
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Open Software License (OSL 3.0)
9
+ * that is bundled with this package in the file LICENSE.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/osl-3.0.php
12
+ * If you did not receive a copy of the license and are unable to
13
+ * obtain it through the world-wide-web, please send an email
14
+ * to info@magmodules.eu so we can send you a copy immediately.
15
+ *
16
+ * @category Magmodules
17
+ * @package Magmodules_Kiyoh
18
+ * @author Magmodules <info@magmodules.eu)
19
+ * @copyright Copyright (c) 2015 (http://www.magmodules.eu)
20
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
21
+ */
22
+
23
+ class Magmodules_Kiyoh_Block_Custom extends Mage_Core_Block_Template {
24
+
25
+ protected function _construct() {
26
+ if(Mage::getStoreConfig('kiyoh/general/enabled')) {
27
+ $this->setKiyohEnabled(1);
28
+ } else {
29
+ $this->setKiyohEnabled(0);
30
+ }
31
+
32
+ parent::_construct();
33
+ $this->setTemplate('magmodules/kiyoh/widget/custom.phtml');
34
+ }
35
+
36
+ public function getKiyohData() {
37
+ return $this->helper('kiyoh')->getTotalScore();
38
+ }
39
+
40
+ }
app/code/local/Magmodules/Kiyoh/Block/Reviews.php ADDED
@@ -0,0 +1,64 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magmodules.eu - http://www.magmodules.eu
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to info@magmodules.eu so we can send you a copy immediately.
14
+ *
15
+ * @category Magmodules
16
+ * @package Magmodules_Kiyoh
17
+ * @author Magmodules <info@magmodules.eu)
18
+ * @copyright Copyright (c) 2015 (http://www.magmodules.eu)
19
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
20
+ */
21
+
22
+ class Magmodules_Kiyoh_Block_Reviews extends Mage_Core_Block_Template {
23
+
24
+ public function __construct() {
25
+ parent::__construct();
26
+
27
+ // Load Reviews
28
+ $collection = Mage::getModel('kiyoh/reviews')->getCollection();
29
+ $collection->setOrder('date_created', 'DESC');
30
+ $collection->addFieldToFilter('status',1);
31
+ $collection->addFieldToFilter('shop_id', Mage::getStoreConfig('kiyoh/general/api_id'));
32
+ $this->setReviews($collection);
33
+
34
+ // Load Stats
35
+ $stats = Mage::getModel('kiyoh/stats')->load(Mage::getStoreConfig('kiyoh/general/api_id'), 'shop_id');
36
+ $this->setStats($stats);
37
+ }
38
+
39
+ public function _prepareLayout() {
40
+ parent::_prepareLayout();
41
+ $pager = $this->getLayout()->createBlock('page/html_pager', 'kiyoh.pager');
42
+ if(Mage::getStoreConfig('kiyoh/overview/enable_paging')) {
43
+ $fieldPerPage = Mage::getStoreConfig('kiyoh/overview/paging_settings');
44
+ $fieldPerPage = explode(',', $fieldPerPage);
45
+ $fieldPerPage = array_combine($fieldPerPage, $fieldPerPage);
46
+ $pager->setAvailableLimit($fieldPerPage);
47
+ } else {
48
+ $pager->setAvailableLimit(array('all'=>'all'));
49
+ }
50
+ $pager->setCollection($this->getReviews());
51
+ $this->setChild('pager', $pager);
52
+ $this->getReviews()->load();
53
+ return $this;
54
+ }
55
+
56
+ public function getPagerHtml() {
57
+ return $this->getChildHtml('pager');
58
+ }
59
+
60
+ public function getFormUrl() {
61
+ return $this->helper('kiyoh')->getFormUrl();
62
+ }
63
+
64
+ }
app/code/local/Magmodules/Kiyoh/Block/Sidebar.php ADDED
@@ -0,0 +1,126 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magmodules.eu - http://www.magmodules.eu
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to info@magmodules.eu so we can send you a copy immediately.
14
+ *
15
+ * @category Magmodules
16
+ * @package Magmodules_Kiyoh
17
+ * @author Magmodules <info@magmodules.eu)
18
+ * @copyright Copyright (c) 2015 (http://www.magmodules.eu)
19
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
20
+ */
21
+
22
+ class Magmodules_Kiyoh_Block_Sidebar extends Mage_Core_Block_Template {
23
+
24
+ protected function _construct() {
25
+ parent::_construct();
26
+ }
27
+
28
+ function getSidebarCollection($sidebar) {
29
+
30
+ $enabled = '';
31
+ $qty = '5';
32
+
33
+ if(Mage::getStoreConfig('kiyoh/general/enabled')):
34
+ if($sidebar == 'left'):
35
+ $qty = Mage::getStoreConfig('kiyoh/sidebar/left_qty');
36
+ $enabled = Mage::getStoreConfig('kiyoh/sidebar/left');
37
+ endif;
38
+ if($sidebar == 'right'):
39
+ $qty = Mage::getStoreConfig('kiyoh/sidebar/right_qty');
40
+ $enabled = Mage::getStoreConfig('kiyoh/sidebar/right');
41
+ endif;
42
+ endif;
43
+
44
+ if($enabled):
45
+ $shop_id = Mage::getStoreConfig('kiyoh/general/api_id');
46
+ $collection = Mage::getModel("kiyoh/reviews")->getCollection();
47
+ $collection->setOrder('date_created', 'DESC');
48
+ $collection->addFieldToFilter('status',1);
49
+ $collection->addFieldToFilter('sidebar',1);
50
+ $collection->addFieldToFilter('shop_id', array('eq'=> array($shop_id)));
51
+ $collection->setPageSize($qty);
52
+ $collection->load();
53
+ return $collection;
54
+ else:
55
+ return false;
56
+ endif;
57
+ }
58
+
59
+ function formatContent($sidebarreview, $sidebar = 'left') {
60
+
61
+ $content = $sidebarreview->getPositive();
62
+
63
+ if($sidebar == 'left'):
64
+ $char_limit = Mage::getStoreConfig('kiyoh/sidebar/left_lenght');
65
+ endif;
66
+ if($sidebar == 'right'):
67
+ $char_limit = Mage::getStoreConfig('kiyoh/sidebar/right_lenght');
68
+ endif;
69
+
70
+ $content = Mage::helper('core/string')->truncate($content, $char_limit, ' ...', $_remainder, false);
71
+
72
+ if($content) {
73
+ $content = '"' . $content . '"';
74
+ }
75
+
76
+ return $content;
77
+
78
+ }
79
+
80
+ function getReviewsUrl($sidebar = 'left') {
81
+
82
+ if($sidebar == 'left'):
83
+ $link = Mage::getStoreConfig('kiyoh/sidebar/left_link');
84
+ endif;
85
+ if($sidebar == 'right'):
86
+ $link = Mage::getStoreConfig('kiyoh/sidebar/left_right');
87
+ endif;
88
+
89
+ if($link == 'internal'):
90
+ $url = $this->getUrl('kiyoh');
91
+ endif;
92
+ if($link == 'external'):
93
+ $url = Mage::getStoreConfig('kiyoh/general/url');
94
+ endif;
95
+
96
+ if($url) {
97
+ return '<a href="' . $url . '">' . $this->__('View all reviews') . '</a>';
98
+ } else {
99
+ return false;
100
+ }
101
+
102
+ }
103
+
104
+ function getSnippetsEnabled($sidebar = 'left') {
105
+
106
+ if($sidebar == 'left'):
107
+ $enabled = Mage::getStoreConfig('kiyoh/sidebar/left_snippets');
108
+ endif;
109
+ if($sidebar == 'right'):
110
+ $enabled = Mage::getStoreConfig('kiyoh/sidebar/right_snippets');
111
+ endif;
112
+
113
+ $homepage = Mage::getBlockSingleton('page/html_header')->getIsHomePage();
114
+
115
+ if($enabled && $homepage) {
116
+ return true;
117
+ } else {
118
+ return false;
119
+ }
120
+ }
121
+
122
+ public function getTotalScore() {
123
+ return $this->helper('kiyoh')->getTotalScore();
124
+ }
125
+
126
+ }
app/code/local/Magmodules/Kiyoh/Block/Snippets.php ADDED
@@ -0,0 +1,47 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magmodules.eu - http://www.magmodules.eu
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to info@magmodules.eu so we can send you a copy immediately.
14
+ *
15
+ * @category Magmodules
16
+ * @package Magmodules_Kiyoh
17
+ * @author Magmodules <info@magmodules.eu)
18
+ * @copyright Copyright (c) 2015 (http://www.magmodules.eu)
19
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
20
+ */
21
+
22
+ class Magmodules_Kiyoh_Block_Snippets extends Mage_Core_Block_Template {
23
+
24
+ protected function _construct() {
25
+ if(Mage::getStoreConfig('kiyoh/general/enabled')) {
26
+ $this->setSnippetsEnabled(1);
27
+ } else {
28
+ $this->setSnippetsEnabled(0);
29
+ }
30
+
31
+ parent::_construct();
32
+ $this->setTemplate('magmodules/kiyoh/widget/richsnippets.phtml');
33
+ }
34
+
35
+ public function getSnippets() {
36
+ return $this->helper('kiyoh')->getTotalScore();
37
+ }
38
+
39
+ public function getHtmlStars($rating) {
40
+ return $this->helper('kiyoh')->getHtmlStars($rating);
41
+ }
42
+
43
+ public function getExternalLink() {
44
+ return $this->helper('kiyoh')->getExternalLink();
45
+ }
46
+
47
+ }
app/code/local/Magmodules/Kiyoh/Helper/Data.php ADDED
@@ -0,0 +1,54 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magmodules.eu - http://www.magmodules.eu
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to info@magmodules.eu so we can send you a copy immediately.
14
+ *
15
+ * @category Magmodules
16
+ * @package Magmodules_Kiyoh
17
+ * @author Magmodules <info@magmodules.eu)
18
+ * @copyright Copyright (c) 2015 (http://www.magmodules.eu)
19
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
20
+ */
21
+
22
+ class Magmodules_Kiyoh_Helper_Data extends Mage_Core_Helper_Abstract {
23
+
24
+ public function getTotalScore() {
25
+ $qty = 0; $rating = 0;
26
+ $shop_id = Mage::getStoreConfig('kiyoh/general/api_id');
27
+ $review_stats = Mage::getModel('kiyoh/stats')->load($shop_id, 'shop_id');
28
+ if($review_stats->getScore() > 0) {
29
+ $review_stats->setPercentage($review_stats->getScore());
30
+ $review_stats->setStarsQty(number_format(($review_stats->getScore() / 10), 1, ',', ''));
31
+ return $review_stats;
32
+ } else {
33
+ return false;
34
+ }
35
+ }
36
+
37
+ function getExternalLink() {
38
+ if(Mage::getStoreConfig('kiyoh/general/url')) {
39
+ return Mage::helper('kiyoh')->__('on') . ' <a href="' . Mage::getStoreConfig('kiyoh/general/url'). '" target="_blank">Kiyoh.nl</a>';
40
+ } else {
41
+ return false;
42
+ }
43
+ }
44
+
45
+ function getHtmlStars($rating)
46
+ {
47
+ $perc = $rating;
48
+ $html = '<div class="rating-box">';
49
+ $html .= ' <div class="rating" style="width:' . $perc . '%"></div>';
50
+ $html .= '</div>';
51
+ return $html;
52
+ }
53
+
54
+ }
app/code/local/Magmodules/Kiyoh/Model/Api.php ADDED
@@ -0,0 +1,121 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magmodules.eu - http://www.magmodules.eu
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to info@magmodules.eu so we can send you a copy immediately.
14
+ *
15
+ * @category Magmodules
16
+ * @package Magmodules_Kiyoh
17
+ * @author Magmodules <info@magmodules.eu)
18
+ * @copyright Copyright (c) 2015 (http://www.magmodules.eu)
19
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
20
+ */
21
+
22
+ class Magmodules_Kiyoh_Model_Api extends Mage_Core_Model_Abstract {
23
+
24
+ public function processFeed($storeid = 0, $type) {
25
+ if($feed = $this->getFeed($storeid, $type)) {
26
+ $results = Mage::getModel('kiyoh/reviews')->processFeed($feed, $storeid, $type);
27
+ $results['stats'] = Mage::getModel('kiyoh/stats')->processFeed($feed, $storeid);
28
+ return $results;
29
+ } else {
30
+ return false;
31
+ }
32
+ }
33
+
34
+ public function getFeed($storeid, $type = '') {
35
+ $api_id = Mage::getStoreConfig('kiyoh/general/api_id', $storeid);
36
+ $api_key = Mage::getStoreConfig('kiyoh/general/api_key', $storeid);
37
+ $api_url = Mage::getStoreConfig('kiyoh/general/api_url', $storeid);
38
+
39
+ if($type == 'stats') {
40
+ $api_url = 'https://' . $api_url . '/xml/recent_company_reviews.xml?connectorcode=' . $api_key . '&company_id=' . $api_id . '&reviewcount=10';
41
+ }
42
+ if($type == 'reviews') {
43
+ $api_url = 'https://' . $api_url . '/xml/recent_company_reviews.xml?connectorcode=' . $api_key . '&company_id=' . $api_id . '&reviewcount=10';
44
+ }
45
+ if($type == 'history') {
46
+ $api_url = 'https://' . $api_url . '/xml/recent_company_reviews.xml?connectorcode=' . $api_key . '&company_id=' . $api_id . '&reviewcount=10000';
47
+ }
48
+
49
+ if($api_id) {
50
+ $xml = simplexml_load_file($api_url);
51
+ if($xml) {
52
+ return $xml;
53
+ } else {
54
+ return false;
55
+ }
56
+ } else {
57
+ return false;
58
+ }
59
+ }
60
+
61
+ public function sendInvitation($order) {
62
+
63
+ $store_id = $order->getStoreId();
64
+ $start_time = microtime(true);
65
+ $crontype = 'orderupdate';
66
+ $order_id = $order->getIncrementId();
67
+ $api_id = Mage::getStoreConfig('kiyoh/general/api_id', $store_id);
68
+ $api_key = Mage::getStoreConfig('kiyoh/general/api_key', $store_id);
69
+ $api_url = Mage::getStoreConfig('kiyoh/general/api_url', $store_id);
70
+ $api_email = Mage::getStoreConfig('kiyoh/invitation/company_email', $store_id);
71
+ $delay = Mage::getStoreConfig('kiyoh/invitation/delay', $store_id);
72
+ $min_order = Mage::getStoreConfig('kiyoh/invitation/min_order_total', $store_id);
73
+ $inv_status = Mage::getStoreConfig('kiyoh/invitation/status', $store_id);
74
+ $email = strtolower($order->getCustomerEmail());
75
+ $order_total = $order->getGrandTotal();
76
+
77
+ if($order_total >= $min_order || $min_order == 0) {
78
+ if($order->getStatus() == $inv_status) {
79
+ $http = new Varien_Http_Adapter_Curl();
80
+ $http->setConfig(array('timeout' => 30, 'maxredirects' => 0));
81
+
82
+ $url = 'https://' . $api_url. '/set.php';
83
+ $request = "action=sendInvitation&connector=" . $api_key . "&targetMail=" . $email . "&delay=" . $delay . "&user=" . $api_email;
84
+
85
+ $http->write(Zend_Http_Client::POST, $url, '1.1', array(), $request);
86
+ $result = $http->read();
87
+
88
+ if($result) {
89
+ $lines = explode("\n", $result);
90
+ $response_html = $lines[0];
91
+ $lines = array_reverse($lines);
92
+ $response_html .= ' - ' . $lines[0];
93
+ } else {
94
+ $response_html = 'No response from ' . $url;
95
+ }
96
+
97
+ // Write to log
98
+ $writelog = Mage::getModel('kiyoh/log')->addToLog('invitation', $order->getStoreId(), '', $response_html, (microtime(true) - $start_time), $crontype, $url . '?' . $request, $order->getId());
99
+ return true;
100
+ }
101
+ } else {
102
+ return false;
103
+ }
104
+ }
105
+
106
+ public function getStoreIds() {
107
+ $resource = Mage::getSingleton('core/resource');
108
+ $read = $resource->getConnection('core_read');
109
+ $query = "SELECT DISTINCT value, scope_id FROM " . $resource->getTableName('core/config_data') . " WHERE path LIKE 'kiyoh/general/api_id'";
110
+ $results = $read->fetchAll($query);
111
+ $storeids = array();
112
+
113
+ foreach($results as $result) {
114
+ if($result['value'] > 0) {
115
+ $storeids[] = $result['scope_id'];
116
+ }
117
+ }
118
+ return $storeids;
119
+ }
120
+
121
+ }
app/code/local/Magmodules/Kiyoh/Model/Log.php ADDED
@@ -0,0 +1,61 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magmodules.eu - http://www.magmodules.eu
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to info@magmodules.eu so we can send you a copy immediately.
14
+ *
15
+ * @category Magmodules
16
+ * @package Magmodules_Kiyoh
17
+ * @author Magmodules <info@magmodules.eu)
18
+ * @copyright Copyright (c) 2015 (http://www.magmodules.eu)
19
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
20
+ */
21
+
22
+ class Magmodules_Kiyoh_Model_Log extends Mage_Core_Model_Abstract {
23
+
24
+ public function _construct() {
25
+ parent::_construct();
26
+ $this->_init('kiyoh/log');
27
+ }
28
+
29
+ public function addToLog($type, $storeid, $review = '', $inivation = '', $time, $crontype = '', $api_url = '', $orderid = '') {
30
+
31
+ if(Mage::getStoreConfig('kiyoh/log/enabled')) {
32
+
33
+ $api_id = Mage::getStoreConfig('kiyoh/general/api_id', $storeid);
34
+ $company = Mage::getStoreConfig('kiyoh/general/company', $storeid);
35
+ $review_updates = '';
36
+ $review_new = '';
37
+
38
+ if($review) {
39
+ $review_updates = $review['review_updates'];
40
+ $review_new = $review['review_new'];
41
+ }
42
+
43
+ $model = Mage::getModel('kiyoh/log');
44
+ $model->setType($type)
45
+ ->setShopId($api_id)
46
+ ->setCompany($company)
47
+ ->setReviewUpdate($review_updates)
48
+ ->setReviewNew($review_new)
49
+ ->setResponse($inivation)
50
+ ->setOrderId($orderid)
51
+ ->setCron($crontype)
52
+ ->setDate(now())
53
+ ->setTime($time)
54
+ ->setApiUrl($api_url)
55
+ ->save();
56
+ }
57
+
58
+ return;
59
+ }
60
+
61
+ }
app/code/local/Magmodules/Kiyoh/Model/Mysql4/Log.php ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magmodules.eu - http://www.magmodules.eu
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to info@magmodules.eu so we can send you a copy immediately.
14
+ *
15
+ * @category Magmodules
16
+ * @package Magmodules_Kiyoh
17
+ * @author Magmodules <info@magmodules.eu)
18
+ * @copyright Copyright (c) 2015 (http://www.magmodules.eu)
19
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
20
+ */
21
+
22
+ class Magmodules_Kiyoh_Model_Mysql4_Log extends Mage_Core_Model_Mysql4_Abstract {
23
+
24
+ public function _construct() {
25
+ $this->_init('kiyoh/log', 'id');
26
+ }
27
+
28
+ }
app/code/local/Magmodules/Kiyoh/Model/Mysql4/Log/Collection.php ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magmodules.eu - http://www.magmodules.eu
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to info@magmodules.eu so we can send you a copy immediately.
14
+ *
15
+ * @category Magmodules
16
+ * @package Magmodules_Kiyoh
17
+ * @author Magmodules <info@magmodules.eu)
18
+ * @copyright Copyright (c) 2015 (http://www.magmodules.eu)
19
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
20
+ */
21
+
22
+ class Magmodules_Kiyoh_Model_Mysql4_Log_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract {
23
+
24
+ public function _construct() {
25
+ parent::_construct();
26
+ $this->_init('kiyoh/log');
27
+ }
28
+
29
+ }
app/code/local/Magmodules/Kiyoh/Model/Mysql4/Reviews.php ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magmodules.eu - http://www.magmodules.eu
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to info@magmodules.eu so we can send you a copy immediately.
14
+ *
15
+ * @category Magmodules
16
+ * @package Magmodules_Kiyoh
17
+ * @author Magmodules <info@magmodules.eu)
18
+ * @copyright Copyright (c) 2015 (http://www.magmodules.eu)
19
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
20
+ */
21
+
22
+ class Magmodules_Kiyoh_Model_Mysql4_Reviews extends Mage_Core_Model_Mysql4_Abstract {
23
+
24
+ public function _construct() {
25
+ $this->_init('kiyoh/reviews', 'review_id');
26
+ }
27
+
28
+ }
app/code/local/Magmodules/Kiyoh/Model/Mysql4/Reviews/Collection.php ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magmodules.eu - http://www.magmodules.eu
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to info@magmodules.eu so we can send you a copy immediately.
14
+ *
15
+ * @category Magmodules
16
+ * @package Magmodules_Kiyoh
17
+ * @author Magmodules <info@magmodules.eu)
18
+ * @copyright Copyright (c) 2015 (http://www.magmodules.eu)
19
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
20
+ */
21
+
22
+ class Magmodules_Kiyoh_Model_Mysql4_Reviews_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract {
23
+
24
+ public function _construct() {
25
+ parent::_construct();
26
+ $this->_init('kiyoh/reviews');
27
+ }
28
+
29
+ }
app/code/local/Magmodules/Kiyoh/Model/Mysql4/Stats.php ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magmodules.eu - http://www.magmodules.eu
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to info@magmodules.eu so we can send you a copy immediately.
14
+ *
15
+ * @category Magmodules
16
+ * @package Magmodules_Kiyoh
17
+ * @author Magmodules <info@magmodules.eu)
18
+ * @copyright Copyright (c) 2015 (http://www.magmodules.eu)
19
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
20
+ */
21
+
22
+ class Magmodules_Kiyoh_Model_Mysql4_Stats extends Mage_Core_Model_Mysql4_Abstract {
23
+
24
+ public function _construct() {
25
+ $this->_init('kiyoh/stats', 'id');
26
+ }
27
+
28
+ }
app/code/local/Magmodules/Kiyoh/Model/Mysql4/Stats/Collection.php ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magmodules.eu - http://www.magmodules.eu
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to info@magmodules.eu so we can send you a copy immediately.
14
+ *
15
+ * @category Magmodules
16
+ * @package Magmodules_Kiyoh
17
+ * @author Magmodules <info@magmodules.eu)
18
+ * @copyright Copyright (c) 2015 (http://www.magmodules.eu)
19
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
20
+ */
21
+
22
+ class Magmodules_Kiyoh_Model_Mysql4_Stats_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract {
23
+
24
+ public function _construct() {
25
+ parent::_construct();
26
+ $this->_init('kiyoh/stats');
27
+ }
28
+
29
+ }
app/code/local/Magmodules/Kiyoh/Model/Observer.php ADDED
@@ -0,0 +1,120 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magmodules.eu - http://www.magmodules.eu
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to info@magmodules.eu so we can send you a copy immediately.
14
+ *
15
+ * @category Magmodules
16
+ * @package Magmodules_Kiyoh
17
+ * @author Magmodules <info@magmodules.eu)
18
+ * @copyright Copyright (c) 2015 (http://www.magmodules.eu)
19
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
20
+ */
21
+
22
+ class Magmodules_Kiyoh_Model_Observer {
23
+
24
+ public function processStats() {
25
+ $storeids = Mage::getModel('kiyoh/api')->getStoreIds();
26
+ foreach($storeids as $storeid) {
27
+ $enabled = Mage::getStoreConfig('kiyoh/general/enabled', $storeid);
28
+ $cron_enabled = Mage::getStoreConfig('kiyoh/reviews/cron', $storeid);
29
+ if($enabled && $cron_enabled) {
30
+ $crontype = 'stats';
31
+ $start_time = microtime(true);
32
+ $feed = Mage::getModel('kiyoh/api')->getFeed($storeid, $crontype);
33
+ $resuls = array();
34
+ $results['stats'] = Mage::getModel('kiyoh/stats')->processFeed($feed, $storeid);
35
+ $results['company'] = $feed->company;
36
+ $log = Mage::getModel('kiyoh/log')->addToLog('reviews', $storeid, $results, '', (microtime(true) - $start_time), $crontype);
37
+ }
38
+ }
39
+ Mage::getModel('kiyoh/stats')->processOverall();
40
+ }
41
+
42
+ public function processReviews() {
43
+ $storeids = Mage::getModel('kiyoh/api')->getStoreIds();
44
+ foreach($storeids as $storeid) {
45
+ $enabled = Mage::getStoreConfig('kiyoh/general/enabled', $storeid);
46
+ $cron_enabled = Mage::getStoreConfig('kiyoh/reviews/cron', $storeid);
47
+ if($enabled && $cron_enabled) {
48
+ $crontype = 'reviews';
49
+ $start_time = microtime(true);
50
+ $feed = Mage::getModel('kiyoh/api')->getFeed($storeid, $crontype);
51
+ $results = Mage::getModel('kiyoh/reviews')->processFeed($feed, $storeid, $crontype);
52
+ $results['stats'] = Mage::getModel('kiyoh/stats')->processFeed($feed, $storeid, $type);
53
+ $log = Mage::getModel('kiyoh/log')->addToLog('reviews', $storeid, $results, '', (microtime(true) - $start_time), $crontype);
54
+ }
55
+ }
56
+ }
57
+
58
+ public function processHistory() {
59
+ $storeids = Mage::getModel('kiyoh/api')->getStoreIds();
60
+ foreach($storeids as $storeid) {
61
+ $enabled = Mage::getStoreConfig('kiyoh/general/enabled', $storeid);
62
+ $cron_enabled = Mage::getStoreConfig('kiyoh/reviews/cron', $storeid);
63
+ if($enabled && $cron_enabled) {
64
+ $crontype = 'history';
65
+ $start_time = microtime(true); $storeid = 0;
66
+ $feed = Mage::getModel('kiyoh/api')->getFeed($storeid, $crontype);
67
+ $results = Mage::getModel('kiyoh/reviews')->processFeed($feed, $storeid, $crontype);
68
+ $results['stats'] = Mage::getModel('kiyoh/stats')->processFeed($feed, $storeid);
69
+ $log = Mage::getModel('kiyoh/log')->addToLog('reviews', $storeid, $results, '', (microtime(true) - $start_time), $crontype);
70
+ }
71
+ }
72
+ }
73
+
74
+ public function cleanLog() {
75
+ $enabled = Mage::getStoreConfig('kiyoh/log/clean', 0);
76
+ $days = Mage::getStoreConfig('kiyoh/log/clean_days', 0);
77
+ if(($enabled) && ($days > 0)) {
78
+ $logmodel = Mage::getModel('kiyoh/log');
79
+ $deldate = date('Y-m-d', strtotime('-' . $days . ' days'));
80
+ $logs = $logmodel->getCollection()->addFieldToSelect('id')->addFieldToFilter('date', array('lteq' => $deldate));
81
+ foreach ($logs as $log) {
82
+ $logmodel->load($log->getId())->delete();
83
+ }
84
+ }
85
+ }
86
+
87
+ public function processFeedbackInvitationcallAfterShipment($observer) {
88
+ $shipment = $observer->getEvent()->getShipment();
89
+ $order = $shipment->getOrder();
90
+ if((Mage::getStoreConfig('kiyoh/invitation/enabled', $order->getStoreId())) && (Mage::getStoreConfig('kiyoh/invitation/connector', $order->getStoreId()))):
91
+ if($order->getStatus() == Mage::getStoreConfig('kiyoh/invitation/status', $order->getStoreId())):
92
+ if(Mage::getStoreConfig('kiyoh/invitation/backlog', $order->getStoreId()) > 0):
93
+ $date_diff = floor(time() - strtotime($order->getCreatedAt()))/(60*60*24);
94
+ if($date_diff < Mage::getStoreConfig('kiyoh/invitation/backlog', $order->getStoreId())):
95
+ Mage::getModel('kiyoh/api')->sendInvitation($order);
96
+ endif;
97
+ else:
98
+ Mage::getModel('kiyoh/api')->sendInvitation($order);
99
+ endif;
100
+ endif;
101
+ endif;
102
+ }
103
+
104
+ public function processFeedbackInvitationcall($observer) {
105
+ $order = $observer->getEvent()->getOrder();
106
+ if((Mage::getStoreConfig('kiyoh/invitation/enabled', $order->getStoreId())) && (Mage::getStoreConfig('kiyoh/invitation/connector', $order->getStoreId()))):
107
+ if($order->getStatus() == Mage::getStoreConfig('kiyoh/invitation/status', $order->getStoreId())):
108
+ if(Mage::getStoreConfig('kiyoh/invitation/backlog', $order->getStoreId()) > 0):
109
+ $date_diff = floor(time() - strtotime($order->getCreatedAt()))/(60*60*24);
110
+ if($date_diff < Mage::getStoreConfig('kiyoh/invitation/backlog', $order->getStoreId())):
111
+ $value = Mage::getModel('kiyoh/api')->sendInvitation($order);
112
+ endif;
113
+ else:
114
+ Mage::getModel('kiyoh/api')->sendInvitation($order);
115
+ endif;
116
+ endif;
117
+ endif;
118
+ }
119
+
120
+ }
app/code/local/Magmodules/Kiyoh/Model/Reviews.php ADDED
@@ -0,0 +1,137 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magmodules.eu - http://www.magmodules.eu
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to info@magmodules.eu so we can send you a copy immediately.
14
+ *
15
+ * @category Magmodules
16
+ * @package Magmodules_Kiyoh
17
+ * @author Magmodules <info@magmodules.eu)
18
+ * @copyright Copyright (c) 2015 (http://www.magmodules.eu)
19
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
20
+ */
21
+
22
+ class Magmodules_Kiyoh_Model_Reviews extends Mage_Core_Model_Abstract {
23
+
24
+ public function _construct() {
25
+ parent::_construct();
26
+ $this->_init('kiyoh/reviews');
27
+ }
28
+
29
+ public function loadbyKiyohId($kiyoh_id) {
30
+ $this->_getResource()->load($this, $kiyoh_id, 'kiyoh_id');
31
+ return $this;
32
+ }
33
+
34
+ public function processFeed($feed, $storeid = 0, $type) {
35
+
36
+ $updates = 0; $new = 0; $history = 0;
37
+ $api_id = Mage::getStoreConfig('kiyoh/general/api_id', $storeid);
38
+ $company = $feed->company->name;
39
+
40
+ foreach($feed->review_list->review as $review) {
41
+
42
+ $kiyoh_id = $review->id;
43
+ $customer_name = $review->customer->name;
44
+ $customer_email = $review->customer->email;
45
+ $customer_place = $review->customer->place;
46
+ $date = $review->customer->date;
47
+ $total_score = $review->total_score;
48
+
49
+ $recommendation = $review->recommendation;
50
+ $positive = $review->positive;
51
+ $negative = $review->negative;
52
+ $purchase = $review->purchase;
53
+ $reaction = $review->reaction;
54
+
55
+ if(($recommendation == 'Ja') || ($recommendation == 'Yes')) {
56
+ $recommendation = 1;
57
+ } else {
58
+ $recommendation = 0;
59
+ }
60
+
61
+ $questions = array();
62
+ foreach($review->questions->question as $question) {
63
+ $questions[] = $question->score;
64
+ }
65
+
66
+ $indatabase = $this->loadbyKiyohId($kiyoh_id);
67
+
68
+ if($indatabase->getId()) {
69
+ if($type == 'history') {
70
+ $reviews = Mage::getModel('kiyoh/reviews');
71
+ $reviews->setReviewId($indatabase->getReviewId())
72
+ ->setShopId($api_id)
73
+ ->setCompany($company)
74
+ ->setKiyohId($kiyoh_id)
75
+ ->setCustomerName($customer_name)
76
+ ->setCustomerEmail($customer_email)
77
+ ->setCustomerPlace($customer_place)
78
+ ->setScore($total_score)
79
+ ->setScoreQ2($questions[0])
80
+ ->setScoreQ3($questions[1])
81
+ ->setScoreQ4($questions[2])
82
+ ->setScoreQ5($questions[3])
83
+ ->setScoreQ6($questions[4])
84
+ ->setScoreQ7($questions[5])
85
+ ->setScoreQ8($questions[6])
86
+ ->setScoreQ9($questions[7])
87
+ ->setScoreQ10($questions[8])
88
+ ->setRecommendation($recommendation)
89
+ ->setPositive($positive)
90
+ ->setNegative($negative)
91
+ ->setPurchase($purchase)
92
+ ->setReaction($reaction)
93
+ ->setDateCreated($date)
94
+ ->save();
95
+ $updates++;
96
+ } else {
97
+ break;
98
+ }
99
+ } else {
100
+ $reviews = Mage::getModel('kiyoh/reviews');
101
+ $reviews->setShopId($api_id)
102
+ ->setCompany($company)
103
+ ->setKiyohId($kiyoh_id)
104
+ ->setCustomerName($customer_name)
105
+ ->setCustomerEmail($customer_email)
106
+ ->setCustomerPlace($customer_place)
107
+ ->setScore($total_score)
108
+ ->setScoreQ2($questions[0])
109
+ ->setScoreQ3($questions[1])
110
+ ->setScoreQ4($questions[2])
111
+ ->setScoreQ5($questions[3])
112
+ ->setScoreQ6($questions[4])
113
+ ->setScoreQ7($questions[5])
114
+ ->setScoreQ8($questions[6])
115
+ ->setScoreQ9($questions[7])
116
+ ->setScoreQ10($questions[8])
117
+ ->setRecommendation($recommendation)
118
+ ->setPositive($positive)
119
+ ->setNegative($negative)
120
+ ->setPurchase($purchase)
121
+ ->setReaction($reaction)
122
+ ->setDateCreated($date)
123
+ ->save();
124
+ $new++;
125
+ }
126
+ }
127
+
128
+ $config = new Mage_Core_Model_Config();
129
+ $config->saveConfig('kiyoh/reviews/lastrun', now(), 'default', $storeid);
130
+ $result = array();
131
+ $result['review_updates'] = $updates;
132
+ $result['review_new'] = $new;
133
+ $result['company'] = $company;
134
+ return $result;
135
+ }
136
+
137
+ }
app/code/local/Magmodules/Kiyoh/Model/Stats.php ADDED
@@ -0,0 +1,134 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magmodules.eu - http://www.magmodules.eu
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to info@magmodules.eu so we can send you a copy immediately.
14
+ *
15
+ * @category Magmodules
16
+ * @package Magmodules_Kiyoh
17
+ * @author Magmodules <info@magmodules.eu)
18
+ * @copyright Copyright (c) 2015 (http://www.magmodules.eu)
19
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
20
+ */
21
+ class Magmodules_Kiyoh_Model_Stats extends Mage_Core_Model_Abstract {
22
+
23
+ public function _construct() {
24
+ parent::_construct();
25
+ $this->_init('kiyoh/stats');
26
+ }
27
+
28
+ public function processFeed($feed, $storeid = 0) {
29
+ $shop_id = Mage::getStoreConfig('kiyoh/general/api_id', $storeid);
30
+ $company = $feed->company->name;
31
+
32
+ if($storeid == 0) {
33
+ $config = new Mage_Core_Model_Config();
34
+ $config->saveConfig('kiyoh/general/url', $feed->company->url, 'default', $storeid);
35
+ $config->saveConfig('kiyoh/general/company', $feed->company->name, 'default', $storeid);
36
+ } else {
37
+ $config = new Mage_Core_Model_Config();
38
+ $config->saveConfig('kiyoh/general/url', $feed->company->url, 'stores', $storeid);
39
+ $config->saveConfig('kiyoh/general/company', $feed->company->name, 'stores', $storeid);
40
+ }
41
+
42
+ if($feed->company->total_reviews > 0) {
43
+ $score = floatval($feed->company->total_score);
44
+ $score = ($score * 10);
45
+ $scoremax = '100';
46
+ $votes = $feed->company->total_reviews;
47
+
48
+ // Check for update or save
49
+ if($indatabase = $this->loadbyShopId($shop_id)) {
50
+ $id = $indatabase->getId();
51
+ } else {
52
+ $id = '';
53
+ }
54
+
55
+ $questions = array();
56
+ foreach($feed->company->average_scores->questions->question as $question) {
57
+ $questions[] = array('title' => $question->title, 'score' => $question->score);
58
+ }
59
+
60
+ // Save Review Stats
61
+ $model = Mage::getModel('kiyoh/stats');
62
+ $model->setId($id)
63
+ ->setShopId($shop_id)
64
+ ->setCompany($company)
65
+ ->setScore($score)
66
+ ->setScoreQ2($questions[0]['score'])
67
+ ->setScoreQ2Title($questions[0]['title'])
68
+ ->setScoreQ3($questions[1]['score'])
69
+ ->setScoreQ3Title($questions[1]['title'])
70
+ ->setScoreQ4($questions[2]['score'])
71
+ ->setScoreQ4Title($questions[2]['title'])
72
+ ->setScoreQ5($questions[3]['score'])
73
+ ->setScoreQ5Title($questions[3]['title'])
74
+ ->setScoreQ6($questions[4]['score'])
75
+ ->setScoreQ6Title($questions[4]['title'])
76
+ ->setScoreQ7($questions[5]['score'])
77
+ ->setScoreQ7Title($questions[5]['title'])
78
+ ->setScoreQ8($questions[6]['score'])
79
+ ->setScoreQ8Title($questions[6]['title'])
80
+ ->setScoreQ9($questions[7]['score'])
81
+ ->setScoreQ9Title($questions[7]['title'])
82
+ ->setScoreQ10($questions[8]['score'])
83
+ ->setScoreQ10Title($questions[8]['title'])
84
+ ->setScoremax($scoremax)
85
+ ->setVotes($votes)
86
+ ->save();
87
+ return true;
88
+ } else {
89
+ return false;
90
+ }
91
+ }
92
+
93
+ public function processOverall() {
94
+ $stats = Mage::getModel('kiyoh/stats')->getCollection();
95
+ $stats->addFieldToFilter('shop_id', array('neq' => '0'));
96
+
97
+ $score = '';
98
+ $scoremax = '';
99
+ $votes= '';
100
+ $i = 0;
101
+
102
+ foreach($stats as $stat) {
103
+ $score = ($score + $stat->getScore());
104
+ $scoremax = ($scoremax + $stat->getScoremax());
105
+ $votes = ($votes + $stat->getVotes());
106
+ $i++;
107
+ }
108
+
109
+ $score = ($score / $i);
110
+ $scoremax = ($scoremax / $i);
111
+ $company = 'Overall';
112
+
113
+ if($indatabase = $this->loadbyShopId(0)) {
114
+ $id = $indatabase->getId();
115
+ } else {
116
+ $id = '';
117
+ }
118
+
119
+ $model = Mage::getModel('kiyoh/stats')
120
+ ->setId($id)
121
+ ->setShopId(0)
122
+ ->setCompany($company)
123
+ ->setScore($score)
124
+ ->setScoremax($scoremax)
125
+ ->setVotes($votes)
126
+ ->save();
127
+ }
128
+
129
+ public function loadbyShopId($shop_id) {
130
+ $this->_getResource()->load($this, $shop_id, 'shop_id');
131
+ return $this;
132
+ }
133
+
134
+ }
app/code/local/Magmodules/Kiyoh/Model/System/Config/Source/Cronfrequency.php ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magmodules.eu - http://www.magmodules.eu
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to info@magmodules.eu so we can send you a copy immediately.
14
+ *
15
+ * @category Magmodules
16
+ * @package Magmodules_Kiyoh
17
+ * @author Magmodules <info@magmodules.eu)
18
+ * @copyright Copyright (c) 2015 (http://www.magmodules.eu)
19
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
20
+ */
21
+
22
+ class Magmodules_Kiyoh_Model_System_Config_Source_Cronfrequency {
23
+
24
+ public function toOptionArray() {
25
+ return array(
26
+ '*/15 * * * *' => Mage::helper('kiyoh')->__('Every 15 minutes'),
27
+ '0 * * * *' => Mage::helper('kiyoh')->__('Every Hour'),
28
+ '0 */2 * * *' => Mage::helper('kiyoh')->__('Every other Hour'),
29
+ '0 8,20 * * *' => Mage::helper('kiyoh')->__('Twice a Day'),
30
+ '0 02 * * *' => Mage::helper('kiyoh')->__('Once a Day'),
31
+ '0 02 0 * *' => Mage::helper('kiyoh')->__('Once a Week'),
32
+ );
33
+ }
34
+
35
+ }
app/code/local/Magmodules/Kiyoh/Model/System/Config/Source/Kiyoh.php ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magmodules.eu - http://www.magmodules.eu
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to info@magmodules.eu so we can send you a copy immediately.
14
+ *
15
+ * @category Magmodules
16
+ * @package Magmodules_Kiyoh
17
+ * @author Magmodules <info@magmodules.eu)
18
+ * @copyright Copyright (c) 2015 (http://www.magmodules.eu)
19
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
20
+ */
21
+
22
+ class Magmodules_Kiyoh_Model_System_Config_Source_Kiyoh {
23
+
24
+ public function toOptionArray() {
25
+ return array(
26
+ 'kiyoh.nl' => Mage::helper('kiyoh')->__('Kiyoh.nl'),
27
+ 'kiyoh.com' => Mage::helper('kiyoh')->__('Kihoy.com'),
28
+ );
29
+ }
30
+
31
+ }
app/code/local/Magmodules/Kiyoh/Model/System/Config/Source/Orderstatus.php ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magmodules.eu - http://www.magmodules.eu
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to info@magmodules.eu so we can send you a copy immediately.
14
+ *
15
+ * @category Magmodules
16
+ * @package Magmodules_Kiyoh
17
+ * @author Magmodules <info@magmodules.eu)
18
+ * @copyright Copyright (c) 2015 (http://www.magmodules.eu)
19
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
20
+ */
21
+
22
+ class Magmodules_Kiyoh_Model_System_Config_Source_Orderstatus {
23
+
24
+ public function toOptionArray() {
25
+ $storeModel = Mage::getSingleton('adminhtml/system_store');
26
+ $statuses = Mage::getSingleton('sales/order_config')->getStatuses();
27
+ $options = array();
28
+
29
+ $this->_options = array(array('value' => 0, 'label' => Mage::helper('kiyoh') -> __('-- none')));
30
+
31
+ foreach($statuses as $k=>$v) {
32
+ $options[] = array('label' => $v, 'value' => $k);
33
+ }
34
+
35
+ $this->_options = array_merge($this->_options, $options);
36
+ return $this->_options;
37
+ }
38
+
39
+ }
app/code/local/Magmodules/Kiyoh/Model/System/Config/Source/Position.php ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magmodules.eu - http://www.magmodules.eu
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to info@magmodules.eu so we can send you a copy immediately.
14
+ *
15
+ * @category Magmodules
16
+ * @package Magmodules_Kiyoh
17
+ * @author Magmodules <info@magmodules.eu)
18
+ * @copyright Copyright (c) 2015 (http://www.magmodules.eu)
19
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
20
+ */
21
+
22
+ class Magmodules_Kiyoh_Model_System_Config_Source_Position {
23
+
24
+ public function toOptionArray() {
25
+ $position = array();
26
+ $position[] = array('value'=>'left', 'label' => Mage::helper('kiyoh')->__('Left'));
27
+ $position[] = array('value'=>'right', 'label' => Mage::helper('kiyoh')->__('Right'));
28
+ return $position;
29
+ }
30
+
31
+ }
app/code/local/Magmodules/Kiyoh/Model/System/Config/Source/Sidebarlink.php ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magmodules.eu - http://www.magmodules.eu
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to info@magmodules.eu so we can send you a copy immediately.
14
+ *
15
+ * @category Magmodules
16
+ * @package Magmodules_Kiyoh
17
+ * @author Magmodules <info@magmodules.eu)
18
+ * @copyright Copyright (c) 2015 (http://www.magmodules.eu)
19
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
20
+ */
21
+
22
+ class Magmodules_Kiyoh_Model_System_Config_Source_Sidebarlink {
23
+
24
+ public function toOptionArray() {
25
+ return array(
26
+ '' => Mage::helper('kiyoh')->__('None'),
27
+ 'external' => Mage::helper('kiyoh')->__('External (Kiyoh.nl)'),
28
+ 'internal' => Mage::helper('kiyoh')->__('Internal (/kiyoh)'),
29
+ );
30
+ }
31
+
32
+ }
app/code/local/Magmodules/Kiyoh/controllers/Adminhtml/KiyohlogController.php ADDED
@@ -0,0 +1,68 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magmodules.eu
4
+ * http://www.magmodules.eu
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Open Software License (OSL 3.0)
9
+ * that is bundled with this package in the file LICENSE.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/osl-3.0.php
12
+ * If you did not receive a copy of the license and are unable to
13
+ * obtain it through the world-wide-web, please send an email
14
+ * to info@magmodules.eu so we can send you a copy immediately.
15
+ *
16
+ * @category Magmodules
17
+ * @package Magmodules_Kiyoh
18
+ * @author Magmodules <info@magmodules.eu)
19
+ * @copyright Copyright (c) 2015 (http://www.magmodules.eu)
20
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
21
+ */
22
+
23
+ class Magmodules_Kiyoh_Adminhtml_KiyohlogController extends Mage_Adminhtml_Controller_Action {
24
+
25
+ protected function _initAction() {
26
+ $this->loadLayout()->_setActiveMenu('kiyoh/kiyohreviews')->_addBreadcrumb(Mage::helper('adminhtml')->__('Items Manager'), Mage::helper('adminhtml')->__('Item Manager'));
27
+ return $this;
28
+ }
29
+
30
+ public function indexAction() {
31
+ $this->_initAction()->renderLayout();
32
+ }
33
+
34
+ public function massDeleteAction() {
35
+ $LogIds = $this->getRequest()->getParam('logids');
36
+ if(!is_array($LogIds)) {
37
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('kiyoh')->__('Please select item(s)'));
38
+ } else {
39
+ try {
40
+ foreach ($LogIds as $id) {
41
+ $log = Mage::getModel('kiyoh/log')->load($id)->delete();
42
+ }
43
+ Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('kiyoh')->__('Total of %d log record(s) deleted.', count($LogIds)));
44
+ } catch (Exception $e) {
45
+ Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
46
+ }
47
+ }
48
+ $this->_redirect('*/*/index');
49
+ }
50
+
51
+ public function cleanAction() {
52
+ $enabled = Mage::getStoreConfig('kiyoh/log/clean');
53
+ $days = Mage::getStoreConfig('kiyoh/log/clean_days');
54
+ $i = 0;
55
+ if(($enabled) && ($days > 0)) {
56
+ $logmodel = Mage::getModel('kiyoh/log');
57
+ $deldate = date('Y-m-d', strtotime('-' . $days . ' days'));
58
+ $logs = $logmodel->getCollection()->addFieldToSelect('id')->addFieldToFilter('date', array('lteq' => $deldate));
59
+ foreach ($logs as $log) {
60
+ $logmodel->load($log->getId())->delete();
61
+ $i++;
62
+ }
63
+ Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('kiyoh')->__('Total of %s log record(s) deleted.', $i));
64
+ }
65
+ $this->_redirect('*/*/index');
66
+ }
67
+
68
+ }
app/code/local/Magmodules/Kiyoh/controllers/Adminhtml/KiyohreviewsController.php ADDED
@@ -0,0 +1,143 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magmodules.eu
4
+ * http://www.magmodules.eu
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Open Software License (OSL 3.0)
9
+ * that is bundled with this package in the file LICENSE.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/osl-3.0.php
12
+ * If you did not receive a copy of the license and are unable to
13
+ * obtain it through the world-wide-web, please send an email
14
+ * to info@magmodules.eu so we can send you a copy immediately.
15
+ *
16
+ * @category Magmodules
17
+ * @package Magmodules_Kiyoh
18
+ * @author Magmodules <info@magmodules.eu)
19
+ * @copyright Copyright (c) 2015 (http://www.magmodules.eu)
20
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
21
+ */
22
+
23
+ class Magmodules_Kiyoh_Adminhtml_KiyohreviewsController extends Mage_Adminhtml_Controller_Action {
24
+
25
+ protected function _initAction() {
26
+ $this->loadLayout()->_setActiveMenu('kiyoh/kiyohreviews')->_addBreadcrumb(Mage::helper('adminhtml')->__('Items Manager'), Mage::helper('adminhtml')->__('Item Manager'));
27
+ return $this;
28
+ }
29
+
30
+ public function indexAction() {
31
+ $this->_initAction()->renderLayout();
32
+ }
33
+
34
+ public function processAction() {
35
+ $storeids = Mage::getModel('kiyoh/api')->getStoreIds();
36
+ $start_time = microtime(true);
37
+ foreach($storeids as $storeid) {
38
+ $msg = '';
39
+ $api_id = Mage::getStoreConfig('kiyoh/general/api_id', $storeid);
40
+ $result = Mage::getModel('kiyoh/api')->processFeed($storeid, 'history');
41
+ $log = Mage::getModel('kiyoh/log')->addToLog('reviews', $storeid, $result, '', (microtime(true) - $start_time), '', '');
42
+
43
+ if(($result['review_new'] > 0) || ($result['review_updates'] > 0) || ($result['stats'] == true)) {
44
+ $msg = Mage::helper('kiyoh')->__('Webwinkel ID %s:', $api_id) . ' ';
45
+ $msg .= Mage::helper('kiyoh')->__('%s new review(s)', $result['review_new']) . ', ';
46
+ $msg .= Mage::helper('kiyoh')->__('%s review(s) updated', $result['review_updates']) . ' & ';
47
+ $msg .= Mage::helper('kiyoh')->__('and total score updated.');
48
+ }
49
+
50
+ if($msg) {
51
+ Mage::getSingleton('adminhtml/session')->addSuccess($msg);
52
+ } else {
53
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('kiyoh')->__('Webwinkel ID %s: no updates found, feed is empty or not found!', $api_id));
54
+ }
55
+ }
56
+ Mage::getModel('kiyoh/stats')->processOverall();
57
+ $this->_redirect('adminhtml/system_config/edit/section/kiyoh');
58
+ }
59
+
60
+ public function massDisableAction() {
61
+ $reviewIds = $this->getRequest()->getParam('reviewids');
62
+ if(!is_array($reviewIds)) {
63
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('kiyoh')->__('Please select item(s)'));
64
+ } else {
65
+ try {
66
+ foreach ($reviewIds as $review_id) {
67
+ $reviews = Mage::getModel('kiyoh/reviews')->load($review_id);
68
+ $reviews->setStatus(0)->save();
69
+ }
70
+ Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('kiyoh')->__('Total of %d review(s) were disabled.', count($reviewIds)));
71
+ } catch (Exception $e) {
72
+ Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
73
+ }
74
+ }
75
+ $this->_redirect('*/*/index');
76
+ }
77
+
78
+ public function massEnableAction() {
79
+ $reviewIds = $this->getRequest()->getParam('reviewids');
80
+ if(!is_array($reviewIds)) {
81
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('kiyoh')->__('Please select item(s)'));
82
+ } else {
83
+ try {
84
+ foreach ($reviewIds as $review_id) {
85
+ $reviews = Mage::getModel('kiyoh/reviews')->load($review_id);
86
+ $reviews->setStatus(1)->save();
87
+ }
88
+ Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('kiyoh')->__('Total of %d review(s) were enabled.', count($reviewIds)));
89
+ } catch (Exception $e) {
90
+ Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
91
+ }
92
+ }
93
+ $this->_redirect('*/*/index');
94
+ }
95
+
96
+ public function massEnableSidebarAction() {
97
+ $reviewIds = $this->getRequest()->getParam('reviewids');
98
+ if(!is_array($reviewIds)) {
99
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('kiyoh')->__('Please select item(s)'));
100
+ } else {
101
+ try {
102
+ foreach ($reviewIds as $review_id) {
103
+ $reviews = Mage::getModel('kiyoh/reviews')->load($review_id);
104
+ $reviews->setSidebar(1)->save();
105
+ }
106
+ Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('kiyoh')->__('Total of %d review(s) were added to the sidebar.', count($reviewIds)));
107
+ } catch (Exception $e) {
108
+ Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
109
+ }
110
+ }
111
+ $this->_redirect('*/*/index');
112
+ }
113
+
114
+ public function massDisableSidebarAction() {
115
+ $reviewIds = $this->getRequest()->getParam('reviewids');
116
+ if(!is_array($reviewIds)) {
117
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('kiyoh')->__('Please select item(s)'));
118
+ } else {
119
+ try {
120
+ foreach ($reviewIds as $review_id) {
121
+ $reviews = Mage::getModel('kiyoh/reviews')->load($review_id);
122
+ $reviews->setSidebar(0)->save();
123
+ }
124
+ Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('kiyoh')->__('Total of %d review(s) were removed from the sidebar.', count($reviewIds)));
125
+ } catch (Exception $e) {
126
+ Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
127
+ }
128
+ }
129
+ $this->_redirect('*/*/index');
130
+ }
131
+
132
+ public function truncateAction() {
133
+ $i = 0;
134
+ $collection = Mage::getModel('kiyoh/reviews')->getCollection();
135
+ foreach ($collection as $item) {
136
+ $item->delete();
137
+ $i++;
138
+ }
139
+ Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('kiyoh')->__('Succefully deleted all %s saved review(s).', $i));
140
+ $this->_redirect('*/*/index');
141
+ }
142
+
143
+ }
app/code/local/Magmodules/Kiyoh/controllers/IndexController.php ADDED
@@ -0,0 +1,52 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magmodules.eu
4
+ * http://www.magmodules.eu
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Open Software License (OSL 3.0)
9
+ * that is bundled with this package in the file LICENSE.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/osl-3.0.php
12
+ * If you did not receive a copy of the license and are unable to
13
+ * obtain it through the world-wide-web, please send an email
14
+ * to info@magmodules.eu so we can send you a copy immediately.
15
+ *
16
+ * @category Magmodules
17
+ * @package Magmodules_Kiyoh
18
+ * @author Magmodules <info@magmodules.eu)
19
+ * @copyright Copyright (c) 2015 (http://www.magmodules.eu)
20
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
21
+ */
22
+
23
+ class Magmodules_Kiyoh_IndexController extends Mage_Core_Controller_Front_Action {
24
+
25
+ public function indexAction() {
26
+
27
+ $enabled = Mage::getStoreConfig('kiyoh/general/enabled');
28
+ $overview = Mage::getStoreConfig('kiyoh/overview/enabled');
29
+
30
+ if($enabled && $overview) {
31
+ $this->loadLayout();
32
+ $head = $this->getLayout()->getBlock('head');
33
+
34
+ if($title = Mage::getStoreConfig('kiyoh/overview/meta_title')):
35
+ $head->setTitle($title);
36
+ endif;
37
+
38
+ if($description = Mage::getStoreConfig('kiyoh/overview/meta_description')):
39
+ $head->setDescription($description);
40
+ endif;
41
+
42
+ if($keywords = Mage::getStoreConfig('kiyoh/overview/meta_keywords')):
43
+ $head->setKeywords($keywords);
44
+ endif;
45
+
46
+ $this->renderLayout();
47
+ } else {
48
+ $this->_redirect('/');
49
+ }
50
+ }
51
+
52
+ }
app/code/local/Magmodules/Kiyoh/etc/adminhtml.xml ADDED
@@ -0,0 +1,92 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * Magmodules.eu
5
+ * http://www.magmodules.eu
6
+ *
7
+ * NOTICE OF LICENSE
8
+ *
9
+ * This source file is subject to the Open Software License (OSL 3.0)
10
+ * that is bundled with this package in the file LICENSE.txt.
11
+ * It is also available through the world-wide-web at this URL:
12
+ * http://opensource.org/licenses/osl-3.0.php
13
+ * If you did not receive a copy of the license and are unable to
14
+ * obtain it through the world-wide-web, please send an email
15
+ * to info@magmodules.eu so we can send you a copy immediately.
16
+ *
17
+ * @category Magmodules
18
+ * @package Magmodules_Kiyoh
19
+ * @author Magmodules <info@magmodules.eu)
20
+ * @copyright Copyright (c) 2015 (http://www.magmodules.eu)
21
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
22
+ */
23
+ -->
24
+ <config>
25
+ <menu>
26
+ <shopreview module="kiyoh">
27
+ <title>Reviews</title>
28
+ <sort_order>71</sort_order>
29
+ <children>
30
+ <kiyoh module="kiyoh">
31
+ <title>KiyOh Connect</title>
32
+ <sort_order>11</sort_order>
33
+ <children>
34
+ <kiyoh_reviews module="kiyoh">
35
+ <title>Manage Reviews</title>
36
+ <sort_order>100</sort_order>
37
+ <action>adminhtml/kiyohreviews/</action>
38
+ </kiyoh_reviews>
39
+ <kiyoh_log module="kiyoh">
40
+ <title>Manage Log</title>
41
+ <sort_order>110</sort_order>
42
+ <action>adminhtml/kiyohlog/</action>
43
+ </kiyoh_log>
44
+ <kiyoh_config module="kiyoh">
45
+ <title>KiyOh Config</title>
46
+ <sort_order>120</sort_order>
47
+ <action>adminhtml/system_config/edit/section/kiyoh</action>
48
+ </kiyoh_config>
49
+ </children>
50
+ </kiyoh>
51
+ </children>
52
+ </shopreview>
53
+ </menu>
54
+ <acl>
55
+ <resources>
56
+ <all>
57
+ <title>Allow Everything</title>
58
+ </all>
59
+ <admin>
60
+ <children>
61
+ <system>
62
+ <children>
63
+ <config>
64
+ <children>
65
+ <kiyoh translate="title" module="kiyoh">
66
+ <title>KiyOh Connect Permission Setting</title>
67
+ </kiyoh>
68
+ </children>
69
+ </config>
70
+ </children>
71
+ </system>
72
+ <kiyoh module="kiyoh">
73
+ <title>Kiyoh Connect</title>
74
+ <sort_order>60</sort_order>
75
+ <children>
76
+ <kiyoh_reviews module="kiyoh">
77
+ <title>Reviews</title>
78
+ <sort_order>100</sort_order>
79
+ <action>adminhtml/kiyohreviews/</action>
80
+ </kiyoh_reviews>
81
+ <kiyoh_log module="kiyoh">
82
+ <title>Log</title>
83
+ <sort_order>110</sort_order>
84
+ <action>adminhtml/kiyohlog/</action>
85
+ </kiyoh_log>
86
+ </children>
87
+ </kiyoh>
88
+ </children>
89
+ </admin>
90
+ </resources>
91
+ </acl>
92
+ </config>
app/code/local/Magmodules/Kiyoh/etc/config.xml ADDED
@@ -0,0 +1,231 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * Magmodules.eu
5
+ * http://www.magmodules.eu
6
+ *
7
+ * NOTICE OF LICENSE
8
+ *
9
+ * This source file is subject to the Open Software License (OSL 3.0)
10
+ * that is bundled with this package in the file LICENSE.txt.
11
+ * It is also available through the world-wide-web at this URL:
12
+ * http://opensource.org/licenses/osl-3.0.php
13
+ * If you did not receive a copy of the license and are unable to
14
+ * obtain it through the world-wide-web, please send an email
15
+ * to info@magmodules.eu so we can send you a copy immediately.
16
+ *
17
+ * @category Magmodules
18
+ * @package Magmodules_Kiyoh
19
+ * @author Magmodules <info@magmodules.eu)
20
+ * @copyright Copyright (c) 2015 (http://www.magmodules.eu)
21
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
22
+ */
23
+ -->
24
+ <config>
25
+ <modules>
26
+ <Magmodules_Kiyoh>
27
+ <version>1.0.0</version>
28
+ </Magmodules_Kiyoh>
29
+ </modules>
30
+ <global>
31
+ <models>
32
+ <kiyoh>
33
+ <class>Magmodules_Kiyoh_Model</class>
34
+ <resourceModel>kiyoh_mysql4</resourceModel>
35
+ </kiyoh>
36
+ <kiyoh_mysql4>
37
+ <class>Magmodules_Kiyoh_Model_Mysql4</class>
38
+ <entities>
39
+ <reviews>
40
+ <table>kiyoh_reviews</table>
41
+ </reviews>
42
+ <stats>
43
+ <table>kiyoh_stats</table>
44
+ </stats>
45
+ <log>
46
+ <table>kiyoh_log</table>
47
+ </log>
48
+ </entities>
49
+ </kiyoh_mysql4>
50
+ </models>
51
+ <resources>
52
+ <kiyoh_setup>
53
+ <setup>
54
+ <module>Magmodules_Kiyoh</module>
55
+ </setup>
56
+ <connection>
57
+ <use>core_setup</use>
58
+ </connection>
59
+ </kiyoh_setup>
60
+ <kiyoh_write>
61
+ <connection>
62
+ <use>core_write</use>
63
+ </connection>
64
+ </kiyoh_write>
65
+ <kiyoh_read>
66
+ <connection>
67
+ <use>core_read</use>
68
+ </connection>
69
+ </kiyoh_read>
70
+ </resources>
71
+ <helpers>
72
+ <kiyoh>
73
+ <class>Magmodules_Kiyoh_Helper</class>
74
+ </kiyoh>
75
+ </helpers>
76
+ <blocks>
77
+ <kiyoh>
78
+ <class>Magmodules_Kiyoh_Block</class>
79
+ </kiyoh>
80
+ </blocks>
81
+ <events>
82
+ <sales_order_shipment_save_after>
83
+ <observers>
84
+ <kiyoh>
85
+ <type>singleton</type>
86
+ <class>kiyoh/observer</class>
87
+ <method>processFeedbackInvitationcallAfterShipment</method>
88
+ </kiyoh>
89
+ </observers>
90
+ </sales_order_shipment_save_after>
91
+ <sales_order_save_commit_after>
92
+ <observers>
93
+ <kiyoh>
94
+ <type>singleton</type>
95
+ <class>kiyoh/observer</class>
96
+ <method>processFeedbackInvitationcall</method>
97
+ </kiyoh>
98
+ </observers>
99
+ </sales_order_save_commit_after>
100
+ </events>
101
+ </global>
102
+ <frontend>
103
+ <routers>
104
+ <kiyoh>
105
+ <use>standard</use>
106
+ <args>
107
+ <module>Magmodules_Kiyoh</module>
108
+ <frontName>kiyoh</frontName>
109
+ </args>
110
+ </kiyoh>
111
+ </routers>
112
+ <layout>
113
+ <updates>
114
+ <kiyoh>
115
+ <file>magmodules_kiyoh.xml</file>
116
+ </kiyoh>
117
+ </updates>
118
+ </layout>
119
+ <translate>
120
+ <modules>
121
+ <magmodules_kiyoh>
122
+ <files>
123
+ <default>Magmodules_Kiyoh.csv</default>
124
+ </files>
125
+ </magmodules_kiyoh>
126
+ </modules>
127
+ </translate>
128
+ </frontend>
129
+ <adminhtml>
130
+ <layout>
131
+ <updates>
132
+ <magmodules_kiyoh>
133
+ <file>magmodules_kiyoh.xml</file>
134
+ </magmodules_kiyoh>
135
+ </updates>
136
+ </layout>
137
+ <translate>
138
+ <modules>
139
+ <magmodules_kiyoh>
140
+ <files>
141
+ <default>Magmodules_Kiyoh.csv</default>
142
+ </files>
143
+ </magmodules_kiyoh>
144
+ </modules>
145
+ </translate>
146
+ </adminhtml>
147
+ <admin>
148
+ <routers>
149
+ <adminhtml>
150
+ <args>
151
+ <modules>
152
+ <magmodules_kiyoh after="Mage_Adminhtml">Magmodules_Kiyoh_Adminhtml</magmodules_kiyoh>
153
+ </modules>
154
+ </args>
155
+ </adminhtml>
156
+ </routers>
157
+ </admin>
158
+ <crontab>
159
+ <jobs>
160
+ <magmodules_kiyoh_stats>
161
+ <schedule><config_path>kiyoh/reviews/cron_stats</config_path></schedule>
162
+ <run><model>kiyoh/observer::processStats</model></run>
163
+ </magmodules_kiyoh_stats>
164
+ <magmodules_kiyoh_reviews>
165
+ <schedule><config_path>kiyoh/reviews/cron_reviews</config_path></schedule>
166
+ <run><model>kiyoh/observer::processReviews</model></run>
167
+ </magmodules_kiyoh_reviews>
168
+ <magmodules_kiyoh_reviewhistory>
169
+ <schedule><config_path>kiyoh/reviews/cron_all</config_path></schedule>
170
+ <run><model>kiyoh/observer::processHistory</model></run>
171
+ </magmodules_kiyoh_reviewhistory>
172
+ <magmodules_kiyoh_cleanlog>
173
+ <schedule><cron_expr>0 02 * * *</cron_expr></schedule>
174
+ <run><model>kiyoh/observer::cleanLog</model></run>
175
+ </magmodules_kiyoh_cleanlog>
176
+ </jobs>
177
+ </crontab>
178
+ <default>
179
+ <kiyoh>
180
+ <general>
181
+ <enabled>0</enabled>
182
+ </general>
183
+ <reviews>
184
+ <cron>0</cron>
185
+ <cron_stats>*/15 * * * *</cron_stats>
186
+ <cron_reviews>0 */2 * * *</cron_reviews>
187
+ <cron_all>0 02 0 * *</cron_all>
188
+ </reviews>
189
+ <sidebar>
190
+ <left>0</left>
191
+ <left_qty>3</left_qty>
192
+ <left_lenght>150</left_lenght>
193
+ <left_link>external</left_link>
194
+ <right>0</right>
195
+ <right_qty>3</right_qty>
196
+ <right_lenght>150</right_lenght>
197
+ <right_link>external</right_link>
198
+ </sidebar>
199
+ <snippets>
200
+ <sidebar>1</sidebar>
201
+ </snippets>
202
+ <overview>
203
+ <enabled>1</enabled>
204
+ <enable_paging>1</enable_paging>
205
+ <paging_settings>10,20,30</paging_settings>
206
+ <meta_title>KiyOh Reviews</meta_title>
207
+ <meta_description>KiyOh overview page</meta_description>
208
+ <meta_keywords>reviews, kiyoh</meta_keywords>
209
+ </overview>
210
+ <invitation>
211
+ <enabled>0</enabled>
212
+ <status>complete</status>
213
+ <delay>5</delay>
214
+ <backlog>20</backlog>
215
+ <remind_delay>0</remind_delay>
216
+ <resend>1</resend>
217
+ </invitation>
218
+ <frontend>
219
+ <enabled>0</enabled>
220
+ <tooltip>0</tooltip>
221
+ <sidebar_position>left</sidebar_position>
222
+ <sidebar_height>120</sidebar_height>
223
+ </frontend>
224
+ <log>
225
+ <enabled>1</enabled>
226
+ <clean>1</clean>
227
+ <clean_days>14</clean_days>
228
+ </log>
229
+ </kiyoh>
230
+ </default>
231
+ </config>
app/code/local/Magmodules/Kiyoh/etc/system.xml ADDED
@@ -0,0 +1,544 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * Magmodules.eu
5
+ * http://www.magmodules.eu
6
+ *
7
+ * NOTICE OF LICENSE
8
+ *
9
+ * This source file is subject to the Open Software License (OSL 3.0)
10
+ * that is bundled with this package in the file LICENSE.txt.
11
+ * It is also available through the world-wide-web at this URL:
12
+ * http://opensource.org/licenses/osl-3.0.php
13
+ * If you did not receive a copy of the license and are unable to
14
+ * obtain it through the world-wide-web, please send an email
15
+ * to info@magmodules.eu so we can send you a copy immediately.
16
+ *
17
+ * @category Magmodules
18
+ * @package Magmodules_Kiyoh
19
+ * @author Magmodules <info@magmodules.eu)
20
+ * @copyright Copyright (c) 2015 (http://www.magmodules.eu)
21
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
22
+ */
23
+ -->
24
+ <config>
25
+ <tabs>
26
+ <magmodules translate="label" module="kiyoh">
27
+ <label>Magmodules</label>
28
+ <sort_order>200</sort_order>
29
+ </magmodules>
30
+ </tabs>
31
+ <sections>
32
+ <kiyoh translate="label" module="kiyoh">
33
+ <label>KiyOh Connect</label>
34
+ <tab>magmodules</tab>
35
+ <frontend_type>text</frontend_type>
36
+ <sort_order>40</sort_order>
37
+ <show_in_default>1</show_in_default>
38
+ <show_in_website>1</show_in_website>
39
+ <show_in_store>1</show_in_store>
40
+ <groups>
41
+ <info>
42
+ <frontend_model>kiyoh/adminhtml_widget_info_info</frontend_model>
43
+ <sort_order>1</sort_order>
44
+ <show_in_default>1</show_in_default>
45
+ <show_in_website>1</show_in_website>
46
+ <show_in_store>1</show_in_store>
47
+ </info>
48
+ <general translate="label" module="kiyoh">
49
+ <label>General configuration</label>
50
+ <frontend_type>text</frontend_type>
51
+ <sort_order>2</sort_order>
52
+ <show_in_default>1</show_in_default>
53
+ <show_in_website>1</show_in_website>
54
+ <show_in_store>1</show_in_store>
55
+ <expanded>1</expanded>
56
+ <comment>
57
+ <![CDATA[
58
+ <script>
59
+ Event.observe(window, 'load', function() {
60
+ if ($('kiyoh_reviews_lastrun')) {
61
+ $('kiyoh_reviews_lastrun').style.backgroundColor='#f0f0f0';
62
+ $('kiyoh_reviews_lastrun').disable();
63
+ }
64
+ if ($('kiyoh_general_url')) {
65
+ $('kiyoh_general_url').style.backgroundColor='#f0f0f0';
66
+ $('kiyoh_general_url').disable();
67
+ }
68
+ if ($('kiyoh_general_company')) {
69
+ $('kiyoh_general_company').style.backgroundColor='#f0f0f0';
70
+ $('kiyoh_general_company').disable();
71
+ }
72
+ });
73
+ </script>
74
+ ]]>
75
+ </comment>
76
+ <fields>
77
+ <enabled translate="label">
78
+ <label>Enabled</label>
79
+ <frontend_type>select</frontend_type>
80
+ <source_model>adminhtml/system_config_source_yesno</source_model>
81
+ <sort_order>1</sort_order>
82
+ <show_in_default>1</show_in_default>
83
+ <show_in_website>1</show_in_website>
84
+ <show_in_store>1</show_in_store>
85
+ </enabled>
86
+ <heading_api translate="label">
87
+ <label>API CREDENTIALS</label>
88
+ <frontend_model>kiyoh/adminhtml_widget_form_heading</frontend_model>
89
+ <sort_order>2</sort_order>
90
+ <show_in_default>1</show_in_default>
91
+ <show_in_website>0</show_in_website>
92
+ <show_in_store>1</show_in_store>
93
+ </heading_api>
94
+ <api_url translate="label">
95
+ <label>Localisation</label>
96
+ <frontend_type>select</frontend_type>
97
+ <source_model>kiyoh/system_config_source_kiyoh</source_model>
98
+ <sort_order>3</sort_order>
99
+ <show_in_default>1</show_in_default>
100
+ <show_in_website>1</show_in_website>
101
+ <show_in_store>1</show_in_store>
102
+ </api_url>
103
+ <api_id translate="label">
104
+ <label>Company ID</label>
105
+ <frontend_type>text</frontend_type>
106
+ <sort_order>4</sort_order>
107
+ <show_in_default>1</show_in_default>
108
+ <show_in_website>0</show_in_website>
109
+ <show_in_store>1</show_in_store>
110
+ </api_id>
111
+ <api_key translate="label">
112
+ <label>Connector Code</label>
113
+ <frontend_type>text</frontend_type>
114
+ <sort_order>5</sort_order>
115
+ <show_in_default>1</show_in_default>
116
+ <show_in_website>0</show_in_website>
117
+ <show_in_store>1</show_in_store>
118
+ <tooltip>You can find this information in your Kiyoh account</tooltip>
119
+ </api_key>
120
+
121
+ <heading_company translate="label">
122
+ <label>Company Import</label>
123
+ <frontend_model>kiyoh/adminhtml_widget_form_heading</frontend_model>
124
+ <sort_order>10</sort_order>
125
+ <show_in_default>1</show_in_default>
126
+ <show_in_website>0</show_in_website>
127
+ <show_in_store>1</show_in_store>
128
+ </heading_company>
129
+ <company translate="label">
130
+ <label>Company</label>
131
+ <frontend_type>text</frontend_type>
132
+ <sort_order>11</sort_order>
133
+ <show_in_default>1</show_in_default>
134
+ <show_in_website>0</show_in_website>
135
+ <show_in_store>1</show_in_store>
136
+ </company>
137
+ <url translate="label">
138
+ <label>Url</label>
139
+ <frontend_type>text</frontend_type>
140
+ <sort_order>12</sort_order>
141
+ <show_in_default>1</show_in_default>
142
+ <show_in_website>0</show_in_website>
143
+ <show_in_store>1</show_in_store>
144
+ </url>
145
+ </fields>
146
+ </general>
147
+ <reviews translate="label" module="kiyoh">
148
+ <label>Kiyoh Import Reviews</label>
149
+ <frontend_type>text</frontend_type>
150
+ <sort_order>3</sort_order>
151
+ <show_in_default>1</show_in_default>
152
+ <show_in_website>1</show_in_website>
153
+ <show_in_store>1</show_in_store>
154
+ <expanded>1</expanded>
155
+ <fields>
156
+ <cron translate="label">
157
+ <label>Use Cronjob</label>
158
+ <frontend_type>select</frontend_type>
159
+ <source_model>adminhtml/system_config_source_yesno</source_model>
160
+ <sort_order>1</sort_order>
161
+ <show_in_default>1</show_in_default>
162
+ <show_in_website>1</show_in_website>
163
+ <show_in_store>1</show_in_store>
164
+ </cron>
165
+ <cron_stats translate="label">
166
+ <label>Update Summary</label>
167
+ <frontend_type>select</frontend_type>
168
+ <source_model>kiyoh/system_config_source_cronfrequency</source_model>
169
+ <sort_order>2</sort_order>
170
+ <show_in_default>1</show_in_default>
171
+ <show_in_website>1</show_in_website>
172
+ <show_in_store>1</show_in_store>
173
+ <depends><cron>1</cron></depends>
174
+ </cron_stats>
175
+ <cron_reviews translate="label">
176
+ <label>Update Reviews</label>
177
+ <frontend_type>select</frontend_type>
178
+ <source_model>kiyoh/system_config_source_cronfrequency</source_model>
179
+ <sort_order>3</sort_order>
180
+ <show_in_default>1</show_in_default>
181
+ <show_in_website>1</show_in_website>
182
+ <show_in_store>1</show_in_store>
183
+ <depends><cron>1</cron></depends>
184
+ </cron_reviews>
185
+ <cron_all translate="label">
186
+ <label>Update Review History</label>
187
+ <frontend_type>select</frontend_type>
188
+ <source_model>kiyoh/system_config_source_cronfrequency</source_model>
189
+ <sort_order>4</sort_order>
190
+ <show_in_default>1</show_in_default>
191
+ <show_in_website>1</show_in_website>
192
+ <show_in_store>1</show_in_store>
193
+ <depends><cron>1</cron></depends>
194
+ </cron_all>
195
+ <lastrun translate="label">
196
+ <label>Last Update</label>
197
+ <frontend_type>text</frontend_type>
198
+ <sort_order>100</sort_order>
199
+ <show_in_default>1</show_in_default>
200
+ <show_in_website>1</show_in_website>
201
+ <show_in_store>1</show_in_store>
202
+ </lastrun>
203
+ <process translate="label">
204
+ <label>Process Manually</label>
205
+ <frontend_type>button</frontend_type>
206
+ <frontend_model>kiyoh/adminhtml_widget_buttons_process</frontend_model>
207
+ <sort_order>101</sort_order>
208
+ <show_in_default>1</show_in_default>
209
+ <show_in_website>1</show_in_website>
210
+ <show_in_store>1</show_in_store>
211
+ </process>
212
+ </fields>
213
+ </reviews>
214
+ <sidebar translate="label">
215
+ <label>KiyOh Reviews Sidebar</label>
216
+ <frontend_type>text</frontend_type>
217
+ <sort_order>4</sort_order>
218
+ <show_in_default>1</show_in_default>
219
+ <show_in_website>1</show_in_website>
220
+ <show_in_store>1</show_in_store>
221
+ <expanded>1</expanded>
222
+ <fields>
223
+ <left_heading translate="label">
224
+ <label>Left Sidebar</label>
225
+ <frontend_model>kiyoh/adminhtml_widget_form_heading</frontend_model>
226
+ <sort_order>50</sort_order>
227
+ <show_in_default>1</show_in_default>
228
+ <show_in_website>1</show_in_website>
229
+ <show_in_store>1</show_in_store>
230
+ </left_heading>
231
+ <left translate="label">
232
+ <label>Enabled</label>
233
+ <frontend_type>select</frontend_type>
234
+ <source_model>adminhtml/system_config_source_yesno</source_model>
235
+ <sort_order>51</sort_order>
236
+ <show_in_default>1</show_in_default>
237
+ <show_in_website>1</show_in_website>
238
+ <show_in_store>1</show_in_store>
239
+ </left>
240
+ <left_qty translate="label">
241
+ <label>Number of Reviews</label>
242
+ <validate>validate-number</validate>
243
+ <frontend_type>text</frontend_type>
244
+ <sort_order>52</sort_order>
245
+ <show_in_default>1</show_in_default>
246
+ <show_in_website>1</show_in_website>
247
+ <show_in_store>1</show_in_store>
248
+ <depends><left>1</left></depends>
249
+ </left_qty>
250
+ <left_lenght translate="label">
251
+ <label>Length of Reviews</label>
252
+ <validate>validate-number</validate>
253
+ <frontend_type>text</frontend_type>
254
+ <sort_order>53</sort_order>
255
+ <show_in_default>1</show_in_default>
256
+ <show_in_website>1</show_in_website>
257
+ <show_in_store>1</show_in_store>
258
+ <depends><left>1</left></depends>
259
+ </left_lenght>
260
+ <left_snippets translate="label">
261
+ <label>Add Rich Snippets</label>
262
+ <frontend_type>select</frontend_type>
263
+ <source_model>adminhtml/system_config_source_yesno</source_model>
264
+ <sort_order>56</sort_order>
265
+ <show_in_default>1</show_in_default>
266
+ <show_in_website>1</show_in_website>
267
+ <show_in_store>1</show_in_store>
268
+ <depends><left>1</left></depends>
269
+ <comment>You can only activate the Rich Snippets when this block is shown on your Homepage only</comment>
270
+ </left_snippets>
271
+ <left_link translate="label">
272
+ <label>Link to</label>
273
+ <frontend_type>select</frontend_type>
274
+ <source_model>kiyoh/system_config_source_sidebarlink</source_model>
275
+ <sort_order>55</sort_order>
276
+ <show_in_default>1</show_in_default>
277
+ <show_in_website>1</show_in_website>
278
+ <show_in_store>1</show_in_store>
279
+ <depends><left>1</left></depends>
280
+ </left_link>
281
+ <right_heading translate="label">
282
+ <label>Right Sidebar</label>
283
+ <frontend_model>kiyoh/adminhtml_widget_form_heading</frontend_model>
284
+ <sort_order>60</sort_order>
285
+ <show_in_default>1</show_in_default>
286
+ <show_in_website>1</show_in_website>
287
+ <show_in_store>1</show_in_store>
288
+ </right_heading>
289
+ <right translate="label">
290
+ <label>Enabled</label>
291
+ <frontend_type>select</frontend_type>
292
+ <source_model>adminhtml/system_config_source_yesno</source_model>
293
+ <sort_order>61</sort_order>
294
+ <show_in_default>1</show_in_default>
295
+ <show_in_website>1</show_in_website>
296
+ <show_in_store>1</show_in_store>
297
+ </right>
298
+ <right_qty translate="label">
299
+ <label>Number of Reviews</label>
300
+ <validate>validate-number</validate>
301
+ <frontend_type>text</frontend_type>
302
+ <sort_order>62</sort_order>
303
+ <show_in_default>1</show_in_default>
304
+ <show_in_website>1</show_in_website>
305
+ <show_in_store>1</show_in_store>
306
+ <depends><right>1</right></depends>
307
+ </right_qty>
308
+ <right_lenght translate="label">
309
+ <label>Length of Reviews</label>
310
+ <validate>validate-number</validate>
311
+ <frontend_type>text</frontend_type>
312
+ <sort_order>63</sort_order>
313
+ <show_in_default>1</show_in_default>
314
+ <show_in_website>1</show_in_website>
315
+ <show_in_store>1</show_in_store>
316
+ <depends><right>1</right></depends>
317
+ </right_lenght>
318
+ <right_link>
319
+ <label>Link to</label>
320
+ <frontend_type>select</frontend_type>
321
+ <source_model>kiyoh/system_config_source_sidebarlink</source_model>
322
+ <sort_order>65</sort_order>
323
+ <show_in_default>1</show_in_default>
324
+ <show_in_website>1</show_in_website>
325
+ <show_in_store>1</show_in_store>
326
+ <depends><right>1</right></depends>
327
+ </right_link>
328
+ <right_snippets translate="label">
329
+ <label>Add to Sidebar Homepage</label>
330
+ <frontend_type>select</frontend_type>
331
+ <source_model>adminhtml/system_config_source_yesno</source_model>
332
+ <sort_order>66</sort_order>
333
+ <show_in_default>1</show_in_default>
334
+ <show_in_website>1</show_in_website>
335
+ <show_in_store>1</show_in_store>
336
+ <depends><right>1</right></depends>
337
+ <comment>You can only activate the Rich Snippets when this block is shown on your Homepage only</comment>
338
+ </right_snippets>
339
+ </fields>
340
+ </sidebar>
341
+ <overview translate="label">
342
+ <label>KiyOh Overview Page</label>
343
+ <frontend_type>text</frontend_type>
344
+ <sort_order>6</sort_order>
345
+ <show_in_default>1</show_in_default>
346
+ <show_in_website>1</show_in_website>
347
+ <show_in_store>1</show_in_store>
348
+ <expanded>1</expanded>
349
+ <fields>
350
+ <enabled translate="label">
351
+ <label>Enabled</label>
352
+ <frontend_type>select</frontend_type>
353
+ <source_model>adminhtml/system_config_source_yesno</source_model>
354
+ <sort_order>1</sort_order>
355
+ <show_in_default>1</show_in_default>
356
+ <show_in_website>1</show_in_website>
357
+ <show_in_store>1</show_in_store>
358
+ </enabled>
359
+ <intro translate="lable">
360
+ <label>Intro</label>
361
+ <frontend_type>textarea</frontend_type>
362
+ <sort_order>2</sort_order>
363
+ <show_in_default>1</show_in_default>
364
+ <show_in_website>1</show_in_website>
365
+ <show_in_store>1</show_in_store>
366
+ <depends><enabled>1</enabled></depends>
367
+ </intro>
368
+ <enable_paging>
369
+ <label>Paging</label>
370
+ <frontend_type>select</frontend_type>
371
+ <source_model>adminhtml/system_config_source_enabledisable</source_model>
372
+ <sort_order>3</sort_order>
373
+ <show_in_default>1</show_in_default>
374
+ <show_in_website>1</show_in_website>
375
+ <show_in_store>1</show_in_store>
376
+ </enable_paging>
377
+ <paging_settings>
378
+ <label>Reviews per page</label>
379
+ <frontend_type>text</frontend_type>
380
+ <sort_order>4</sort_order>
381
+ <show_in_default>1</show_in_default>
382
+ <show_in_website>1</show_in_website>
383
+ <show_in_store>1</show_in_store>
384
+ <tooltip>Comma Separated, as: 10,20,30</tooltip>
385
+ <depends><enable_paging>1</enable_paging></depends>
386
+ </paging_settings>
387
+ <heading_meta translate="label">
388
+ <label>Meta Data</label>
389
+ <frontend_model>kiyoh/adminhtml_widget_form_heading</frontend_model>
390
+ <sort_order>10</sort_order>
391
+ <show_in_default>1</show_in_default>
392
+ <show_in_website>1</show_in_website>
393
+ <show_in_store>1</show_in_store>
394
+ </heading_meta>
395
+ <meta_title translate="lable">
396
+ <label>Meta Title</label>
397
+ <frontend_type>text</frontend_type>
398
+ <sort_order>11</sort_order>
399
+ <show_in_default>1</show_in_default>
400
+ <show_in_website>1</show_in_website>
401
+ <show_in_store>1</show_in_store>
402
+ <depends><enabled>1</enabled></depends>
403
+ </meta_title>
404
+ <meta_description translate="lable">
405
+ <label>Meta Description</label>
406
+ <frontend_type>textarea</frontend_type>
407
+ <sort_order>12</sort_order>
408
+ <show_in_default>1</show_in_default>
409
+ <show_in_website>1</show_in_website>
410
+ <show_in_store>1</show_in_store>
411
+ <depends><enabled>1</enabled></depends>
412
+ </meta_description>
413
+ <meta_keywords translate="label">
414
+ <label>Meta Keywords</label>
415
+ <frontend_type>textarea</frontend_type>
416
+ <sort_order>13</sort_order>
417
+ <show_in_default>1</show_in_default>
418
+ <show_in_website>1</show_in_website>
419
+ <show_in_store>1</show_in_store>
420
+ <depends><enabled>1</enabled></depends>
421
+ </meta_keywords>
422
+ </fields>
423
+ </overview>
424
+ <invitation translate="label">
425
+ <label>Invitation to write the customer experience</label>
426
+ <frontend_type>text</frontend_type>
427
+ <sort_order>7</sort_order>
428
+ <show_in_default>1</show_in_default>
429
+ <show_in_website>1</show_in_website>
430
+ <show_in_store>1</show_in_store>
431
+ <expanded>1</expanded>
432
+ <fields>
433
+ <enabled translate="label">
434
+ <label>Activate</label>
435
+ <frontend_type>select</frontend_type>
436
+ <source_model>adminhtml/system_config_source_yesno</source_model>
437
+ <sort_order>1</sort_order>
438
+ <show_in_default>1</show_in_default>
439
+ <show_in_website>1</show_in_website>
440
+ <show_in_store>1</show_in_store>
441
+ <comment>Send invitation?</comment>
442
+ <tooltip>Send customers automatically receive an invitation to share a customer experience.</tooltip>
443
+ </enabled>
444
+ <company_email>
445
+ <label>Company Email address</label>
446
+ <frontend_type>text</frontend_type>
447
+ <sort_order>2</sort_order>
448
+ <show_in_default>1</show_in_default>
449
+ <show_in_website>1</show_in_website>
450
+ <show_in_store>1</show_in_store>
451
+ <comment>Use the company email address registered with Kiyoh, this is used as en extra validation.</comment>
452
+ <depends><enabled>1</enabled></depends>
453
+ </company_email>
454
+ <status>
455
+ <label>Order completed with status</label>
456
+ <frontend_type>select</frontend_type>
457
+ <source_model>kiyoh/system_config_source_orderstatus</source_model>
458
+ <sort_order>3</sort_order>
459
+ <show_in_default>1</show_in_default>
460
+ <show_in_website>1</show_in_website>
461
+ <show_in_store>1</show_in_store>
462
+ <can_be_empty>1</can_be_empty>
463
+ <comment>Invitation e-mail is sent after such status is achieved</comment>
464
+ <tooltip>Specify at which status you want to send the invitation. Default is "Completed"</tooltip>
465
+ <depends><enabled>1</enabled></depends>
466
+ </status>
467
+ <delay translate="label">
468
+ <label>Delay</label>
469
+ <frontend_type>text</frontend_type>
470
+ <sort_order>4</sort_order>
471
+ <show_in_default>1</show_in_default>
472
+ <show_in_website>1</show_in_website>
473
+ <show_in_store>1</show_in_store>
474
+ <comment>Send the invitation x days after the order is completed</comment>
475
+ <tooltip>This will ensure that the customer receives the invitation shortly after receiving the product and not before. This increases the opportunity that the client will share his experience.</tooltip>
476
+ <depends><enabled>1</enabled></depends>
477
+ </delay>
478
+ <backlog translate="label">
479
+ <label>Maximum Delay</label>
480
+ <frontend_type>text</frontend_type>
481
+ <sort_order>6</sort_order>
482
+ <show_in_default>1</show_in_default>
483
+ <show_in_website>1</show_in_website>
484
+ <show_in_store>1</show_in_store>
485
+ <comment>Change only if necessary</comment>
486
+ <tooltip>Number of days to complete order may last, if it takes longer then no invitation will be sent. Read more about this feature on Kiyoh.nl.</tooltip>
487
+ <depends><enabled>1</enabled></depends>
488
+ </backlog>
489
+ </fields>
490
+ </invitation>
491
+ <log translate="label">
492
+ <label>KiyOh Log Settings</label>
493
+ <frontend_type>text</frontend_type>
494
+ <sort_order>9</sort_order>
495
+ <show_in_default>1</show_in_default>
496
+ <show_in_website>0</show_in_website>
497
+ <show_in_store>0</show_in_store>
498
+ <expanded>1</expanded>
499
+ <fields>
500
+ <enabled translate="label">
501
+ <label>Enable Log Function</label>
502
+ <frontend_type>select</frontend_type>
503
+ <source_model>adminhtml/system_config_source_yesno</source_model>
504
+ <sort_order>1</sort_order>
505
+ <show_in_default>1</show_in_default>
506
+ <show_in_website>0</show_in_website>
507
+ <show_in_store>0</show_in_store>
508
+ </enabled>
509
+ <clean translate="label">
510
+ <label>Auto Cleaning</label>
511
+ <frontend_type>select</frontend_type>
512
+ <source_model>adminhtml/system_config_source_yesno</source_model>
513
+ <sort_order>2</sort_order>
514
+ <show_in_default>1</show_in_default>
515
+ <show_in_website>0</show_in_website>
516
+ <show_in_store>0</show_in_store>
517
+ <depends><enabled>1</enabled></depends>
518
+ </clean>
519
+ <clean_days translate="label">
520
+ <label>Clean after Days</label>
521
+ <validate>validate-number</validate>
522
+ <frontend_type>text</frontend_type>
523
+ <sort_order>3</sort_order>
524
+ <show_in_default>1</show_in_default>
525
+ <show_in_website>0</show_in_website>
526
+ <show_in_store>0</show_in_store>
527
+ <depends><enabled>1</enabled></depends>
528
+ </clean_days>
529
+ </fields>
530
+ </log>
531
+ <snippets translate="label">
532
+ <label>KiyOh Custom Blocks</label>
533
+ <frontend_type>text</frontend_type>
534
+ <sort_order>10</sort_order>
535
+ <show_in_default>1</show_in_default>
536
+ <show_in_website>1</show_in_website>
537
+ <show_in_store>1</show_in_store>
538
+ <expanded>1</expanded>
539
+ <comment><![CDATA[<p>The extension comes with two coded blocks.<br>With this blocks you can add your store rating in a Static block or CMS page.</p><p><br><strong>The Rich Snippets Block.<br></strong>Show your Store-rating with this block and generate results in the Google Search Engine Results better known as Rich Snippets.<br>Paste the code below at the desired location using a Static Block or a CMS page.</p><p>Code: {{block type="kiyoh/snippets" name="kiyohsnippets"}}</p><p><br><strong>Custom Block.</strong><br>With this block you can create custom block for footer of header, you can paste the code below at the desired location using a Static Block or a CMS page.<br>To edit this block you need to edit the .phtml file located in the following path: app/design/frontend/base/default/template/magmodules/kiyoh/widget/custom.phtml</p><p>Code: {{block type="kiyoh/custom" name="kiyoh"}}</p>]]></comment>
540
+ </snippets>
541
+ </groups>
542
+ </kiyoh>
543
+ </sections>
544
+ </config>
app/code/local/Magmodules/Kiyoh/sql/kiyoh_setup/mysql4-install-1.0.0.php ADDED
@@ -0,0 +1,102 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magmodules.eu - http://www.magmodules.eu
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to info@magmodules.eu so we can send you a copy immediately.
14
+ *
15
+ * @category Magmodules
16
+ * @package Magmodules_Kiyoh
17
+ * @author Magmodules <info@magmodules.eu)
18
+ * @copyright Copyright (c) 2015 (http://www.magmodules.eu)
19
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
20
+ */
21
+
22
+ $installer = $this;
23
+ $installer->startSetup();
24
+ $installer->run("
25
+ DROP TABLE IF EXISTS {$this->getTable('kiyoh_reviews')};
26
+ CREATE TABLE IF NOT EXISTS {$this->getTable('kiyoh_reviews')} (
27
+ `review_id` int(10) NOT NULL AUTO_INCREMENT,
28
+ `shop_id` int(5) NOT NULL,
29
+ `company` varchar(255) DEFAULT NULL,
30
+ `kiyoh_id` int(5) NOT NULL,
31
+ `score` smallint(6) DEFAULT '0',
32
+ `score_q2` smallint(6) DEFAULT '0',
33
+ `score_q3` smallint(6) DEFAULT '0',
34
+ `score_q4` smallint(6) DEFAULT '0',
35
+ `score_q5` smallint(6) DEFAULT '0',
36
+ `score_q6` smallint(6) DEFAULT '0',
37
+ `score_q7` smallint(6) DEFAULT '0',
38
+ `score_q8` smallint(6) DEFAULT '0',
39
+ `score_q9` smallint(6) DEFAULT '0',
40
+ `score_q10` smallint(6) DEFAULT '0',
41
+ `customer_name` varchar(255) DEFAULT NULL,
42
+ `customer_email` varchar(255) DEFAULT NULL,
43
+ `customer_place` varchar(255) DEFAULT NULL,
44
+ `recommendation` tinyint(1) DEFAULT NULL,
45
+ `positive` text,
46
+ `negative` text,
47
+ `purchase` text,
48
+ `reaction` text,
49
+ `date_created` date NOT NULL,
50
+ `date_updated` date NOT NULL,
51
+ `sidebar` tinyint(1) NOT NULL DEFAULT '1',
52
+ `status` tinyint(5) NOT NULL DEFAULT '1',
53
+ PRIMARY KEY (`review_id`)
54
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
55
+
56
+ DROP TABLE IF EXISTS {$this->getTable('kiyoh_log')};
57
+ CREATE TABLE IF NOT EXISTS {$this->getTable('kiyoh_log')} (
58
+ `id` int(10) NOT NULL AUTO_INCREMENT,
59
+ `type` varchar(255) NOT NULL,
60
+ `shop_id` varchar(255) NOT NULL,
61
+ `company` varchar(255) DEFAULT NULL,
62
+ `review_update` int(5) DEFAULT '0',
63
+ `review_new` int(5) DEFAULT '0',
64
+ `response` text,
65
+ `order_id` int(10) DEFAULT NULL,
66
+ `cron` varchar(255) DEFAULT NULL,
67
+ `date` datetime NOT NULL,
68
+ `time` varchar(255) NOT NULL,
69
+ `api_url` text,
70
+ PRIMARY KEY (`id`)
71
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
72
+
73
+ DROP TABLE IF EXISTS {$this->getTable('kiyoh_stats')};
74
+ CREATE TABLE IF NOT EXISTS {$this->getTable('kiyoh_stats')} (
75
+ `id` int(5) NOT NULL AUTO_INCREMENT,
76
+ `company` varchar(255) DEFAULT NULL,
77
+ `shop_id` int(5) NOT NULL,
78
+ `score` smallint(6) DEFAULT '0',
79
+ `score_q2` smallint(6) DEFAULT '0',
80
+ `score_q2_title` varchar(255) NOT NULL,
81
+ `score_q3` smallint(6) DEFAULT '0',
82
+ `score_q3_title` varchar(255) NOT NULL,
83
+ `score_q4` smallint(6) DEFAULT '0',
84
+ `score_q4_title` varchar(255) NOT NULL,
85
+ `score_q5` smallint(6) DEFAULT '0',
86
+ `score_q5_title` varchar(255) NOT NULL,
87
+ `score_q6` smallint(6) DEFAULT '0',
88
+ `score_q6_title` varchar(255) NOT NULL,
89
+ `score_q7` smallint(6) DEFAULT '0',
90
+ `score_q7_title` varchar(255) NOT NULL,
91
+ `score_q8` smallint(6) DEFAULT '0',
92
+ `score_q8_title` varchar(255) NOT NULL,
93
+ `score_q9` smallint(6) DEFAULT '0',
94
+ `score_q9_title` varchar(255) NOT NULL,
95
+ `score_q10` smallint(6) DEFAULT '0',
96
+ `score_q10_title` varchar(255) NOT NULL,
97
+ `scoremax` smallint(6) DEFAULT '0',
98
+ `votes` int(5) DEFAULT '0',
99
+ PRIMARY KEY (`id`)
100
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
101
+ ");
102
+ $installer->endSetup();
app/design/adminhtml/default/default/layout/magmodules_kiyoh.xml ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <layout version="0.1.0">
3
+ <adminhtml_kiyohreviews_index>
4
+ <reference name="head">
5
+ <action method="addCss"><name>magmodules/kiyoh/grid.css</name></action>
6
+ </reference>
7
+ <reference name="content">
8
+ <block type="kiyoh/adminhtml_kiyohreviews" name="kiyoh" />
9
+ </reference>
10
+ </adminhtml_kiyohreviews_index>
11
+ <adminhtml_kiyohlog_index>
12
+ <reference name="content">
13
+ <block type="kiyoh/adminhtml_kiyohlog" name="kiyohlog" />
14
+ </reference>
15
+ </adminhtml_kiyohlog_index>
16
+ </layout>
app/design/frontend/base/default/layout/magmodules_kiyoh.xml ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <layout version="0.1.0">
3
+ <default>
4
+ <reference name="head">
5
+ <action method="addCss"><stylesheet>magmodules/kiyoh/sidebar.css</stylesheet></action>
6
+ </reference>
7
+ <reference name="left">
8
+ <block type="kiyoh/sidebar" name="left.kiyoh" template="magmodules/kiyoh/sidebar/left.phtml" />
9
+ </reference>
10
+ <reference name="right">
11
+ <block type="kiyoh/sidebar" name="right.kiyoh" template="magmodules/kiyoh/sidebar/right.phtml" />
12
+ </reference>
13
+ </default>
14
+ <kiyoh_index_index>
15
+ <reference name="root">
16
+ <action method="setTemplate"><template>page/2columns-left.phtml</template></action>
17
+ </reference>
18
+ <reference name="head">
19
+ <action method="addCss"><stylesheet>magmodules/kiyoh/style.css</stylesheet></action>
20
+ </reference>
21
+ <reference name="content">
22
+ <block type="kiyoh/reviews" name="kiyoh.index" template="magmodules/kiyoh/index.phtml" />
23
+ </reference>
24
+ <reference name="left">
25
+ <remove name="left.kiyoh" />
26
+ </reference>
27
+ <reference name="right">
28
+ <remove name="right.kiyoh" />
29
+ </reference>
30
+ </kiyoh_index_index>
31
+ <cms_index_index>
32
+ <reference name="head">
33
+ <action method="addCss"><stylesheet>magmodules/kiyoh/richsnippets.css</stylesheet></action>
34
+ </reference>
35
+ </cms_index_index>
36
+ </layout>
app/design/frontend/base/default/template/magmodules/kiyoh/index.phtml ADDED
@@ -0,0 +1,148 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magmodules.eu
4
+ * http://www.magmodules.eu
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Open Software License (OSL 3.0)
9
+ * that is bundled with this package in the file LICENSE.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/osl-3.0.php
12
+ * If you did not receive a copy of the license and are unable to
13
+ * obtain it through the world-wide-web, please send an email
14
+ * to info@magmodules.eu so we can send you a copy immediately.
15
+ *
16
+ * @category Magmodules
17
+ * @package Magmodules_Kiyoh
18
+ * @author Magmodules <info@magmodules.eu)
19
+ * @copyright Copyright (c) 2015 (http://www.magmodules.eu)
20
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
21
+ */
22
+ ?>
23
+ <?php
24
+ // Load Reviews & Stats
25
+ $reviews = $this->getReviews();
26
+ $stats = $this->getStats();
27
+ ?>
28
+ <div class="kiyoh">
29
+
30
+ <div class="page-title">
31
+ <h1><?php echo $this->__('Kiyoh'); ?></h1>
32
+ <?php if(Mage::getStoreConfig('kiyoh/general/url')): ?>
33
+ <button class="button" onclick="setLocation('<?php echo Mage::getStoreConfig('kiyoh/general/url'); ?>')">
34
+ <span>
35
+ <span>
36
+ <?php echo $this->__('Write review');?>
37
+ </span>
38
+ </span>
39
+ </button>
40
+ <?php endif; ?>
41
+ </div>
42
+
43
+ <?php if($reviews->getSize()): ?>
44
+ <div class="content-kiyoh">
45
+ <div class="about-kiyoh">
46
+ <?php echo nl2br(Mage::getStoreConfig('kiyoh/overview/intro')); ?>
47
+ </div>
48
+ </div>
49
+
50
+ <?php $i=0; foreach($reviews as $review): ?>
51
+ <div class="review-list">
52
+ <div class="review-header">
53
+ <h3><?php echo $review->getCustomerName(); ?> - <?php echo Mage::helper('core')->formatDate($review->getDateCreated(), 'long', false); ?> - <?php echo $review->getCustomerPlace(); ?> </h3>
54
+ <?php if($review->getScore()): ?>
55
+ <ul class="overall">
56
+ <li>
57
+ <span class="rating-empty"><span class="rating-star-<?php echo $review->getScore();?>"></span></span>
58
+ </li>
59
+ </ul>
60
+ <?php endif; ?>
61
+ </div>
62
+ <ul class="experience">
63
+ <li>
64
+ <p>
65
+ <?php if($review->getPositive()): ?>
66
+ <strong><?php echo $this->__('Positive'); ?>:</strong>
67
+ <p><?php echo nl2br($review->getPositive()); ?></p>
68
+ <?php endif; ?>
69
+
70
+ <?php if($review->getNegative()): ?>
71
+ <strong><?php echo $this->__('Suggestions'); ?>:</strong>
72
+ <p><?php echo nl2br($review->getNegative()); ?></p>
73
+ <?php endif; ?>
74
+
75
+ <strong><?php echo $this->__('Recommend'); ?>:</strong>
76
+ <?php
77
+ if($review->getRecommendation() == '1') {
78
+ echo $this->__('Yes');
79
+ } else {
80
+ echo $this->__('No');
81
+ }
82
+ ?>
83
+ </p>
84
+ </li>
85
+ </ul>
86
+ <ul class="summary-index">
87
+ <?php if($review->getScoreQ2() > 0): ?>
88
+ <li>
89
+ <span class="rating-name"><?php echo $stats->getScoreQ2Title(); ?></span>
90
+ <span class="rating-empty"><span class="rating-greystar-<?php echo $review->getScoreQ2();?>"></span></span>
91
+ </li>
92
+ <?php endif; ?>
93
+ <?php if($review->getScoreQ3() > 0): ?>
94
+ <li>
95
+ <span class="rating-name"><?php echo $stats->getScoreQ3Title(); ?></span>
96
+ <span class="rating-empty"><span class="rating-greystar-<?php echo $review->getScoreQ3();?>"></span></span>
97
+ </li>
98
+ <?php endif; ?>
99
+ <?php if($review->getScoreQ4() > 0): ?>
100
+ <li>
101
+ <span class="rating-name"><?php echo $stats->getScoreQ4Title(); ?></span>
102
+ <span class="rating-empty"><span class="rating-greystar-<?php echo $review->getScoreQ4();?>"></span></span>
103
+ </li>
104
+ <?php endif; ?>
105
+ <?php if($review->getScoreQ5() > 0): ?>
106
+ <li>
107
+ <span class="rating-name"><?php echo $stats->getScoreQ5Title(); ?></span>
108
+ <span class="rating-empty"><span class="rating-greystar-<?php echo $review->getScoreQ5();?>"></span></span>
109
+ </li>
110
+ <?php endif; ?>
111
+ <?php if($review->getScoreQ6() > 0): ?>
112
+ <li>
113
+ <span class="rating-name"><?php echo $stats->getScoreQ6Title(); ?></span>
114
+ <span class="rating-empty"><span class="rating-greystar-<?php echo $review->getScoreQ6();?>"></span></span>
115
+ </li>
116
+ <?php endif; ?>
117
+ <?php if($review->getScoreQ7() > 0): ?>
118
+ <li>
119
+ <span class="rating-name"><?php echo $stats->getScoreQ7Title(); ?></span>
120
+ <span class="rating-empty"><span class="rating-greystar-<?php echo $review->getScoreQ7();?>"></span></span>
121
+ </li>
122
+ <?php endif; ?>
123
+ <?php if($review->getScoreQ8() > 0): ?>
124
+ <li>
125
+ <span class="rating-name"><?php echo $stats->getScoreQ8Title(); ?></span>
126
+ <span class="rating-empty"><span class="rating-greystar-<?php echo $review->getScoreQ8();?>"></span></span>
127
+ </li>
128
+ <?php endif; ?>
129
+ <?php if($review->getScoreQ9() > 0): ?>
130
+ <li>
131
+ <span class="rating-name"><?php echo $stats->getScoreQ9Title(); ?></span>
132
+ <span class="rating-empty"><span class="rating-greystar-<?php echo $review->getScoreQ9();?>"></span></span>
133
+ </li>
134
+ <?php endif; ?>
135
+ <?php if($review->getScoreQ10() > 0): ?>
136
+ <li>
137
+ <span class="rating-name"><?php echo $stats->getScoreQ10Title(); ?></span>
138
+ <span class="rating-empty"><span class="rating-greystar-<?php echo $review->getScoreQ10();?>"></span></span>
139
+ </li>
140
+ <?php endif; ?>
141
+ </ul>
142
+ </div>
143
+ <?php $i++; endforeach;?>
144
+ <?php echo $this->getPagerHtml(); ?>
145
+ <?php else: ?>
146
+ <p class="note-msg"><?php echo $this->__('No reviews found...'); ?></p>
147
+ <?php endif ?>
148
+ </div>
app/design/frontend/base/default/template/magmodules/kiyoh/sidebar/left.phtml ADDED
@@ -0,0 +1,71 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magmodules.eu
4
+ * http://www.magmodules.eu
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Open Software License (OSL 3.0)
9
+ * that is bundled with this package in the file LICENSE.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/osl-3.0.php
12
+ * If you did not receive a copy of the license and are unable to
13
+ * obtain it through the world-wide-web, please send an email
14
+ * to info@magmodules.eu so we can send you a copy immediately.
15
+ *
16
+ * @category Magmodules
17
+ * @package Magmodules_Kiyoh
18
+ * @author Magmodules <info@magmodules.eu)
19
+ * @copyright Copyright (c) 2015 (http://www.magmodules.eu)
20
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
21
+ */
22
+ $sidebarreviews = $this->getSidebarCollection('left');
23
+ $total = $this->getTotalScore();
24
+ ?>
25
+ <?php if($sidebarreviews && $total): ?>
26
+ <div class="block kiyoh-sidebar">
27
+ <div class="block-title">
28
+ <strong><span><?php echo $this->__('Kiyoh') ?></span></strong>
29
+ </div>
30
+ <?php if($total->getPercentage() > 0): ?>
31
+ <?php if($this->getSnippetsEnabled('left')): ?>
32
+ <div class="block-content" itemscope itemtype="http://schema.org/LocalBusiness">
33
+ <p itemprop="name" class="company-name"><?php echo $total->getCompany(); ?></p>
34
+ <div class="total-block-stars"><span style="width: <?php echo $total->getPercentage(); ?>%"></span></div>
35
+ <div class="total-block-text" itemprop="aggregateRating" itemscope itemtype="http://schema.org/AggregateRating">
36
+ <p><strong><span itemprop="ratingValue"><?php echo $total->getStarsQty(); ?></span> / <span itemprop="bestRating">10</span></strong></p>
37
+ <p class="based-on"><?php echo $this->__('Based on %s reviews', '<span itemprop="ratingCount">' . $total->getVotes() . '</span>'); ?></p>
38
+ </div>
39
+ </div>
40
+ <?php else: ?>
41
+ <div class="block-content">
42
+ <div class="total-block-stars"><span style="width: <?php echo $total->getPercentage(); ?>%"></span></div>
43
+ <div class="total-block-text">
44
+ <p><strong><?php echo $total->getStarsQty(); ?> / 10</strong></p>
45
+ <p class="based-on"><?php echo $this->__('Based on %s reviews', '<span itemprop="ratingCount">' . $total->getVotes() . '</span>'); ?></p>
46
+ </div>
47
+ </div>
48
+ <?php endif; ?>
49
+ <?php endif; ?>
50
+ <?php $i=0; foreach($sidebarreviews as $sidebarreview): ?>
51
+ <?php $content = $this->formatContent($sidebarreview, 'left'); ?>
52
+ <div class="block-content">
53
+ <div class="kiyoh-sidebar-block">
54
+ <p><u><?php echo $sidebarreview->getCustomerName(); ?></u> <?php echo $content; ?></p>
55
+ <span class="rating-name"><?php echo Mage::helper('core')->formatDate($sidebarreview->getDateCreated(), 'medium', false) ; ?></span>
56
+ <?php if($sidebarreview->getScore()): ?>
57
+ <span class="rating-empty"><span class="rating-star-<?php echo $sidebarreview->getScore();?>"></span></span>
58
+ <?php endif; ?>
59
+ </div>
60
+ </div>
61
+ <?php endforeach; ?>
62
+ <?php if($reviewurl = $this->getReviewsUrl()): ?>
63
+ <div class="block-content">
64
+ <img src="<?php echo $this->getSkinUrl('magmodules/kiyoh/images/logo.png'); ?>" class="kiyoh-logo">
65
+ <div class="actions">
66
+ <?php echo $reviewurl; ?>
67
+ </div>
68
+ </div>
69
+ <?php endif; ?>
70
+ </div>
71
+ <?php endif; ?>
app/design/frontend/base/default/template/magmodules/kiyoh/sidebar/right.phtml ADDED
@@ -0,0 +1,71 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magmodules.eu
4
+ * http://www.magmodules.eu
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Open Software License (OSL 3.0)
9
+ * that is bundled with this package in the file LICENSE.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/osl-3.0.php
12
+ * If you did not receive a copy of the license and are unable to
13
+ * obtain it through the world-wide-web, please send an email
14
+ * to info@magmodules.eu so we can send you a copy immediately.
15
+ *
16
+ * @category Magmodules
17
+ * @package Magmodules_Kiyoh
18
+ * @author Magmodules <info@magmodules.eu)
19
+ * @copyright Copyright (c) 2015 (http://www.magmodules.eu)
20
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
21
+ */
22
+ $sidebarreviews = $this->getSidebarCollection('right');
23
+ $total = $this->getTotalScore();
24
+ ?>
25
+ <?php if($sidebarreviews && $total): ?>
26
+ <div class="block kiyoh-sidebar">
27
+ <div class="block-title">
28
+ <strong><span><?php echo $this->__('Kiyoh') ?></span></strong>
29
+ </div>
30
+ <?php if($total->getPercentage() > 0): ?>
31
+ <?php if($this->getSnippetsEnabled('right')): ?>
32
+ <div class="block-content" itemscope itemtype="http://schema.org/LocalBusiness">
33
+ <p itemprop="name" class="company-name"><?php echo $total->getCompany(); ?></p>
34
+ <div class="total-block-stars"><span style="width: <?php echo $total->getPercentage(); ?>%"></span></div>
35
+ <div class="total-block-text" itemprop="aggregateRating" itemscope itemtype="http://schema.org/AggregateRating">
36
+ <p><strong><span itemprop="ratingValue"><?php echo $total->getStarsQty(); ?></span> / <span itemprop="bestRating">10</span></strong></p>
37
+ <p class="based-on"><?php echo $this->__('Based on %s reviews', '<span itemprop="ratingCount">' . $total->getVotes() . '</span>'); ?></p>
38
+ </div>
39
+ </div>
40
+ <?php else: ?>
41
+ <div class="block-content">
42
+ <div class="total-block-stars"><span style="width: <?php echo $total->getPercentage(); ?>%"></span></div>
43
+ <div class="total-block-text">
44
+ <p><strong><?php echo $total->getStarsQty(); ?> / 10</strong></p>
45
+ <p class="based-on"><?php echo $this->__('Based on %s reviews', '<span itemprop="ratingCount">' . $total->getVotes() . '</span>'); ?></p>
46
+ </div>
47
+ </div>
48
+ <?php endif; ?>
49
+ <?php endif; ?>
50
+ <?php $i=0; foreach($sidebarreviews as $sidebarreview): ?>
51
+ <?php $content = $this->formatContent($sidebarreview, 'right'); ?>
52
+ <div class="block-content">
53
+ <div class="kiyoh-sidebar-block">
54
+ <p><u><?php echo $sidebarreview->getCustomerName(); ?></u> <?php echo $content; ?></p>
55
+ <span class="rating-name"><?php echo Mage::helper('core')->formatDate($sidebarreview->getDateCreated(), 'medium', false) ; ?></span>
56
+ <?php if($sidebarreview->getScore()): ?>
57
+ <span class="rating-empty"><span class="rating-star-<?php echo $sidebarreview->getScore();?>"></span></span>
58
+ <?php endif; ?>
59
+ </div>
60
+ </div>
61
+ <?php endforeach; ?>
62
+ <?php if($reviewurl = $this->getReviewsUrl()): ?>
63
+ <div class="block-content">
64
+ <img src="<?php echo $this->getSkinUrl('magmodules/kiyoh/images/logo.png'); ?>" class="kiyoh-logo">
65
+ <div class="actions">
66
+ <?php echo $reviewurl; ?>
67
+ </div>
68
+ </div>
69
+ <?php endif; ?>
70
+ </div>
71
+ <?php endif; ?>
app/design/frontend/base/default/template/magmodules/kiyoh/widget/custom.phtml ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magmodules.eu
4
+ * http://www.magmodules.eu
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Open Software License (OSL 3.0)
9
+ * that is bundled with this package in the file LICENSE.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/osl-3.0.php
12
+ * If you did not receive a copy of the license and are unable to
13
+ * obtain it through the world-wide-web, please send an email
14
+ * to info@magmodules.eu so we can send you a copy immediately.
15
+ *
16
+ * @category Magmodules
17
+ * @package Magmodules_Kiyoh
18
+ * @author Magmodules <info@magmodules.eu)
19
+ * @copyright Copyright (c) 2015 (http://www.magmodules.eu)
20
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
21
+ */
22
+
23
+ // Load data
24
+ $enabled = $this->getKiyohEnabled();
25
+ $data = $this->getKiyohData();
26
+
27
+ // All available data
28
+ $company = $data->getCompany();
29
+ $percentage = $data->getPercentage();
30
+
31
+ ?>
32
+ <?php if($enabled) { ?>
33
+ <div class="kiyoh-custom">
34
+ <div class="client">Customers like <?php echo $company; ?>!</div>
35
+ <div class="rating-box">
36
+ <div class="rating" style="width:<?php echo $percentage; ?>%"> </div>
37
+ </div>
38
+ </div>
39
+ <?php } ?>
app/design/frontend/base/default/template/magmodules/kiyoh/widget/richsnippets.phtml ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magmodules.eu
4
+ * http://www.magmodules.eu
5
+ *
6
+ * NOTICE OF LICENSE
7
+ *
8
+ * This source file is subject to the Open Software License (OSL 3.0)
9
+ * that is bundled with this package in the file LICENSE.txt.
10
+ * It is also available through the world-wide-web at this URL:
11
+ * http://opensource.org/licenses/osl-3.0.php
12
+ * If you did not receive a copy of the license and are unable to
13
+ * obtain it through the world-wide-web, please send an email
14
+ * to info@magmodules.eu so we can send you a copy immediately.
15
+ *
16
+ * @category Magmodules
17
+ * @package Magmodules_Kiyoh
18
+ * @author Magmodules <info@magmodules.eu)
19
+ * @copyright Copyright (c) 2015 (http://www.magmodules.eu)
20
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
21
+ */
22
+ ?>
23
+ <?php if(($this->getSnippetsEnabled()) && ($snippets = $this->getSnippets())) { ?>
24
+ <div class="kiyoh-snippets">
25
+ <?php echo $this->getHtmlStars($snippets->getPercentage()); ?>
26
+ <div itemscope="itemscope" itemtype="http://schema.org/Product">
27
+ <meta itemprop="name" content="<?php echo $snippets->getCompany(); ?>">
28
+ <div itemprop="aggregateRating" itemscope="itemscope" itemtype="http://schema.org/AggregateRating">
29
+ <meta itemprop="bestRating" content="100">
30
+ <p><?php echo Mage::helper('kiyoh')->__('Rating %s based on %s customer reviews', '<span itemprop="ratingValue">' . $snippets->getPercentage() . '</span>%', '<span itemprop="reviewCount">' . $snippets->getVotes() . '</span>') ?> <?php echo $this->getExternalLink(); ?> </p>
31
+ </div>
32
+ </div>
33
+ </div>
34
+ <?php } ?>
app/etc/modules/Magmodules_Kiyoh.xml ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <Magmodules_Kiyoh>
5
+ <active>true</active>
6
+ <codePool>local</codePool>
7
+ </Magmodules_Kiyoh>
8
+ </modules>
9
+ </config>
package.xml ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <package>
3
+ <name>Magmodules_Kiyoh</name>
4
+ <version>1.0.0</version>
5
+ <stability>stable</stability>
6
+ <license/>
7
+ <channel>community</channel>
8
+ <extends/>
9
+ <summary>Connect your Magento shop to KiyOh</summary>
10
+ <description>Connect your Magento shop to KiyOh</description>
11
+ <notes>First stable release</notes>
12
+ <authors><author><name>Magmodules</name><user>auto-converted</user><email>info@magmodules.nl</email></author></authors>
13
+ <date>2015-01-20</date>
14
+ <time>14:45:40</time>
15
+ <contents><target name="magelocal"><dir name="Magmodules"><dir name="Kiyoh"><dir name="Block"><dir name="Adminhtml"><dir name="Kiyohlog"><file name="Grid.php" hash="39d3a230b792a146bcb7ea6fc5975d5a"/></dir><dir name="Kiyohreviews"><dir name="Renderer"><file name="Experience.php" hash="abf99c6f9a07589b8fe2bcf63b9edb48"/></dir><file name="Grid.php" hash="e4326ccf1ea00dff4a664ecfbd03e9f7"/></dir><dir name="Widget"><dir name="Buttons"><file name="Process.php" hash="119648013568daa5953dc8db0a386868"/><file name="Test.php" hash="019586f9d0a4bc7bb431a3df2cf7c4d9"/></dir><dir name="Form"><file name="Heading.php" hash="6c99f624f1267ed1500a708f3e01fea3"/></dir><dir name="Grid"><file name="Log.php" hash="7971522fb582fdedaa1624f2878d1304"/><file name="Seconds.php" hash="ab77b3a2da42984db58388d119c2e07c"/><file name="Stars.php" hash="4544f1fec819ec465d69ad1c562ae31c"/></dir><dir name="Info"><file name="Info.php" hash="53ee9e0e47ad2a27b61f03884a25dedc"/></dir></dir><file name="Kiyohlog.php" hash="0499fae2c8246c1224e42003422dbb0f"/><file name="Kiyohreviews.php" hash="bf7858406e19fe69785022922c1c4ae1"/></dir><file name="Custom.php" hash="faa8d978906ffc75d7bc32dd95ad9144"/><file name="Reviews.php" hash="c841e61a6980f52754cecc6b618018d3"/><file name="Sidebar.php" hash="c60dd260e43cfa7f2aaba3ba7aea9bf8"/><file name="Snippets.php" hash="466609602676efe2d190f46351e34d86"/></dir><dir name="Helper"><file name="Data.php" hash="158084e97d97626c45471cbda69b67fe"/></dir><dir name="Model"><dir name="Mysql4"><dir name="Log"><file name="Collection.php" hash="b9cc585b00e4e372a6fe2ce36677f546"/></dir><dir name="Reviews"><file name="Collection.php" hash="0a16cd2660475f7fd498403437cd0bf7"/></dir><dir name="Stats"><file name="Collection.php" hash="bdfb3db30e754ae539ba445678570eaf"/></dir><file name="Log.php" hash="e60478150048e9c4e6d4197ae12f6f16"/><file name="Reviews.php" hash="de8cd145282dc3105e963cf845f45e25"/><file name="Stats.php" hash="c917baef200f1ce4dfe391e7444bf280"/></dir><dir name="System"><dir name="Config"><dir name="Source"><file name="Cronfrequency.php" hash="83243ce547e81705df4497b7e94922fe"/><file name="Kiyoh.php" hash="eebd1d93fea7b955793b8bc2a60fb9eb"/><file name="Orderstatus.php" hash="7e42dbf2ab2e5f3544cf34da1fd1a04c"/><file name="Position.php" hash="74bc6ab7cb4560b682ebdbf82d891b08"/><file name="Sidebarlink.php" hash="c576f54e39f067bae18999aa26874fe1"/></dir></dir></dir><file name="Api.php" hash="28b613328932e3beefa74399ad20149a"/><file name="Log.php" hash="bcf9328adcf61b84164b86ff3e14914f"/><file name="Observer.php" hash="27441c1b02caae831d10888b9c6c6ac9"/><file name="Reviews.php" hash="5399449c89808f30d2d1d266c224e046"/><file name="Stats.php" hash="3c296058685dbb8465fed3864efa91dd"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="KiyohlogController.php" hash="fbaf34e6de3920e5576bd346c72df271"/><file name="KiyohreviewsController.php" hash="a13feaf09636352a0dc6c222ac57fca5"/></dir><file name="IndexController.php" hash="09bd38e43ead00a123ded748281f3607"/></dir><dir name="etc"><file name="adminhtml.xml" hash="f061cc2a82aa9c33503b8c6afd1a253c"/><file name="config.xml" hash="6ef408605d3ba24359f37ebf569a3996"/><file name="system.xml" hash="c6495ded8acc8e3d1f4492453509b3c0"/></dir><dir name="sql"><dir name="kiyoh_setup"><file name="mysql4-install-1.0.0.php" hash="bf048fb7428e3aba9e078a06e38afe20"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="magmodules_kiyoh.xml" hash="8e873ae1213e8db26169cc21a532cea6"/></dir><dir name="template"><dir name="magmodules"><dir name="kiyoh"><dir name="sidebar"><file name="left.phtml" hash="4dc24d52c5da32a49a31fce39d8db4cb"/><file name="right.phtml" hash="aebc83a4492669b7b985647a32eb4375"/></dir><dir name="widget"><file name="custom.phtml" hash="188632f8449044f604a92062e0344ec4"/><file name="richsnippets.phtml" hash="f50ea1836fab1d31229de5091238441d"/></dir><file name="index.phtml" hash="12b24e4ec169d7b11e31c0f5831a7553"/></dir></dir></dir></dir></dir></dir><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="magmodules_kiyoh.xml" hash="ea960e10667c3a1d3df2527c7f1d0561"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Magmodules_Kiyoh.xml" hash="4ad6b4740e25b3587cc0692f444838e2"/></dir></target><target name="mageskin"><dir name="frontend"><dir name="base"><dir name="default"><dir name="magmodules"><dir name="kiyoh"><dir name="images"><file name="5-stars-empty.png" hash="799c499ca785331e7e69d892df52dd48"/><file name="5-stars-full.png" hash="1d06151a2c4da6bb71381538c8a903a5"/><file name="greystar.png" hash="ab99888c7a8f47826ad7a83bcabf9130"/><file name="logo.png" hash="6e3cdb474978f98f8cd2907b593fdb63"/><file name="star.png" hash="647c77f0ef881fb2a90a4f53f70d75fa"/></dir><file name="richsnippets.css" hash="d04b64ab1f22af2b4899bf17ac5406ae"/><file name="sidebar.css" hash="ed9bac8878ed90310d364afd61b44bc1"/><file name="style.css" hash="b081241691d7042267d42d58c3417c6d"/></dir></dir></dir></dir></dir><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="magmodules"><dir name="kiyoh"><file name="grid.css" hash="8236836bfb11ba1a52bec1cea1ea64b0"/><file name="star.png" hash="4beacfb62ebdd5feecd946494e895f4c"/></dir></dir></dir></dir></dir></target></contents>
16
+ <compatible/>
17
+ <dependencies/>
18
+ </package>
skin/adminhtml/default/default/magmodules/kiyoh/grid.css ADDED
@@ -0,0 +1,96 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * Magmodules.eu
3
+ * http://www.magmodules.eu
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to info@magmodules.eu so we can send you a copy immediately.
14
+ *
15
+ * @category Magmodules
16
+ * @package Magmodules_Kiyoh
17
+ * @author Magmodules <info@magmodules.eu)
18
+ * @copyright Copyright (c) 2014 (http://www.magmodules.eu)
19
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
20
+ */
21
+
22
+ /** RATINGS ORDER GRID **/
23
+ .rating-empty, .rating-star-1, .rating-star-2, .rating-star-3, .rating-star-4, .rating-star-5, .rating-star-6, .rating-star-7, .rating-star-8, .rating-star-9, .rating-star-10 {
24
+ background: url('star.png') 0 0;
25
+ margin-right: 5px;
26
+ height: 16px;
27
+ float: left;
28
+ width: 80px;
29
+ }
30
+
31
+ .rating-star-1 {
32
+ width: 8px;
33
+ }
34
+
35
+ .rating-star-2 {
36
+ width: 16px;
37
+ }
38
+
39
+ .rating-star-3 {
40
+ width: 24px;
41
+ }
42
+
43
+ .rating-star-4 {
44
+ width: 32px;
45
+ }
46
+
47
+ .rating-star-5 {
48
+ width: 40px;
49
+ }
50
+
51
+ .rating-star-6 {
52
+ width: 48px;
53
+ }
54
+
55
+ .rating-star-7 {
56
+ width: 56px;
57
+ }
58
+
59
+ .rating-star-8 {
60
+ width: 64px;
61
+ }
62
+
63
+ .rating-star-9 {
64
+ width: 72px;
65
+ }
66
+
67
+ .rating-star-10 {
68
+ width: 80px;
69
+ }
70
+
71
+ .rating-empty {
72
+ float: left;
73
+ width: 80px;
74
+ background: url('star.png') 0 -16px;
75
+ }
76
+
77
+ a.magtooltip span {
78
+ display:none;
79
+ padding:2px 3px;
80
+ margin-left:8px;
81
+ width:450px;
82
+ }
83
+
84
+ a.magtooltip:hover span {
85
+ display:inline;
86
+ position:absolute;
87
+ background:#ffffff;
88
+ border:1px solid #cccccc;
89
+ color:#000;
90
+ padding: 10px;
91
+ }
92
+
93
+ .magtooltip hr {
94
+ height:1px;
95
+ border: 1px dotted #606;
96
+ }
skin/adminhtml/default/default/magmodules/kiyoh/star.png ADDED
Binary file
skin/frontend/base/default/magmodules/kiyoh/images/5-stars-empty.png ADDED
Binary file
skin/frontend/base/default/magmodules/kiyoh/images/5-stars-full.png ADDED
Binary file
skin/frontend/base/default/magmodules/kiyoh/images/greystar.png ADDED
Binary file
skin/frontend/base/default/magmodules/kiyoh/images/logo.png ADDED
Binary file
skin/frontend/base/default/magmodules/kiyoh/images/star.png ADDED
Binary file
skin/frontend/base/default/magmodules/kiyoh/richsnippets.css ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * Magmodules.eu
3
+ * http://www.magmodules.eu
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to info@magmodules.eu so we can send you a copy immediately.
14
+ *
15
+ * @category Magmodules
16
+ * @package Magmodules_Kiyoh
17
+ * @author Magmodules <info@magmodules.eu)
18
+ * @copyright Copyright (c) 2015 (http://www.magmodules.eu)
19
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
20
+ */
21
+
22
+ .kiyoh-snippets .rating-box {
23
+ float: left;
24
+ margin-right: 4px;
25
+ margin-top: 0px;
26
+ width:69px;
27
+ height:13px;
28
+ font-size:0;
29
+ line-height:0;
30
+ background:url('images/bkg_rating.gif') 0 0 repeat-x;
31
+ text-indent:-999em;
32
+ overflow:hidden;
33
+ }
34
+
35
+ .kiyoh-snippets-snippets .rating {
36
+ float:left;
37
+ height:13px;
38
+ background:url('images/bkg_rating.gif') 0 100% repeat-x;
39
+ }
40
+
41
+ /** FOR DEFAULT USE OF RATING STARTS, REMOVE BOTH CLASSES FROM CSS **/
skin/frontend/base/default/magmodules/kiyoh/sidebar.css ADDED
@@ -0,0 +1,54 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * Magmodules.eu
3
+ * http://www.magmodules.eu
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to info@magmodules.eu so we can send you a copy immediately.
14
+ *
15
+ * @category Magmodules
16
+ * @package Magmodules_Kiyoh
17
+ * @author Magmodules <info@magmodules.eu)
18
+ * @copyright Copyright (c) 2015 (http://www.magmodules.eu)
19
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
20
+ */
21
+
22
+ .kiyoh-sidebar-block {
23
+ padding: 10px;
24
+ }
25
+
26
+ .kiyoh-sidebar-block .rating-name {
27
+ font-style: italic;
28
+ vertical-align: middle;
29
+ }
30
+
31
+ img.kiyoh-logo {
32
+ display: block;
33
+ margin: 0 auto;
34
+ }
35
+
36
+ .kiyoh-sidebar-block .rating-empty { float: right; display: block; width: 80px; height: 16px; background: url('./images/star.png') 0 -16px; margin-right: 5px; }
37
+ .kiyoh-sidebar-block .rating-star-1 { float: left; display: block; width: 8px; height: 16px; background: url('./images/star.png') 0 0; margin-right: 5px; }
38
+ .kiyoh-sidebar-block .rating-star-2 { float: left; display: block; width: 16px; height: 16px; background: url('./images/star.png') 0 0; margin-right: 5px; }
39
+ .kiyoh-sidebar-block .rating-star-3 { float: left; display: block; width: 24px; height: 16px; background: url('./images/star.png') 0 0; margin-right: 5px; }
40
+ .kiyoh-sidebar-block .rating-star-4 { float: left; display: block; width: 32px; height: 16px; background: url('./images/star.png') 0 0; margin-right: 5px; }
41
+ .kiyoh-sidebar-block .rating-star-5 { float: left; display: block; width: 40px; height: 16px; background: url('./images/star.png') 0 0; margin-right: 5px; }
42
+ .kiyoh-sidebar-block .rating-star-6 { float: left; display: block; width: 48px; height: 16px; background: url('./images/star.png') 0 0; margin-right: 5px; }
43
+ .kiyoh-sidebar-block .rating-star-7 { float: left; display: block; width: 56px; height: 16px; background: url('./images/star.png') 0 0; margin-right: 5px; }
44
+ .kiyoh-sidebar-block .rating-star-8 { float: left; display: block; width: 64px; height: 16px; background: url('./images/star.png') 0 0; margin-right: 5px; }
45
+ .kiyoh-sidebar-block .rating-star-9 { float: left; display: block; width: 72px; height: 16px; background: url('./images/star.png') 0 0; margin-right: 5px; }
46
+ .kiyoh-sidebar-block .rating-star-10 { float: left; display: block; width: 80px; height: 16px; background: url('./images/star.png') 0 0; margin-right: 5px; }
47
+
48
+ /** big review stars **/
49
+ .block-content p.company-name { text-align: center; margin: 5px auto; font-size: 12px; }
50
+ .total-block-text { border-bottom: 1px solid #ccc; padding-bottom: 5px; }
51
+ .total-block-text p { text-align: center; padding-top: 5px; margin-bottom: 2px; font-size: 18px; }
52
+ .total-block-text p.based-on { text-align: center; padding-top: 0px; font-size: 11px; font-style: italic; }
53
+ .total-block-stars { height: 35px; width: 188px; background: url('./images/5-stars-empty.png') no-repeat; margin: 5px auto; }
54
+ .total-block-stars span{ display: block; height: 50px; background: url('./images/5-stars-full.png') no-repeat; }
skin/frontend/base/default/magmodules/kiyoh/style.css ADDED
@@ -0,0 +1,134 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * Magmodules.eu
3
+ * http://www.magmodules.eu
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to info@magmodules.eu so we can send you a copy immediately.
14
+ *
15
+ * @category Magmodules
16
+ * @package Magmodules_Kiyoh
17
+ * @author Magmodules <info@magmodules.eu)
18
+ * @copyright Copyright (c) 2015 (http://www.magmodules.eu)
19
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
20
+ */
21
+
22
+ .kiyoh {
23
+ }
24
+
25
+ .kiyoh h1 {
26
+ float: left;
27
+ width: 50%;
28
+ }
29
+
30
+ .kiyoh .button {
31
+ float: right;
32
+ }
33
+
34
+ .kiyoh .about-kiyoh {
35
+ float: left;
36
+ width: 70%;
37
+ }
38
+
39
+ .kiyoh .stats-kiyoh {
40
+ float: right;
41
+ width: 30%;
42
+ text-align: center;
43
+ }
44
+
45
+ .kiyoh .ratingblock-kiyoh {
46
+ width: 60px;
47
+ height: 60px;
48
+ padding: 4px 0px 0px 3px;
49
+ font-weight: bold;
50
+ font-size: 13px;
51
+ margin: 6px auto;
52
+ border-radius: 70px;
53
+ border: 4px solid white;
54
+ box-shadow: 1px 1px 3px #CCCCCC;
55
+ }
56
+
57
+ .kiyoh .content-kiyoh {
58
+ overflow: auto;
59
+ width: 100%;
60
+ margin-bottom: 5px;
61
+ }
62
+
63
+ .kiyoh .review-list {
64
+ margin-bottom: 25px;
65
+ margin-top: 10px;
66
+ }
67
+
68
+ .kiyoh .review-list h3 {
69
+ width: 80%;
70
+ float: left;
71
+ }
72
+
73
+ .kiyoh .review-header {
74
+ clear: both;
75
+ border-bottom: 1px solid #e0e0e0;
76
+ width: 100%;
77
+ height: 25px;
78
+ }
79
+
80
+ .kiyoh ul.overall li {
81
+ float: right;
82
+ }
83
+
84
+ .kiyoh ul.summary-index {
85
+ display: table;
86
+ list-style-type: none;
87
+ }
88
+
89
+ .kiyoh ul.summary-index li {
90
+ display: table-cell;
91
+ padding: 5px 5px 5px 10px;
92
+ }
93
+
94
+ .kiyoh ul.summary-index li.head {
95
+ padding: 10px 5px 5px 5px;
96
+ border-bottom: 1px dotted #e0e0e0;
97
+ }
98
+
99
+ .kiyoh ul.experience li {
100
+ width: 100%;
101
+ padding: 10px;
102
+ }
103
+
104
+ .kiyoh .rating-name {
105
+ font-weight: bold;
106
+ display: block;
107
+ margin-bottom: 2px;
108
+ }
109
+
110
+ /* INDEX REVIEW LIST */
111
+ .review-list .rating-empty { float: left; display: block; width: 80px; height: 16px; background: url('./images/star.png') 0 -16px; margin-right: 5px; }
112
+
113
+ .review-list .rating-empty { float: right; display: block; width: 80px; height: 16px; background: url('./images/star.png') 0 -16px; margin-right: 5px; }
114
+ .review-list .rating-star-1 { float: left; display: block; width: 8px; height: 16px; background: url('./images/star.png') 0 0; margin-right: 5px; }
115
+ .review-list .rating-star-2 { float: left; display: block; width: 16px; height: 16px; background: url('./images/star.png') 0 0; margin-right: 5px; }
116
+ .review-list .rating-star-3 { float: left; display: block; width: 24px; height: 16px; background: url('./images/star.png') 0 0; margin-right: 5px; }
117
+ .review-list .rating-star-4 { float: left; display: block; width: 32px; height: 16px; background: url('./images/star.png') 0 0; margin-right: 5px; }
118
+ .review-list .rating-star-5 { float: left; display: block; width: 40px; height: 16px; background: url('./images/star.png') 0 0; margin-right: 5px; }
119
+ .review-list .rating-star-6 { float: left; display: block; width: 48px; height: 16px; background: url('./images/star.png') 0 0; margin-right: 5px; }
120
+ .review-list .rating-star-7 { float: left; display: block; width: 56px; height: 16px; background: url('./images/star.png') 0 0; margin-right: 5px; }
121
+ .review-list .rating-star-8 { float: left; display: block; width: 64px; height: 16px; background: url('./images/star.png') 0 0; margin-right: 5px; }
122
+ .review-list .rating-star-9 { float: left; display: block; width: 72px; height: 16px; background: url('./images/star.png') 0 0; margin-right: 5px; }
123
+ .review-list .rating-star-10 { float: left; display: block; width: 80px; height: 16px; background: url('./images/star.png') 0 0; margin-right: 5px; }
124
+
125
+ .review-list .rating-greystar-1 { float: left; display: block; width: 8px; height: 16px; background: url('./images/greystar.png') 0 0; margin-right: 5px; }
126
+ .review-list .rating-greystar-2 { float: left; display: block; width: 16px; height: 16px; background: url('./images/greystar.png') 0 0; margin-right: 5px; }
127
+ .review-list .rating-greystar-3 { float: left; display: block; width: 24px; height: 16px; background: url('./images/greystar.png') 0 0; margin-right: 5px; }
128
+ .review-list .rating-greystar-4 { float: left; display: block; width: 32px; height: 16px; background: url('./images/greystar.png') 0 0; margin-right: 5px; }
129
+ .review-list .rating-greystar-5 { float: left; display: block; width: 40px; height: 16px; background: url('./images/greystar.png') 0 0; margin-right: 5px; }
130
+ .review-list .rating-greystar-6 { float: left; display: block; width: 48px; height: 16px; background: url('./images/greystar.png') 0 0; margin-right: 5px; }
131
+ .review-list .rating-greystar-7 { float: left; display: block; width: 56px; height: 16px; background: url('./images/greystar.png') 0 0; margin-right: 5px; }
132
+ .review-list .rating-greystar-8 { float: left; display: block; width: 64px; height: 16px; background: url('./images/greystar.png') 0 0; margin-right: 5px; }
133
+ .review-list .rating-greystar-9 { float: left; display: block; width: 72px; height: 16px; background: url('./images/greystar.png') 0 0; margin-right: 5px; }
134
+ .review-list .rating-greystar-10 { float: left; display: block; width: 80px; height: 16px; background: url('./images/greystar.png') 0 0; margin-right: 5px; }