survey-engine - Version 0.0.1

Version Notes

Rainconcert Customer Feedback Kit

Download this release

Release Info

Developer Jason Koshy
Extension survey-engine
Version 0.0.1
Comparing to
See all releases


Version 0.0.1

Files changed (53) hide show
  1. app/code/community/Rainconcert/SurveyManager/Block/Adminhtml/Questions/Edit.php +82 -0
  2. app/code/community/Rainconcert/SurveyManager/Block/Adminhtml/Questions/Edit/Form.php +40 -0
  3. app/code/community/Rainconcert/SurveyManager/Block/Adminhtml/Questions/Edit/Tab/Answers.php +49 -0
  4. app/code/community/Rainconcert/SurveyManager/Block/Adminhtml/Questions/Edit/Tab/Form.php +115 -0
  5. app/code/community/Rainconcert/SurveyManager/Block/Adminhtml/Questions/Edit/Tabs.php +55 -0
  6. app/code/community/Rainconcert/SurveyManager/Block/Adminhtml/Questions/Grid.php +135 -0
  7. app/code/community/Rainconcert/SurveyManager/Block/Adminhtml/Questions/Manage.php +40 -0
  8. app/code/community/Rainconcert/SurveyManager/Block/Adminhtml/Survey/Edit.php +79 -0
  9. app/code/community/Rainconcert/SurveyManager/Block/Adminhtml/Survey/Edit/Form.php +40 -0
  10. app/code/community/Rainconcert/SurveyManager/Block/Adminhtml/Survey/Edit/Tab/Form.php +103 -0
  11. app/code/community/Rainconcert/SurveyManager/Block/Adminhtml/Survey/Edit/Tab/Managesurvey.php +61 -0
  12. app/code/community/Rainconcert/SurveyManager/Block/Adminhtml/Survey/Edit/Tab/Reports.php +52 -0
  13. app/code/community/Rainconcert/SurveyManager/Block/Adminhtml/Survey/Edit/Tabs.php +56 -0
  14. app/code/community/Rainconcert/SurveyManager/Block/Adminhtml/Survey/Grid.php +117 -0
  15. app/code/community/Rainconcert/SurveyManager/Block/Adminhtml/Survey/Manage.php +35 -0
  16. app/code/community/Rainconcert/SurveyManager/Block/Customeropinion.php +73 -0
  17. app/code/community/Rainconcert/SurveyManager/Helper/Data.php +87 -0
  18. app/code/community/Rainconcert/SurveyManager/Model/Mysql4/Survey.php +31 -0
  19. app/code/community/Rainconcert/SurveyManager/Model/Mysql4/Survey/Collection.php +32 -0
  20. app/code/community/Rainconcert/SurveyManager/Model/Mysql4/Surveyanswer.php +31 -0
  21. app/code/community/Rainconcert/SurveyManager/Model/Mysql4/Surveyanswer/Collection.php +32 -0
  22. app/code/community/Rainconcert/SurveyManager/Model/Mysql4/Surveyqnrelation.php +31 -0
  23. app/code/community/Rainconcert/SurveyManager/Model/Mysql4/Surveyqnrelation/Collection.php +32 -0
  24. app/code/community/Rainconcert/SurveyManager/Model/Mysql4/Surveyquestions.php +31 -0
  25. app/code/community/Rainconcert/SurveyManager/Model/Mysql4/Surveyquestions/Collection.php +32 -0
  26. app/code/community/Rainconcert/SurveyManager/Model/Mysql4/Surveyresults.php +31 -0
  27. app/code/community/Rainconcert/SurveyManager/Model/Mysql4/Surveyresults/Collection.php +32 -0
  28. app/code/community/Rainconcert/SurveyManager/Model/Mysql4/Surveyresultvalue.php +31 -0
  29. app/code/community/Rainconcert/SurveyManager/Model/Mysql4/Surveyresultvalue/Collection.php +32 -0
  30. app/code/community/Rainconcert/SurveyManager/Model/Observer.php +28 -0
  31. app/code/community/Rainconcert/SurveyManager/Model/Survey.php +38 -0
  32. app/code/community/Rainconcert/SurveyManager/Model/Surveyanswer.php +40 -0
  33. app/code/community/Rainconcert/SurveyManager/Model/Surveyqnrelation.php +39 -0
  34. app/code/community/Rainconcert/SurveyManager/Model/Surveyquestions.php +37 -0
  35. app/code/community/Rainconcert/SurveyManager/Model/Surveyresults.php +32 -0
  36. app/code/community/Rainconcert/SurveyManager/Model/Surveyresultvalue.php +49 -0
  37. app/code/community/Rainconcert/SurveyManager/controllers/Adminhtml/IndexController.php +401 -0
  38. app/code/community/Rainconcert/SurveyManager/controllers/IndexController.php +93 -0
  39. app/code/community/Rainconcert/SurveyManager/etc/config.xml +176 -0
  40. app/code/community/Rainconcert/SurveyManager/etc/system.xml +42 -0
  41. app/code/community/Rainconcert/SurveyManager/sql/surveymanager_setup/mysql4-install-0.1.0.php +79 -0
  42. app/code/community/Rainconcert/SurveyManager/sql/surveymanager_setup/mysql4-upgrade-0.1.0-0.1.1.php +10 -0
  43. app/code/community/Rainconcert/SurveyManager/sql/surveymanager_setup/mysql4-upgrade-0.1.1-0.1.2.php +20 -0
  44. app/code/community/Rainconcert/SurveyManager/sql/surveymanager_setup/mysql4-upgrade-0.1.2-0.1.3.php +10 -0
  45. app/design/adminhtml/default/default/layout/surveymanager.xml +18 -0
  46. app/design/adminhtml/default/default/template/surveymanager/answers.phtml +104 -0
  47. app/design/adminhtml/default/default/template/surveymanager/managesurvey.phtml +122 -0
  48. app/design/adminhtml/default/default/template/surveymanager/results.phtml +90 -0
  49. app/design/frontend/default/default/layout/surveymanager.xml +13 -0
  50. app/design/frontend/default/default/template/surveymanager/survey_layout.phtml +67 -0
  51. app/etc/modules/Rainconcert_SurveyManager.xml +29 -0
  52. js/surveymanager/jsapi +39 -0
  53. package.xml +18 -0
