kiyoh_customerreview - Version 1.6.4.4

Version Notes

KiyOh.nl-gebruikers kunnen met deze plug-in automatisch klantbeoordelingen verzamelen, publiceren en delen in social media. Wanneer een klant een bestelling heeft gemaakt in uw Magento Shop, wordt een e-mail uitnodiging automatisch na een paar dagen verstuurd om u te beoordelen. De e-mail wordt uit naam en e-mailadres van uw organisatie gestuurd, zodat uw klanten u herkennen. De e-mail tekst is aanpasbaar en bevat een persoonlijke en veilige link naar de pagina om te beoordelen. Vanaf nu worden de beoordelingen dus automatisch verzameld, gepubliceerd en gedeeld. Dat is nog eens handig!

Download this release

Release Info

Developer Magento Core Team
Extension kiyoh_customerreview
Version 1.6.4.4
Comparing to
See all releases


Code changes from version 1.6.3 to 1.6.4.4

Files changed (24) hide show
  1. app/code/community/Kiyoh/Customerreview/Adminhtml/Model/System/Config/Source/Reviewevents.php +24 -0
  2. app/code/community/Kiyoh/Customerreview/Block/Adminhtml/Customerreview.php +0 -12
  3. app/code/community/Kiyoh/Customerreview/Block/Adminhtml/Customerreview/Edit.php +0 -45
  4. app/code/community/Kiyoh/Customerreview/Block/Adminhtml/Customerreview/Edit/Form.php +0 -19
  5. app/code/community/Kiyoh/Customerreview/Block/Adminhtml/Customerreview/Edit/Tab/Form.php +0 -58
  6. app/code/community/Kiyoh/Customerreview/Block/Adminhtml/Customerreview/Edit/Tabs.php +0 -24
  7. app/code/community/Kiyoh/Customerreview/Block/Adminhtml/Customerreview/Grid.php +0 -116
  8. app/code/community/Kiyoh/Customerreview/Block/Customerreview.php +0 -17
  9. app/code/community/Kiyoh/Customerreview/Model/Customerreview.php +0 -10
  10. app/code/community/Kiyoh/Customerreview/Model/Mysql4/Customerreview.php +0 -10
  11. app/code/community/Kiyoh/Customerreview/Model/Mysql4/Customerreview/Collection.php +0 -10
  12. app/code/community/Kiyoh/Customerreview/Model/Status.php +0 -15
  13. app/code/community/Kiyoh/Customerreview/controllers/Adminhtml/CustomerreviewController.php +0 -306
  14. app/code/community/Kiyoh/Customerreview/controllers/Adminhtml/Sales/Order/ShipmentController.php +10 -14
  15. app/code/community/Kiyoh/Customerreview/controllers/IndexController.php +0 -47
  16. app/code/community/Kiyoh/Customerreview/etc/adminhtml.xml +21 -30
  17. app/code/community/Kiyoh/Customerreview/etc/config.xml +11 -13
  18. app/code/community/Kiyoh/Customerreview/etc/system.xml +89 -0
  19. app/code/community/Kiyoh/Customerreview/sql/customerreview_setup/mysql4-install-0.1.0.php +0 -24
  20. app/design/adminhtml/default/default/layout/customerreview.xml +0 -8
  21. app/design/adminhtml/default/default/template/customerreview/view.phtml +0 -113
  22. app/design/frontend/default/default/layout/customerreview.xml +1 -1
  23. app/design/frontend/default/default/template/{checkout/success1.phtml → kiyohcheckout/success.phtml} +10 -13
  24. package.xml +4 -4
app/code/community/Kiyoh/Customerreview/Adminhtml/Model/System/Config/Source/Reviewevents.php ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * My own options
4
+ *
5
+ */
6
+ class Kiyoh_Customerreview_Adminhtml_Model_System_Config_Source_Reviewevents
7
+ {
8
+
9
+ /**
10
+ * Options getter
11
+ *
12
+ * @return array
13
+ */
14
+ public function toOptionArray()
15
+ {
16
+ return array(
17
+ array('value' => 'Shipping', 'label'=>Mage::helper('adminhtml')->__('Shipping')),
18
+ array('value' => 'Purchase', 'label'=>Mage::helper('adminhtml')->__('Purchase')),
19
+
20
+ );
21
+ }
22
+
23
+ }
24
+ ?>
app/code/community/Kiyoh/Customerreview/Block/Adminhtml/Customerreview.php DELETED
@@ -1,12 +0,0 @@
1
- <?php
2
- class Kiyoh_Customerreview_Block_Adminhtml_Customerreview extends Mage_Adminhtml_Block_Widget_Grid_Container
3
- {
4
- public function __construct()
5
- {
6
- $this->_controller = 'adminhtml_customerreview';
7
- $this->_blockGroup = 'customerreview';
8
- $this->_headerText = Mage::helper('customerreview')->__('Item Manager');
9
- $this->_addButtonLabel = Mage::helper('customerreview')->__('Add Item');
10
- parent::__construct();
11
- }
12
- }
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/Kiyoh/Customerreview/Block/Adminhtml/Customerreview/Edit.php DELETED
@@ -1,45 +0,0 @@
1
- <?php
2
-
3
- class Kiyoh_Customerreview_Block_Adminhtml_Customerreview_Edit extends Mage_Adminhtml_Block_Widget_Form_Container
4
- {
5
- public function __construct()
6
- {
7
- parent::__construct();
8
-
9
- $this->_objectId = 'id';
10
- $this->_blockGroup = 'customerreview';
11
- $this->_controller = 'adminhtml_customerreview';
12
-
13
- $this->_updateButton('save', 'label', Mage::helper('customerreview')->__('Save Item'));
14
- $this->_updateButton('delete', 'label', Mage::helper('customerreview')->__('Delete Item'));
15
-
16
- $this->_addButton('saveandcontinue', array(
17
- 'label' => Mage::helper('adminhtml')->__('Save And Continue Edit'),
18
- 'onclick' => 'saveAndContinueEdit()',
19
- 'class' => 'save',
20
- ), -100);
21
-
22
- $this->_formScripts[] = "
23
- function toggleEditor() {
24
- if (tinyMCE.getInstanceById('customerreview_content') == null) {
25
- tinyMCE.execCommand('mceAddControl', false, 'customerreview_content');
26
- } else {
27
- tinyMCE.execCommand('mceRemoveControl', false, 'customerreview_content');
28
- }
29
- }
30
-
31
- function saveAndContinueEdit(){
32
- editForm.submit($('edit_form').action+'back/edit/');
33
- }
34
- ";
35
- }
36
-
37
- public function getHeaderText()
38
- {
39
- if( Mage::registry('customerreview_data') && Mage::registry('customerreview_data')->getId() ) {
40
- return Mage::helper('customerreview')->__("Edit Item '%s'", $this->htmlEscape(Mage::registry('customerreview_data')->getTitle()));
41
- } else {
42
- return Mage::helper('customerreview')->__('Add Item');
43
- }
44
- }
45
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/Kiyoh/Customerreview/Block/Adminhtml/Customerreview/Edit/Form.php DELETED
@@ -1,19 +0,0 @@
1
- <?php
2
-
3
- class Kiyoh_Customerreview_Block_Adminhtml_Customerreview_Edit_Form extends Mage_Adminhtml_Block_Widget_Form
4
- {
5
- protected function _prepareForm()
6
- {
7
- $form = new Varien_Data_Form(array(
8
- 'id' => 'edit_form',
9
- 'action' => $this->getUrl('*/*/save', array('id' => $this->getRequest()->getParam('id'))),
10
- 'method' => 'post',
11
- 'enctype' => 'multipart/form-data'
12
- )
13
- );
14
-
15
- $form->setUseContainer(true);
16
- $this->setForm($form);
17
- return parent::_prepareForm();
18
- }
19
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/Kiyoh/Customerreview/Block/Adminhtml/Customerreview/Edit/Tab/Form.php DELETED
@@ -1,58 +0,0 @@
1
- <?php
2
-
3
- class Kiyoh_Customerreview_Block_Adminhtml_Customerreview_Edit_Tab_Form extends Mage_Adminhtml_Block_Widget_Form
4
- {
5
- protected function _prepareForm()
6
- {
7
- $form = new Varien_Data_Form();
8
- $this->setForm($form);
9
- $fieldset = $form->addFieldset('customerreview_form', array('legend'=>Mage::helper('customerreview')->__('Item information')));
10
-
11
- $fieldset->addField('title', 'text', array(
12
- 'label' => Mage::helper('customerreview')->__('Title'),
13
- 'class' => 'required-entry',
14
- 'required' => true,
15
- 'name' => 'title',
16
- ));
17
-
18
- $fieldset->addField('filename', 'file', array(
19
- 'label' => Mage::helper('customerreview')->__('File'),
20
- 'required' => false,
21
- 'name' => 'filename',
22
- ));
23
-
24
- $fieldset->addField('status', 'select', array(
25
- 'label' => Mage::helper('customerreview')->__('Status'),
26
- 'name' => 'status',
27
- 'values' => array(
28
- array(
29
- 'value' => 1,
30
- 'label' => Mage::helper('customerreview')->__('Enabled'),
31
- ),
32
-
33
- array(
34
- 'value' => 2,
35
- 'label' => Mage::helper('customerreview')->__('Disabled'),
36
- ),
37
- ),
38
- ));
39
-
40
- $fieldset->addField('content', 'editor', array(
41
- 'name' => 'content',
42
- 'label' => Mage::helper('customerreview')->__('Content'),
43
- 'title' => Mage::helper('customerreview')->__('Content'),
44
- 'style' => 'width:700px; height:500px;',
45
- 'wysiwyg' => false,
46
- 'required' => true,
47
- ));
48
-
49
- if ( Mage::getSingleton('adminhtml/session')->getCustomerreviewData() )
50
- {
51
- $form->setValues(Mage::getSingleton('adminhtml/session')->getCustomerreviewData());
52
- Mage::getSingleton('adminhtml/session')->setCustomerreviewData(null);
53
- } elseif ( Mage::registry('customerreview_data') ) {
54
- $form->setValues(Mage::registry('customerreview_data')->getData());
55
- }
56
- return parent::_prepareForm();
57
- }
58
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/Kiyoh/Customerreview/Block/Adminhtml/Customerreview/Edit/Tabs.php DELETED
@@ -1,24 +0,0 @@
1
- <?php
2
-
3
- class Kiyoh_Customerreview_Block_Adminhtml_Customerreview_Edit_Tabs extends Mage_Adminhtml_Block_Widget_Tabs
4
- {
5
-
6
- public function __construct()
7
- {
8
- parent::__construct();
9
- $this->setId('customerreview_tabs');
10
- $this->setDestElementId('edit_form');
11
- $this->setTitle(Mage::helper('customerreview')->__('Item Information'));
12
- }
13
-
14
- protected function _beforeToHtml()
15
- {
16
- $this->addTab('form_section', array(
17
- 'label' => Mage::helper('customerreview')->__('Item Information'),
18
- 'title' => Mage::helper('customerreview')->__('Item Information'),
19
- 'content' => $this->getLayout()->createBlock('customerreview/adminhtml_customerreview_edit_tab_form')->toHtml(),
20
- ));
21
-
22
- return parent::_beforeToHtml();
23
- }
24
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/Kiyoh/Customerreview/Block/Adminhtml/Customerreview/Grid.php DELETED
@@ -1,116 +0,0 @@
1
- <?php
2
-
3
- class Kiyoh_Customerreview_Block_Adminhtml_Customerreview_Grid extends Mage_Adminhtml_Block_Widget_Grid
4
- {
5
- public function __construct()
6
- {
7
- parent::__construct();
8
- $this->setId('customerreviewGrid');
9
- $this->setDefaultSort('customerreview_id');
10
- $this->setDefaultDir('ASC');
11
- $this->setSaveParametersInSession(true);
12
- }
13
-
14
- protected function _prepareCollection()
15
- {
16
- $collection = Mage::getModel('customerreview/customerreview')->getCollection();
17
- $this->setCollection($collection);
18
- return parent::_prepareCollection();
19
- }
20
-
21
- protected function _prepareColumns()
22
- {
23
- $this->addColumn('customerreview_id', array(
24
- 'header' => Mage::helper('customerreview')->__('ID'),
25
- 'align' =>'right',
26
- 'width' => '50px',
27
- 'index' => 'customerreview_id',
28
- ));
29
-
30
- $this->addColumn('title', array(
31
- 'header' => Mage::helper('customerreview')->__('Title'),
32
- 'align' =>'left',
33
- 'index' => 'title',
34
- ));
35
-
36
- /*
37
- $this->addColumn('content', array(
38
- 'header' => Mage::helper('customerreview')->__('Item Content'),
39
- 'width' => '150px',
40
- 'index' => 'content',
41
- ));
42
- */
43
-
44
- $this->addColumn('status', array(
45
- 'header' => Mage::helper('customerreview')->__('Status'),
46
- 'align' => 'left',
47
- 'width' => '80px',
48
- 'index' => 'status',
49
- 'type' => 'options',
50
- 'options' => array(
51
- 1 => 'Enabled',
52
- 2 => 'Disabled',
53
- ),
54
- ));
55
-
56
- $this->addColumn('action',
57
- array(
58
- 'header' => Mage::helper('customerreview')->__('Action'),
59
- 'width' => '100',
60
- 'type' => 'action',
61
- 'getter' => 'getId',
62
- 'actions' => array(
63
- array(
64
- 'caption' => Mage::helper('customerreview')->__('Edit'),
65
- 'url' => array('base'=> '*/*/edit'),
66
- 'field' => 'id'
67
- )
68
- ),
69
- 'filter' => false,
70
- 'sortable' => false,
71
- 'index' => 'stores',
72
- 'is_system' => true,
73
- ));
74
-
75
- $this->addExportType('*/*/exportCsv', Mage::helper('customerreview')->__('CSV'));
76
- $this->addExportType('*/*/exportXml', Mage::helper('customerreview')->__('XML'));
77
-
78
- return parent::_prepareColumns();
79
- }
80
-
81
- protected function _prepareMassaction()
82
- {
83
- $this->setMassactionIdField('customerreview_id');
84
- $this->getMassactionBlock()->setFormFieldName('customerreview');
85
-
86
- $this->getMassactionBlock()->addItem('delete', array(
87
- 'label' => Mage::helper('customerreview')->__('Delete'),
88
- 'url' => $this->getUrl('*/*/massDelete'),
89
- 'confirm' => Mage::helper('customerreview')->__('Are you sure?')
90
- ));
91
-
92
- $statuses = Mage::getSingleton('customerreview/status')->getOptionArray();
93
-
94
- array_unshift($statuses, array('label'=>'', 'value'=>''));
95
- $this->getMassactionBlock()->addItem('status', array(
96
- 'label'=> Mage::helper('customerreview')->__('Change status'),
97
- 'url' => $this->getUrl('*/*/massStatus', array('_current'=>true)),
98
- 'additional' => array(
99
- 'visibility' => array(
100
- 'name' => 'status',
101
- 'type' => 'select',
102
- 'class' => 'required-entry',
103
- 'label' => Mage::helper('customerreview')->__('Status'),
104
- 'values' => $statuses
105
- )
106
- )
107
- ));
108
- return $this;
109
- }
110
-
111
- public function getRowUrl($row)
112
- {
113
- return $this->getUrl('*/*/edit', array('id' => $row->getId()));
114
- }
115
-
116
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/Kiyoh/Customerreview/Block/Customerreview.php DELETED
@@ -1,17 +0,0 @@
1
- <?php
2
- class Kiyoh_Customerreview_Block_Customerreview extends Mage_Core_Block_Template
3
- {
4
- public function _prepareLayout()
5
- {
6
- return parent::_prepareLayout();
7
- }
8
-
9
- public function getCustomerreview()
10
- {
11
- if (!$this->hasData('customerreview')) {
12
- $this->setData('customerreview', Mage::registry('customerreview'));
13
- }
14
- return $this->getData('customerreview');
15
-
16
- }
17
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/Kiyoh/Customerreview/Model/Customerreview.php DELETED
@@ -1,10 +0,0 @@
1
- <?php
2
-
3
- class Kiyoh_Customerreview_Model_Customerreview extends Mage_Core_Model_Abstract
4
- {
5
- public function _construct()
6
- {
7
- parent::_construct();
8
- $this->_init('customerreview/customerreview');
9
- }
10
- }
 
 
 
 
 
 
 
 
 
 
app/code/community/Kiyoh/Customerreview/Model/Mysql4/Customerreview.php DELETED
@@ -1,10 +0,0 @@
1
- <?php
2
-
3
- class Kiyoh_Customerreview_Model_Mysql4_Customerreview extends Mage_Core_Model_Mysql4_Abstract
4
- {
5
- public function _construct()
6
- {
7
- // Note that the customerreview_id refers to the key field in your database table.
8
- $this->_init('customerreview/customerreview', 'customerreview_id');
9
- }
10
- }
 
 
 
 
 
 
 
 
 
 
app/code/community/Kiyoh/Customerreview/Model/Mysql4/Customerreview/Collection.php DELETED
@@ -1,10 +0,0 @@
1
- <?php
2
-
3
- class Kiyoh_Customerreview_Model_Mysql4_Customerreview_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
4
- {
5
- public function _construct()
6
- {
7
- parent::_construct();
8
- $this->_init('customerreview/customerreview');
9
- }
10
- }
 
 
 
 
 
 
 
 
 
 
app/code/community/Kiyoh/Customerreview/Model/Status.php DELETED
@@ -1,15 +0,0 @@
1
- <?php
2
-
3
- class Kiyoh_Customerreview_Model_Status extends Varien_Object
4
- {
5
- const STATUS_ENABLED = 1;
6
- const STATUS_DISABLED = 2;
7
-
8
- static public function getOptionArray()
9
- {
10
- return array(
11
- self::STATUS_ENABLED => Mage::helper('customerreview')->__('Enabled'),
12
- self::STATUS_DISABLED => Mage::helper('customerreview')->__('Disabled')
13
- );
14
- }
15
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/Kiyoh/Customerreview/controllers/Adminhtml/CustomerreviewController.php DELETED
@@ -1,306 +0,0 @@
1
- <?php
2
-
3
- class Kiyoh_Customerreview_Adminhtml_CustomerreviewController extends Mage_Adminhtml_Controller_action
4
- {
5
-
6
- protected function _initAction() {
7
- $this->loadLayout()
8
- ->_setActiveMenu('customerreview/items')
9
- ->_addBreadcrumb(Mage::helper('adminhtml')->__('Items Manager'), Mage::helper('adminhtml')->__('Item Manager'));
10
-
11
- return $this;
12
- }
13
-
14
- public function indexAction() {
15
- // $config is an array
16
- $tableNN = $this->getRequest()->getModuleName();
17
- $write = Mage::getSingleton('core/resource')->getConnection('core_write');
18
- $dataF = Mage::getSingleton('core/resource')->getConnection('core_write');
19
-
20
- $conntectionDetail = $dataF->getConfig();
21
-
22
- /*************custom database conntection in magento***************/
23
- $hostN = $conntectionDetail['host'];
24
- $userN = $conntectionDetail['username'];
25
- $passwordN = $conntectionDetail['password'];
26
- $dbName = $conntectionDetail['dbname'];
27
-
28
- $confire = mysql_connect($hostN,$userN,$passwordN);
29
- mysql_select_db($dbName,$confire);
30
-
31
-
32
-
33
- /*************custom database conntection in magento***************/
34
-
35
- // now $write is an instance of Zend_Db_Ad
36
- if(mysql_query("select * from customerreview"))
37
- {
38
-
39
- }
40
- else
41
- {
42
- mysql_query("CREATE TABLE `customerreview` (
43
- `customerreview_id` int(11) unsigned NOT NULL auto_increment,
44
- `Connector` varchar(255) NOT NULL default '',
45
- `action` varchar(255) NOT NULL default '',
46
- `user` text NOT NULL,
47
- `delay` smallint(6) NOT NULL default '0',
48
- `created_time` datetime default NULL,
49
- `update_time` datetime default NULL,
50
- `event` varchar(255) NOT NULL,
51
- PRIMARY KEY (`customerreview_id`)
52
- )");
53
- }
54
-
55
-
56
-
57
- //////////////creation of table instllation/////////////////////
58
-
59
- $model = Mage::getModel('customerreview/customerreview');
60
-
61
- $collection = $model->getCollection();
62
-
63
- foreach($collection as $item){
64
- $data = $item->getData();
65
-
66
- }
67
-
68
- Mage::register('data1', $data);
69
-
70
- $this->_initAction()
71
- ->renderLayout();
72
- }
73
-
74
- public function editAction() {
75
- $data = $this->getRequest()->getPost();
76
-
77
- $id = $data['ids'];
78
-
79
- /*****************update autoreview table*************/
80
- $dataF = Mage::getSingleton('core/resource')->getConnection('core_write');
81
- $connector= $data['Connector'];
82
- $action = $data['action'];
83
- $user = $data['user'];
84
- $delay = $data['delay'];
85
- $event = $data['event'];
86
- $conntectionDetail = $dataF->getConfig();
87
-
88
- /*************custom database conntection in magento***************/
89
- $hostN = $conntectionDetail['host'];
90
- $userN = $conntectionDetail['username'];
91
- $passwordN = $conntectionDetail['password'];
92
- $dbName = $conntectionDetail['dbname'];
93
-
94
- $confire = mysql_connect($hostN,$userN,$passwordN);
95
- mysql_select_db($dbName,$confire);
96
- mysql_query("Update customerreview set Connector = '$connector',action='$action',user = '$user',delay = '$delay',event = '$event' where customerreview_id = $id ");
97
-
98
- /*****************update autoreview table*************/
99
- // $model = Mage::getModel('autoreview/autoreview')->load($id)->addData($data);
100
- try {
101
- //$model->setId($id)->save();
102
- Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('customerreview')->__('Item was successfully Updated'));
103
- $this->_redirect('*/*/');
104
- } catch (Exception $e){
105
- echo $e->getMessage();
106
- }
107
- }
108
-
109
- public function newAction() {
110
- $this->_forward('edit');
111
- }
112
-
113
- public function saveAction() {
114
-
115
-
116
- $data = $this->getRequest()->getPost();
117
-
118
-
119
-
120
- if ($data = $this->getRequest()->getPost()) {
121
-
122
- if(isset($_FILES['filename']['name']) && $_FILES['filename']['name'] != '') {
123
- try {
124
- /* Starting upload */
125
- $uploader = new Varien_File_Uploader('filename');
126
-
127
- // Any extention would work
128
- $uploader->setAllowedExtensions(array('jpg','jpeg','gif','png'));
129
- $uploader->setAllowRenameFiles(false);
130
-
131
- // Set the file upload mode
132
- // false -> get the file directly in the specified folder
133
- // true -> get the file in the product like folders
134
- // (file.jpg will go in something like /media/f/i/file.jpg)
135
- $uploader->setFilesDispersion(false);
136
-
137
- // We set media as the upload dir
138
- $path = Mage::getBaseDir('media') . DS ;
139
- $uploader->save($path, $_FILES['filename']['name'] );
140
-
141
- } catch (Exception $e) {
142
-
143
- }
144
-
145
- //this way the name is saved in DB
146
- $data['filename'] = $_FILES['filename']['name'];
147
- }
148
-
149
-
150
- $model = Mage::getModel('customerreview/customerreview');
151
-
152
- $model->setData($data)
153
- ->setId($this->getRequest()->getParam('id'));
154
-
155
- try {
156
- if ($model->getCreatedTime == NULL || $model->getUpdateTime() == NULL) {
157
- $model->setCreatedTime(now())
158
- ->setUpdateTime(now());
159
- } else {
160
- $model->setUpdateTime(now());
161
- }
162
-
163
- /***********save data**********/
164
- //$model->save();
165
- $dataF = Mage::getSingleton('core/resource')->getConnection('core_write');
166
-
167
- $conntectionDetail = $dataF->getConfig();
168
-
169
- /*************custom database conntection in magento***************/
170
- $hostN = $conntectionDetail['host'];
171
- $userN = $conntectionDetail['username'];
172
- $passwordN = $conntectionDetail['password'];
173
- $dbName = $conntectionDetail['dbname'];
174
-
175
- $confire = mysql_connect($hostN,$userN,$passwordN);
176
- mysql_select_db($dbName,$confire);
177
- $connector= $data['Connector'];
178
- $action = $data['action'];
179
- $user = $data['user'];
180
- $delay = $data['delay'];
181
- $event = $data['event'];
182
-
183
-
184
- mysql_query("insert into customerreview (Connector,action,user,delay,event) values('$connector','$action','$user','$delay','$event')");
185
-
186
- /*******************save data***********************/
187
-
188
- Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('customerreview')->__('Item was successfully saved'));
189
- Mage::getSingleton('adminhtml/session')->setFormData(false);
190
-
191
- if ($this->getRequest()->getParam('back')) {
192
- $this->_redirect('*/*/edit', array('id' => $model->getId()));
193
- return;
194
- }
195
- $this->_redirect('*/*/');
196
- return;
197
- } catch (Exception $e) {
198
- Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
199
- Mage::getSingleton('adminhtml/session')->setFormData($data);
200
- $this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));
201
- return;
202
- }
203
- }
204
- Mage::getSingleton('adminhtml/session')->addError(Mage::helper('customerreview')->__('Unable to find item to save'));
205
- $this->_redirect('*/*/');
206
- }
207
-
208
-
209
- public function deleteAction() {
210
- if( $this->getRequest()->getParam('id') > 0 ) {
211
- try {
212
- $model = Mage::getModel('customerreview/customerreview');
213
-
214
- $model->setId($this->getRequest()->getParam('id'))
215
- ->delete();
216
-
217
- Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('adminhtml')->__('Item was successfully deleted'));
218
- $this->_redirect('*/*/');
219
- } catch (Exception $e) {
220
- Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
221
- $this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));
222
- }
223
- }
224
- $this->_redirect('*/*/');
225
- }
226
-
227
- public function massDeleteAction() {
228
- $customerreviewIds = $this->getRequest()->getParam('customerreview');
229
- if(!is_array($customerreviewIds)) {
230
- Mage::getSingleton('adminhtml/session')->addError(Mage::helper('adminhtml')->__('Please select item(s)'));
231
- } else {
232
- try {
233
- foreach ($customerreviewIds as $customerreviewId) {
234
- $customerreview = Mage::getModel('customerreview/customerreview')->load($customerreviewId);
235
- $customerreview->delete();
236
- }
237
- Mage::getSingleton('adminhtml/session')->addSuccess(
238
- Mage::helper('adminhtml')->__(
239
- 'Total of %d record(s) were successfully deleted', count($customerreviewIds)
240
- )
241
- );
242
- } catch (Exception $e) {
243
- Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
244
- }
245
- }
246
- $this->_redirect('*/*/index');
247
- }
248
-
249
- public function massStatusAction()
250
- {
251
- $customerreviewIds = $this->getRequest()->getParam('customerreview');
252
- if(!is_array($customerreviewIds)) {
253
- Mage::getSingleton('adminhtml/session')->addError($this->__('Please select item(s)'));
254
- } else {
255
- try {
256
- foreach ($customerreviewIds as $customerreviewId) {
257
- $customerreview = Mage::getSingleton('customerreview/customerreview')
258
- ->load($customerreviewId)
259
- ->setStatus($this->getRequest()->getParam('status'))
260
- ->setIsMassupdate(true)
261
- ->save();
262
- }
263
- $this->_getSession()->addSuccess(
264
- $this->__('Total of %d record(s) were successfully updated', count($customerreviewIds))
265
- );
266
- } catch (Exception $e) {
267
- $this->_getSession()->addError($e->getMessage());
268
- }
269
- }
270
- $this->_redirect('*/*/index');
271
- }
272
-
273
- public function exportCsvAction()
274
- {
275
- $fileName = 'customerreview.csv';
276
- $content = $this->getLayout()->createBlock('customerreview/adminhtml_customerreview_grid')
277
- ->getCsv();
278
-
279
- $this->_sendUploadResponse($fileName, $content);
280
- }
281
-
282
- public function exportXmlAction()
283
- {
284
- $fileName = 'customerreview.xml';
285
- $content = $this->getLayout()->createBlock('customerreview/adminhtml_customerreview_grid')
286
- ->getXml();
287
-
288
- $this->_sendUploadResponse($fileName, $content);
289
- }
290
-
291
- protected function _sendUploadResponse($fileName, $content, $contentType='application/octet-stream')
292
- {
293
- $response = $this->getResponse();
294
- $response->setHeader('HTTP/1.1 200 OK','');
295
- $response->setHeader('Pragma', 'public', true);
296
- $response->setHeader('Cache-Control', 'must-revalidate, post-check=0, pre-check=0', true);
297
- $response->setHeader('Content-Disposition', 'attachment; filename='.$fileName);
298
- $response->setHeader('Last-Modified', date('r'));
299
- $response->setHeader('Accept-Ranges', 'bytes');
300
- $response->setHeader('Content-Length', strlen($content));
301
- $response->setHeader('Content-type', $contentType);
302
- $response->setBody($content);
303
- $response->sendResponse();
304
- die;
305
- }
306
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/Kiyoh/Customerreview/controllers/Adminhtml/Sales/Order/ShipmentController.php CHANGED
@@ -46,8 +46,8 @@ class Kiyoh_Customerreview_Adminhtml_Sales_Order_ShipmentController extends Mage
46
  */
47
  public function saveAction()
48
  {
49
-
50
-
51
  $data = $this->getRequest()->getPost('shipment');
52
  if (!empty($data['comment_text'])) {
53
  Mage::getSingleton('adminhtml/session')->setCommentText($data['comment_text']);
@@ -86,26 +86,22 @@ class Kiyoh_Customerreview_Adminhtml_Sales_Order_ShipmentController extends Mage
86
  }
87
 
88
  $email = $data11['email'];
89
- $model = Mage::getModel('customerreview/customerreview');
90
-
91
- $collection1 = $model->getCollection();
92
-
93
- foreach($collection1 as $item1){
94
- $datareview = $item1->getData();
95
 
96
- }
97
 
98
- if($datareview['event'] == 'shipping')
99
  {
100
- $connector = $datareview['Connector'];
101
- $action = $datareview['action'];
102
- $user = $datareview['user'];
103
- $delay = $datareview['delay'];
104
 
105
  ////call url
106
  // create a new cURL resource
107
  //Create a curl handle
108
  $url = 'https://www.kiyoh.nl/set.php?user='.$user.'&connector='.$connector.'&action='.$action.'&targetMail='.$email.'&delay='.$delay;
 
 
109
 
110
  // create a new cURL resource
111
  $curl = curl_init();
46
  */
47
  public function saveAction()
48
  {
49
+ $eventval = Mage::getStoreConfig('customconfig/review_group/custom_event');
50
+ $status = Mage::getStoreConfig('customconfig/review_group/custom_enable');
51
  $data = $this->getRequest()->getPost('shipment');
52
  if (!empty($data['comment_text'])) {
53
  Mage::getSingleton('adminhtml/session')->setCommentText($data['comment_text']);
86
  }
87
 
88
  $email = $data11['email'];
89
+
 
 
 
 
 
90
 
 
91
 
92
+ if($eventval == 'Shipping' && $status =='1')
93
  {
94
+ $connector = Mage::getStoreConfig('customconfig/review_group/custom_connector');
95
+ $action = Mage::getStoreConfig('customconfig/review_group/custom_action');
96
+ $user = Mage::getStoreConfig('customconfig/review_group/custom_user');
97
+ $delay = Mage::getStoreConfig('customconfig/review_group/custom_delay');
98
 
99
  ////call url
100
  // create a new cURL resource
101
  //Create a curl handle
102
  $url = 'https://www.kiyoh.nl/set.php?user='.$user.'&connector='.$connector.'&action='.$action.'&targetMail='.$email.'&delay='.$delay;
103
+
104
+
105
 
106
  // create a new cURL resource
107
  $curl = curl_init();
app/code/community/Kiyoh/Customerreview/controllers/IndexController.php DELETED
@@ -1,47 +0,0 @@
1
- <?php
2
- class Kiyoh_Customerreview_IndexController extends Mage_Core_Controller_Front_Action
3
- {
4
- public function indexAction()
5
- {
6
-
7
- /*
8
- * Load an object by id
9
- * Request looking like:
10
- * http://site.com/customerreview?id=15
11
- * or
12
- * http://site.com/customerreview/id/15
13
- */
14
- /*
15
- $customerreview_id = $this->getRequest()->getParam('id');
16
-
17
- if($customerreview_id != null && $customerreview_id != '') {
18
- $customerreview = Mage::getModel('customerreview/customerreview')->load($customerreview_id)->getData();
19
- } else {
20
- $customerreview = null;
21
- }
22
- */
23
-
24
- /*
25
- * If no param we load a the last created item
26
- */
27
- /*
28
- if($customerreview == null) {
29
- $resource = Mage::getSingleton('core/resource');
30
- $read= $resource->getConnection('core_read');
31
- $customerreviewTable = $resource->getTableName('customerreview');
32
-
33
- $select = $read->select()
34
- ->from($customerreviewTable,array('customerreview_id','title','content','status'))
35
- ->where('status',1)
36
- ->order('created_time DESC') ;
37
-
38
- $customerreview = $read->fetchRow($select);
39
- }
40
- Mage::register('customerreview', $customerreview);
41
- */
42
-
43
-
44
- $this->loadLayout();
45
- $this->renderLayout();
46
- }
47
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/Kiyoh/Customerreview/etc/adminhtml.xml CHANGED
@@ -1,32 +1,23 @@
1
  <?xml version="1.0"?>
2
  <config>
3
- <menu>
4
- <customerreview module="customerreview">
5
- <title>Customerreview</title>
6
- <sort_order>71</sort_order>
7
- <children>
8
- <items module="customerreview">
9
- <title>Setting</title>
10
- <sort_order>0</sort_order>
11
- <action>customerreview/adminhtml_customerreview</action>
12
- </items>
13
- </children>
14
- </customerreview>
15
- </menu>
16
- <acl>
17
- <resources>
18
- <all>
19
- <title>Allow Everything</title>
20
- </all>
21
- <admin>
22
- <children>
23
- <Kiyoh_Customerreview>
24
- <title>Customerreview Module</title>
25
- <sort_order>10</sort_order>
26
- </Kiyoh_Customerreview>
27
- </children>
28
- </admin>
29
- </resources>
30
- </acl>
31
-
32
- </config>
1
  <?xml version="1.0"?>
2
  <config>
3
+ <acl>
4
+ <resources>
5
+ <admin>
6
+ <children>
7
+ <system>
8
+ <children>
9
+ <config>
10
+ <children>
11
+ <customconfig translate="title" module="customerreview">
12
+ <title>Customers</title>
13
+ <sort_order>100</sort_order>
14
+ </customconfig>
15
+ </children>
16
+ </config>
17
+ </children>
18
+ </system>
19
+ </children>
20
+ </admin>
21
+ </resources>
22
+ </acl>
23
+ </config>
 
 
 
 
 
 
 
 
 
app/code/community/Kiyoh/Customerreview/etc/config.xml CHANGED
@@ -50,19 +50,6 @@
50
  </routers>
51
  </admin>
52
  <adminhtml>
53
- <menu>
54
- <customerreview module="customerreview">
55
- <title>Customerreview</title>
56
- <sort_order>71</sort_order>
57
- <children>
58
- <items module="customerreview">
59
- <title>Setting</title>
60
- <sort_order>0</sort_order>
61
- <action>customerreview/adminhtml_customerreview</action>
62
- </items>
63
- </children>
64
- </customerreview>
65
- </menu>
66
  <acl>
67
  <resources>
68
  <all>
@@ -88,6 +75,10 @@
88
  </adminhtml>
89
  <global>
90
  <models>
 
 
 
 
91
  <customerreview>
92
  <class>Kiyoh_Customerreview_Model</class>
93
  <resourceModel>customerreview_mysql4</resourceModel>
@@ -132,4 +123,11 @@
132
  </customerreview>
133
  </helpers>
134
  </global>
 
 
 
 
 
 
 
135
  </config>
50
  </routers>
51
  </admin>
52
  <adminhtml>
 
 
 
 
 
 
 
 
 
 
 
 
 
53
  <acl>
54
  <resources>
55
  <all>
75
  </adminhtml>
76
  <global>
77
  <models>
78
+ <customerreview_adminhtml>
79
+ <class>Kiyoh_Customerreview_Adminhtml_Model</class>
80
+ </customerreview_adminhtml>
81
+
82
  <customerreview>
83
  <class>Kiyoh_Customerreview_Model</class>
84
  <resourceModel>customerreview_mysql4</resourceModel>
123
  </customerreview>
124
  </helpers>
125
  </global>
126
+ <default>
127
+ <customconfig>
128
+ <review_group>
129
+ <custom_action>sendInvitation</custom_action>
130
+ </review_group>
131
+ </customconfig>
132
+ </default>
133
  </config>
app/code/community/Kiyoh/Customerreview/etc/system.xml ADDED
@@ -0,0 +1,89 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" ?>
2
+ <config>
3
+ <tabs>
4
+ <mynew_tab module="customerreview" translate="label">
5
+ <label>Customers</label>
6
+ <sort_order>100</sort_order>
7
+ </mynew_tab>
8
+ </tabs>
9
+ <sections>
10
+ <customconfig module="customerreview" translate="label">
11
+ <label>Review</label>
12
+ <sort_order>200</sort_order>
13
+ <show_in_default>1</show_in_default>
14
+ <show_in_website>1</show_in_website>
15
+ <show_in_store>1</show_in_store>
16
+ <tab>mynew_tab</tab>
17
+ <groups>
18
+ <review_group translate="label">
19
+ <label>Customers</label>
20
+ <comment>This is example of custom configuration.</comment>
21
+ <sort_order>10</sort_order>
22
+ <show_in_default>1</show_in_default>
23
+ <show_in_website>1</show_in_website>
24
+ <show_in_store>1</show_in_store>
25
+ <fields>
26
+ <custom_enable translate="label">
27
+ <label>Enable: </label>
28
+ <comment>Source model provider Magento's default Yes/No values</comment>
29
+ <frontend_type>select</frontend_type>
30
+ <sort_order>0</sort_order>
31
+ <show_in_default>1</show_in_default>
32
+ <show_in_website>1</show_in_website>
33
+ <show_in_store>1</show_in_store>
34
+ <source_model>adminhtml/system_config_source_yesno</source_model>
35
+ <comment>Recommended Value is Yes. On setting it to NO, module ll stop sending email invites to customers.</comment>
36
+ </custom_enable>
37
+
38
+ <custom_connector translate="label tooltip comment">
39
+ <label>Enter Connector</label>
40
+ <frontend_type>text</frontend_type>
41
+ <sort_order>1</sort_order>
42
+ <show_in_default>1</show_in_default>
43
+ <show_in_website>1</show_in_website>
44
+ <show_in_store>1</show_in_store>
45
+ <comment>Enter here the Kiyoh Connector Code from your Kiyoh Account.</comment>
46
+ </custom_connector>
47
+ <custom_action translate="label tooltip comment">
48
+
49
+ <frontend_type>hidden</frontend_type>
50
+ <sort_order>2</sort_order>
51
+ <show_in_default>1</show_in_default>
52
+ <show_in_website>1</show_in_website>
53
+ <show_in_store>1</show_in_store>
54
+
55
+ </custom_action>
56
+ <custom_user translate="label tooltip comment">
57
+ <label>Enter User</label>
58
+ <frontend_type>text</frontend_type>
59
+ <sort_order>3</sort_order>
60
+ <show_in_default>1</show_in_default>
61
+ <show_in_website>1</show_in_website>
62
+ <show_in_store>1</show_in_store>
63
+ <comment>Enter here your email address using which you are registered at Kiyoh.</comment>
64
+ </custom_user>
65
+ <custom_delay translate="label tooltip comment">
66
+ <label>Enter delay</label>
67
+ <frontend_type>text</frontend_type>
68
+ <sort_order>4</sort_order>
69
+ <show_in_default>1</show_in_default>
70
+ <show_in_website>1</show_in_website>
71
+ <show_in_store>1</show_in_store>
72
+ <comment>Enter here the delay(number of days) after which you would like to send review invite email to your customer. This delay applies after customer event(Shipping/Purchase - to be selected at next option). You may enter 0 to send review invite email immediately after customer event(Shipping/Purchase).</comment>
73
+ </custom_delay>
74
+ <custom_event translate="label tooltip comment">
75
+ <label>Select Event</label>
76
+ <frontend_type>select</frontend_type>
77
+ <source_model>customerreview_adminhtml/system_config_source_reviewevents</source_model>
78
+ <sort_order>5</sort_order>
79
+ <show_in_default>1</show_in_default>
80
+ <show_in_website>1</show_in_website>
81
+ <show_in_store>1</show_in_store>
82
+ <comment>Enter here the event after which you would like to send review invite email to your customer. Enter Shipping if your store sells products that need shipping. Enter Purchase if your store sells downloadable products(softwares).</comment>
83
+ </custom_event>
84
+ </fields>
85
+ </review_group>
86
+ </groups>
87
+ </customconfig>
88
+ </sections>
89
+ </config>
app/code/community/Kiyoh/Customerreview/sql/customerreview_setup/mysql4-install-0.1.0.php DELETED
@@ -1,24 +0,0 @@
1
- <?php
2
-
3
- $installer = $this;
4
-
5
- $installer->startSetup();
6
-
7
- $installer->run("
8
-
9
- -- DROP TABLE IF EXISTS {$this->getTable('customerreview')};
10
- CREATE TABLE {$this->getTable('customerreview')} (
11
- `customerreview_id` int(11) unsigned NOT NULL auto_increment,
12
- `Connector` varchar(255) NOT NULL default '',
13
- `action` varchar(255) NOT NULL default '',
14
- `user` text NOT NULL,
15
- `delay` smallint(6) NOT NULL default '0',
16
- `created_time` datetime default NULL,
17
- `update_time` datetime default NULL,
18
- `event` varchar(255) NOT NULL,
19
- PRIMARY KEY (`customerreview_id`)
20
- ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
21
-
22
- ");
23
-
24
- $installer->endSetup();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/design/adminhtml/default/default/layout/customerreview.xml DELETED
@@ -1,8 +0,0 @@
1
- <?xml version="1.0"?>
2
- <layout version="0.1.0">
3
- <customerreview_adminhtml_customerreview_index>
4
- <reference name="content">
5
- <block type="adminhtml/template" name="customerreview" template="customerreview/view.phtml"/>
6
- </reference>
7
- </customerreview_adminhtml_customerreview_index>
8
- </layout>
 
 
 
 
 
 
 
 
app/design/adminhtml/default/default/template/customerreview/view.phtml DELETED
@@ -1,113 +0,0 @@
1
- <?php
2
- $data = Mage::registry('data1');
3
-
4
- ?>
5
- <div class="content-header">
6
- <table cellspacing="0" class="grid-header">
7
- <tr>
8
- <td><h3><?=$this->__('Review Setting')?></h3></td>
9
- <td class="a-right">
10
- <button onclick="editForm.submit()" class="scalable save" type="button"><span>Submit my form</span></button>
11
- </td>
12
- </tr>
13
- </table>
14
- </div>
15
- <div class="entry-edit">
16
- <?php
17
- if(!isset($data['customerreview_id']))
18
- {
19
- ?>
20
- <form id="edit_form" name="edit_form" method="post" action="<?=$this->getUrl('*/*/save')?>">
21
- <?php
22
- }
23
-
24
- else
25
- {
26
- ?>
27
- <form id="edit_form" name="edit_form" method="post" action="<?=$this->getUrl('*/*/edit')?>">
28
- <?php
29
- }
30
- ?>
31
- <input name="form_key" type="hidden" value="<?php echo Mage::getSingleton('core/session')->getFormKey() ?>" />
32
- <h4 class="icon-head head-edit-form fieldset-legend"><?=$this->__('Manage Setting')?></h4>
33
- <fieldset id="my-fieldset">
34
- <table cellspacing="0" class="form-list">
35
- <tr>
36
- <td class="label"><?=$this->__('Enter Connector')?> <span class="required">*</span></td>
37
- <td class="input-ele"><input class="input-text required-entry" name="Connector" value="<?php echo $data['Connector'];?>" size="60" />
38
- <br/><span style="font-size:10px;color:#CC3300;">Enter here the Kiyoh Connector Code from your Kiyoh Account.</span>
39
- </td>
40
-
41
- </tr>
42
-
43
-
44
-
45
- <tr style="display:none">
46
- <td class="label"><?=$this->__('Enter action')?> <span class="required">*</span></td>
47
- <td class="input-ele"><input class="input-text required-entry" name="action" value="sendInvitation" size="60"/><br/><span style="font-size:10px;color:#CC3300;">holds the action that will be taken, in this case invite (value: sendInvitation)</span></td>
48
- </tr>
49
- <tr>
50
- <td class="label"><?=$this->__('Enter User')?> <span class="required">*</span></td>
51
- <td class="input-ele"><input class="input-text required-entry" name="user" value="<?php echo $data['user'];?>" size="60"/><br/><span style="font-size:10px;color:#CC3300;">Enter here your email address using which you registered at Kiyoh.</span></td>
52
- </tr>
53
- <tr>
54
- <td class="label"><?=$this->__('Enter delay')?> <span class="required">*</span></td>
55
- <td class="input-ele"><input class="input-text required-entry" name="delay" value="<?php echo $data['delay'];?>" size="60"/><br/><span style="font-size:10px;color:#CC3300;">Enter here the delay(number of days) after which you would like to send review invite to your customer. This delay applies after customer event(Shipping/Purchase).
56
- You may enter 0 to send review invite immediately after customer event(Shipping/Purchase).</span></td>
57
- </tr>
58
-
59
- <tr>
60
- <td class="label"><?=$this->__('Enter Event')?> <span class="required">*</span></td>
61
- <td class="input-ele">
62
- <select name="event">
63
- <?php
64
- if(isset($data['event']))
65
- {
66
- if($data['event'] == 'shipping')
67
- {
68
- ?>
69
- <option value="shipping" selected="selected">Shipping</option>
70
- <option value="purchase">Purchase</option>
71
- <?php
72
- }
73
-
74
- if($data['event'] == 'purchase')
75
- {
76
- ?>
77
- <option value="shipping" >Shipping</option>
78
- <option value="purchase" selected="selected">Purchase</option>
79
- <?php
80
- }
81
- }
82
- else
83
- {
84
- ?>
85
- <option value="shipping">Shipping</option>
86
- <option value="purchase">Purchase</option>
87
- <?php
88
- }
89
- ?>
90
- </select>
91
-
92
-
93
-
94
- <br/><span style="font-size:10px;color:#CC3300;">Enter here the event after which you would like to send review invitation to your customer.
95
- Enter Shipping if your store sells products that need shipping.
96
- Enter Purchase if your store sells downloadable products(softwares).</span> </td>
97
- </tr>
98
- <?php
99
- if(isset($data['customerreview_id']))
100
- {
101
- ?>
102
- <input type="hidden" class="input-text required-entry" name="ids" value="<?php echo $data['customerreview_id'];?>"/>
103
- <?php
104
- }
105
- ?>
106
- </table>
107
- </fieldset>
108
- </form>
109
- </div>
110
-
111
- <script type="text/javascript">
112
- var editForm = new varienForm('edit_form');
113
- </script>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/design/frontend/default/default/layout/customerreview.xml CHANGED
@@ -13,7 +13,7 @@
13
  <action method="setTemplate"><template>page/2columns-right.phtml</template></action>
14
  </reference>
15
  <reference name="content">
16
- <block type="checkout/onepage_success" name="checkout.success" template="checkout/success1.phtml"/>
17
  </reference>
18
  </checkout_onepage_success>
19
  </layout>
13
  <action method="setTemplate"><template>page/2columns-right.phtml</template></action>
14
  </reference>
15
  <reference name="content">
16
+ <block type="checkout/onepage_success" name="checkout.success" template="kiyohcheckout/success.phtml"/>
17
  </reference>
18
  </checkout_onepage_success>
19
  </layout>
app/design/frontend/default/default/template/{checkout/success1.phtml → kiyohcheckout/success.phtml} RENAMED
@@ -29,22 +29,17 @@ if (Mage::isInstalled() && Mage::getSingleton('customer/session')->isLoggedIn())
29
  $this->_data['email'] = $this->__($this->htmlEscape(Mage::getSingleton('customer/session')->getCustomer()->getEmail()));
30
  }
31
  $email = $this->_data['email'];
32
-
33
- $model = Mage::getModel('customerreview/customerreview');
34
-
35
- $collection = $model->getCollection();
36
-
37
- foreach($collection as $item){
38
- $data = $item->getData();
39
 
40
- }
41
 
42
- if($data['event'] == 'purchase')
43
  {
44
- $connector = $data['Connector'];
45
- $action = $data['action'];
46
- $user = $data['user'];
47
- $delay = $data['delay'];
 
48
 
49
  ////call url
50
 
@@ -53,6 +48,8 @@ $delay = $data['delay'];
53
  // Create a curl handle
54
  $url = 'https://www.kiyoh.nl/set.php?user='.$user.'&connector='.$connector.'&action='.$action.'&targetMail='.$email.'&delay='.$delay;
55
 
 
 
56
 
57
  // create a new cURL resource
58
  $curl = curl_init();
29
  $this->_data['email'] = $this->__($this->htmlEscape(Mage::getSingleton('customer/session')->getCustomer()->getEmail()));
30
  }
31
  $email = $this->_data['email'];
32
+ $eventval = Mage::getStoreConfig('customconfig/review_group/custom_event');
33
+ $status = Mage::getStoreConfig('customconfig/review_group/custom_enable');
 
 
 
 
 
34
 
 
35
 
36
+ if( $eventval == 'Purchase' && $status == '1')
37
  {
38
+ $connector = Mage::getStoreConfig('customconfig/review_group/custom_connector');
39
+ $action = Mage::getStoreConfig('customconfig/review_group/custom_action');
40
+ $user = Mage::getStoreConfig('customconfig/review_group/custom_user');
41
+ $delay = Mage::getStoreConfig('customconfig/review_group/custom_delay');
42
+
43
 
44
  ////call url
45
 
48
  // Create a curl handle
49
  $url = 'https://www.kiyoh.nl/set.php?user='.$user.'&connector='.$connector.'&action='.$action.'&targetMail='.$email.'&delay='.$delay;
50
 
51
+
52
+
53
 
54
  // create a new cURL resource
55
  $curl = curl_init();
package.xml CHANGED
@@ -1,7 +1,7 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>kiyoh_customerreview</name>
4
- <version>1.6.3</version>
5
  <stability>stable</stability>
6
  <license uri="http://www.opensource.org/licenses/osl-3.0.php">OSL v3.0</license>
7
  <channel>community</channel>
@@ -10,9 +10,9 @@
10
  <description>KiyOh.nl-gebruikers kunnen met deze plug-in automatisch klantbeoordelingen verzamelen, publiceren en delen in social media. Wanneer een klant een bestelling heeft gemaakt in uw Magento Shop, wordt een e-mail uitnodiging automatisch na een paar dagen verstuurd om u te beoordelen. De e-mail wordt uit naam en e-mailadres van uw organisatie gestuurd, zodat uw klanten u herkennen. De e-mail tekst is aanpasbaar en bevat een persoonlijke en veilige link naar de pagina om te beoordelen. Vanaf nu worden de beoordelingen dus automatisch verzameld, gepubliceerd en gedeeld. Dat is nog eens handig!</description>
11
  <notes>KiyOh.nl-gebruikers kunnen met deze plug-in automatisch klantbeoordelingen verzamelen, publiceren en delen in social media. Wanneer een klant een bestelling heeft gemaakt in uw Magento Shop, wordt een e-mail uitnodiging automatisch na een paar dagen verstuurd om u te beoordelen. De e-mail wordt uit naam en e-mailadres van uw organisatie gestuurd, zodat uw klanten u herkennen. De e-mail tekst is aanpasbaar en bevat een persoonlijke en veilige link naar de pagina om te beoordelen. Vanaf nu worden de beoordelingen dus automatisch verzameld, gepubliceerd en gedeeld. Dat is nog eens handig!</notes>
12
  <authors><author><name>kiyoh_m</name><user>auto-converted</user><email>kiyoh.autoreview@gmail.com</email></author></authors>
13
- <date>2011-04-21</date>
14
- <time>15:13:35</time>
15
- <contents><target name="mage"><dir name="app"><dir name="code"><dir name="community"><dir name="Kiyoh"><dir name="Customerreview"><dir name="Block"><dir name="Adminhtml"><dir name="Customerreview"><dir name="Edit"><dir name="Tab"><file name="Form.php" hash="a50cb6d28768e5a0161753a0ed360cb5"/></dir><file name="Form.php" hash="f852059f7d07e8d0a93c65359d79cd08"/><file name="Tabs.php" hash="11eb0974977b5b27004e5b015d46680b"/></dir><file name="Edit.php" hash="673f999d1aa63b9477769a97d816f3e1"/><file name="Grid.php" hash="2ee706abce845bc76b9afadca49aacda"/></dir><file name="Customerreview.php" hash="b18441bf48af3c809d68193b0e31e4a6"/></dir><file name="Customerreview.php" hash="be8fa564fc669477445c9d8d1c7fba5c"/></dir><dir name="Helper"><file name="Data.php" hash="fda5c34b4da4ade55e107f88fc7c6287"/></dir><dir name="Model"><dir name="Mysql4"><dir name="Customerreview"><file name="Collection.php" hash="d5a6959c3f95e2c72742512b7a5ffc77"/></dir><file name="Customerreview.php" hash="b61962026b3eec52549160689f3ea106"/></dir><file name="Customerreview.php" hash="fb2f4a070079adce2670b871c1a4cd6a"/><file name="Status.php" hash="644c20690349400e33f3e4bf606f2471"/></dir><dir name="controllers"><dir name="Adminhtml"><dir name="Sales"><dir name="Order"><file name="ShipmentController.php" hash="8f031bb81341cec578f7e5952a773202"/></dir></dir><file name="CustomerreviewController.php" hash="b211503a4430d8bb2413a6a77319342e"/></dir><file name="IndexController.php" hash="2c3974763eac5929e0610afeb7fe252f"/></dir><dir name="etc"><file name="adminhtml.xml" hash="c99b84cf706cf2ad801595e3a16a1541"/><file name="config.xml" hash="64c90504811a278079701cfae72dcdcc"/></dir><dir name="sql"><dir name="customerreview_setup"><file name="mysql4-install-0.1.0.php" hash="c943078158c883ef93ac80499747c473"/></dir></dir></dir></dir></dir></dir><dir name="etc"><dir name="modules"><file name="Kiyoh_Customerreview.xml" hash="bbaf093738bc2b0835c48341a8849acb"/></dir></dir><dir name="design"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="customerreview.xml" hash="a264228bd530b64ab9915659cd1f00cb"/></dir><dir name="template"><dir name="customerreview"><file name="view.phtml" hash="55dcd7e65a313775c1e72b111baa6f20"/></dir></dir></dir></dir></dir><dir name="frontend"><dir name="default"><dir name="default"><dir name="layout"><file name="customerreview.xml" hash="abe2f7a36df2e432346f00a50fdc92c1"/></dir><dir name="template"><dir name="customerreview"><file name="customerreview.phtml" hash="c692037d1baf7c41be15ff9a2b0e126e"/></dir><dir name="checkout"><file name="success1.phtml" hash="605944d981e04af9ebd960e88f9b2e70"/></dir></dir></dir></dir></dir></dir></dir></target></contents>
16
  <compatible/>
17
  <dependencies/>
18
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>kiyoh_customerreview</name>
4
+ <version>1.6.4.4</version>
5
  <stability>stable</stability>
6
  <license uri="http://www.opensource.org/licenses/osl-3.0.php">OSL v3.0</license>
7
  <channel>community</channel>
10
  <description>KiyOh.nl-gebruikers kunnen met deze plug-in automatisch klantbeoordelingen verzamelen, publiceren en delen in social media. Wanneer een klant een bestelling heeft gemaakt in uw Magento Shop, wordt een e-mail uitnodiging automatisch na een paar dagen verstuurd om u te beoordelen. De e-mail wordt uit naam en e-mailadres van uw organisatie gestuurd, zodat uw klanten u herkennen. De e-mail tekst is aanpasbaar en bevat een persoonlijke en veilige link naar de pagina om te beoordelen. Vanaf nu worden de beoordelingen dus automatisch verzameld, gepubliceerd en gedeeld. Dat is nog eens handig!</description>
11
  <notes>KiyOh.nl-gebruikers kunnen met deze plug-in automatisch klantbeoordelingen verzamelen, publiceren en delen in social media. Wanneer een klant een bestelling heeft gemaakt in uw Magento Shop, wordt een e-mail uitnodiging automatisch na een paar dagen verstuurd om u te beoordelen. De e-mail wordt uit naam en e-mailadres van uw organisatie gestuurd, zodat uw klanten u herkennen. De e-mail tekst is aanpasbaar en bevat een persoonlijke en veilige link naar de pagina om te beoordelen. Vanaf nu worden de beoordelingen dus automatisch verzameld, gepubliceerd en gedeeld. Dat is nog eens handig!</notes>
12
  <authors><author><name>kiyoh_m</name><user>auto-converted</user><email>kiyoh.autoreview@gmail.com</email></author></authors>
13
+ <date>2011-05-17</date>
14
+ <time>10:11:43</time>
15
+ <contents><target name="mage"><dir name="app"><dir name="code"><dir name="community"><dir name="Kiyoh"><dir name="Customerreview"><dir name="Adminhtml"><dir name="Model"><dir name="System"><dir name="Config"><dir name="Source"><file name="Reviewevents.php" hash="ebcb4f837723a3e1cd7d3e0996fa81ca"/></dir></dir></dir></dir></dir><dir name="Helper"><file name="Data.php" hash="fda5c34b4da4ade55e107f88fc7c6287"/></dir><dir name="controllers"><dir name="Adminhtml"><dir name="Sales"><dir name="Order"><file name="ShipmentController.php" hash="047e28fbae43bcf3161c5008ad2f6ecb"/></dir></dir></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="6cf979d01f8317d9dd7a177747ab24f2"/><file name="config.xml" hash="1eb598985cdc2d0d5c79a5b3c5e66cee"/><file name="system.xml" hash="1d1c1ad576f673e87fa2a2448864ca32"/></dir></dir></dir></dir></dir><dir name="etc"><dir name="modules"><file name="Kiyoh_Customerreview.xml" hash="bbaf093738bc2b0835c48341a8849acb"/></dir></dir><dir name="design"><dir name="frontend"><dir name="default"><dir name="default"><dir name="layout"><file name="customerreview.xml" hash="acb07a543c8484371e93e81d02fab4c8"/></dir><dir name="template"><dir name="customerreview"><file name="customerreview.phtml" hash="c692037d1baf7c41be15ff9a2b0e126e"/></dir><dir name="kiyohcheckout"><file name="success.phtml" hash="9859669db823b766fd80a759b8c3ce42"/></dir></dir></dir></dir></dir></dir></dir></target></contents>
16
  <compatible/>
17
  <dependencies/>
18
  </package>