app/code/community/Rainconcert/SurveyManager/Block/Adminhtml/Questions/Edit.php ADDED
@@ -0,0 +1,82 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Rainconcert Co.
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the EULA
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ *
10
+ * =================================================================
11
+ * MAGENTO EDITION USAGE NOTICE
12
+ * =================================================================
13
+ * This package designed for Magento COMMUNITY edition
14
+ * Rainconcert does not guarantee correct work of this extension
15
+ * on any other Magento edition except Magento COMMUNITY edition.
16
+ * aheadWorks does not provide extension support in case of
17
+ * incorrect edition usage.
18
+ * =================================================================
19
+ *
20
+ * @category Rainconcert
21
+ * @package Rainconcert_SurveyManager
22
+ * @version 1.1.1
23
+ */
24
+
25
+ class Rainconcert_SurveyManager_Block_Adminhtml_Questions_Edit extends Mage_Adminhtml_Block_Widget_Form_Container {
26
+
27
+ public function __construct() {
28
+ parent::__construct();
29
+
30
+ $this->_objectId = 'id';
31
+ $this->_blockGroup = 'surveymanager';
32
+ $this->_controller = 'adminhtml_questions';
33
+
34
+ $this->_updateButton('save', 'label', Mage::helper('surveymanager')->__('Save Survey Question/Answers'));
35
+ $this->_updateButton('delete', 'label', Mage::helper('surveymanager')->__('Delete Survey Question'));
36
+
37
+ $this->_addButton('saveandcontinue', array(
38
+ 'label' => Mage::helper('adminhtml')->__('Save And Continue Edit'),
39
+ 'onclick' => 'saveAndContinueEdit()',
40
+ 'class' => 'save',
41
+ ), -100);
42
+
43
+
44
+ $this->_formScripts[] = "
45
+ function toggleEditor() {
46
+ if (tinyMCE.getInstanceById('surveymanager_content') == null) {
47
+ tinyMCE.execCommand('mceAddControl', false, 'post_content');
48
+ } else {
49
+ tinyMCE.execCommand('mceRemoveControl', false, 'post_content');
50
+ }
51
+ }
52
+
53
+ function saveAndContinueEdit(){
54
+ editForm.submit($('edit_form').action+'back/editQuestions/');
55
+ }
56
+ ";
57
+ }
58
+
59
+ public function getDeleteUrl()
60
+ {
61
+ return $this->getUrl('*/*/deleteQuestion', array($this->_objectId => $this->getRequest()->getParam($this->_objectId)));
62
+ }
63
+
64
+ /**
65
+ * Get URL for back (reset) button
66
+ *
67
+ * @return string
68
+ */
69
+ public function getBackUrl()
70
+ {
71
+ return $this->getUrl('*/*/questions');
72
+ }
73
+
74
+ public function getHeaderText() {
75
+ if (Mage::registry('surveymanager_data') && Mage::registry('surveymanager_data')->getId()) {
76
+ return Mage::helper('surveymanager')->__("Edit Survey Question/Answers '%s'", $this->htmlEscape(Mage::registry('surveymanager_data')->getTitle()));
77
+ } else {
78
+ return Mage::helper('surveymanager')->__('Add Survey Question/Answers');
79
+ }
80
+ }
81
+
82
+ }
app/code/community/Rainconcert/SurveyManager/Block/Adminhtml/Questions/Edit/Form.php ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Rainconcert Co.
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the EULA
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ *
10
+ * =================================================================
11
+ * MAGENTO EDITION USAGE NOTICE
12
+ * =================================================================
13
+ * This package designed for Magento COMMUNITY edition
14
+ * Rainconcert does not guarantee correct work of this extension
15
+ * on any other Magento edition except Magento COMMUNITY edition.
16
+ * aheadWorks does not provide extension support in case of
17
+ * incorrect edition usage.
18
+ * =================================================================
19
+ *
20
+ * @category Rainconcert
21
+ * @package Rainconcert_SurveyManager
22
+ * @version 1.1.1
23
+ */
24
+
25
+ class Rainconcert_SurveyManager_Block_Adminhtml_Questions_Edit_Form extends Mage_Adminhtml_Block_Widget_Form {
26
+
27
+ protected function _prepareForm() {
28
+ $form = new Varien_Data_Form(array(
29
+ 'id' => 'edit_form',
30
+ 'action' => $this->getUrl('*/*/saveQnAns', array('id' => $this->getRequest()->getParam('id'))),
31
+ 'method' => 'post',
32
+ )
33
+ );
34
+
35
+ $form->setUseContainer(true);
36
+ $this->setForm($form);
37
+ return parent::_prepareForm();
38
+ }
39
+
40
+ }
app/code/community/Rainconcert/SurveyManager/Block/Adminhtml/Questions/Edit/Tab/Answers.php ADDED
@@ -0,0 +1,49 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Rainconcert Co.
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the EULA
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ *
10
+ * =================================================================
11
+ * MAGENTO EDITION USAGE NOTICE
12
+ * =================================================================
13
+ * This package designed for Magento COMMUNITY edition
14
+ * Rainconcert does not guarantee correct work of this extension
15
+ * on any other Magento edition except Magento COMMUNITY edition.
16
+ * aheadWorks does not provide extension support in case of
17
+ * incorrect edition usage.
18
+ * =================================================================
19
+ *
20
+ * @category Rainconcert
21
+ * @package Rainconcert_SurveyManager
22
+ * @version 1.1.1
23
+ */
24
+
25
+ class Rainconcert_SurveyManager_Block_Adminhtml_Questions_Edit_Tab_Answers extends
26
+ Mage_Adminhtml_Block_Widget_Form
27
+ {
28
+ public function __construct() {
29
+ parent::__construct();
30
+ $this->setTemplate('surveymanager/answers.phtml');
31
+ }
32
+
33
+ public function getSurveyAnswers()
34
+ {
35
+ $answers = Mage::getModel('surveymanager/surveyanswer')->getCollection()
36
+ ->addFieldToFilter('is_active',1);
37
+
38
+ return $answers;
39
+ }
40
+
41
+ public function getSurveyAnswerByQn( $qnId)
42
+ {
43
+ $answers = Mage::getModel('surveymanager/surveyanswer')
44
+ ->getAnswerByQnId( $qnId);
45
+
46
+ return $answers;
47
+ }
48
+
49
+ }
app/code/community/Rainconcert/SurveyManager/Block/Adminhtml/Questions/Edit/Tab/Form.php ADDED
@@ -0,0 +1,115 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Rainconcert Co.
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the EULA
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ *
10
+ * =================================================================
11
+ * MAGENTO EDITION USAGE NOTICE
12
+ * =================================================================
13
+ * This package designed for Magento COMMUNITY edition
14
+ * Rainconcert does not guarantee correct work of this extension
15
+ * on any other Magento edition except Magento COMMUNITY edition.
16
+ * aheadWorks does not provide extension support in case of
17
+ * incorrect edition usage.
18
+ * =================================================================
19
+ *
20
+ * @category Rainconcert
21
+ * @package Rainconcert_SurveyManager
22
+ * @version 1.1.1
23
+ */
24
+
25
+ class Rainconcert_SurveyManager_Block_Adminhtml_Questions_Edit_Tab_Form extends Mage_Adminhtml_Block_Widget_Form {
26
+
27
+ protected function _prepareForm() {
28
+
29
+ $form = new Varien_Data_Form();
30
+ $this->setForm($form);
31
+ $fieldset = $form->addFieldset('survey_questions_form', array('legend' => Mage::helper('surveymanager')->__('Add Question Details')));
32
+
33
+ $fieldset->addField('survey_qn_title', 'text', array(
34
+ 'label' => Mage::helper('surveymanager')->__('Question Title'),
35
+ 'class' => 'required-entry',
36
+ 'required' => true,
37
+ 'name' => 'survey_qn_title',
38
+ ));
39
+
40
+
41
+ $fieldset->addField('survey_qn_desc', 'textarea', array(
42
+ 'label' => Mage::helper('surveymanager')->__('Question Description'),
43
+ 'class' => 'required-entry',
44
+ 'required' => true,
45
+ 'name' => 'survey_qn_desc',
46
+ ));
47
+
48
+ $fieldset->addField('survey_ans_type', 'select', array(
49
+ 'label' => Mage::helper('surveymanager')->__('Answer Type!'),
50
+ 'name' => 'survey_ans_type',
51
+ 'values' => array(
52
+ /* array(
53
+ 'value' => 1,
54
+ 'label' => Mage::helper('surveymanager')->__('Satisfaction Bubbles'),
55
+ ),
56
+ array(
57
+ 'value' => 2,
58
+ 'label' => Mage::helper('surveymanager')->__('Excellent-Poor Bubbles'),
59
+ ),*/
60
+ array(
61
+ 'value' => 3,
62
+ 'label' => Mage::helper('surveymanager')->__('Text Field'),
63
+ ),
64
+ array(
65
+ 'value' => 4,
66
+ 'label' => Mage::helper('surveymanager')->__('Text Area'),
67
+ ),
68
+ /*array(
69
+ 'value' => 5,
70
+ 'label' => Mage::helper('surveymanager')->__('5 Star Rating'),
71
+ ),*/
72
+ array(
73
+ 'value' => 6,
74
+ 'label' => Mage::helper('surveymanager')->__('Yes/No'),
75
+ ),
76
+ array(
77
+ 'value' => 7,
78
+ 'label' => Mage::helper('surveymanager')->__('Custom Radio'),
79
+ ),
80
+ array(
81
+ 'value' => 8,
82
+ 'label' => Mage::helper('surveymanager')->__('Check Box'),
83
+ ),
84
+ array(
85
+ 'value' => 9,
86
+ 'label' => Mage::helper('surveymanager')->__('Select Box'),
87
+ ),
88
+ ),
89
+ ));
90
+
91
+ $fieldset->addField('is_active', 'select', array(
92
+ 'label' => Mage::helper('surveymanager')->__('Status'),
93
+ 'name' => 'is_active',
94
+ 'values' => array(
95
+ array(
96
+ 'value' => 0,
97
+ 'label' => Mage::helper('surveymanager')->__('InActive'),
98
+ ),
99
+ array(
100
+ 'value' => 1,
101
+ 'label' => Mage::helper('surveymanager')->__('Active'),
102
+ ),
103
+ ),
104
+ ));
105
+
106
+ if (Mage::getSingleton('adminhtml/session')->getSurveyQuestionData()) {
107
+ $form->setValues(Mage::getSingleton('adminhtml/session')->getSurveyQuestionData());
108
+ Mage::getSingleton('adminhtml/session')->setSurveyQuestionData(null);
109
+ } elseif (Mage::registry('survey_question_data')) {
110
+ $form->setValues(Mage::registry('survey_question_data')->getData());
111
+ }
112
+ return parent::_prepareForm();
113
+ }
114
+
115
+ }
app/code/community/Rainconcert/SurveyManager/Block/Adminhtml/Questions/Edit/Tabs.php ADDED
@@ -0,0 +1,55 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Rainconcert Co.
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the EULA
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ *
10
+ * =================================================================
11
+ * MAGENTO EDITION USAGE NOTICE
12
+ * =================================================================
13
+ * This package designed for Magento COMMUNITY edition
14
+ * Rainconcert does not guarantee correct work of this extension
15
+ * on any other Magento edition except Magento COMMUNITY edition.
16
+ * aheadWorks does not provide extension support in case of
17
+ * incorrect edition usage.
18
+ * =================================================================
19
+ *
20
+ * @category Rainconcert
21
+ * @package Rainconcert_SurveyManager
22
+ * @version 1.1.1
23
+ */
24
+
25
+ class Rainconcert_SurveyManager_Block_Adminhtml_Questions_Edit_Tabs extends Mage_Adminhtml_Block_Widget_Tabs {
26
+
27
+ public function __construct() {
28
+ parent::__construct();
29
+ $this->setId('survey_tabs');
30
+ $this->setDestElementId('edit_form');
31
+ $this->setTitle(Mage::helper('surveymanager')->__('Survey Question/Answer Manager'));
32
+ }
33
+
34
+ protected function _beforeToHtml() {
35
+ $questionId = $this->getRequest()->getParam('id');
36
+
37
+ $this->addTab('form_section', array(
38
+ 'label' => Mage::helper('surveymanager')->__('Manage Questions'),
39
+ 'title' => Mage::helper('surveymanager')->__('Manage Questions'),
40
+ 'content' => $this->getLayout()->createBlock('surveymanager/adminhtml_questions_edit_tab_form')->toHtml(),
41
+ ));
42
+
43
+ if($questionId && ($this->helper('surveymanager')->getAnsTypeByQid($questionId)!=3
44
+ && $this->helper('surveymanager')->getAnsTypeByQid($questionId)!=4 )){
45
+ $this->addTab('survey_answer', array(
46
+ 'label' => Mage::helper('surveymanager')->__('Manage Answers'),
47
+ 'title' => Mage::helper('surveymanager')->__('Manage Answers'),
48
+ 'content' => $this->getLayout()->createBlock('surveymanager/adminhtml_questions_edit_tab_answers')->toHtml(),
49
+ ));
50
+ }
51
+
52
+ return parent::_beforeToHtml();
53
+ }
54
+
55
+ }
app/code/community/Rainconcert/SurveyManager/Block/Adminhtml/Questions/Grid.php ADDED
@@ -0,0 +1,135 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Rainconcert Co.
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the EULA
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ *
10
+ * =================================================================
11
+ * MAGENTO EDITION USAGE NOTICE
12
+ * =================================================================
13
+ * This package designed for Magento COMMUNITY edition
14
+ * Rainconcert does not guarantee correct work of this extension
15
+ * on any other Magento edition except Magento COMMUNITY edition.
16
+ * aheadWorks does not provide extension support in case of
17
+ * incorrect edition usage.
18
+ * =================================================================
19
+ *
20
+ * @category Rainconcert
21
+ * @package Rainconcert_SurveyManager
22
+ * @version 1.1.1
23
+ */
24
+
25
+ class Rainconcert_SurveyManager_Block_Adminhtml_Questions_Grid extends Mage_Adminhtml_Block_Widget_Grid {
26
+
27
+ public function __construct() {
28
+ parent::__construct();
29
+ $this->setId('surveyQuestionGrid');
30
+ $this->setDefaultSort('created_time');
31
+ $this->setDefaultDir('DESC');
32
+ $this->setSaveParametersInSession(true);
33
+ }
34
+
35
+ protected function _prepareCollection() {
36
+ $collection = Mage::getModel('surveymanager/surveyquestions')->getCollection();
37
+ $this->setCollection($collection);
38
+ return parent::_prepareCollection();
39
+ }
40
+
41
+ protected function _prepareColumns() {
42
+ $this->addColumn('survey_qn_id', array(
43
+ 'header' => Mage::helper('surveymanager')->__('Question ID'),
44
+ 'align' => 'right',
45
+ 'width' => '50px',
46
+ 'index' => 'survey_qn_id',
47
+ ));
48
+
49
+ $this->addColumn('survey_qn_title', array(
50
+ 'header' => Mage::helper('surveymanager')->__('Question'),
51
+ 'align' => 'left',
52
+ 'index' => 'survey_qn_title',
53
+ ));
54
+
55
+ $this->addColumn('survey_qn_desc', array(
56
+ 'header' => Mage::helper('surveymanager')->__('Question Description'),
57
+ 'align' => 'left',
58
+ 'index' => 'survey_qn_desc',
59
+ ));
60
+
61
+ $this->addColumn('survey_ans_type', array(
62
+ 'header' => Mage::helper('surveymanager')->__('Answer Type'),
63
+ 'align' => 'left',
64
+ 'index' => 'survey_ans_type',
65
+ 'type' => 'options',
66
+ 'options' => array(
67
+ 1 => Mage::helper('surveymanager')->__('Satisfaction Bubbles'),
68
+ 2 => Mage::helper('surveymanager')->__('Excellent-Poor Bubbles'),
69
+ 3 => Mage::helper('surveymanager')->__('Text Field'),
70
+ 4 => Mage::helper('surveymanager')->__('Text Area'),
71
+ 5 => Mage::helper('surveymanager')->__('5 Star Rating'),
72
+ 6 => Mage::helper('surveymanager')->__('Yes/No'),
73
+ 7 => Mage::helper('surveymanager')->__('Custom Radio'),
74
+ 8 => Mage::helper('surveymanager')->__('Check Box'),
75
+ 9 => Mage::helper('surveymanager')->__('Select Box'),
76
+ ),
77
+ ));
78
+
79
+ $this->addColumn('created_time', array(
80
+ 'header' => Mage::helper('surveymanager')->__('Created at'),
81
+ 'index' => 'created_time',
82
+ 'type' => 'datetime',
83
+ 'width' => '120px',
84
+ 'gmtoffset' => true,
85
+ 'default' => ' -- '
86
+ ));
87
+
88
+ $this->addColumn('update_time', array(
89
+ 'header' => Mage::helper('surveymanager')->__('Updated at'),
90
+ 'index' => 'update_time',
91
+ 'width' => '120px',
92
+ 'type' => 'datetime',
93
+ 'gmtoffset' => true,
94
+ 'default' => ' -- '
95
+ ));
96
+
97
+ $this->addColumn('is_active', array(
98
+ 'header' => Mage::helper('surveymanager')->__('Status'),
99
+ 'align' => 'left',
100
+ 'width' => '80px',
101
+ 'index' => 'is_active',
102
+ 'type' => 'options',
103
+ 'options' => array(
104
+ 1 => Mage::helper('surveymanager')->__('Enabled'),
105
+ 0 => Mage::helper('surveymanager')->__('Disabled'),
106
+ ),
107
+ ));
108
+
109
+ $this->addColumn('action', array(
110
+ 'header' => Mage::helper('surveymanager')->__('Action'),
111
+ 'width' => '100',
112
+ 'type' => 'action',
113
+ 'getter' => 'getId',
114
+ 'actions' => array(
115
+ array(
116
+ 'caption' => Mage::helper('surveymanager')->__('Edit'),
117
+ 'url' => array('base' => '*/*/editQuestions'),
118
+ 'field' => 'id'
119
+ )
120
+ ),
121
+ 'filter' => false,
122
+ 'sortable' => false,
123
+ 'index' => 'stores',
124
+ 'is_system' => true,
125
+ ));
126
+
127
+ return parent::_prepareColumns();
128
+ }
129
+
130
+
131
+ public function getRowUrl($row) {
132
+ return $this->getUrl('*/*/editQuestions', array('id' => $row->getId()));
133
+ }
134
+
135
+ }
app/code/community/Rainconcert/SurveyManager/Block/Adminhtml/Questions/Manage.php ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Rainconcert Co.
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the EULA
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ *
10
+ * =================================================================
11
+ * MAGENTO EDITION USAGE NOTICE
12
+ * =================================================================
13
+ * This package designed for Magento COMMUNITY edition
14
+ * Rainconcert does not guarantee correct work of this extension
15
+ * on any other Magento edition except Magento COMMUNITY edition.
16
+ * aheadWorks does not provide extension support in case of
17
+ * incorrect edition usage.
18
+ * =================================================================
19
+ *
20
+ * @category Rainconcert
21
+ * @package Rainconcert_SurveyManager
22
+ * @version 1.1.1
23
+ */
24
+
25
+ class Rainconcert_SurveyManager_Block_Adminhtml_Questions_Manage extends Mage_Adminhtml_Block_Widget_Grid_Container
26
+ {
27
+ public function __construct()
28
+ {
29
+ $this->_blockGroup = 'surveymanager';
30
+ $this->_controller = 'adminhtml_questions';
31
+ $this->_headerText = Mage::helper('surveymanager')->__('Manage Questions/Answers');
32
+ $this->_addButtonLabel = Mage::helper('surveymanager')->__('Add New Questions/Answers');
33
+ parent::__construct();
34
+ }
35
+
36
+ public function getCreateUrl()
37
+ {
38
+ return $this->getUrl('*/*/addQuestions');
39
+ }
40
+ }
app/code/community/Rainconcert/SurveyManager/Block/Adminhtml/Survey/Edit.php ADDED
@@ -0,0 +1,79 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Rainconcert Co.
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the EULA
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ *
10
+ * =================================================================
11
+ * MAGENTO EDITION USAGE NOTICE
12
+ * =================================================================
13
+ * This package designed for Magento COMMUNITY edition
14
+ * Rainconcert does not guarantee correct work of this extension
15
+ * on any other Magento edition except Magento COMMUNITY edition.
16
+ * aheadWorks does not provide extension support in case of
17
+ * incorrect edition usage.
18
+ * =================================================================
19
+ *
20
+ * @category Rainconcert
21
+ * @package Rainconcert_SurveyManager
22
+ * @version 1.1.1
23
+ */
24
+
25
+ class Rainconcert_SurveyManager_Block_Adminhtml_Survey_Edit extends Mage_Adminhtml_Block_Widget_Form_Container {
26
+
27
+ public function __construct() {
28
+ parent::__construct();
29
+
30
+ $this->_objectId = 'id';
31
+ $this->_blockGroup = 'surveymanager';
32
+ $this->_controller = 'adminhtml_survey';
33
+
34
+ $this->_updateButton('save', 'label', Mage::helper('surveymanager')->__('Save Survey'));
35
+ $this->_updateButton('delete', 'label', Mage::helper('surveymanager')->__('Delete Survey'));
36
+
37
+ $this->_addButton('saveandcontinue', array(
38
+ 'label' => Mage::helper('adminhtml')->__('Save And Continue Edit'),
39
+ 'onclick' => 'saveAndContinueEdit()',
40
+ 'class' => 'save',
41
+ ), -100);
42
+
43
+ if ($this->getRequest()->getParam('id')) {
44
+ $this->_addButton('duplicate', array(
45
+ 'label' => Mage::helper('surveymanager')->__('Duplicate Survey'),
46
+ 'onclick' => 'duplicate()',
47
+ 'class' => 'save'
48
+ ), 0);
49
+ }
50
+
51
+ $this->_formScripts[] = "
52
+ function toggleEditor() {
53
+ if (tinyMCE.getInstanceById('surveymanager_content') == null) {
54
+ tinyMCE.execCommand('mceAddControl', false, 'post_content');
55
+ } else {
56
+ tinyMCE.execCommand('mceRemoveControl', false, 'post_content');
57
+ }
58
+ }
59
+
60
+ function saveAndContinueEdit(){
61
+ editForm.submit($('edit_form').action+'back/edit/');
62
+ }
63
+
64
+ function duplicate() {
65
+ $(editForm.formId).action = '" . $this->getUrl('*/*/duplicate') . "';
66
+ editForm.submit();
67
+ }
68
+ ";
69
+ }
70
+
71
+ public function getHeaderText() {
72
+ if (Mage::registry('surveymanager_data') && Mage::registry('surveymanager_data')->getId()) {
73
+ return Mage::helper('surveymanager')->__("Edit Survey '%s'", $this->htmlEscape(Mage::registry('surveymanager_data')->getTitle()));
74
+ } else {
75
+ return Mage::helper('surveymanager')->__('Add Survey');
76
+ }
77
+ }
78
+
79
+ }
app/code/community/Rainconcert/SurveyManager/Block/Adminhtml/Survey/Edit/Form.php ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Rainconcert Co.
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the EULA
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ *
10
+ * =================================================================
11
+ * MAGENTO EDITION USAGE NOTICE
12
+ * =================================================================
13
+ * This package designed for Magento COMMUNITY edition
14
+ * Rainconcert does not guarantee correct work of this extension
15
+ * on any other Magento edition except Magento COMMUNITY edition.
16
+ * aheadWorks does not provide extension support in case of
17
+ * incorrect edition usage.
18
+ * =================================================================
19
+ *
20
+ * @category Rainconcert
21
+ * @package Rainconcert_SurveyManager
22
+ * @version 1.1.1
23
+ */
24
+
25
+ class Rainconcert_SurveyManager_Block_Adminhtml_Survey_Edit_Form extends Mage_Adminhtml_Block_Widget_Form {
26
+
27
+ protected function _prepareForm() {
28
+ $form = new Varien_Data_Form(array(
29
+ 'id' => 'edit_form',
30
+ 'action' => $this->getUrl('*/*/save', array('id' => $this->getRequest()->getParam('id'))),
31
+ 'method' => 'post',
32
+ )
33
+ );
34
+
35
+ $form->setUseContainer(true);
36
+ $this->setForm($form);
37
+ return parent::_prepareForm();
38
+ }
39
+
40
+ }
app/code/community/Rainconcert/SurveyManager/Block/Adminhtml/Survey/Edit/Tab/Form.php ADDED
@@ -0,0 +1,103 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Rainconcert Co.
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the EULA
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ *
10
+ * =================================================================
11
+ * MAGENTO EDITION USAGE NOTICE
12
+ * =================================================================
13
+ * This package designed for Magento COMMUNITY edition
14
+ * Rainconcert does not guarantee correct work of this extension
15
+ * on any other Magento edition except Magento COMMUNITY edition.
16
+ * aheadWorks does not provide extension support in case of
17
+ * incorrect edition usage.
18
+ * =================================================================
19
+ *
20
+ * @category Rainconcert
21
+ * @package Rainconcert_SurveyManager
22
+ * @version 1.1.1
23
+ */
24
+
25
+ class Rainconcert_SurveyManager_Block_Adminhtml_Survey_Edit_Tab_Form extends Mage_Adminhtml_Block_Widget_Form {
26
+
27
+ protected function _prepareForm() {
28
+
29
+ $form = new Varien_Data_Form();
30
+ $this->setForm($form);
31
+ $fieldset = $form->addFieldset('survey_form', array('legend' => Mage::helper('surveymanager')->__('Survey information')));
32
+
33
+ $fieldset->addField('survey_name', 'text', array(
34
+ 'label' => Mage::helper('surveymanager')->__('Survey Name'),
35
+ 'class' => 'required-entry',
36
+ 'required' => true,
37
+ 'name' => 'survey_name',
38
+ ));
39
+
40
+ $fieldset->addField('survey_url', 'text', array(
41
+ 'label' => Mage::helper('surveymanager')->__('Survey Url'),
42
+ 'class' => 'required-entry',
43
+ 'required' => true,
44
+ 'name' => 'survey_url',
45
+ 'class' => 'surveymanager-validate-identifier',
46
+ /*'after_element_html' => '<span class="hint">' . Mage::helper('surveymanager')->__('(eg: domain.com/surveymanager/identifier)') . '</span>'
47
+ . "<script>
48
+ Validation.add(
49
+ 'surveymanager-validate-identifier',
50
+ '" . addslashes(Mage::helper('surveymanager')->__("Please use only letters (a-z or A-Z), numbers (0-9) or symbols '-' and '_' in this field")) . "',
51
+ function(v, elm) {
52
+ var regex = new RegExp(/^[a-zA-Z0-9_-]+$/);
53
+ return v.match(regex);
54
+ }
55
+ );
56
+ </script>",*/)
57
+ );
58
+
59
+ $fieldset->addField('survey_layout_template', 'select', array(
60
+ 'label' => Mage::helper('surveymanager')->__('Survey Layout Template'),
61
+ 'required' => true,
62
+ 'name' => 'survey_layout_template',
63
+ 'values' => array(
64
+ array(
65
+ 'value' => 'empty',
66
+ 'label' => Mage::helper('surveymanager')->__('Empty'),
67
+ ),
68
+ array(
69
+ 'value' => 'one_column',
70
+ 'label' => Mage::helper('surveymanager')->__('1 Column'),
71
+ ),
72
+ array(
73
+ 'value' => 'two_columns_left',
74
+ 'label' => Mage::helper('surveymanager')->__('2 Columns-left'),
75
+ ),
76
+ array(
77
+ 'value' => 'two_columns_right',
78
+ 'label' => Mage::helper('surveymanager')->__('2 Columns-right'),
79
+ ),
80
+ array(
81
+ 'value' => 'three_columns',
82
+ 'label' => Mage::helper('surveymanager')->__('3 Column'),
83
+ )
84
+ ))
85
+ );
86
+
87
+ $fieldset->addField('survey_desc', 'textarea', array(
88
+ 'label' => Mage::helper('surveymanager')->__('Survey Description'),
89
+ 'class' => 'required-entry',
90
+ 'required' => true,
91
+ 'name' => 'survey_desc',
92
+ ));
93
+
94
+ if (Mage::getSingleton('adminhtml/session')->getSurveyData()) {
95
+ $form->setValues(Mage::getSingleton('adminhtml/session')->getSurveyData());
96
+ Mage::getSingleton('adminhtml/session')->setSurveyData(null);
97
+ } elseif (Mage::registry('survey_data')) {
98
+ $form->setValues(Mage::registry('survey_data')->getData());
99
+ }
100
+ return parent::_prepareForm();
101
+ }
102
+
103
+ }
app/code/community/Rainconcert/SurveyManager/Block/Adminhtml/Survey/Edit/Tab/Managesurvey.php ADDED
@@ -0,0 +1,61 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Rainconcert Co.
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the EULA
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ *
10
+ * =================================================================
11
+ * MAGENTO EDITION USAGE NOTICE
12
+ * =================================================================
13
+ * This package designed for Magento COMMUNITY edition
14
+ * Rainconcert does not guarantee correct work of this extension
15
+ * on any other Magento edition except Magento COMMUNITY edition.
16
+ * aheadWorks does not provide extension support in case of
17
+ * incorrect edition usage.
18
+ * =================================================================
19
+ *
20
+ * @category Rainconcert
21
+ * @package Rainconcert_SurveyManager
22
+ * @version 1.1.1
23
+ */
24
+
25
+ class Rainconcert_SurveyManager_Block_Adminhtml_Survey_Edit_Tab_Managesurvey extends
26
+ Mage_Adminhtml_Block_Widget_Form
27
+ {
28
+ public function __construct() {
29
+ parent::__construct();
30
+ $this->setTemplate('surveymanager/managesurvey.phtml');
31
+ }
32
+
33
+ public function getSurveyQuestions()
34
+ {
35
+ $questions = Mage::getModel('surveymanager/surveyquestions')->getCollection()
36
+ ->addFieldToFilter('is_active',1);
37
+
38
+ return $questions;
39
+ }
40
+
41
+ public function checkQnActiveByQid( $qnId)
42
+ {
43
+ $question = Mage::getModel('surveymanager/surveyquestions')->load( $qnId);
44
+
45
+ if( $question!=NULL){
46
+ if($question->is_active==1):
47
+ return true;
48
+ else:
49
+ return false;
50
+ endif;
51
+ }
52
+ }
53
+
54
+ public function getSurveyAnswerTypeByQid( $qnId)
55
+ {
56
+ $ansType = Mage::getModel('surveymanager/survey_answer')->load( $qnId);
57
+
58
+ return $ansType;
59
+ }
60
+
61
+ }
app/code/community/Rainconcert/SurveyManager/Block/Adminhtml/Survey/Edit/Tab/Reports.php ADDED
@@ -0,0 +1,52 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Rainconcert Co.
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the EULA
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ *
10
+ * =================================================================
11
+ * MAGENTO EDITION USAGE NOTICE
12
+ * =================================================================
13
+ * This package designed for Magento COMMUNITY edition
14
+ * Rainconcert does not guarantee correct work of this extension
15
+ * on any other Magento edition except Magento COMMUNITY edition.
16
+ * aheadWorks does not provide extension support in case of
17
+ * incorrect edition usage.
18
+ * =================================================================
19
+ *
20
+ * @category Rainconcert
21
+ * @package Rainconcert_SurveyManager
22
+ * @version 1.1.1
23
+ */
24
+
25
+ class Rainconcert_SurveyManager_Block_Adminhtml_Survey_Edit_Tab_Reports extends
26
+ Mage_Adminhtml_Block_Widget_Form
27
+ {
28
+ public function __construct() {
29
+ parent::__construct();
30
+ $this->setTemplate('surveymanager/results.phtml');
31
+ }
32
+
33
+ public function getResultsCountByQnId( $qnId){
34
+ $surveyResults = Mage::getModel('surveymanager/surveyresults')
35
+ ->getCollection()
36
+ ->addFieldToFilter( 'survey_qn_id',$qnId);
37
+ return count($surveyResults);
38
+ }
39
+
40
+ public function getResultsByQnId( $qnId){
41
+ $surveyResults = Mage::getModel('surveymanager/surveyresults')
42
+ ->getCollection()
43
+ ->addFieldToFilter( 'survey_qn_id',$qnId);
44
+ return $surveyResults;
45
+ }
46
+
47
+ public function getValueByResultId( $resultId){
48
+ $surveyResultValue = Mage::getModel('surveymanager/surveyresultvalue')
49
+ ->getValueByResultId( $resultId);
50
+ return $surveyResultValue;
51
+ }
52
+ }
app/code/community/Rainconcert/SurveyManager/Block/Adminhtml/Survey/Edit/Tabs.php ADDED
@@ -0,0 +1,56 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Rainconcert Co.
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the EULA
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ *
10
+ * =================================================================
11
+ * MAGENTO EDITION USAGE NOTICE
12
+ * =================================================================
13
+ * This package designed for Magento COMMUNITY edition
14
+ * Rainconcert does not guarantee correct work of this extension
15
+ * on any other Magento edition except Magento COMMUNITY edition.
16
+ * aheadWorks does not provide extension support in case of
17
+ * incorrect edition usage.
18
+ * =================================================================
19
+ *
20
+ * @category Rainconcert
21
+ * @package Rainconcert_SurveyManager
22
+ * @version 1.1.1
23
+ */
24
+
25
+ class Rainconcert_SurveyManager_Block_Adminhtml_Survey_Edit_Tabs extends Mage_Adminhtml_Block_Widget_Tabs {
26
+
27
+ public function __construct() {
28
+ parent::__construct();
29
+ $this->setId('survey_tabs');
30
+ $this->setDestElementId('edit_form');
31
+ $this->setTitle(Mage::helper('surveymanager')->__('Survey Manager'));
32
+ }
33
+
34
+ protected function _beforeToHtml() {
35
+ $this->addTab('form_section', array(
36
+ 'label' => Mage::helper('surveymanager')->__('Survey Manager'),
37
+ 'title' => Mage::helper('surveymanager')->__('Survey Manager'),
38
+ 'content' => $this->getLayout()->createBlock('surveymanager/adminhtml_survey_edit_tab_form')->toHtml(),
39
+ ));
40
+
41
+ $this->addTab('survey_manage', array(
42
+ 'label' => Mage::helper('surveymanager')->__('Assign Questions to Survey'),
43
+ 'title' => Mage::helper('surveymanager')->__('Assign Questions to Survey'),
44
+ 'content' => $this->getLayout()->createBlock('surveymanager/adminhtml_survey_edit_tab_managesurvey')->toHtml(),
45
+ ));
46
+
47
+ $this->addTab('survey_results', array(
48
+ 'label' => Mage::helper('surveymanager')->__('Survey Report'),
49
+ 'title' => Mage::helper('surveymanager')->__('Survey Report'),
50
+ 'content' => $this->getLayout()->createBlock('surveymanager/adminhtml_survey_edit_tab_reports')->toHtml(),
51
+ ));
52
+
53
+ return parent::_beforeToHtml();
54
+ }
55
+
56
+ }
app/code/community/Rainconcert/SurveyManager/Block/Adminhtml/Survey/Grid.php ADDED
@@ -0,0 +1,117 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Rainconcert Co.
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the EULA
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ *
10
+ * =================================================================
11
+ * MAGENTO EDITION USAGE NOTICE
12
+ * =================================================================
13
+ * This package designed for Magento COMMUNITY edition
14
+ * Rainconcert does not guarantee correct work of this extension
15
+ * on any other Magento edition except Magento COMMUNITY edition.
16
+ * aheadWorks does not provide extension support in case of
17
+ * incorrect edition usage.
18
+ * =================================================================
19
+ *
20
+ * @category Rainconcert
21
+ * @package Rainconcert_SurveyManager
22
+ * @version 1.1.1
23
+ */
24
+
25
+ class Rainconcert_SurveyManager_Block_Adminhtml_Survey_Grid extends Mage_Adminhtml_Block_Widget_Grid {
26
+
27
+ public function __construct() {
28
+ parent::__construct();
29
+ $this->setId('surveyGrid');
30
+ $this->setDefaultSort('created_time');
31
+ $this->setDefaultDir('DESC');
32
+ $this->setSaveParametersInSession(true);
33
+ }
34
+
35
+ protected function _prepareCollection() {
36
+ $collection = Mage::getModel('surveymanager/survey')->getCollection();
37
+ $this->setCollection($collection);
38
+ return parent::_prepareCollection();
39
+ }
40
+
41
+ protected function _prepareColumns() {
42
+ $this->addColumn('survey_id', array(
43
+ 'header' => Mage::helper('surveymanager')->__('ID'),
44
+ 'align' => 'right',
45
+ 'width' => '50px',
46
+ 'index' => 'survey_id',
47
+ ));
48
+
49
+ $this->addColumn('survey_name', array(
50
+ 'header' => Mage::helper('surveymanager')->__('Title'),
51
+ 'align' => 'left',
52
+ 'index' => 'survey_name',
53
+ ));
54
+
55
+ $this->addColumn('survey_url', array(
56
+ 'header' => Mage::helper('surveymanager')->__('Identifier'),
57
+ 'align' => 'left',
58
+ 'index' => 'survey_url',
59
+ ));
60
+
61
+ $this->addColumn('created_time', array(
62
+ 'header' => Mage::helper('surveymanager')->__('Created at'),
63
+ 'index' => 'created_time',
64
+ 'type' => 'datetime',
65
+ 'width' => '120px',
66
+ 'gmtoffset' => true,
67
+ 'default' => ' -- '
68
+ ));
69
+
70
+ $this->addColumn('update_time', array(
71
+ 'header' => Mage::helper('surveymanager')->__('Updated at'),
72
+ 'index' => 'update_time',
73
+ 'width' => '120px',
74
+ 'type' => 'datetime',
75
+ 'gmtoffset' => true,
76
+ 'default' => ' -- '
77
+ ));
78
+
79
+ $this->addColumn('status', array(
80
+ 'header' => Mage::helper('surveymanager')->__('Status'),
81
+ 'align' => 'left',
82
+ 'width' => '80px',
83
+ 'index' => 'status',
84
+ 'type' => 'options',
85
+ 'options' => array(
86
+ 1 => Mage::helper('surveymanager')->__('Enabled'),
87
+ 0 => Mage::helper('surveymanager')->__('Disabled'),
88
+ ),
89
+ ));
90
+
91
+ $this->addColumn('action', array(
92
+ 'header' => Mage::helper('surveymanager')->__('Action'),
93
+ 'width' => '100',
94
+ 'type' => 'action',
95
+ 'getter' => 'getId',
96
+ 'actions' => array(
97
+ array(
98
+ 'caption' => Mage::helper('surveymanager')->__('Edit'),
99
+ 'url' => array('base' => '*/*/edit'),
100
+ 'field' => 'id'
101
+ )
102
+ ),
103
+ 'filter' => false,
104
+ 'sortable' => false,
105
+ 'index' => 'stores',
106
+ 'is_system' => true,
107
+ ));
108
+
109
+ return parent::_prepareColumns();
110
+ }
111
+
112
+
113
+ public function getRowUrl($row) {
114
+ return $this->getUrl('*/*/edit', array('id' => $row->getId()));
115
+ }
116
+
117
+ }
app/code/community/Rainconcert/SurveyManager/Block/Adminhtml/Survey/Manage.php ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Rainconcert Co.
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the EULA
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ *
10
+ * =================================================================
11
+ * MAGENTO EDITION USAGE NOTICE
12
+ * =================================================================
13
+ * This package designed for Magento COMMUNITY edition
14
+ * Rainconcert does not guarantee correct work of this extension
15
+ * on any other Magento edition except Magento COMMUNITY edition.
16
+ * aheadWorks does not provide extension support in case of
17
+ * incorrect edition usage.
18
+ * =================================================================
19
+ *
20
+ * @category Rainconcert
21
+ * @package Rainconcert_SurveyManager
22
+ * @version 1.1.1
23
+ */
24
+
25
+ class Rainconcert_SurveyManager_Block_Adminhtml_Survey_Manage extends Mage_Adminhtml_Block_Widget_Grid_Container
26
+ {
27
+ public function __construct()
28
+ {
29
+ $this->_blockGroup = 'surveymanager';
30
+ $this->_controller = 'adminhtml_survey';
31
+ $this->_headerText = Mage::helper('surveymanager')->__('Manage Surveys');
32
+ $this->_addButtonLabel = Mage::helper('surveymanager')->__('Add New Survey');
33
+ parent::__construct();
34
+ }
35
+ }
app/code/community/Rainconcert/SurveyManager/Block/Customeropinion.php ADDED
@@ -0,0 +1,73 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Rainconcert Co.
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the EULA
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ *
10
+ * =================================================================
11
+ * MAGENTO EDITION USAGE NOTICE
12
+ * =================================================================
13
+ * This package designed for Magento COMMUNITY edition
14
+ * Rainconcert does not guarantee correct work of this extension
15
+ * on any other Magento edition except Magento COMMUNITY edition.
16
+ * aheadWorks does not provide extension support in case of
17
+ * incorrect edition usage.
18
+ * =================================================================
19
+ *
20
+ * @category Rainconcert
21
+ * @package Rainconcert_SurveyManager
22
+ * @version 1.1.1
23
+ */
24
+
25
+ class Rainconcert_SurveyManager_Block_Customeropinion extends Mage_Core_Block_Template
26
+ {
27
+ protected function _prepareLayout() {
28
+
29
+ $surveyId = $this->getRequest()->getParam('survey_id');
30
+
31
+ if($surveyId==null)
32
+ return;
33
+
34
+ $surveyLayoutTemplate = $this->helper('surveymanager')->getNewLayoutBySurveyId( $surveyId);
35
+
36
+ if($surveyLayoutTemplate)
37
+ {
38
+ $this->getLayout()->getBlock('root')
39
+ ->setTemplate( $surveyLayoutTemplate);
40
+ }
41
+
42
+ parent::_prepareLayout();
43
+ return $this;
44
+ }
45
+
46
+ public function getSurveyDetails()
47
+ {
48
+ $surveyId = $this->getSurveyId();
49
+
50
+ if($surveyId!=NULL)
51
+ {
52
+ $surveyDetails = Mage::getModel('surveymanager/survey')
53
+ ->getSurveyDetailsById( $surveyId);
54
+ return $surveyDetails;
55
+ }
56
+ return null;
57
+ }
58
+
59
+ public function getSurveyId()
60
+ {
61
+ $surveyId = $this->getRequest()->getParam('survey_id');
62
+
63
+ if($surveyId!=NULL){
64
+ return $surveyId;
65
+ }
66
+
67
+ return null;
68
+ }
69
+
70
+ public function getSurveySubmitUrl(){
71
+ return $this->getUrl('').'surveymanager/index/result/';
72
+ }
73
+ }
app/code/community/Rainconcert/SurveyManager/Helper/Data.php ADDED
@@ -0,0 +1,87 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Rainconcert Co.
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the EULA
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ *
10
+ * =================================================================
11
+ * MAGENTO EDITION USAGE NOTICE
12
+ * =================================================================
13
+ * This package designed for Magento COMMUNITY edition
14
+ * Rainconcert does not guarantee correct work of this extension
15
+ * on any other Magento edition except Magento COMMUNITY edition.
16
+ * aheadWorks does not provide extension support in case of
17
+ * incorrect edition usage.
18
+ * =================================================================
19
+ *
20
+ * @category Rainconcert
21
+ * @package Rainconcert_SurveyManager
22
+ * @version 1.1.1
23
+ */
24
+
25
+ class Rainconcert_SurveyManager_Helper_Data extends Mage_Core_Helper_Abstract
26
+ {
27
+
28
+ public function getSurveyRelations( $surveyId)
29
+ {
30
+ $surveyQnRelations = Mage::getModel('surveymanager/surveyqnrelation')
31
+ ->getRelationBySurveyId( $surveyId);
32
+
33
+ return $surveyQnRelations;
34
+ }
35
+
36
+ public function getSurveyQnById( $qId){
37
+ $surveyQn = Mage::getModel('surveymanager/surveyquestions')
38
+ ->getQuestionById( $qId);
39
+
40
+ return $surveyQn;
41
+ }
42
+
43
+ public function getSurveyAnswersByQid( $qId){
44
+ $surveyAnswers = Mage::getModel('surveymanager/surveyanswer')
45
+ ->getAnswerByQnId( $qId);
46
+
47
+ return $surveyAnswers;
48
+ }
49
+
50
+ public function getAnsTypeByQid( $qId){
51
+
52
+ $surveyAnsType = $this->getSurveyQnById( $qId)
53
+ ->getSurveyAnsType();
54
+
55
+ return $surveyAnsType;
56
+ }
57
+
58
+ public function getNewLayoutBySurveyId( $surveyId){
59
+
60
+ $survey = Mage::getModel('surveymanager/survey')->getSurveyDetailsById( $surveyId);
61
+ $page_layout = $survey->getSurveyLayoutTemplate();
62
+
63
+ switch($page_layout)
64
+ {
65
+ case 'empty':
66
+ $page_layout = 'page/empty.phtml';
67
+ break;
68
+ case 'one_column':
69
+ $page_layout = "page/1column.phtml";
70
+ break;
71
+ case 'two_columns_left':
72
+ $page_layout = 'page/2columns-left.phtml';
73
+ break;
74
+ case 'two_columns_right':
75
+ $page_layout = 'page/2columns-right.phtml';
76
+ break;
77
+ case 'three_columns':
78
+ $page_layout = 'page/3columns.phtml';
79
+ break;
80
+ default:
81
+ $page_layout = 'page/2columns-right.phtml';
82
+ }
83
+
84
+ return $page_layout;
85
+
86
+ }
87
+ }
app/code/community/Rainconcert/SurveyManager/Model/Mysql4/Survey.php ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Rainconcert Co.
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the EULA
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ *
10
+ * =================================================================
11
+ * MAGENTO EDITION USAGE NOTICE
12
+ * =================================================================
13
+ * This package designed for Magento COMMUNITY edition
14
+ * Rainconcert does not guarantee correct work of this extension
15
+ * on any other Magento edition except Magento COMMUNITY edition.
16
+ * aheadWorks does not provide extension support in case of
17
+ * incorrect edition usage.
18
+ * =================================================================
19
+ *
20
+ * @category Rainconcert
21
+ * @package Rainconcert_SurveyManager
22
+ * @version 1.1.1
23
+ */
24
+
25
+ class Rainconcert_SurveyManager_Model_Mysql4_Survey extends Mage_Core_Model_Mysql4_Abstract {
26
+
27
+ public function _construct() {
28
+ $this->_init('surveymanager/survey','survey_id');
29
+ }
30
+
31
+ }
app/code/community/Rainconcert/SurveyManager/Model/Mysql4/Survey/Collection.php ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Rainconcert Co.
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the EULA
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ *
10
+ * =================================================================
11
+ * MAGENTO EDITION USAGE NOTICE
12
+ * =================================================================
13
+ * This package designed for Magento COMMUNITY edition
14
+ * Rainconcert does not guarantee correct work of this extension
15
+ * on any other Magento edition except Magento COMMUNITY edition.
16
+ * aheadWorks does not provide extension support in case of
17
+ * incorrect edition usage.
18
+ * =================================================================
19
+ *
20
+ * @category Rainconcert
21
+ * @package Rainconcert_SurveyManager
22
+ * @version 1.1.1
23
+ */
24
+
25
+ class Rainconcert_SurveyManager_Model_Mysql4_Survey_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract {
26
+
27
+ public function _construct() {
28
+ parent::_construct();
29
+ $this->_init('surveymanager/survey');
30
+ }
31
+
32
+ }
app/code/community/Rainconcert/SurveyManager/Model/Mysql4/Surveyanswer.php ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Rainconcert Co.
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the EULA
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ *
10
+ * =================================================================
11
+ * MAGENTO EDITION USAGE NOTICE
12
+ * =================================================================
13
+ * This package designed for Magento COMMUNITY edition
14
+ * Rainconcert does not guarantee correct work of this extension
15
+ * on any other Magento edition except Magento COMMUNITY edition.
16
+ * aheadWorks does not provide extension support in case of
17
+ * incorrect edition usage.
18
+ * =================================================================
19
+ *
20
+ * @category Rainconcert
21
+ * @package Rainconcert_SurveyManager
22
+ * @version 1.1.1
23
+ */
24
+
25
+ class Rainconcert_SurveyManager_Model_Mysql4_Surveyanswer extends Mage_Core_Model_Mysql4_Abstract {
26
+
27
+ public function _construct() {
28
+ $this->_init('surveymanager/surveyanswer','survey_ans_id');
29
+ }
30
+
31
+ }
app/code/community/Rainconcert/SurveyManager/Model/Mysql4/Surveyanswer/Collection.php ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Rainconcert Co.
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the EULA
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ *
10
+ * =================================================================
11
+ * MAGENTO EDITION USAGE NOTICE
12
+ * =================================================================
13
+ * This package designed for Magento COMMUNITY edition
14
+ * Rainconcert does not guarantee correct work of this extension
15
+ * on any other Magento edition except Magento COMMUNITY edition.
16
+ * aheadWorks does not provide extension support in case of
17
+ * incorrect edition usage.
18
+ * =================================================================
19
+ *
20
+ * @category Rainconcert
21
+ * @package Rainconcert_SurveyManager
22
+ * @version 1.1.1
23
+ */
24
+
25
+ class Rainconcert_SurveyManager_Model_Mysql4_Surveyanswer_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract {
26
+
27
+ public function _construct() {
28
+ parent::_construct();
29
+ $this->_init('surveymanager/surveyanswer');
30
+ }
31
+
32
+ }
app/code/community/Rainconcert/SurveyManager/Model/Mysql4/Surveyqnrelation.php ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Rainconcert Co.
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the EULA
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ *
10
+ * =================================================================
11
+ * MAGENTO EDITION USAGE NOTICE
12
+ * =================================================================
13
+ * This package designed for Magento COMMUNITY edition
14
+ * Rainconcert does not guarantee correct work of this extension
15
+ * on any other Magento edition except Magento COMMUNITY edition.
16
+ * aheadWorks does not provide extension support in case of
17
+ * incorrect edition usage.
18
+ * =================================================================
19
+ *
20
+ * @category Rainconcert
21
+ * @package Rainconcert_SurveyManager
22
+ * @version 1.1.1
23
+ */
24
+
25
+ class Rainconcert_SurveyManager_Model_Mysql4_Surveyqnrelation extends Mage_Core_Model_Mysql4_Abstract {
26
+
27
+ public function _construct() {
28
+ $this->_init('surveymanager/surveyqnrelation','survey_qn_relation_id');
29
+ }
30
+
31
+ }
app/code/community/Rainconcert/SurveyManager/Model/Mysql4/Surveyqnrelation/Collection.php ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Rainconcert Co.
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the EULA
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ *
10
+ * =================================================================
11
+ * MAGENTO EDITION USAGE NOTICE
12
+ * =================================================================
13
+ * This package designed for Magento COMMUNITY edition
14
+ * Rainconcert does not guarantee correct work of this extension
15
+ * on any other Magento edition except Magento COMMUNITY edition.
16
+ * aheadWorks does not provide extension support in case of
17
+ * incorrect edition usage.
18
+ * =================================================================
19
+ *
20
+ * @category Rainconcert
21
+ * @package Rainconcert_SurveyManager
22
+ * @version 1.1.1
23
+ */
24
+
25
+ class Rainconcert_SurveyManager_Model_Mysql4_Surveyqnrelation_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract {
26
+
27
+ public function _construct() {
28
+ parent::_construct();
29
+ $this->_init('surveymanager/surveyqnrelation');
30
+ }
31
+
32
+ }
app/code/community/Rainconcert/SurveyManager/Model/Mysql4/Surveyquestions.php ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Rainconcert Co.
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the EULA
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ *
10
+ * =================================================================
11
+ * MAGENTO EDITION USAGE NOTICE
12
+ * =================================================================
13
+ * This package designed for Magento COMMUNITY edition
14
+ * Rainconcert does not guarantee correct work of this extension
15
+ * on any other Magento edition except Magento COMMUNITY edition.
16
+ * aheadWorks does not provide extension support in case of
17
+ * incorrect edition usage.
18
+ * =================================================================
19
+ *
20
+ * @category Rainconcert
21
+ * @package Rainconcert_SurveyManager
22
+ * @version 1.1.1
23
+ */
24
+
25
+ class Rainconcert_SurveyManager_Model_Mysql4_Surveyquestions extends Mage_Core_Model_Mysql4_Abstract {
26
+
27
+ public function _construct() {
28
+ $this->_init('surveymanager/surveyquestions','survey_qn_id');
29
+ }
30
+
31
+ }
app/code/community/Rainconcert/SurveyManager/Model/Mysql4/Surveyquestions/Collection.php ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Rainconcert Co.
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the EULA
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ *
10
+ * =================================================================
11
+ * MAGENTO EDITION USAGE NOTICE
12
+ * =================================================================
13
+ * This package designed for Magento COMMUNITY edition
14
+ * Rainconcert does not guarantee correct work of this extension
15
+ * on any other Magento edition except Magento COMMUNITY edition.
16
+ * aheadWorks does not provide extension support in case of
17
+ * incorrect edition usage.
18
+ * =================================================================
19
+ *
20
+ * @category Rainconcert
21
+ * @package Rainconcert_SurveyManager
22
+ * @version 1.1.1
23
+ */
24
+
25
+ class Rainconcert_SurveyManager_Model_Mysql4_Surveyquestions_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract {
26
+
27
+ public function _construct() {
28
+ parent::_construct();
29
+ $this->_init('surveymanager/surveyquestions');
30
+ }
31
+
32
+ }
app/code/community/Rainconcert/SurveyManager/Model/Mysql4/Surveyresults.php ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Rainconcert Co.
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the EULA
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ *
10
+ * =================================================================
11
+ * MAGENTO EDITION USAGE NOTICE
12
+ * =================================================================
13
+ * This package designed for Magento COMMUNITY edition
14
+ * Rainconcert does not guarantee correct work of this extension
15
+ * on any other Magento edition except Magento COMMUNITY edition.
16
+ * aheadWorks does not provide extension support in case of
17
+ * incorrect edition usage.
18
+ * =================================================================
19
+ *
20
+ * @category Rainconcert
21
+ * @package Rainconcert_SurveyManager
22
+ * @version 1.1.1
23
+ */
24
+
25
+ class Rainconcert_SurveyManager_Model_Mysql4_Surveyresults extends Mage_Core_Model_Mysql4_Abstract {
26
+
27
+ public function _construct() {
28
+ $this->_init('surveymanager/surveyresults','survey_result_id');
29
+ }
30
+
31
+ }
app/code/community/Rainconcert/SurveyManager/Model/Mysql4/Surveyresults/Collection.php ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Rainconcert Co.
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the EULA
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ *
10
+ * =================================================================
11
+ * MAGENTO EDITION USAGE NOTICE
12
+ * =================================================================
13
+ * This package designed for Magento COMMUNITY edition
14
+ * Rainconcert does not guarantee correct work of this extension
15
+ * on any other Magento edition except Magento COMMUNITY edition.
16
+ * aheadWorks does not provide extension support in case of
17
+ * incorrect edition usage.
18
+ * =================================================================
19
+ *
20
+ * @category Rainconcert
21
+ * @package Rainconcert_SurveyManager
22
+ * @version 1.1.1
23
+ */
24
+
25
+ class Rainconcert_SurveyManager_Model_Mysql4_Surveyresults_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract {
26
+
27
+ public function _construct() {
28
+ parent::_construct();
29
+ $this->_init('surveymanager/surveyresults');
30
+ }
31
+
32
+ }
app/code/community/Rainconcert/SurveyManager/Model/Mysql4/Surveyresultvalue.php ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Rainconcert Co.
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the EULA
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ *
10
+ * =================================================================
11
+ * MAGENTO EDITION USAGE NOTICE
12
+ * =================================================================
13
+ * This package designed for Magento COMMUNITY edition
14
+ * Rainconcert does not guarantee correct work of this extension
15
+ * on any other Magento edition except Magento COMMUNITY edition.
16
+ * aheadWorks does not provide extension support in case of
17
+ * incorrect edition usage.
18
+ * =================================================================
19
+ *
20
+ * @category Rainconcert
21
+ * @package Rainconcert_SurveyManager
22
+ * @version 1.1.1
23
+ */
24
+
25
+ class Rainconcert_SurveyManager_Model_Mysql4_Surveyresultvalue extends Mage_Core_Model_Mysql4_Abstract {
26
+
27
+ public function _construct() {
28
+ $this->_init('surveymanager/surveyresultvalue','survey_result_value_id');
29
+ }
30
+
31
+ }
app/code/community/Rainconcert/SurveyManager/Model/Mysql4/Surveyresultvalue/Collection.php ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Rainconcert Co.
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the EULA
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ *
10
+ * =================================================================
11
+ * MAGENTO EDITION USAGE NOTICE
12
+ * =================================================================
13
+ * This package designed for Magento COMMUNITY edition
14
+ * Rainconcert does not guarantee correct work of this extension
15
+ * on any other Magento edition except Magento COMMUNITY edition.
16
+ * aheadWorks does not provide extension support in case of
17
+ * incorrect edition usage.
18
+ * =================================================================
19
+ *
20
+ * @category Rainconcert
21
+ * @package Rainconcert_SurveyManager
22
+ * @version 1.1.1
23
+ */
24
+
25
+ class Rainconcert_SurveyManager_Model_Mysql4_Surveyresultvalue_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract {
26
+
27
+ public function _construct() {
28
+ parent::_construct();
29
+ $this->_init('surveymanager/surveyresultvalue');
30
+ }
31
+
32
+ }
app/code/community/Rainconcert/SurveyManager/Model/Observer.php ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Rainconcert Co.
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the EULA
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ *
10
+ * =================================================================
11
+ * MAGENTO EDITION USAGE NOTICE
12
+ * =================================================================
13
+ * This package designed for Magento COMMUNITY edition
14
+ * Rainconcert does not guarantee correct work of this extension
15
+ * on any other Magento edition except Magento COMMUNITY edition.
16
+ * aheadWorks does not provide extension support in case of
17
+ * incorrect edition usage.
18
+ * =================================================================
19
+ *
20
+ * @category Rainconcert
21
+ * @package Rainconcert_SurveyManager
22
+ * @version 1.1.1
23
+ */
24
+
25
+
26
+ class Rainconcert_SurveyManager_Model_Observer {
27
+
28
+ }
app/code/community/Rainconcert/SurveyManager/Model/Survey.php ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Rainconcert Co.
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the EULA
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ *
10
+ * =================================================================
11
+ * MAGENTO EDITION USAGE NOTICE
12
+ * =================================================================
13
+ * This package designed for Magento COMMUNITY edition
14
+ * Rainconcert does not guarantee correct work of this extension
15
+ * on any other Magento edition except Magento COMMUNITY edition.
16
+ * aheadWorks does not provide extension support in case of
17
+ * incorrect edition usage.
18
+ * =================================================================
19
+ *
20
+ * @category Rainconcert
21
+ * @package Rainconcert_SurveyManager
22
+ * @version 1.1.1
23
+ */
24
+
25
+ class Rainconcert_SurveyManager_Model_Survey extends Mage_Core_Model_Abstract {
26
+
27
+ public function _construct() {
28
+ parent::_construct();
29
+ $this->_init('surveymanager/survey');
30
+ }
31
+
32
+ public function getSurveyDetailsById( $id)
33
+ {
34
+ $this->load($id);
35
+ return $this;
36
+ }
37
+
38
+ }
app/code/community/Rainconcert/SurveyManager/Model/Surveyanswer.php ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Rainconcert Co.
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the EULA
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ *
10
+ * =================================================================
11
+ * MAGENTO EDITION USAGE NOTICE
12
+ * =================================================================
13
+ * This package designed for Magento COMMUNITY edition
14
+ * Rainconcert does not guarantee correct work of this extension
15
+ * on any other Magento edition except Magento COMMUNITY edition.
16
+ * aheadWorks does not provide extension support in case of
17
+ * incorrect edition usage.
18
+ * =================================================================
19
+ *
20
+ * @category Rainconcert
21
+ * @package Rainconcert_SurveyManager
22
+ * @version 1.1.1
23
+ */
24
+
25
+ class Rainconcert_SurveyManager_Model_Surveyanswer extends Mage_Core_Model_Abstract {
26
+
27
+ public function _construct() {
28
+ parent::_construct();
29
+ $this->_init('surveymanager/surveyanswer');
30
+ }
31
+
32
+ public function getAnswerByQnId( $qnId)
33
+ {
34
+ $answers = $this->getCollection()
35
+ ->addFieldToFilter('survey_ans_qn_id',$qnId)
36
+ ->addFieldToFilter('is_active',1);
37
+
38
+ return $answers;
39
+ }
40
+ }
app/code/community/Rainconcert/SurveyManager/Model/Surveyqnrelation.php ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Rainconcert Co.
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the EULA
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ *
10
+ * =================================================================
11
+ * MAGENTO EDITION USAGE NOTICE
12
+ * =================================================================
13
+ * This package designed for Magento COMMUNITY edition
14
+ * Rainconcert does not guarantee correct work of this extension
15
+ * on any other Magento edition except Magento COMMUNITY edition.
16
+ * aheadWorks does not provide extension support in case of
17
+ * incorrect edition usage.
18
+ * =================================================================
19
+ *
20
+ * @category Rainconcert
21
+ * @package Rainconcert_SurveyManager
22
+ * @version 1.1.1
23
+ */
24
+
25
+ class Rainconcert_SurveyManager_Model_Surveyqnrelation extends Mage_Core_Model_Abstract {
26
+
27
+ public function _construct() {
28
+ parent::_construct();
29
+ $this->_init('surveymanager/surveyqnrelation');
30
+ }
31
+
32
+ public function getRelationBySurveyId( $surveyId)
33
+ {
34
+ $surveyQnRelations = $this->getCollection()
35
+ ->addFieldToFilter('survey_id',$surveyId);
36
+
37
+ return $surveyQnRelations;
38
+ }
39
+ }
app/code/community/Rainconcert/SurveyManager/Model/Surveyquestions.php ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Rainconcert Co.
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the EULA
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ *
10
+ * =================================================================
11
+ * MAGENTO EDITION USAGE NOTICE
12
+ * =================================================================
13
+ * This package designed for Magento COMMUNITY edition
14
+ * Rainconcert does not guarantee correct work of this extension
15
+ * on any other Magento edition except Magento COMMUNITY edition.
16
+ * aheadWorks does not provide extension support in case of
17
+ * incorrect edition usage.
18
+ * =================================================================
19
+ *
20
+ * @category Rainconcert
21
+ * @package Rainconcert_SurveyManager
22
+ * @version 1.1.1
23
+ */
24
+
25
+ class Rainconcert_SurveyManager_Model_Surveyquestions extends Mage_Core_Model_Abstract {
26
+
27
+ public function _construct() {
28
+ parent::_construct();
29
+ $this->_init('surveymanager/surveyquestions');
30
+ }
31
+
32
+ public function getQuestionById( $qId)
33
+ {
34
+ $this->load($qId);
35
+ return $this;
36
+ }
37
+ }
app/code/community/Rainconcert/SurveyManager/Model/Surveyresults.php ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Rainconcert Co.
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the EULA
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ *
10
+ * =================================================================
11
+ * MAGENTO EDITION USAGE NOTICE
12
+ * =================================================================
13
+ * This package designed for Magento COMMUNITY edition
14
+ * Rainconcert does not guarantee correct work of this extension
15
+ * on any other Magento edition except Magento COMMUNITY edition.
16
+ * aheadWorks does not provide extension support in case of
17
+ * incorrect edition usage.
18
+ * =================================================================
19
+ *
20
+ * @category Rainconcert
21
+ * @package Rainconcert_SurveyManager
22
+ * @version 1.1.1
23
+ */
24
+
25
+ class Rainconcert_SurveyManager_Model_Surveyresults extends Mage_Core_Model_Abstract {
26
+
27
+ public function _construct() {
28
+ parent::_construct();
29
+ $this->_init('surveymanager/surveyresults');
30
+ }
31
+
32
+ }
app/code/community/Rainconcert/SurveyManager/Model/Surveyresultvalue.php ADDED
@@ -0,0 +1,49 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Rainconcert Co.
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the EULA
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ *
10
+ * =================================================================
11
+ * MAGENTO EDITION USAGE NOTICE
12
+ * =================================================================
13
+ * This package designed for Magento COMMUNITY edition
14
+ * Rainconcert does not guarantee correct work of this extension
15
+ * on any other Magento edition except Magento COMMUNITY edition.
16
+ * aheadWorks does not provide extension support in case of
17
+ * incorrect edition usage.
18
+ * =================================================================
19
+ *
20
+ * @category Rainconcert
21
+ * @package Rainconcert_SurveyManager
22
+ * @version 1.1.1
23
+ */
24
+
25
+ class Rainconcert_SurveyManager_Model_Surveyresultvalue extends Mage_Core_Model_Abstract {
26
+
27
+ public function _construct() {
28
+ parent::_construct();
29
+ $this->_init('surveymanager/surveyresultvalue');
30
+ }
31
+
32
+ public function getResultsCountByAnsId( $ansId)
33
+ {
34
+ $surveyResultValue = $this->getCollection()
35
+ ->addFieldToFilter( 'survey_result_value',$ansId);
36
+ return count($surveyResultValue);
37
+ }
38
+
39
+ public function getValueByResultId( $resultId){
40
+ $surveyResultValues = $this->getCollection()
41
+ ->addFieldToFilter( 'survey_result_id',$resultId);
42
+
43
+ foreach($surveyResultValues as $surveyResultValue){
44
+ $resultValue = $surveyResultValue->getSurveyResultValue();
45
+ }
46
+
47
+ return $resultValue;
48
+ }
49
+ }
app/code/community/Rainconcert/SurveyManager/controllers/Adminhtml/IndexController.php ADDED
@@ -0,0 +1,401 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Rainconcert Co.
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the EULA
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ *
10
+ * =================================================================
11
+ * MAGENTO EDITION USAGE NOTICE
12
+ * =================================================================
13
+ * This package designed for Magento COMMUNITY edition
14
+ * Rainconcert does not guarantee correct work of this extension
15
+ * on any other Magento edition except Magento COMMUNITY edition.
16
+ * aheadWorks does not provide extension support in case of
17
+ * incorrect edition usage.
18
+ * =================================================================
19
+ *
20
+ * @category Rainconcert
21
+ * @package Rainconcert_SurveyManager
22
+ * @version 1.1.1
23
+ */
24
+
25
+ class Rainconcert_SurveyManager_Adminhtml_IndexController extends Mage_Adminhtml_Controller_Action {
26
+
27
+ public function preDispatch() {
28
+ parent::preDispatch();
29
+ }
30
+
31
+ protected function _initAction() {
32
+ $this->loadLayout()->_setActiveMenu("surveymanager/surveymanager")
33
+ ->_addBreadcrumb(Mage::helper('adminhtml')->__('Manage Surveys'), Mage::helper('adminhtml')->__('Manage Surveys'));
34
+ return $this;
35
+ }
36
+
37
+ public function indexAction() {
38
+
39
+ $this->_initAction();
40
+ $this->renderLayout();
41
+ }
42
+
43
+ public function editAction() {
44
+
45
+ $id = $this->getRequest()->getParam('id');
46
+ $model = Mage::getModel('surveymanager/survey')->load($id);
47
+
48
+ if ($model->getId() || $id == 0) {
49
+ $data = Mage::getSingleton('adminhtml/session')->getFormData(true);
50
+ if (!empty($data)) {
51
+ $model->setData($data);
52
+ }
53
+
54
+ Mage::register('survey_data', $model);
55
+
56
+ $this->loadLayout();
57
+
58
+ $this->getLayout()->getBlock('head')->setCanLoadExtJs(true);
59
+
60
+ $this->_addContent($this->getLayout()->createBlock('surveymanager/adminhtml_survey_edit'))
61
+ ->_addLeft($this->getLayout()->createBlock('surveymanager/adminhtml_survey_edit_tabs'));
62
+
63
+ $this->getLayout()->getBlock('head')->setCanLoadTinyMce(true);
64
+
65
+ $this->renderLayout();
66
+ } else {
67
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('surveymanager')->__('No Survey'));
68
+ $this->_redirect('*/*/');
69
+ }
70
+ }
71
+
72
+ public function newAction() {
73
+
74
+ $id = $this->getRequest()->getParam('id');
75
+ $model = Mage::getModel('surveymanager/survey')->load($id);
76
+
77
+ $data = Mage::getSingleton('adminhtml/session')->getFormData(true);
78
+ if (!empty($data)) {
79
+ $model->setData($data);
80
+ }
81
+
82
+ Mage::register('survey_data', $model);
83
+
84
+ $this->loadLayout();
85
+
86
+ $this->getLayout()->getBlock('head')->setCanLoadExtJs(true);
87
+
88
+ $this->_addContent($this->getLayout()->createBlock('surveymanager/adminhtml_survey_edit'))
89
+ ->_addLeft($this->getLayout()->createBlock('surveymanager/adminhtml_survey_edit_tabs'));
90
+
91
+ $this->getLayout()->getBlock('head')->setCanLoadTinyMce(true);
92
+
93
+ $this->renderLayout();
94
+ }
95
+
96
+
97
+
98
+ public function saveAction() {
99
+ if ($data = $this->getRequest()->getPost()) {
100
+ $model = Mage::getModel('surveymanager/survey');
101
+
102
+ $model->setData($data)
103
+ ->setId($this->getRequest()->getParam('id'));
104
+
105
+ try {
106
+
107
+ $format = Mage::app()->getLocale()->getDateTimeFormat(Mage_Core_Model_Locale::FORMAT_TYPE_MEDIUM);
108
+ if (isset($data['created_time']) && $data['created_time']) {
109
+ $dateFrom = Mage::app()->getLocale()->date($data['created_time'], $format);
110
+ $model->setCreatedTime(Mage::getModel('core/date')->gmtDate(null, $dateFrom->getTimestamp()));
111
+ $model->setUpdateTime(Mage::getModel('core/date')->gmtDate());
112
+ } else {
113
+ $model->setCreatedTime(Mage::getModel('core/date')->gmtDate());
114
+ }
115
+ $model->save();
116
+
117
+ $i=1;
118
+ if($model->getId()){
119
+
120
+ $url = Mage::getModel('core/url_rewrite')
121
+ ->getCollection()
122
+ ->addFieldToFilter('is_system',0)
123
+ ->addFieldToFilter('id_path',$data['survey_url']);
124
+
125
+ if( count($url)==0){
126
+ Mage::getModel('core/url_rewrite')
127
+ ->setIsSystem(0)
128
+ ->setStoreId(1)
129
+ ->setIdPath($data['survey_url'])
130
+ ->setTargetPath('surveymanager/index/index/survey_id/'.$model->getId())
131
+ ->setRequestPath($data['survey_url'].'.html')
132
+ ->save();
133
+ }
134
+
135
+ $modelSurveyQnRelations = Mage::getModel('surveymanager/surveyqnrelation')
136
+ ->getCollection()
137
+ ->addFieldToFilter('survey_id',$model->getId());
138
+
139
+ foreach($modelSurveyQnRelations as $modelSurveyQnRelation){
140
+ $modelSurveyQnRelation->delete();
141
+ }
142
+
143
+ while($i<=$data['highestID']){
144
+ if( $data['survey_qn_id_'.$i]!=0)
145
+ {
146
+ $modelSurvey = Mage::getModel('surveymanager/surveyqnrelation');
147
+
148
+ $modelSurvey->setData('survey_id',$model->getId());
149
+ $modelSurvey->setData('survey_qn_id',$data['survey_qn_id_'.$i]);
150
+ $modelSurvey->save();
151
+ }
152
+ $i++;
153
+ }
154
+ }
155
+ Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('surveymanager')->__('Survey was successfully saved'));
156
+ Mage::getSingleton('adminhtml/session')->setFormData(false);
157
+
158
+ if ($this->getRequest()->getParam('back')) {
159
+ $this->_redirect('*/*/edit', array('id' => $model->getId()));
160
+ return;
161
+ }
162
+ $this->_redirect('*/*/');
163
+ return;
164
+ } catch (Exception $e) {
165
+ Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
166
+ Mage::getSingleton('adminhtml/session')->setFormData($data);
167
+ $this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));
168
+ return;
169
+ }
170
+
171
+ }
172
+
173
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('surveymanager')->__('Unable to find survey to save'));
174
+ $this->_redirect('*/*/');
175
+ }
176
+
177
+ protected function _initQuestionAction() {
178
+ $this->loadLayout()->_setActiveMenu("surveymanager/surveymanager")
179
+ ->_addBreadcrumb(Mage::helper('adminhtml')->__('Manage Survey Questions'), Mage::helper('adminhtml')->__('Manage Survey Questions'));
180
+ return $this;
181
+ }
182
+
183
+ public function questionsAction() {
184
+
185
+ $this->_initQuestionAction();
186
+ $this->renderLayout();
187
+ }
188
+
189
+ public function addQuestionsAction(){
190
+ $id = $this->getRequest()->getParam('id');
191
+
192
+ $model = Mage::getModel('surveymanager/surveyquestions')->load($id);
193
+
194
+ $data = Mage::getSingleton('adminhtml/session')->getFormData(true);
195
+ if (!empty($data)) {
196
+ $model->setData($data);
197
+ }
198
+
199
+ Mage::register('survey_question_data', $model);
200
+
201
+ $this->loadLayout();
202
+
203
+ $this->getLayout()->getBlock('head')->setCanLoadExtJs(true);
204
+
205
+ $this->_addContent($this->getLayout()->createBlock('surveymanager/adminhtml_questions_edit'))
206
+ ->_addLeft($this->getLayout()->createBlock('surveymanager/adminhtml_questions_edit_tabs'));
207
+
208
+ $this->getLayout()->getBlock('head')->setCanLoadTinyMce(true);
209
+
210
+ $this->renderLayout();
211
+ }
212
+
213
+ public function editQuestionsAction() {
214
+
215
+ $id = $this->getRequest()->getParam('id');
216
+ $model = Mage::getModel('surveymanager/surveyquestions')->load($id);
217
+
218
+ if ($model->getId() || $id == 0) {
219
+ $data = Mage::getSingleton('adminhtml/session')->getFormData(true);
220
+ if (!empty($data)) {
221
+ $model->setData($data);
222
+ }
223
+
224
+ Mage::register('survey_question_data', $model);
225
+
226
+ $this->loadLayout();
227
+
228
+ $this->getLayout()->getBlock('head')->setCanLoadExtJs(true);
229
+
230
+ $this->_addContent($this->getLayout()->createBlock('surveymanager/adminhtml_questions_edit'))
231
+ ->_addLeft($this->getLayout()->createBlock('surveymanager/adminhtml_questions_edit_tabs'));
232
+
233
+ $this->getLayout()->getBlock('head')->setCanLoadTinyMce(true);
234
+
235
+ $this->renderLayout();
236
+ } else {
237
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('surveymanager')->__('No Survey Questions'));
238
+ $this->_redirect('*/*/');
239
+ }
240
+ }
241
+
242
+ public function saveQnAnsAction() {
243
+ if ($data = $this->getRequest()->getPost()) {
244
+
245
+ $model = Mage::getModel('surveymanager/surveyquestions');
246
+
247
+ $model->setData($data)
248
+ ->setId($this->getRequest()->getParam('id'));
249
+
250
+ try {
251
+
252
+ $format = Mage::app()->getLocale()->getDateTimeFormat(Mage_Core_Model_Locale::FORMAT_TYPE_MEDIUM);
253
+ if (isset($data['created_time']) && $data['created_time']) {
254
+ $dateFrom = Mage::app()->getLocale()->date($data['created_time'], $format);
255
+ $model->setCreatedTime(Mage::getModel('core/date')->gmtDate(null, $dateFrom->getTimestamp()));
256
+ $model->setUpdateTime(Mage::getModel('core/date')->gmtDate());
257
+ } else {
258
+ $model->setCreatedTime(Mage::getModel('core/date')->gmtDate());
259
+ }
260
+ $model->save();
261
+
262
+ if($model->getId()){
263
+
264
+ $modelAnsQnIds = Mage::getModel('surveymanager/surveyanswer')
265
+ ->getCollection()
266
+ ->addFieldToFilter('survey_ans_qn_id',$model->getId());
267
+
268
+ foreach($modelAnsQnIds as $modelAnswer){
269
+ $modelAnswer->delete();
270
+ }
271
+
272
+ $i=1;
273
+ while($i<=$data['highestID']){
274
+ $modelSurveyAnswer = Mage::getModel('surveymanager/surveyanswer');
275
+
276
+ if($data['survey_ans_id_'.$i]!='')
277
+ {
278
+ $modelSurveyAnswer->setSurveyAnsQnId($model->getId())
279
+ ->setSurveyAnsTitle($data['survey_ans_id_'.$i])
280
+ ->setIsActive(1);
281
+
282
+ if (isset($data['created_time']) && $data['created_time']) {
283
+ $dateFrom = Mage::app()->getLocale()->date($data['created_time'], $format);
284
+ $modelSurveyAnswer->setCreatedTime(Mage::getModel('core/date')->gmtDate(null, $dateFrom->getTimestamp()));
285
+ $modelSurveyAnswer->setUpdateTime(Mage::getModel('core/date')->gmtDate());
286
+ } else {
287
+ $modelSurveyAnswer->setCreatedTime(Mage::getModel('core/date')->gmtDate());
288
+ }
289
+ $modelSurveyAnswer->save();
290
+ }
291
+ $i++;
292
+ }
293
+ }
294
+ Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('surveymanager')->__('Question was successfully saved'));
295
+ Mage::getSingleton('adminhtml/session')->setFormData(false);
296
+
297
+ if ($this->getRequest()->getParam('back')) {
298
+ $this->_redirect('*/*/editQuestions', array('id' => $model->getId()));
299
+ return;
300
+ }
301
+ $this->_redirect('*/*/questions');
302
+ return;
303
+ } catch (Exception $e) {
304
+ Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
305
+ Mage::getSingleton('adminhtml/session')->setFormData($data);
306
+ $this->_redirect('*/*/editQuestions', array('id' => $this->getRequest()->getParam('id')));
307
+ return;
308
+ }
309
+
310
+ }
311
+
312
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('surveymanager')->__('Unable to find question to save'));
313
+ $this->_redirect('*/*/');
314
+ }
315
+
316
+ public function deleteQuestionAction() {
317
+ $questionId = (int) $this->getRequest()->getParam('id');
318
+ if ($questionId) {
319
+ try {
320
+ $model = Mage::getModel('surveymanager/surveyquestions')->load($questionId);
321
+ $model->delete();
322
+ Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('adminhtml')->__('Question was successfully deleted'));
323
+ $this->_redirect('*/*/questions');
324
+ return;
325
+ } catch (Exception $e) {
326
+ Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
327
+ $this->_redirect('*/*/editQuestions', array('id' => $this->getRequest()->getParam('id')));
328
+ }
329
+ }
330
+ $this->_redirect('*/*/');
331
+ }
332
+
333
+ public function deleteAction() {
334
+ $postId = (int) $this->getRequest()->getParam('id');
335
+ if ($postId) {
336
+ try {
337
+ $this->_postDelete($postId);
338
+ Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('adminhtml')->__('Survey was successfully deleted'));
339
+ $this->_redirect('*/*/');
340
+ } catch (Exception $e) {
341
+ Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
342
+ $this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));
343
+ }
344
+ }
345
+ $this->_redirect('*/*/');
346
+ }
347
+
348
+ public function massDeleteAction() {
349
+ $surveyIds = $this->getRequest()->getParam('survey');
350
+ if (!is_array($surveyIds)) {
351
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('adminhtml')->__('Please select surveys'));
352
+ } else {
353
+ try {
354
+ foreach ($surveyIds as $surveyId) {
355
+ $this->_postDelete($surveyId);
356
+ }
357
+ Mage::getSingleton('adminhtml/session')->addSuccess(
358
+ Mage::helper('adminhtml')->__(
359
+ 'Total of %d record(s) were successfully deleted', count($surveyIds)
360
+ )
361
+ );
362
+ } catch (Exception $e) {
363
+ Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
364
+ }
365
+ }
366
+ $this->_redirect('*/*/index');
367
+ }
368
+
369
+ protected function _postDelete($surveyId) {
370
+ $model = Mage::getModel('surveymanager/survey')->load($surveyId);
371
+ $model->delete();
372
+ }
373
+
374
+ public function massStatusAction() {
375
+ $surveyIds = $this->getRequest()->getParam('survey');
376
+ if (!is_array($surveyIds)) {
377
+ Mage::getSingleton('adminhtml/session')->addError($this->__('Please select survey'));
378
+ } else {
379
+ try {
380
+
381
+ foreach ($surveyIds as $surveyId) {
382
+ $survey = Mage::getModel('surveymanager/survey')
383
+ ->load($surveyId)
384
+ ->setIsActive($this->getRequest()->getParam('status'))
385
+ ->setIsMassupdate(true)
386
+ ->save();
387
+ }
388
+ $this->_getSession()->addSuccess(
389
+ $this->__('Total of %d record(s) were successfully updated', count($surveyIds))
390
+ );
391
+ } catch (Exception $e) {
392
+
393
+ $this->_getSession()->addError($e->getMessage());
394
+ }
395
+ }
396
+ $this->_redirect('*/*/index');
397
+ }
398
+
399
+
400
+
401
+ }
app/code/community/Rainconcert/SurveyManager/controllers/IndexController.php ADDED
@@ -0,0 +1,93 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Rainconcert Co.
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the EULA
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ *
10
+ * =================================================================
11
+ * MAGENTO EDITION USAGE NOTICE
12
+ * =================================================================
13
+ * This package designed for Magento COMMUNITY edition
14
+ * Rainconcert does not guarantee correct work of this extension
15
+ * on any other Magento edition except Magento COMMUNITY edition.
16
+ * aheadWorks does not provide extension support in case of
17
+ * incorrect edition usage.
18
+ * =================================================================
19
+ *
20
+ * @category Rainconcert
21
+ * @package Rainconcert_SurveyManager
22
+ * @version 1.1.1
23
+ */
24
+
25
+
26
+ class Rainconcert_SurveyManager_IndexController extends Mage_Core_Controller_Front_Action {
27
+
28
+ public function indexAction() {
29
+
30
+ $this->loadLayout();
31
+
32
+ $this->renderLayout();
33
+ }
34
+
35
+ public function resultAction() {
36
+
37
+ if ($data = $this->getRequest()->getPost()) {
38
+
39
+ $customerId = NULL;
40
+ if(Mage::getSingleton('customer/session')->isLoggedIn()) {
41
+ $customerData = Mage::getSingleton('customer/session')->getCustomer();
42
+ $customerId = $customerData->getId();
43
+ }
44
+
45
+ $sessionId = Mage::getSingleton("core/session")->getEncryptedSessionId();
46
+
47
+ foreach($data['survey_values'] as $key=>$surveyValue){
48
+ $model = Mage::getModel('surveymanager/surveyresults');
49
+
50
+ $model->setCustomerId($customerId)
51
+ ->setSessionId($sessionId)
52
+ ->setSurveyQnId($key)
53
+ ->setIsActive(1);
54
+
55
+ $format = Mage::app()->getLocale()->getDateTimeFormat(Mage_Core_Model_Locale::FORMAT_TYPE_MEDIUM);
56
+ if (isset($data['created_time']) && $data['created_time']) {
57
+ $dateFrom = Mage::app()->getLocale()->date($data['created_time'], $format);
58
+ $model->setCreatedTime(Mage::getModel('core/date')->gmtDate(null, $dateFrom->getTimestamp()));
59
+ $model->setUpdateTime(Mage::getModel('core/date')->gmtDate());
60
+ } else {
61
+ $model->setCreatedTime(Mage::getModel('core/date')->gmtDate());
62
+ }
63
+ $model->save();
64
+
65
+ if($model->getId()){
66
+
67
+ $modelSurveyResultValue = Mage::getModel('surveymanager/surveyresultvalue');
68
+ $modelSurveyResultValue->setData('survey_result_id', $model->getId())
69
+ ->setData('survey_result_value', $surveyValue)
70
+ ->setData('survey_ans_type_id', $data['survey_ans_type'][$key]);
71
+
72
+ if (isset($data['created_time']) && $data['created_time']) {
73
+ $dateFrom = Mage::app()->getLocale()->date($data['created_time'], $format);
74
+ $modelSurveyResultValue->setCreatedTime(Mage::getModel('core/date')->gmtDate(null, $dateFrom->getTimestamp()));
75
+ $modelSurveyResultValue->setUpdateTime(Mage::getModel('core/date')->gmtDate());
76
+ } else {
77
+ $modelSurveyResultValue->setCreatedTime(Mage::getModel('core/date')->gmtDate());
78
+ }
79
+
80
+ $modelSurveyResultValue->save();
81
+ }
82
+ }
83
+
84
+ Mage::getSingleton('core/session')->addSuccess(Mage::helper('surveymanager')->__('Your Feedback is successfully saved'));
85
+
86
+ $this->_redirect('*/*/');
87
+ return;
88
+ }
89
+
90
+ Mage::getSingleton('core/session')->addError(Mage::helper('surveymanager')->__('Unable to save Feedback'));
91
+ $this->_redirect('*/*/');
92
+ }
93
+ }
app/code/community/Rainconcert/SurveyManager/etc/config.xml ADDED
@@ -0,0 +1,176 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <Rainconcert_SurveyManager>
5
+ <version>0.1.3</version>
6
+ </Rainconcert_SurveyManager>
7
+ </modules>
8
+ <frontend>
9
+ <translate>
10
+ <modules>
11
+ <Rainconcert_SurveyManager>
12
+ <files>
13
+ <default>Rainconcert_SurveyManager.csv</default>
14
+ </files>
15
+ </Rainconcert_SurveyManager>
16
+ </modules>
17
+ </translate>
18
+ <routers>
19
+ <surveymanager>
20
+ <use>standard</use>
21
+ <args>
22
+ <module>Rainconcert_SurveyManager</module>
23
+ <frontName>surveymanager</frontName>
24
+ </args>
25
+ </surveymanager>
26
+ </routers>
27
+ <layout>
28
+ <updates>
29
+ <surveymanager>
30
+ <file>surveymanager.xml</file>
31
+ </surveymanager>
32
+ </updates>
33
+ </layout>
34
+ </frontend>
35
+ <admin>
36
+ <routers>
37
+ <surveymanager>
38
+ <use>admin</use>
39
+ <args>
40
+ <module>Rainconcert_SurveyManager</module>
41
+ <frontName>surveymanager</frontName>
42
+ </args>
43
+ </surveymanager>
44
+ </routers>
45
+ </admin>
46
+ <adminhtml>
47
+ <menu>
48
+ <surveymanager translate="title" module="surveymanager">
49
+ <title>Survey Manager</title>
50
+ <sort_order>68</sort_order>
51
+ <children>
52
+ <survey_manage module="surveymanager">
53
+ <title>Manage Surveys</title>
54
+ <sort_order>0</sort_order>
55
+ <action>surveymanager/adminhtml_index/index</action>
56
+ </survey_manage>
57
+ <survey_qns module="surveymanager">
58
+ <title>Manage Questions/Answers</title>
59
+ <sort_order>1</sort_order>
60
+ <action>surveymanager/adminhtml_index/questions</action>
61
+ </survey_qns>
62
+ </children>
63
+ </surveymanager>
64
+ </menu>
65
+ <translate>
66
+ <modules>
67
+ <Rainconcert_SurveyManager>
68
+ <files>
69
+ <default>Rainconcert_SurveyManager.csv</default>
70
+ </files>
71
+ </Rainconcert_SurveyManager>
72
+ </modules>
73
+ </translate>
74
+ <acl>
75
+ <resources>
76
+ <all>
77
+ <title>Allow Everything</title>
78
+ </all>
79
+ <admin>
80
+ <children>
81
+ <Rainconcert_SurveyManager>
82
+ <title>Survey Manager</title>
83
+ <sort_order>10</sort_order>
84
+ </Rainconcert_SurveyManager>
85
+ <system>
86
+ <children>
87
+ <config>
88
+ <children>
89
+ <surveymanager translate="title" module="surveymanager">
90
+ <title>Survey Manager</title>
91
+ <sort_order>50</sort_order>
92
+ </surveymanager>
93
+ </children>
94
+ </config>
95
+ </children>
96
+ </system>
97
+ </children>
98
+ </admin>
99
+ </resources>
100
+ </acl>
101
+ <layout>
102
+ <updates>
103
+ <surveymanager>
104
+ <file>surveymanager.xml</file>
105
+ </surveymanager>
106
+ </updates>
107
+ </layout>
108
+ </adminhtml>
109
+
110
+ <global>
111
+ <models>
112
+ <surveymanager>
113
+ <class>Rainconcert_SurveyManager_Model</class>
114
+ <resourceModel>surveymanager_mysql4</resourceModel>
115
+ </surveymanager>
116
+ <surveymanager_mysql4>
117
+ <class>Rainconcert_SurveyManager_Model_Mysql4</class>
118
+ <entities>
119
+ <survey>
120
+ <table>survey</table>
121
+ </survey>
122
+ <surveyquestions>
123
+ <table>survey_questions</table>
124
+ </surveyquestions>
125
+ <surveyqnrelation>
126
+ <table>survey_qn_relation</table>
127
+ </surveyqnrelation>
128
+ <surveyanswer>
129
+ <table>survey_answer</table>
130
+ </surveyanswer>
131
+ <survey_answer_value>
132
+ <table>survey_answer_value</table>
133
+ </survey_answer_value>
134
+ <surveyresults>
135
+ <table>survey_result</table>
136
+ </surveyresults>
137
+ <surveyresultvalue>
138
+ <table>survey_result_value</table>
139
+ </surveyresultvalue>
140
+ </entities>
141
+ </surveymanager_mysql4>
142
+ </models>
143
+ <resources>
144
+ <surveymanager_setup>
145
+ <setup>
146
+ <module>Rainconcert_SurveyManager</module>
147
+ </setup>
148
+ <connection>
149
+ <use>core_setup</use>
150
+ </connection>
151
+ </surveymanager_setup>
152
+ <surveymanager_write>
153
+ <connection>
154
+ <use>core_write</use>
155
+ </connection>
156
+ </surveymanager_write>
157
+ <surveymanager_read>
158
+ <connection>
159
+ <use>core_read</use>
160
+ </connection>
161
+ </surveymanager_read>
162
+ </resources>
163
+ <blocks>
164
+ <surveymanager>
165
+ <class>Rainconcert_SurveyManager_Block</class>
166
+ </surveymanager>
167
+ </blocks>
168
+
169
+ <helpers>
170
+ <surveymanager>
171
+ <class>Rainconcert_SurveyManager_Helper</class>
172
+ </surveymanager>
173
+ </helpers>
174
+
175
+ </global>
176
+ </config>
app/code/community/Rainconcert/SurveyManager/etc/system.xml ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+
3
+ <config>
4
+ <tabs>
5
+ <rainconcert translate="label">
6
+ <label>Rainconcert</label>
7
+ <sort_order>240</sort_order>
8
+ </rainconcert>
9
+ </tabs>
10
+ <sections>
11
+ <surveymanager translate="label" module="surveymanager">
12
+ <label>Rainconcert Survey Manager</label>
13
+ <tab>surveymanager</tab>
14
+ <frontend_type>text</frontend_type>
15
+ <sort_order>90</sort_order>
16
+ <show_in_default>1</show_in_default>
17
+ <show_in_website>1</show_in_website>
18
+ <show_in_store>1</show_in_store>
19
+ <groups>
20
+ <general translate="label">
21
+ <label>Survey Manager</label>
22
+ <frontend_type>text</frontend_type>
23
+ <sort_order>1</sort_order>
24
+ <show_in_default>1</show_in_default>
25
+ <show_in_website>1</show_in_website>
26
+ <show_in_store>1</show_in_store>
27
+ <fields>
28
+ <enabled translate="label">
29
+ <label>Enabled</label>
30
+ <frontend_type>select</frontend_type>
31
+ <source_model>adminhtml/system_config_source_yesno</source_model>
32
+ <sort_order>70</sort_order>
33
+ <show_in_default>1</show_in_default>
34
+ <show_in_website>1</show_in_website>
35
+ <show_in_store>1</show_in_store>
36
+ </enabled>
37
+ </fields>
38
+ </general>
39
+ </groups>
40
+ </surveymanager>
41
+ </sections>
42
+ </config>
app/code/community/Rainconcert/SurveyManager/sql/surveymanager_setup/mysql4-install-0.1.0.php ADDED
@@ -0,0 +1,79 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ $installer = $this;
4
+
5
+ $installer->startSetup();
6
+
7
+ $installer->run("
8
+
9
+ -- DROP TABLE IF EXISTS {$this->getTable('survey')};
10
+ CREATE TABLE {$this->getTable('survey')} (
11
+ `survey_id` int(11) unsigned NOT NULL auto_increment,
12
+ `survey_name` varchar(2000) NOT NULL default '',
13
+ `survey_desc` text NULL default '',
14
+ `survey_url` text NOT NULL default '',
15
+ `is_active` smallint(6) NOT NULL default '0',
16
+ `created_time` datetime NULL,
17
+ `update_time` datetime NULL,
18
+ PRIMARY KEY (`survey_id`)
19
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
20
+
21
+
22
+ -- DROP TABLE IF EXISTS {$this->getTable('survey_questions')};
23
+ CREATE TABLE {$this->getTable('survey_questions')} (
24
+ `survey_qn_id` int(11) unsigned NOT NULL auto_increment,
25
+ `survey_qn_title` varchar(2000) NOT NULL,
26
+ `survey_qn_desc` text NULL default '',
27
+ `survey_ans_type` int(3) unsigned default '0',
28
+ `is_active` smallint(6) NOT NULL default '0',
29
+ `created_time` datetime NULL,
30
+ `update_time` datetime NULL,
31
+ PRIMARY KEY (`survey_qn_id`)
32
+ )ENGINE=InnoDB DEFAULT CHARSET=utf8;
33
+
34
+ -- DROP TABLE IF EXISTS {$this->getTable('survey_answer')};
35
+ CREATE TABLE {$this->getTable('survey_answer')} (
36
+ `survey_ans_id` int(11) unsigned NOT NULL auto_increment,
37
+ `survey_ans_title` varchar(2000) NOT NULL,
38
+ `is_active` smallint(6) NOT NULL default '0',
39
+ `created_time` datetime NULL,
40
+ `update_time` datetime NULL,
41
+ PRIMARY KEY (`survey_ans_id`)
42
+ )ENGINE=InnoDB DEFAULT CHARSET=utf8;
43
+
44
+ -- DROP TABLE IF EXISTS {$this->getTable('survey_answer_value')};
45
+ CREATE TABLE {$this->getTable('survey_answer_value')} (
46
+ `survey_ans_value_id` int(11) unsigned NOT NULL auto_increment,
47
+ `survey_ans_id` int(11) unsigned NOT NULL,
48
+ `survey_ans_value` text NULL,
49
+ `is_active` smallint(6) NOT NULL default '0',
50
+ `created_time` datetime NULL,
51
+ `update_time` datetime NULL,
52
+ PRIMARY KEY (`survey_ans_value_id`)
53
+ )ENGINE=InnoDB DEFAULT CHARSET=utf8;
54
+
55
+ -- DROP TABLE IF EXISTS {$this->getTable('survey_result')};
56
+ CREATE TABLE {$this->getTable('survey_result')} (
57
+ `survey_result_id` int(11) unsigned NOT NULL auto_increment,
58
+ `customer_id` int(11) unsigned NULL,
59
+ `session_id` text NULL,
60
+ `survey_qn_id` int(11) NULL,
61
+ `is_active` smallint(6) NOT NULL default '0',
62
+ `created_time` datetime NULL,
63
+ `update_time` datetime NULL,
64
+ PRIMARY KEY (`survey_result_id`)
65
+ )ENGINE=InnoDB DEFAULT CHARSET=utf8;
66
+
67
+ -- DROP TABLE IF EXISTS {$this->getTable('survey_result_value')};
68
+ CREATE TABLE {$this->getTable('survey_result_value')} (
69
+ `survey_result_value_id` int(11) unsigned NOT NULL auto_increment,
70
+ `survey_result_id` int(11) unsigned NOT NULL,
71
+ `survey_result_value` text NULL,
72
+ `survey_ans_type_id` int(11) NULL,
73
+ `created_time` datetime NULL,
74
+ `update_time` datetime NULL,
75
+ PRIMARY KEY (`survey_result_value_id`)
76
+ )ENGINE=InnoDB DEFAULT CHARSET=utf8;
77
+
78
+ ");
79
+
app/code/community/Rainconcert/SurveyManager/sql/surveymanager_setup/mysql4-upgrade-0.1.0-0.1.1.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ $installer = $this;
4
+
5
+ $installer->startSetup();
6
+
7
+ $installer->run("ALTER TABLE {$this->getTable('survey_answer')} ADD `survey_ans_qn_id` INT(11) NULL AFTER `survey_ans_title`;");
8
+
9
+ $installer->endSetup();
10
+ ?>
app/code/community/Rainconcert/SurveyManager/sql/surveymanager_setup/mysql4-upgrade-0.1.1-0.1.2.php ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ $installer = $this;
4
+
5
+ $installer->startSetup();
6
+
7
+ $installer->run("
8
+
9
+ -- DROP TABLE IF EXISTS {$this->getTable('survey_qn_relation')};
10
+ CREATE TABLE {$this->getTable('survey_qn_relation')} (
11
+ `survey_qn_relation_id` int(11) unsigned NOT NULL auto_increment,
12
+ `survey_id` int(11) unsigned NOT NULL,
13
+ `survey_qn_id` int(11) unsigned NOT NULL,
14
+ PRIMARY KEY (`survey_qn_relation_id`)
15
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
16
+ ");
17
+
18
+
19
+ $installer->endSetup();
20
+ ?>
app/code/community/Rainconcert/SurveyManager/sql/surveymanager_setup/mysql4-upgrade-0.1.2-0.1.3.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ $installer = $this;
4
+
5
+ $installer->startSetup();
6
+
7
+ $installer->run("ALTER TABLE {$this->getTable('survey')} ADD `survey_layout_template` varchar(20) NULL AFTER `survey_url`;");
8
+
9
+ $installer->endSetup();
10
+ ?>
app/design/adminhtml/default/default/layout/surveymanager.xml ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <layout version="0.1.0">
3
+ <default>
4
+ <reference name="head">
5
+ <action method="addJs"><script>surveymanager/jsapi</script></action>
6
+ </reference>
7
+ </default>
8
+ <surveymanager_adminhtml_index_index>
9
+ <reference name="content">
10
+ <block type="surveymanager/adminhtml_survey_manage" name="surveymanager" />
11
+ </reference>
12
+ </surveymanager_adminhtml_index_index>
13
+ <surveymanager_adminhtml_index_questions>
14
+ <reference name="content">
15
+ <block type="surveymanager/adminhtml_questions_manage" name="surveymanager" />
16
+ </reference>
17
+ </surveymanager_adminhtml_index_questions>
18
+ </layout>
app/design/adminhtml/default/default/template/surveymanager/answers.phtml ADDED
@@ -0,0 +1,104 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div class="entry-edit custom-options product-custom-options">
2
+ <div class="entry-edit-head">
3
+ <h4>Add Answers</h4>
4
+ <div class="right"><button style="" onclick="addClick();" class="scalable " type="button" id="add_button11"><span>Add Answers</span></button></div>
5
+ </div>
6
+ <div id="product_options_container" class="box">
7
+ <div id="product_options_container_top">
8
+
9
+ <?php $counter = 1; ?>
10
+ <?php $list = ""; ?>
11
+
12
+ <?php foreach($this->getSurveyAnswerByQn($this->getRequest()->getParam('id')) as $answer) { ?>
13
+ <div id="survey_ans_id_<?php echo $counter ?>" class="option-box">
14
+ <table cellspacing="0" cellpadding="0" class="option-header" id="product_option_2">
15
+ <thead>
16
+ <tr>
17
+ <th class="opt-title">Answer <?php echo $counter; ?></th>
18
+ <th class="a-right">
19
+ <button style="" onclick="removeAnswer('<?php echo $counter ?>')" class="scalable delete delete-product-option " type="button" id="Delete_Answers">
20
+ <span>Delete Answers</span>
21
+ </button>
22
+ </th>
23
+ </tr>
24
+ </thead>
25
+ <tbody>
26
+ <tr>
27
+ <td>
28
+ <input type="text" id="survey_ans_id_<?php echo $counter ?>" name="survey_ans_id_<?php echo $counter ?>" value="<?php echo $answer->survey_ans_title ?>"/>
29
+ </td>
30
+ </tr>
31
+ </tbody>
32
+ </table>
33
+ </div>
34
+ <?php $list .= " " . $counter . ","; ?>
35
+ <?php $counter++; ?>
36
+ <?php } ?>
37
+
38
+ </div>
39
+ <input type="hidden" value="<?php echo ($counter - 1) ?>" name="highestID" id="highestID">
40
+ <input type="hidden" value="<?php echo $list; ?>" name="answerList" id="answerList">
41
+ </div>
42
+ </div>
43
+
44
+ <script type="text/javascript">
45
+ function addClick() {
46
+ //get the highest ID
47
+ var highestID = document.getElementById('highestID').value;
48
+ var newAnswer = document.getElementById('super_secret').innerHTML;
49
+ var newID = parseInt(highestID) + 1;
50
+
51
+ newAnswer = newAnswer.replace(/id111/g, 'id_'+newID);
52
+ newAnswer = newAnswer.replace(/fakevalue/g, "");
53
+
54
+ var divTag = document.createElement("div");
55
+
56
+ divTag.id = "div" + newID;
57
+
58
+ divTag.innerHTML = newAnswer;
59
+
60
+ document.getElementById('product_options_container_top').appendChild(divTag);
61
+
62
+ document.getElementById('highestID').value = newID;
63
+
64
+ document.getElementById('answerList').value += " " + newID + ",";
65
+ }
66
+
67
+ function removeAnswer(id) {
68
+
69
+ var child = document.getElementById('survey_ans_id_' + id);
70
+ var parent = document.getElementById('product_options_container_top');
71
+
72
+ parent.removeChild(child);
73
+
74
+ var list = document.getElementById('answerList').value;
75
+
76
+ document.getElementById('answerList').value = list.replace(" " + id + ",", "");
77
+ }
78
+
79
+ </script>
80
+
81
+ <div id="super_secret" style="display: none">
82
+
83
+ <div id="survey_ans_id111" class="option-box">
84
+ <table cellspacing="0" cellpadding="0" class="option-header" id="product_option_2">
85
+ <thead>
86
+ <tr>
87
+ <th class="opt-title">Answer <span id="cntr"></span></th>
88
+ <th class="a-right">
89
+ <button style="" onclick="removeAnswer('id111')" class="scalable delete delete-product-option " type="button" id="Delete_Answer">
90
+ <span>Delete Answers</span>
91
+ </button>
92
+ </th>
93
+ </tr>
94
+ </thead>
95
+ <tbody>
96
+ <tr>
97
+ <td>
98
+ <input type="text" id="survey_ans_id111" name="survey_ans_id111" value=""/>
99
+ </td>
100
+ </tr>
101
+ </tbody>
102
+ </table>
103
+ </div>
104
+ </div>
app/design/adminhtml/default/default/template/surveymanager/managesurvey.phtml ADDED
@@ -0,0 +1,122 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div class="entry-edit custom-options product-custom-options">
2
+ <div class="entry-edit-head">
3
+ <h4>Assign Questions to Survey</h4>
4
+ <div class="right"><button style="" onclick="addClick();" class="scalable " type="button" id="add_button11"><span>Add Question</span></button></div>
5
+ </div>
6
+ <div id="product_options_container" class="box">
7
+ <div id="product_options_container_top">
8
+
9
+ <?php $counter = 1; ?>
10
+ <?php $list = ""; ?>
11
+
12
+ <?php foreach($this->helper('surveymanager')->getSurveyRelations($this->getRequest()->getParam('id')) as $surveyRelation) { ?>
13
+ <?php if($this->checkQnActiveByQid($surveyRelation->survey_qn_id)): ?>
14
+ <div id="question_<?php echo $counter ?>" class="option-box">
15
+ <table cellspacing="0" cellpadding="0" class="option-header" id="product_option_2">
16
+ <thead>
17
+ <tr>
18
+ <th class="opt-title">Question <?php echo $counter ?>
19
+ <span class="required">*
20
+ </span>
21
+ </th>
22
+ <th class="a-right">
23
+ <button style="" onclick="removeQuestion('<?php echo $counter ?>')" class="scalable delete delete-product-option " type="button" id="Delete_Question">
24
+ <span>Delete Question</span>
25
+ </button>
26
+ </th>
27
+ </tr>
28
+ </thead>
29
+ <tbody>
30
+ <tr>
31
+ <td>
32
+ <select class="select select-product-option-type required-option-select" id="survey_qn_id_<?php echo $counter ?>" name="survey_qn_id_<?php echo $counter ?>" >
33
+ <?php foreach($this->getSurveyQuestions() as $question): ?>
34
+ <option value="<?php echo $question->survey_qn_id ?>" <?php if($surveyRelation->survey_qn_id == $question->survey_qn_id): ?> selected <?php endif; ?> >
35
+ <?php echo $question->survey_qn_title ?>
36
+ </option>
37
+ <?php endforeach; ?>
38
+ </select>
39
+ </td>
40
+ </tr>
41
+ </tbody>
42
+ </table>
43
+ </div>
44
+ <?php endif; ?>
45
+ <?php $list .= " " . $counter . ","; ?>
46
+ <?php $counter++; ?>
47
+ <?php } ?>
48
+
49
+ </div>
50
+ <input type="hidden" value="<?php echo ($counter - 1) ?>" name="highestID" id="highestID">
51
+ <input type="hidden" value="<?php echo $list; ?>" name="questionList" id="questionList">
52
+ </div>
53
+ </div>
54
+
55
+ <script type="text/javascript">
56
+ function addClick() {
57
+ //get the highest ID
58
+ var highestID = document.getElementById('highestID').value;
59
+ var newQuestion = document.getElementById('super_secret').innerHTML;
60
+ var newID = parseInt(highestID) + 1;
61
+
62
+ newQuestion = newQuestion.replace(/id111/g, 'id_'+newID);
63
+ newQuestion = newQuestion.replace(/fakevalue/g, "");
64
+
65
+ var divTag = document.createElement("div");
66
+
67
+ divTag.id = "div" + newID;
68
+
69
+ divTag.innerHTML = newQuestion;
70
+
71
+ document.getElementById('product_options_container_top').appendChild(divTag);
72
+
73
+ document.getElementById('highestID').value = newID;
74
+
75
+ document.getElementById('questionList').value += " " + newID + ",";
76
+ }
77
+
78
+ function removeQuestion(id) {
79
+
80
+ var child = document.getElementById('question_' + id);
81
+ var parent = document.getElementById('product_options_container_top');
82
+
83
+ parent.removeChild(child);
84
+
85
+ var list = document.getElementById('questionList').value;
86
+
87
+ document.getElementById('questionList').value = list.replace(" " + id + ",", "");
88
+ }
89
+
90
+ </script>
91
+
92
+ <div id="super_secret" style="display: none">
93
+
94
+ <div id="survey_qn_id111" class="option-box">
95
+ <table cellspacing="0" cellpadding="0" class="option-header" id="product_option_2">
96
+ <thead>
97
+ <tr>
98
+ <th class="opt-title">Question
99
+ <span class="required">*
100
+ </span>
101
+ </th>
102
+ <th class="a-right">
103
+ <button style="" onclick="removeQuestion('id111')" class="scalable delete delete-product-option " type="button" id="Delete_Question">
104
+ <span>Delete Question</span>
105
+ </button>
106
+ </th>
107
+ </tr>
108
+ </thead>
109
+ <tbody>
110
+ <tr>
111
+ <td>
112
+ <select id="survey_qn_id111" name="survey_qn_id111" >
113
+ <?php foreach($this->getSurveyQuestions() as $question): ?>
114
+ <option value="<?php echo $question->survey_qn_id ?>" ><?php echo $question->survey_qn_title ?></option>
115
+ <?php endforeach; ?>
116
+ </select>
117
+ </td>
118
+ </tr>
119
+ </tbody>
120
+ </table>
121
+ </div>
122
+ </div>
app/design/adminhtml/default/default/template/surveymanager/results.phtml ADDED
@@ -0,0 +1,90 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php $surveyId = $this->getRequest()->getParam('id'); ?>
2
+ <div class="entry-edit custom-options product-custom-options">
3
+ <div class="entry-edit-head">
4
+ <h4><?php echo $this->__('Survey Results') ?></h4>
5
+ </div>
6
+ <?php $cnt=1; ?>
7
+ <div id="product_options_container" class="box">
8
+ <div id="product_options_container_top" >
9
+ <?php foreach( $this->helper('surveymanager')->getSurveyRelations( $surveyId) as $surveyRln): ?>
10
+ <?php $question = $this->helper('surveymanager')
11
+ ->getSurveyQnById( $surveyRln->getSurveyQnId()) ?>
12
+ <?php $dataTable = ''; ?>
13
+ <div style="padding-bottom:10px;">
14
+ <div style="padding-bottom:10px;">
15
+ <?php echo $cnt.':'?>
16
+ <?php echo $question->survey_qn_title; ?>
17
+ </div>
18
+ <?php $surveyResults = $this->getResultsByQnId( $surveyRln->getSurveyQnId()); ?>
19
+ <?php $answers = $this->helper('surveymanager')->getSurveyAnswersByQid($surveyRln->getSurveyQnId()) ?>
20
+ <?php $ansType = $question->survey_ans_type; ?>
21
+ <?php if( $ansType!="3" && $ansType!="4"): ?>
22
+ <div><?php echo $this->__('No: of Votes:').$this->getResultsCountByQnId($surveyRln->getSurveyQnId()) ?></div>
23
+ <?php endif; ?>
24
+ <?php if( $ansType=="9" || $ansType=="7" ): ?>
25
+ <?php foreach($answers as $answer): ?>
26
+ <?php $ansCnt[$answer->survey_ans_id] = 0; ?>
27
+ <?php foreach($surveyResults as $surveyResult): ?>
28
+ <?php $surveyResultValue = $this->getValueByResultId($surveyResult->getSurveyResultId()); ?>
29
+ <?php if($answer->survey_ans_id==$surveyResultValue): ?>
30
+ <?php $ansCnt[$answer->survey_ans_id]++; ?>
31
+ <?php endif; ?>
32
+ <?php endforeach; ?>
33
+ <div><span><?php echo $answer->survey_ans_title; ?></span></div>
34
+ <?php $dataTable .= "['".$answer->survey_ans_title."',".$ansCnt[$answer->survey_ans_id]."],"; ?>
35
+ <?php endforeach; ?>
36
+ <!------- Pie Chart -------->
37
+ <div id="piechart_<?php echo $surveyRln->getSurveyQnId(); ?>" style="width: 100px; height: 200px;"></div>
38
+ <script type="text/javascript">
39
+ google.load("visualization", "1", {packages:["corechart"]});
40
+ google.setOnLoadCallback(drawChart);
41
+ function drawChart() {
42
+ var data = google.visualization.arrayToDataTable([['Question', 'Votes'],
43
+ <?php echo $dataTable ?>]);
44
+ var options = {
45
+ title: '<?php echo $question->survey_qn_title; ?>',
46
+ is3D: true
47
+ };
48
+
49
+ var chart = new google.visualization.PieChart(document.getElementById('piechart_<?php echo $surveyRln->getSurveyQnId(); ?>'));
50
+ chart.draw(data, options);
51
+ }
52
+ </script>
53
+ <?php endif; ?>
54
+ <?php if( $ansType=="6"): ?>
55
+ <?php $ansYesCnt = $ansNoCnt = 0; ?>
56
+ <?php foreach($surveyResults as $surveyResult): ?>
57
+ <?php $surveyResultValue = $this->getValueByResultId($surveyResult->getSurveyResultId()); ?>
58
+ <?php if("yes"==$surveyResultValue): ?>
59
+ <?php $ansYesCnt++; ?>
60
+ <?php endif; ?>
61
+ <?php if("no"==$surveyResultValue): ?>
62
+ <?php $ansNoCnt++; ?>
63
+ <?php endif; ?>
64
+ <?php endforeach; ?>
65
+ <!------- Pie Chart -------->
66
+ <div id="piechart_<?php echo $surveyRln->getSurveyQnId(); ?>" style="width: 100px; height: 200px;"></div>
67
+ <script type="text/javascript">
68
+ google.load("visualization", "1", {packages:["corechart"]});
69
+ google.setOnLoadCallback(drawChart);
70
+ function drawChart() {
71
+ var data = google.visualization.arrayToDataTable([['Question', 'Votes'],['Yes',<?php echo $ansYesCnt ?>],['No',<?php echo $ansNoCnt ?>]]);
72
+
73
+ var options = {
74
+ title: '<?php echo $question->survey_qn_title; ?>',
75
+ is3D: true
76
+ };
77
+
78
+ var chart = new google.visualization.PieChart(document.getElementById('piechart_<?php echo $surveyRln->getSurveyQnId(); ?>'));
79
+ chart.draw(data, options);
80
+ }
81
+ </script>
82
+ <?php endif; ?>
83
+ <?php $cnt++; ?>
84
+ </div>
85
+ <?php endforeach; ?>
86
+ </div>
87
+ </div>
88
+ </div>
89
+
90
+
app/design/frontend/default/default/layout/surveymanager.xml ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <layout version="0.1.0">
3
+ <default>
4
+ <reference name="head">
5
+ <action method="setTitle" translate="title"><title>Your Feedback</title></action>
6
+ </reference>
7
+ </default>
8
+ <surveymanager_index_index>
9
+ <reference name="content">
10
+ <block type="surveymanager/customeropinion" name="surveymanager" template="surveymanager/survey_layout.phtml"/>
11
+ </reference>
12
+ </surveymanager_index_index>
13
+ </layout>
app/design/frontend/default/default/template/surveymanager/survey_layout.phtml ADDED
@@ -0,0 +1,67 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php $surveyDetails = $this->getSurveyDetails(); ?>
2
+ <?php if( $surveyDetails!=null): ?>
3
+ <div class="block block-related">
4
+ <div class="block-title">
5
+ <strong><span><?php echo $surveyDetails->getData('survey_name'); ?></span></strong>
6
+ </div>
7
+
8
+ <div class="block-content">
9
+ <div id="survey" class="empty">
10
+ <form action="<?php echo $this->getSurveySubmitUrl(); ?>" name="survey_result" method="post">
11
+ <?php $cnt=1; ?>
12
+ <?php foreach( $this->helper('surveymanager')->getSurveyRelations(
13
+ $surveyDetails->getData('survey_id')) as $key=> $surveyRelation): ?>
14
+ <?php $question = $this->helper('surveymanager')
15
+ ->getSurveyQnById( $surveyRelation->getData('survey_qn_id')) ?>
16
+ <div style="padding-bottom:10px;"><?php echo $cnt.':'?> <?php echo $question->survey_qn_title; ?></div>
17
+ <?php $answers = $this->helper('surveymanager')->getSurveyAnswersByQid($question->survey_qn_id) ?>
18
+ <?php $ansType = $question->survey_ans_type; ?>
19
+ <input type="hidden" id="survey_ans_type" name="survey_ans_type[<?php echo $question->survey_qn_id; ?>]" value="<?php echo $ansType; ?>" />
20
+
21
+ <div style="padding-bottom:10px;">
22
+ <?php if($ansType=="9" || $ansType=="6"): ?>
23
+ <select id="survey_value" name="survey_values[<?php echo $question->survey_qn_id; ?>]">
24
+ <?php endif; ?>
25
+ <?php if( $ansType=="6"): ?>
26
+ <option value="yes">Yes</option>
27
+ <option value="no">No</option>
28
+ <?php endif; ?>
29
+
30
+ <?php foreach($answers as $answer): ?>
31
+ <?php if( $ansType=="9"): ?>
32
+ <option value="<?php echo $answer->survey_ans_id; ?>">
33
+ <?php echo $answer->survey_ans_title; ?>
34
+ </option>
35
+ <?php endif; ?>
36
+ <?php if( $ansType=="7"): ?>
37
+ <input type="radio" name="survey_values[<?php echo $question->survey_qn_id; ?>]" value="<?php echo $answer->survey_ans_id; ?>"/>
38
+ <?php echo $answer->survey_ans_title; ?>
39
+ <?php endif; ?>
40
+ <?php if( $ansType=="8"): ?>
41
+ <input type="checkbox" name="survey_values[<?php echo $question->survey_qn_id; ?>]" value="<?php echo $answer->survey_ans_id; ?>"/>
42
+ <?php endif; ?>
43
+ <?php endforeach; ?>
44
+
45
+ <?php if( $ansType=="9" || $ansType=="6"): ?>
46
+ </select>
47
+ <?php endif; ?>
48
+
49
+ <?php if( $ansType=="3"): ?>
50
+ <input type="text" name="survey_values[<?php echo $question->survey_qn_id; ?>]" value="" size="40"/>
51
+ <?php endif; ?>
52
+
53
+ <?php if( $ansType=="4"): ?>
54
+ <textarea name="survey_values[<?php echo $question->survey_qn_id; ?>]" ></textarea>
55
+ <?php endif; ?>
56
+ <?php $cnt++; ?>
57
+ </div>
58
+ <?php endforeach; ?>
59
+ <input type="hidden" id="survey_id" name="survey_id" value="<?php echo $surveyDetails->getData('survey_id'); ?>" />
60
+ <div class="actions">
61
+ <button class="button" title="Submit your Feedback" type="submit"><span><span><?php echo $this->__('Submit your Feedback') ?></span></span></button>
62
+ </div>
63
+ </form>
64
+ </div>
65
+ </div>
66
+ </div>
67
+ <?php endif; ?>
app/etc/modules/Rainconcert_SurveyManager.xml ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * Magento
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 license@magentocommerce.com so we can send you a copy immediately.
15
+ *
16
+ * @category Rainconcert
17
+ * @package Rainconcert_SurveyManager
18
+ * @copyright Copyright (c) 2012 Phoenix Medien GmbH & Co. KG (http://www.phoenix-medien.de)
19
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
20
+ */
21
+ -->
22
+ <config>
23
+ <modules>
24
+ <Rainconcert_SurveyManager>
25
+ <active>true</active>
26
+ <codePool>community</codePool>
27
+ </Rainconcert_SurveyManager>
28
+ </modules>
29
+ </config>
js/surveymanager/jsapi ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ if(!window['googleLT_']){window['googleLT_']=(new Date()).getTime();}if (!window['google']) {
2
+ window['google'] = {};
3
+ }
4
+ if (!window['google']['loader']) {
5
+ window['google']['loader'] = {};
6
+ google.loader.ServiceBase = 'https://www.google.com/uds';
7
+ google.loader.GoogleApisBase = 'https://ajax.googleapis.com/ajax';
8
+ google.loader.ApiKey = 'notsupplied';
9
+ google.loader.KeyVerified = true;
10
+ google.loader.LoadFailure = false;
11
+ google.loader.Secure = true;
12
+ google.loader.GoogleLocale = 'www.google.com';
13
+ google.loader.ClientLocation = null;
14
+ google.loader.AdditionalParams = '';
15
+ (function() {var d=encodeURIComponent,g=window,h=document;function l(a,b){return a.load=b}var m="push",n="replace",q="charAt",r="indexOf",t="ServiceBase",u="name",v="getTime",w="length",x="prototype",y="setTimeout",z="loader",A="substring",B="join",C="toLowerCase";function D(a){return a in E?E[a]:E[a]=-1!=navigator.userAgent[C]()[r](a)}var E={};function F(a,b){var c=function(){};c.prototype=b[x];a.U=b[x];a.prototype=new c}
16
+ function G(a,b,c){var e=Array[x].slice.call(arguments,2)||[];return function(){return a.apply(b,e.concat(Array[x].slice.call(arguments)))}}function H(a){a=Error(a);a.toString=function(){return this.message};return a}function I(a,b){for(var c=a.split(/\./),e=g,f=0;f<c[w]-1;f++)e[c[f]]||(e[c[f]]={}),e=e[c[f]];e[c[c[w]-1]]=b}function J(a,b,c){a[b]=c}if(!K)var K=I;if(!L)var L=J;google[z].v={};K("google.loader.callbacks",google[z].v);var M={},N={};google[z].eval={};K("google.loader.eval",google[z].eval);
17
+ l(google,function(a,b,c){function e(a){var b=a.split(".");if(2<b[w])throw H("Module: '"+a+"' not found!");"undefined"!=typeof b[1]&&(f=b[0],c.packages=c.packages||[],c.packages[m](b[1]))}var f=a;c=c||{};if(a instanceof Array||a&&"object"==typeof a&&"function"==typeof a[B]&&"function"==typeof a.reverse)for(var k=0;k<a[w];k++)e(a[k]);else e(a);if(a=M[":"+f]){c&&!c.language&&c.locale&&(c.language=c.locale);c&&"string"==typeof c.callback&&(k=c.callback,k.match(/^[[\]A-Za-z0-9._]+$/)&&(k=g.eval(k),c.callback=
18
+ k));if((k=c&&null!=c.callback)&&!a.s(b))throw H("Module: '"+f+"' must be loaded before DOM onLoad!");k?a.m(b,c)?g[y](c.callback,0):a.load(b,c):a.m(b,c)||a.load(b,c)}else throw H("Module: '"+f+"' not found!");});K("google.load",google.load);
19
+ google.T=function(a,b){b?(0==O[w]&&(P(g,"load",Q),!D("msie")&&!D("safari")&&!D("konqueror")&&D("mozilla")||g.opera?g.addEventListener("DOMContentLoaded",Q,!1):D("msie")?h.write("<script defer onreadystatechange='google.loader.domReady()' src=//:>\x3c/script>"):(D("safari")||D("konqueror"))&&g[y](S,10)),O[m](a)):P(g,"load",a)};K("google.setOnLoadCallback",google.T);
20
+ function P(a,b,c){if(a.addEventListener)a.addEventListener(b,c,!1);else if(a.attachEvent)a.attachEvent("on"+b,c);else{var e=a["on"+b];a["on"+b]=null!=e?aa([c,e]):c}}function aa(a){return function(){for(var b=0;b<a[w];b++)a[b]()}}var O=[];google[z].P=function(){var a=g.event.srcElement;"complete"==a.readyState&&(a.onreadystatechange=null,a.parentNode.removeChild(a),Q())};K("google.loader.domReady",google[z].P);var ba={loaded:!0,complete:!0};function S(){ba[h.readyState]?Q():0<O[w]&&g[y](S,10)}
21
+ function Q(){for(var a=0;a<O[w];a++)O[a]();O.length=0}google[z].d=function(a,b,c){if(c){var e;"script"==a?(e=h.createElement("script"),e.type="text/javascript",e.src=b):"css"==a&&(e=h.createElement("link"),e.type="text/css",e.href=b,e.rel="stylesheet");(a=h.getElementsByTagName("head")[0])||(a=h.body.parentNode.appendChild(h.createElement("head")));a.appendChild(e)}else"script"==a?h.write('<script src="'+b+'" type="text/javascript">\x3c/script>'):"css"==a&&h.write('<link href="'+b+'" type="text/css" rel="stylesheet"></link>')};
22
+ K("google.loader.writeLoadTag",google[z].d);google[z].Q=function(a){N=a};K("google.loader.rfm",google[z].Q);google[z].S=function(a){for(var b in a)"string"==typeof b&&b&&":"==b[q](0)&&!M[b]&&(M[b]=new T(b[A](1),a[b]))};K("google.loader.rpl",google[z].S);google[z].R=function(a){if((a=a.specs)&&a[w])for(var b=0;b<a[w];++b){var c=a[b];"string"==typeof c?M[":"+c]=new U(c):(c=new V(c[u],c.baseSpec,c.customSpecs),M[":"+c[u]]=c)}};K("google.loader.rm",google[z].R);google[z].loaded=function(a){M[":"+a.module].l(a)};
23
+ K("google.loader.loaded",google[z].loaded);google[z].O=function(){return"qid="+((new Date)[v]().toString(16)+Math.floor(1E7*Math.random()).toString(16))};K("google.loader.createGuidArg_",google[z].O);I("google_exportSymbol",I);I("google_exportProperty",J);google[z].a={};K("google.loader.themes",google[z].a);google[z].a.I="//www.google.com/cse/style/look/bubblegum.css";L(google[z].a,"BUBBLEGUM",google[z].a.I);google[z].a.K="//www.google.com/cse/style/look/greensky.css";L(google[z].a,"GREENSKY",google[z].a.K);
24
+ google[z].a.J="//www.google.com/cse/style/look/espresso.css";L(google[z].a,"ESPRESSO",google[z].a.J);google[z].a.M="//www.google.com/cse/style/look/shiny.css";L(google[z].a,"SHINY",google[z].a.M);google[z].a.L="//www.google.com/cse/style/look/minimalist.css";L(google[z].a,"MINIMALIST",google[z].a.L);google[z].a.N="//www.google.com/cse/style/look/v2/default.css";L(google[z].a,"V2_DEFAULT",google[z].a.N);function U(a){this.b=a;this.o=[];this.n={};this.e={};this.f={};this.j=!0;this.c=-1}
25
+ U[x].g=function(a,b){var c="";void 0!=b&&(void 0!=b.language&&(c+="&hl="+d(b.language)),void 0!=b.nocss&&(c+="&output="+d("nocss="+b.nocss)),void 0!=b.nooldnames&&(c+="&nooldnames="+d(b.nooldnames)),void 0!=b.packages&&(c+="&packages="+d(b.packages)),null!=b.callback&&(c+="&async=2"),void 0!=b.style&&(c+="&style="+d(b.style)),void 0!=b.noexp&&(c+="&noexp=true"),void 0!=b.other_params&&(c+="&"+b.other_params));if(!this.j){google[this.b]&&google[this.b].JSHash&&(c+="&sig="+d(google[this.b].JSHash));
26
+ var e=[],f;for(f in this.n)":"==f[q](0)&&e[m](f[A](1));for(f in this.e)":"==f[q](0)&&this.e[f]&&e[m](f[A](1));c+="&have="+d(e[B](","))}return google[z][t]+"/?file="+this.b+"&v="+a+google[z].AdditionalParams+c};U[x].t=function(a){var b=null;a&&(b=a.packages);var c=null;if(b)if("string"==typeof b)c=[a.packages];else if(b[w])for(c=[],a=0;a<b[w];a++)"string"==typeof b[a]&&c[m](b[a][n](/^\s*|\s*$/,"")[C]());c||(c=["default"]);b=[];for(a=0;a<c[w];a++)this.n[":"+c[a]]||b[m](c[a]);return b};
27
+ l(U[x],function(a,b){var c=this.t(b),e=b&&null!=b.callback;if(e)var f=new W(b.callback);for(var k=[],p=c[w]-1;0<=p;p--){var s=c[p];e&&f.B(s);if(this.e[":"+s])c.splice(p,1),e&&this.f[":"+s][m](f);else k[m](s)}if(c[w]){b&&b.packages&&(b.packages=c.sort()[B](","));for(p=0;p<k[w];p++)s=k[p],this.f[":"+s]=[],e&&this.f[":"+s][m](f);if(b||null==N[":"+this.b]||null==N[":"+this.b].versions[":"+a]||google[z].AdditionalParams||!this.j)b&&b.autoloaded||google[z].d("script",this.g(a,b),e);else{c=N[":"+this.b];
28
+ google[this.b]=google[this.b]||{};for(var R in c.properties)R&&":"==R[q](0)&&(google[this.b][R[A](1)]=c.properties[R]);google[z].d("script",google[z][t]+c.path+c.js,e);c.css&&google[z].d("css",google[z][t]+c.path+c.css,e)}this.j&&(this.j=!1,this.c=(new Date)[v](),1!=this.c%100&&(this.c=-1));for(p=0;p<k[w];p++)s=k[p],this.e[":"+s]=!0}});
29
+ U[x].l=function(a){-1!=this.c&&(X("al_"+this.b,"jl."+((new Date)[v]()-this.c),!0),this.c=-1);this.o=this.o.concat(a.components);google[z][this.b]||(google[z][this.b]={});google[z][this.b].packages=this.o.slice(0);for(var b=0;b<a.components[w];b++){this.n[":"+a.components[b]]=!0;this.e[":"+a.components[b]]=!1;var c=this.f[":"+a.components[b]];if(c){for(var e=0;e<c[w];e++)c[e].C(a.components[b]);delete this.f[":"+a.components[b]]}}};U[x].m=function(a,b){return 0==this.t(b)[w]};U[x].s=function(){return!0};
30
+ function W(a){this.F=a;this.q={};this.r=0}W[x].B=function(a){this.r++;this.q[":"+a]=!0};W[x].C=function(a){this.q[":"+a]&&(this.q[":"+a]=!1,this.r--,0==this.r&&g[y](this.F,0))};function V(a,b,c){this.name=a;this.D=b;this.p=c;this.u=this.h=!1;this.k=[];google[z].v[this[u]]=G(this.l,this)}F(V,U);l(V[x],function(a,b){var c=b&&null!=b.callback;c?(this.k[m](b.callback),b.callback="google.loader.callbacks."+this[u]):this.h=!0;b&&b.autoloaded||google[z].d("script",this.g(a,b),c)});V[x].m=function(a,b){return b&&null!=b.callback?this.u:this.h};V[x].l=function(){this.u=!0;for(var a=0;a<this.k[w];a++)g[y](this.k[a],0);this.k=[]};
31
+ var Y=function(a,b){return a.string?d(a.string)+"="+d(b):a.regex?b[n](/(^.*$)/,a.regex):""};V[x].g=function(a,b){return this.G(this.w(a),a,b)};
32
+ V[x].G=function(a,b,c){var e="";a.key&&(e+="&"+Y(a.key,google[z].ApiKey));a.version&&(e+="&"+Y(a.version,b));b=google[z].Secure&&a.ssl?a.ssl:a.uri;if(null!=c)for(var f in c)a.params[f]?e+="&"+Y(a.params[f],c[f]):"other_params"==f?e+="&"+c[f]:"base_domain"==f&&(b="http://"+c[f]+a.uri[A](a.uri[r]("/",7)));google[this[u]]={};-1==b[r]("?")&&e&&(e="?"+e[A](1));return b+e};V[x].s=function(a){return this.w(a).deferred};V[x].w=function(a){if(this.p)for(var b=0;b<this.p[w];++b){var c=this.p[b];if(RegExp(c.pattern).test(a))return c}return this.D};function T(a,b){this.b=a;this.i=b;this.h=!1}F(T,U);l(T[x],function(a,b){this.h=!0;google[z].d("script",this.g(a,b),!1)});T[x].m=function(){return this.h};T[x].l=function(){};T[x].g=function(a,b){if(!this.i.versions[":"+a]){if(this.i.aliases){var c=this.i.aliases[":"+a];c&&(a=c)}if(!this.i.versions[":"+a])throw H("Module: '"+this.b+"' with version '"+a+"' not found!");}return google[z].GoogleApisBase+"/libs/"+this.b+"/"+a+"/"+this.i.versions[":"+a][b&&b.uncompressed?"uncompressed":"compressed"]};
33
+ T[x].s=function(){return!1};var ca=!1,Z=[],da=(new Date)[v](),fa=function(){ca||(P(g,"unload",ea),ca=!0)},ga=function(a,b){fa();if(!(google[z].Secure||google[z].Options&&!1!==google[z].Options.csi)){for(var c=0;c<a[w];c++)a[c]=d(a[c][C]()[n](/[^a-z0-9_.]+/g,"_"));for(c=0;c<b[w];c++)b[c]=d(b[c][C]()[n](/[^a-z0-9_.]+/g,"_"));g[y](G($,null,"//gg.google.com/csi?s=uds&v=2&action="+a[B](",")+"&it="+b[B](",")),1E4)}},X=function(a,b,c){c?ga([a],[b]):(fa(),Z[m]("r"+Z[w]+"="+d(a+(b?"|"+b:""))),g[y](ea,5<Z[w]?0:15E3))},ea=function(){if(Z[w]){var a=
34
+ google[z][t];0==a[r]("http:")&&(a=a[n](/^http:/,"https:"));$(a+"/stats?"+Z[B]("&")+"&nc="+(new Date)[v]()+"_"+((new Date)[v]()-da));Z.length=0}},$=function(a){var b=new Image,c=$.H++;$.A[c]=b;b.onload=b.onerror=function(){delete $.A[c]};b.src=a;b=null};$.A={};$.H=0;I("google.loader.recordCsiStat",ga);I("google.loader.recordStat",X);I("google.loader.createImageForLogging",$);
35
+
36
+ }) ();google.loader.rm({"specs":["feeds","spreadsheets","gdata","visualization",{"name":"sharing","baseSpec":{"uri":"http://www.google.com/s2/sharing/js","ssl":null,"key":{"string":"key"},"version":{"string":"v"},"deferred":false,"params":{"language":{"string":"hl"}}}},"search","orkut","ads","elements",{"name":"books","baseSpec":{"uri":"http://books.google.com/books/api.js","ssl":"https://encrypted.google.com/books/api.js","key":{"string":"key"},"version":{"string":"v"},"deferred":true,"params":{"callback":{"string":"callback"},"language":{"string":"hl"}}}},{"name":"friendconnect","baseSpec":{"uri":"http://www.google.com/friendconnect/script/friendconnect.js","ssl":"https://www.google.com/friendconnect/script/friendconnect.js","key":{"string":"key"},"version":{"string":"v"},"deferred":false,"params":{}}},"identitytoolkit","ima",{"name":"maps","baseSpec":{"uri":"http://maps.google.com/maps?file\u003dgoogleapi","ssl":"https://maps-api-ssl.google.com/maps?file\u003dgoogleapi","key":{"string":"key"},"version":{"string":"v"},"deferred":true,"params":{"callback":{"regex":"callback\u003d$1\u0026async\u003d2"},"language":{"string":"hl"}}},"customSpecs":[{"uri":"http://maps.googleapis.com/maps/api/js","ssl":"https://maps.googleapis.com/maps/api/js","version":{"string":"v"},"deferred":true,"params":{"callback":{"string":"callback"},"language":{"string":"hl"}},"pattern":"^(3|3..*)$"}]},"payments","wave","annotations_v2","earth","language",{"name":"annotations","baseSpec":{"uri":"http://www.google.com/reviews/scripts/annotations_bootstrap.js","ssl":null,"key":{"string":"key"},"version":{"string":"v"},"deferred":true,"params":{"callback":{"string":"callback"},"language":{"string":"hl"},"country":{"string":"gl"}}}},"picker"]});
37
+ google.loader.rfm({":search":{"versions":{":1":"1",":1.0":"1"},"path":"/api/search/1.0/ee93f9aae9c9e9dba5eea831d506e69a/","js":"default+en.I.js","css":"default+en.css","properties":{":JSHash":"ee93f9aae9c9e9dba5eea831d506e69a",":NoOldNames":false,":Version":"1.0"}},":language":{"versions":{":1":"1",":1.0":"1"},"path":"/api/language/1.0/aa67524fe978e85d12a837b6f572142f/","js":"default+en.I.js","properties":{":JSHash":"aa67524fe978e85d12a837b6f572142f",":Version":"1.0"}},":feeds":{"versions":{":1":"1",":1.0":"1"},"path":"/api/feeds/1.0/482f2817cdf8982edf2e5669f9e3a627/","js":"default+en.I.js","css":"default+en.css","properties":{":JSHash":"482f2817cdf8982edf2e5669f9e3a627",":Version":"1.0"}},":spreadsheets":{"versions":{":0":"1",":0.4":"1"},"path":"/api/spreadsheets/0.4/87ff7219e9f8a8164006cbf28d5e911a/","js":"default.I.js","properties":{":JSHash":"87ff7219e9f8a8164006cbf28d5e911a",":Version":"0.4"}},":ima":{"versions":{":3":"1",":3.0":"1"},"path":"/api/ima/3.0/28a914332232c9a8ac0ae8da68b1006e/","js":"default.I.js","properties":{":JSHash":"28a914332232c9a8ac0ae8da68b1006e",":Version":"3.0"}},":wave":{"versions":{":1":"1",":1.0":"1"},"path":"/api/wave/1.0/3b6f7573ff78da6602dda5e09c9025bf/","js":"default.I.js","properties":{":JSHash":"3b6f7573ff78da6602dda5e09c9025bf",":Version":"1.0"}},":earth":{"versions":{":1":"1",":1.0":"1"},"path":"/api/earth/1.0/db22e5693e0a8de1f62f3536f5a8d7d3/","js":"default.I.js","properties":{":JSHash":"db22e5693e0a8de1f62f3536f5a8d7d3",":Version":"1.0"}},":annotations":{"versions":{":1":"1",":1.0":"1"},"path":"/api/annotations/1.0/bacce7b6155a1bbadda3c05d65391b22/","js":"default+en.I.js","properties":{":JSHash":"bacce7b6155a1bbadda3c05d65391b22",":Version":"1.0"}},":picker":{"versions":{":1":"1",":1.0":"1"},"path":"/api/picker/1.0/1c635e91b9d0c082c660a42091913907/","js":"default.I.js","css":"default.css","properties":{":JSHash":"1c635e91b9d0c082c660a42091913907",":Version":"1.0"}}});
38
+ google.loader.rpl({":scriptaculous":{"versions":{":1.8.3":{"uncompressed":"scriptaculous.js","compressed":"scriptaculous.js"},":1.9.0":{"uncompressed":"scriptaculous.js","compressed":"scriptaculous.js"},":1.8.2":{"uncompressed":"scriptaculous.js","compressed":"scriptaculous.js"},":1.8.1":{"uncompressed":"scriptaculous.js","compressed":"scriptaculous.js"}},"aliases":{":1.8":"1.8.3",":1":"1.9.0",":1.9":"1.9.0"}},":yui":{"versions":{":2.6.0":{"uncompressed":"build/yuiloader/yuiloader.js","compressed":"build/yuiloader/yuiloader-min.js"},":2.9.0":{"uncompressed":"build/yuiloader/yuiloader.js","compressed":"build/yuiloader/yuiloader-min.js"},":2.7.0":{"uncompressed":"build/yuiloader/yuiloader.js","compressed":"build/yuiloader/yuiloader-min.js"},":2.8.0r4":{"uncompressed":"build/yuiloader/yuiloader.js","compressed":"build/yuiloader/yuiloader-min.js"},":2.8.2r1":{"uncompressed":"build/yuiloader/yuiloader.js","compressed":"build/yuiloader/yuiloader-min.js"},":2.8.1":{"uncompressed":"build/yuiloader/yuiloader.js","compressed":"build/yuiloader/yuiloader-min.js"},":3.3.0":{"uncompressed":"build/yui/yui.js","compressed":"build/yui/yui-min.js"}},"aliases":{":3":"3.3.0",":2":"2.9.0",":2.7":"2.7.0",":2.8.2":"2.8.2r1",":2.6":"2.6.0",":2.9":"2.9.0",":2.8":"2.8.2r1",":2.8.0":"2.8.0r4",":3.3":"3.3.0"}},":swfobject":{"versions":{":2.1":{"uncompressed":"swfobject_src.js","compressed":"swfobject.js"},":2.2":{"uncompressed":"swfobject_src.js","compressed":"swfobject.js"}},"aliases":{":2":"2.2"}},":webfont":{"versions":{":1.0.28":{"uncompressed":"webfont_debug.js","compressed":"webfont.js"},":1.0.27":{"uncompressed":"webfont_debug.js","compressed":"webfont.js"},":1.0.29":{"uncompressed":"webfont_debug.js","compressed":"webfont.js"},":1.0.12":{"uncompressed":"webfont_debug.js","compressed":"webfont.js"},":1.0.13":{"uncompressed":"webfont_debug.js","compressed":"webfont.js"},":1.0.14":{"uncompressed":"webfont_debug.js","compressed":"webfont.js"},":1.0.15":{"uncompressed":"webfont_debug.js","compressed":"webfont.js"},":1.0.10":{"uncompressed":"webfont_debug.js","compressed":"webfont.js"},":1.0.11":{"uncompressed":"webfont_debug.js","compressed":"webfont.js"},":1.0.2":{"uncompressed":"webfont_debug.js","compressed":"webfont.js"},":1.0.1":{"uncompressed":"webfont_debug.js","compressed":"webfont.js"},":1.0.0":{"uncompressed":"webfont_debug.js","compressed":"webfont.js"},":1.0.6":{"uncompressed":"webfont_debug.js","compressed":"webfont.js"},":1.0.19":{"uncompressed":"webfont_debug.js","compressed":"webfont.js"},":1.0.5":{"uncompressed":"webfont_debug.js","compressed":"webfont.js"},":1.0.18":{"uncompressed":"webfont_debug.js","compressed":"webfont.js"},":1.0.4":{"uncompressed":"webfont_debug.js","compressed":"webfont.js"},":1.0.17":{"uncompressed":"webfont_debug.js","compressed":"webfont.js"},":1.0.3":{"uncompressed":"webfont_debug.js","compressed":"webfont.js"},":1.0.16":{"uncompressed":"webfont_debug.js","compressed":"webfont.js"},":1.0.9":{"uncompressed":"webfont_debug.js","compressed":"webfont.js"},":1.0.21":{"uncompressed":"webfont_debug.js","compressed":"webfont.js"},":1.0.22":{"uncompressed":"webfont_debug.js","compressed":"webfont.js"},":1.0.25":{"uncompressed":"webfont_debug.js","compressed":"webfont.js"},":1.0.26":{"uncompressed":"webfont_debug.js","compressed":"webfont.js"},":1.0.23":{"uncompressed":"webfont_debug.js","compressed":"webfont.js"},":1.0.24":{"uncompressed":"webfont_debug.js","compressed":"webfont.js"}},"aliases":{":1":"1.0.29",":1.0":"1.0.29"}},":ext-core":{"versions":{":3.1.0":{"uncompressed":"ext-core-debug.js","compressed":"ext-core.js"},":3.0.0":{"uncompressed":"ext-core-debug.js","compressed":"ext-core.js"}},"aliases":{":3":"3.1.0",":3.0":"3.0.0",":3.1":"3.1.0"}},":mootools":{"versions":{":1.3.1":{"uncompressed":"mootools.js","compressed":"mootools-yui-compressed.js"},":1.1.1":{"uncompressed":"mootools.js","compressed":"mootools-yui-compressed.js"},":1.3.0":{"uncompressed":"mootools.js","compressed":"mootools-yui-compressed.js"},":1.3.2":{"uncompressed":"mootools.js","compressed":"mootools-yui-compressed.js"},":1.1.2":{"uncompressed":"mootools.js","compressed":"mootools-yui-compressed.js"},":1.2.3":{"uncompressed":"mootools.js","compressed":"mootools-yui-compressed.js"},":1.2.4":{"uncompressed":"mootools.js","compressed":"mootools-yui-compressed.js"},":1.2.1":{"uncompressed":"mootools.js","compressed":"mootools-yui-compressed.js"},":1.2.2":{"uncompressed":"mootools.js","compressed":"mootools-yui-compressed.js"},":1.2.5":{"uncompressed":"mootools.js","compressed":"mootools-yui-compressed.js"},":1.4.0":{"uncompressed":"mootools.js","compressed":"mootools-yui-compressed.js"},":1.4.1":{"uncompressed":"mootools.js","compressed":"mootools-yui-compressed.js"},":1.4.2":{"uncompressed":"mootools.js","compressed":"mootools-yui-compressed.js"}},"aliases":{":1":"1.1.2",":1.11":"1.1.1",":1.4":"1.4.2",":1.3":"1.3.2",":1.2":"1.2.5",":1.1":"1.1.2"}},":jqueryui":{"versions":{":1.8.0":{"uncompressed":"jquery-ui.js","compressed":"jquery-ui.min.js"},":1.8.2":{"uncompressed":"jquery-ui.js","compressed":"jquery-ui.min.js"},":1.8.1":{"uncompressed":"jquery-ui.js","compressed":"jquery-ui.min.js"},":1.8.15":{"uncompressed":"jquery-ui.js","compressed":"jquery-ui.min.js"},":1.8.14":{"uncompressed":"jquery-ui.js","compressed":"jquery-ui.min.js"},":1.8.13":{"uncompressed":"jquery-ui.js","compressed":"jquery-ui.min.js"},":1.8.12":{"uncompressed":"jquery-ui.js","compressed":"jquery-ui.min.js"},":1.8.11":{"uncompressed":"jquery-ui.js","compressed":"jquery-ui.min.js"},":1.8.10":{"uncompressed":"jquery-ui.js","compressed":"jquery-ui.min.js"},":1.8.17":{"uncompressed":"jquery-ui.js","compressed":"jquery-ui.min.js"},":1.8.16":{"uncompressed":"jquery-ui.js","compressed":"jquery-ui.min.js"},":1.6.0":{"uncompressed":"jquery-ui.js","compressed":"jquery-ui.min.js"},":1.8.9":{"uncompressed":"jquery-ui.js","compressed":"jquery-ui.min.js"},":1.8.7":{"uncompressed":"jquery-ui.js","compressed":"jquery-ui.min.js"},":1.8.8":{"uncompressed":"jquery-ui.js","compressed":"jquery-ui.min.js"},":1.7.2":{"uncompressed":"jquery-ui.js","compressed":"jquery-ui.min.js"},":1.8.5":{"uncompressed":"jquery-ui.js","compressed":"jquery-ui.min.js"},":1.7.3":{"uncompressed":"jquery-ui.js","compressed":"jquery-ui.min.js"},":1.8.6":{"uncompressed":"jquery-ui.js","compressed":"jquery-ui.min.js"},":1.7.0":{"uncompressed":"jquery-ui.js","compressed":"jquery-ui.min.js"},":1.7.1":{"uncompressed":"jquery-ui.js","compressed":"jquery-ui.min.js"},":1.8.4":{"uncompressed":"jquery-ui.js","compressed":"jquery-ui.min.js"},":1.5.3":{"uncompressed":"jquery-ui.js","compressed":"jquery-ui.min.js"},":1.5.2":{"uncompressed":"jquery-ui.js","compressed":"jquery-ui.min.js"}},"aliases":{":1.8":"1.8.17",":1.7":"1.7.3",":1.6":"1.6.0",":1":"1.8.17",":1.5":"1.5.3",":1.8.3":"1.8.4"}},":chrome-frame":{"versions":{":1.0.2":{"uncompressed":"CFInstall.js","compressed":"CFInstall.min.js"},":1.0.1":{"uncompressed":"CFInstall.js","compressed":"CFInstall.min.js"},":1.0.0":{"uncompressed":"CFInstall.js","compressed":"CFInstall.min.js"}},"aliases":{":1":"1.0.2",":1.0":"1.0.2"}},":dojo":{"versions":{":1.3.1":{"uncompressed":"dojo/dojo.xd.js.uncompressed.js","compressed":"dojo/dojo.xd.js"},":1.3.0":{"uncompressed":"dojo/dojo.xd.js.uncompressed.js","compressed":"dojo/dojo.xd.js"},":1.6.1":{"uncompressed":"dojo/dojo.xd.js.uncompressed.js","compressed":"dojo/dojo.xd.js"},":1.1.1":{"uncompressed":"dojo/dojo.xd.js.uncompressed.js","compressed":"dojo/dojo.xd.js"},":1.3.2":{"uncompressed":"dojo/dojo.xd.js.uncompressed.js","compressed":"dojo/dojo.xd.js"},":1.6.0":{"uncompressed":"dojo/dojo.xd.js.uncompressed.js","compressed":"dojo/dojo.xd.js"},":1.2.3":{"uncompressed":"dojo/dojo.xd.js.uncompressed.js","compressed":"dojo/dojo.xd.js"},":1.7.2":{"uncompressed":"dojo/dojo.js.uncompressed.js","compressed":"dojo/dojo.js"},":1.7.0":{"uncompressed":"dojo/dojo.js.uncompressed.js","compressed":"dojo/dojo.js"},":1.7.1":{"uncompressed":"dojo/dojo.js.uncompressed.js","compressed":"dojo/dojo.js"},":1.4.3":{"uncompressed":"dojo/dojo.xd.js.uncompressed.js","compressed":"dojo/dojo.xd.js"},":1.5.1":{"uncompressed":"dojo/dojo.xd.js.uncompressed.js","compressed":"dojo/dojo.xd.js"},":1.5.0":{"uncompressed":"dojo/dojo.xd.js.uncompressed.js","compressed":"dojo/dojo.xd.js"},":1.2.0":{"uncompressed":"dojo/dojo.xd.js.uncompressed.js","compressed":"dojo/dojo.xd.js"},":1.4.0":{"uncompressed":"dojo/dojo.xd.js.uncompressed.js","compressed":"dojo/dojo.xd.js"},":1.4.1":{"uncompressed":"dojo/dojo.xd.js.uncompressed.js","compressed":"dojo/dojo.xd.js"}},"aliases":{":1.7":"1.7.2",":1":"1.6.1",":1.6":"1.6.1",":1.5":"1.5.1",":1.4":"1.4.3",":1.3":"1.3.2",":1.2":"1.2.3",":1.1":"1.1.1"}},":jquery":{"versions":{":1.6.2":{"uncompressed":"jquery.js","compressed":"jquery.min.js"},":1.3.1":{"uncompressed":"jquery.js","compressed":"jquery.min.js"},":1.6.1":{"uncompressed":"jquery.js","compressed":"jquery.min.js"},":1.3.0":{"uncompressed":"jquery.js","compressed":"jquery.min.js"},":1.6.4":{"uncompressed":"jquery.js","compressed":"jquery.min.js"},":1.6.3":{"uncompressed":"jquery.js","compressed":"jquery.min.js"},":1.3.2":{"uncompressed":"jquery.js","compressed":"jquery.min.js"},":1.6.0":{"uncompressed":"jquery.js","compressed":"jquery.min.js"},":1.2.3":{"uncompressed":"jquery.js","compressed":"jquery.min.js"},":1.7.0":{"uncompressed":"jquery.js","compressed":"jquery.min.js"},":1.7.1":{"uncompressed":"jquery.js","compressed":"jquery.min.js"},":1.2.6":{"uncompressed":"jquery.js","compressed":"jquery.min.js"},":1.4.3":{"uncompressed":"jquery.js","compressed":"jquery.min.js"},":1.4.4":{"uncompressed":"jquery.js","compressed":"jquery.min.js"},":1.5.1":{"uncompressed":"jquery.js","compressed":"jquery.min.js"},":1.5.0":{"uncompressed":"jquery.js","compressed":"jquery.min.js"},":1.4.0":{"uncompressed":"jquery.js","compressed":"jquery.min.js"},":1.5.2":{"uncompressed":"jquery.js","compressed":"jquery.min.js"},":1.4.1":{"uncompressed":"jquery.js","compressed":"jquery.min.js"},":1.4.2":{"uncompressed":"jquery.js","compressed":"jquery.min.js"}},"aliases":{":1.7":"1.7.1",":1.6":"1.6.4",":1":"1.7.1",":1.5":"1.5.2",":1.4":"1.4.4",":1.3":"1.3.2",":1.2":"1.2.6"}},":prototype":{"versions":{":1.7.0.0":{"uncompressed":"prototype.js","compressed":"prototype.js"},":1.6.0.2":{"uncompressed":"prototype.js","compressed":"prototype.js"},":1.6.1.0":{"uncompressed":"prototype.js","compressed":"prototype.js"},":1.6.0.3":{"uncompressed":"prototype.js","compressed":"prototype.js"}},"aliases":{":1.7":"1.7.0.0",":1.6.1":"1.6.1.0",":1":"1.7.0.0",":1.6":"1.6.1.0",":1.7.0":"1.7.0.0",":1.6.0":"1.6.0.3"}}});
39
+ }
package.xml ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <package>
3
+ <name>survey-engine</name>
4
+ <version>0.0.1</version>
5
+ <stability>stable</stability>
6
+ <license uri="http://www.opensource.org/licenses/osl-3.0.php">Extension license name (OSL v3.0)</license>
7
+ <channel>community</channel>
8
+ <extends/>
9
+ <summary>Rainconcert Customer Feedback Kit</summary>
10
+ <description>Rainconcert Customer Feedback Kit for Ecommerce Stores</description>
11
+ <notes>Rainconcert Customer Feedback Kit</notes>
12
+ <authors><author><name>Jason Koshy</name><user>jasonkoshy</user><email>jason@rainconcert.in</email></author></authors>
13
+ <date>2014-05-22</date>
14
+ <time>10:16:21</time>
15
+ <contents><target name="magecommunity"><dir name="Rainconcert"><dir name="SurveyManager"><dir name="Block"><dir name="Adminhtml"><dir name="Questions"><dir name="Edit"><file name="Form.php" hash="f331e7b9504d51cc657498d527506b01"/><dir name="Tab"><file name="Answers.php" hash="4e3cfc291e1abed28acc95b1c7ab8bcc"/><file name="Form.php" hash="7f4f64e1d36772066ceeb005bc10935d"/></dir><file name="Tabs.php" hash="7ec4d6fa312b1f17b30f9eea7032b9ed"/></dir><file name="Edit.php" hash="09207a742bddc9a9d0ccdcc0b6bc71c0"/><file name="Grid.php" hash="be47704f2fc4711e1ef375d0baf3df6f"/><file name="Manage.php" hash="bc2085d3350374db68011275b9f75a17"/></dir><dir name="Survey"><dir name="Edit"><file name="Form.php" hash="f04d0b730b3f50eee0d83c22baecdfcd"/><dir name="Tab"><file name="Form.php" hash="b9dac56eea183ee4b435547e82379c5c"/><file name="Managesurvey.php" hash="af7ae7643998a26e300001f62c32da01"/><file name="Reports.php" hash="0857c460d7b6c63ac779448f714494d9"/></dir><file name="Tabs.php" hash="a28f98f83cf89170274495624338baf0"/></dir><file name="Edit.php" hash="2453c130e9b25c781529fadf3001b235"/><file name="Grid.php" hash="d6d319cc2c0265f2cd6c3a9a24519459"/><file name="Manage.php" hash="cf61592ae246665399048147f545e959"/></dir></dir><file name="Customeropinion.php" hash="b6363a0307bfa3cb6f3a8a2eee14cf39"/></dir><dir name="Helper"><file name="Data.php" hash="c777b22e6eff85dbc0bc8d309b2c9e0f"/></dir><dir name="Model"><dir name="Mysql4"><dir name="Survey"><file name="Collection.php" hash="cca9c0f08a8629dfdda8b2a565a470e7"/></dir><file name="Survey.php" hash="6812c2aad1ad7a681a5bfe6f4761e2c5"/><dir name="Surveyanswer"><file name="Collection.php" hash="525bf77650445cf2ec4f13886fdf6bec"/></dir><file name="Surveyanswer.php" hash="c0efef6d331e216712e754d51aeead3d"/><dir name="Surveyqnrelation"><file name="Collection.php" hash="88b3df79b9ec3a41b87698596f39800f"/></dir><file name="Surveyqnrelation.php" hash="e922d0517aae1db62e3afd4ffd499ece"/><dir name="Surveyquestions"><file name="Collection.php" hash="e4f055e8b20d130e1c2dbb11df2e6703"/></dir><file name="Surveyquestions.php" hash="e1df2bfc9aba7fc541cc6cfeb55c4c58"/><dir name="Surveyresults"><file name="Collection.php" hash="27dd5be5674830ab94797c2d74a77b50"/></dir><file name="Surveyresults.php" hash="a9e04a4233cd4cb79effbb380338253f"/><dir name="Surveyresultvalue"><file name="Collection.php" hash="b40d5712fb9ff5ac825317dd66de5ab3"/></dir><file name="Surveyresultvalue.php" hash="af81e5432cac8900a61d63bbac5348b7"/></dir><file name="Observer.php" hash="877e820ac737c84899b97319947c5006"/><file name="Survey.php" hash="13a916dfbf1c10be2399023cebdecb9c"/><file name="Surveyanswer.php" hash="752c41350d539ca18c8f90018f1b48cd"/><file name="Surveyqnrelation.php" hash="b647e0196a73d03b13b208d2fbd97178"/><file name="Surveyquestions.php" hash="f3b1065f1dc57e64faf2bc725b2aa39c"/><file name="Surveyresults.php" hash="c29305d512c96d9a2b6b90fb58df47e7"/><file name="Surveyresultvalue.php" hash="ea9778043b93c791d7edfbaa103d6696"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="IndexController.php" hash="3c948c69d20ea4b6024113f430a2a51c"/></dir><file name="IndexController.php" hash="a58cf53b94b688d04ff97b3ffd5a74a9"/></dir><dir name="etc"><file name="config.xml" hash="a97e77d392f7d31d641e5db1b41ce428"/><file name="system.xml" hash="7587fb78e6818a4f13a7ccf0e5d69581"/></dir><dir name="sql"><dir name="surveymanager_setup"><file name="mysql4-install-0.1.0.php" hash="3ca54a236ad70d0a2082e6afc4dc7979"/><file name="mysql4-upgrade-0.1.0-0.1.1.php" hash="8a43cd19123f3bcb72b0cbaa7114aea6"/><file name="mysql4-upgrade-0.1.1-0.1.2.php" hash="d3ba8395fbcf43d00857c239a849f183"/><file name="mysql4-upgrade-0.1.2-0.1.3.php" hash="72c3b473365359b289e02b578d17ee95"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="surveymanager.xml" hash="2f33dcc42bfeaf14db5605085e7fd07e"/></dir><dir name="template"><dir name="surveymanager"><file name="answers.phtml" hash="80bf2fd94a39f56052c19c9fede36c0f"/><file name="managesurvey.phtml" hash="05fd389231addf62893cfddf685cbfe5"/><file name="results.phtml" hash="8091ebdadc6cce755a15282b01eaed30"/></dir></dir></dir></dir></dir><dir name="frontend"><dir name="default"><dir name="default"><dir name="layout"><file name="surveymanager.xml" hash="195f9f0d99af60aff6a120c131d2527a"/></dir><dir name="template"><dir name="surveymanager"><file name="survey_layout.phtml" hash="0bd0192f142b5f988ea20e0d564179cb"/></dir></dir></dir></dir></dir></target><target name="mageweb"><dir name="js"><dir name="surveymanager"><file name="jsapi" hash="2a829db0a55ef89a37831a09e2883298"/></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Rainconcert_SurveyManager.xml" hash="330b8497a69cb21f10c9932fe253e0db"/></dir></target></contents>
16
+ <compatible/>
17
+ <dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php><package><name>Mage_Core_Modules</name><channel>Community</channel><min>1.6.0.0</min><max>1.8</max></package></required></dependencies>
18
+ </package>