Version Notes
Stable Version
Download this release
Release Info
Developer | SSTech |
Extension | SSTech_Enquiry |
Version | 0.1.0 |
Comparing to | |
See all releases |
Version 0.1.0
- app/code/community/SSTech/Enquiry/Block/Adminhtml/Enquiry.php +14 -0
- app/code/community/SSTech/Enquiry/Block/Adminhtml/Enquiry/Edit.php +28 -0
- app/code/community/SSTech/Enquiry/Block/Adminhtml/Enquiry/Edit/Form.php +17 -0
- app/code/community/SSTech/Enquiry/Block/Adminhtml/Enquiry/Edit/Tab/Form.php +9 -0
- app/code/community/SSTech/Enquiry/Block/Adminhtml/Enquiry/Edit/Tabs.php +21 -0
- app/code/community/SSTech/Enquiry/Block/Adminhtml/Enquiry/Grid.php +105 -0
- app/code/community/SSTech/Enquiry/Block/Adminhtml/Enquirybackend.php +13 -0
- app/code/community/SSTech/Enquiry/Block/Enquiry.php +37 -0
- app/code/community/SSTech/Enquiry/Block/Index.php +3 -0
- app/code/community/SSTech/Enquiry/Helper/Data.php +5 -0
- app/code/community/SSTech/Enquiry/Model/Enquiry.php +12 -0
- app/code/community/SSTech/Enquiry/Model/Mysql4/Enquiry.php +8 -0
- app/code/community/SSTech/Enquiry/Model/Mysql4/Enquiry/Collection.php +9 -0
- app/code/community/SSTech/Enquiry/controllers/Adminhtml/EnquiryController.php +203 -0
- app/code/community/SSTech/Enquiry/controllers/Adminhtml/EnquirybackendController.php +10 -0
- app/code/community/SSTech/Enquiry/controllers/Adminhtml/Rss/RssController.php +25 -0
- app/code/community/SSTech/Enquiry/controllers/EnquiryController.php +42 -0
- app/code/community/SSTech/Enquiry/controllers/IndexController.php +22 -0
- app/code/community/SSTech/Enquiry/etc/adminhtml.xml +23 -0
- app/code/community/SSTech/Enquiry/etc/config.xml +163 -0
- app/code/community/SSTech/Enquiry/etc/system.xml +60 -0
- app/code/community/SSTech/Enquiry/sql/enquiry_setup/mysql4-install-0.1.0.php +24 -0
- app/design/adminhtml/default/default/layout/enquiry.xml +13 -0
- app/design/adminhtml/default/default/template/enquiry/information.phtml +86 -0
- app/design/frontend/base/default/layout/enquiry.xml +31 -0
- app/design/frontend/base/default/template/enquiry/enquiry.phtml +48 -0
- app/design/frontend/base/default/template/enquiry/index.phtml +1 -0
- app/etc/modules/SSTech_Enquiry.xml +10 -0
- app/locale/en_US/template/email/comment_template.html +13 -0
- package.xml +18 -0
app/code/community/SSTech/Enquiry/Block/Adminhtml/Enquiry.php
ADDED
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class SSTech_Enquiry_Block_Adminhtml_Enquiry extends Mage_Adminhtml_Block_Widget_Grid_Container{
|
3 |
+
|
4 |
+
public function __construct()
|
5 |
+
{
|
6 |
+
$this->_controller = "adminhtml_enquiry";
|
7 |
+
$this->_blockGroup = "enquiry";
|
8 |
+
$this->_headerText = Mage::helper("enquiry")->__("Quick Enquiry Manage");
|
9 |
+
parent::__construct();
|
10 |
+
$this->_removeButton('add');
|
11 |
+
|
12 |
+
}
|
13 |
+
|
14 |
+
}
|
app/code/community/SSTech/Enquiry/Block/Adminhtml/Enquiry/Edit.php
ADDED
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class SSTech_Enquiry_Block_Adminhtml_Enquiry_Edit extends Mage_Adminhtml_Block_Widget_Form_Container
|
3 |
+
{
|
4 |
+
public function __construct()
|
5 |
+
{
|
6 |
+
parent::__construct();
|
7 |
+
$this->_objectId = "enquiry_id";
|
8 |
+
$this->_blockGroup = "enquiry";
|
9 |
+
$this->_controller = "adminhtml_enquiry";
|
10 |
+
$this->_updateButton("save", "label", Mage::helper("enquiry")->__("Reply To Message"));
|
11 |
+
$this->_updateButton("delete", "label", Mage::helper("enquiry")->__("Delete Enquiry"));
|
12 |
+
$this->_removeButton('reset');
|
13 |
+
}
|
14 |
+
|
15 |
+
public function getHeaderText()
|
16 |
+
{
|
17 |
+
if( Mage::registry("enquiry_data") && Mage::registry("enquiry_data")->getId() ){
|
18 |
+
|
19 |
+
return Mage::helper("enquiry")->__("View Enquiry", $this->htmlEscape(Mage::registry("enquiry_data")->getId()));
|
20 |
+
|
21 |
+
}
|
22 |
+
else{
|
23 |
+
|
24 |
+
return Mage::helper("enquiry")->__("Add");
|
25 |
+
|
26 |
+
}
|
27 |
+
}
|
28 |
+
}
|
app/code/community/SSTech/Enquiry/Block/Adminhtml/Enquiry/Edit/Form.php
ADDED
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class SSTech_Enquiry_Block_Adminhtml_Enquiry_Edit_Form extends Mage_Adminhtml_Block_Widget_Form
|
3 |
+
{
|
4 |
+
protected function _prepareForm()
|
5 |
+
{
|
6 |
+
$form = new Varien_Data_Form(array(
|
7 |
+
"id" => "edit_form",
|
8 |
+
"action" => $this->getUrl("*/*/save", array("id" => $this->getRequest()->getParam("id"))),
|
9 |
+
"method" => "post",
|
10 |
+
"enctype" =>"multipart/form-data",
|
11 |
+
)
|
12 |
+
);
|
13 |
+
$form->setUseContainer(true);
|
14 |
+
$this->setForm($form);
|
15 |
+
return parent::_prepareForm();
|
16 |
+
}
|
17 |
+
}
|
app/code/community/SSTech/Enquiry/Block/Adminhtml/Enquiry/Edit/Tab/Form.php
ADDED
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class SSTech_Enquiry_Block_Adminhtml_Enquiry_Edit_Tab_Form extends Mage_Adminhtml_Block_Widget_Form
|
3 |
+
{
|
4 |
+
protected function _prepareLayout() {
|
5 |
+
parent::_prepareLayout();
|
6 |
+
$this->setTemplate('enquiry/information.phtml');
|
7 |
+
}
|
8 |
+
|
9 |
+
}
|
app/code/community/SSTech/Enquiry/Block/Adminhtml/Enquiry/Edit/Tabs.php
ADDED
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class SSTech_Enquiry_Block_Adminhtml_Enquiry_Edit_Tabs extends Mage_Adminhtml_Block_Widget_Tabs
|
3 |
+
{
|
4 |
+
public function __construct()
|
5 |
+
{
|
6 |
+
parent::__construct();
|
7 |
+
$this->setId("enquiry_tabs");
|
8 |
+
$this->setDestElementId("edit_form");
|
9 |
+
$this->setTitle(Mage::helper("enquiry")->__("Enquiry Information"));
|
10 |
+
}
|
11 |
+
protected function _beforeToHtml()
|
12 |
+
{
|
13 |
+
$this->addTab("form_section", array(
|
14 |
+
"label" => Mage::helper("enquiry")->__("Enquiry Information"),
|
15 |
+
"title" => Mage::helper("enquiry")->__("Enquiry Information"),
|
16 |
+
"content" => $this->getLayout()->createBlock("enquiry/adminhtml_enquiry_edit_tab_form")->toHtml(),
|
17 |
+
));
|
18 |
+
return parent::_beforeToHtml();
|
19 |
+
}
|
20 |
+
|
21 |
+
}
|
app/code/community/SSTech/Enquiry/Block/Adminhtml/Enquiry/Grid.php
ADDED
@@ -0,0 +1,105 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class SSTech_Enquiry_Block_Adminhtml_Enquiry_Grid extends Mage_Adminhtml_Block_Widget_Grid
|
3 |
+
{
|
4 |
+
public function __construct()
|
5 |
+
{
|
6 |
+
parent::__construct();
|
7 |
+
$this->setId("enquiryGrid");
|
8 |
+
$this->setDefaultSort("enquiry_id");
|
9 |
+
$this->setDefaultDir("ASC");
|
10 |
+
$this->setSaveParametersInSession(true);
|
11 |
+
}
|
12 |
+
|
13 |
+
protected function _prepareCollection()
|
14 |
+
{
|
15 |
+
$collection = Mage::getModel("enquiry/enquiry")
|
16 |
+
->getCollection();
|
17 |
+
$this->setCollection($collection);
|
18 |
+
return parent::_prepareCollection();
|
19 |
+
}
|
20 |
+
protected function _prepareColumns()
|
21 |
+
{
|
22 |
+
$this->addColumn("enquiry_id", array(
|
23 |
+
"header" => Mage::helper("enquiry")->__("ID"),
|
24 |
+
"align" =>"right",
|
25 |
+
"width" => "50px",
|
26 |
+
"type" => "number",
|
27 |
+
"index" => "enquiry_id",
|
28 |
+
));
|
29 |
+
|
30 |
+
$this->addColumn("created_date", array(
|
31 |
+
"header" => Mage::helper("enquiry")->__("Date Added"),
|
32 |
+
"index" => "created_date",
|
33 |
+
));
|
34 |
+
$this->addColumn("comment", array(
|
35 |
+
"header" => Mage::helper("enquiry")->__("Comment"),
|
36 |
+
"index" => "comment",
|
37 |
+
));
|
38 |
+
$this->addColumn('status_id', array(
|
39 |
+
'header' => Mage::helper('enquiry')->__('Status'),
|
40 |
+
'index' => 'status_id',
|
41 |
+
'type' => 'options',
|
42 |
+
'options'=>SSTech_Enquiry_Block_Adminhtml_Enquiry_Grid::getOptionArray2(),
|
43 |
+
));
|
44 |
+
|
45 |
+
$this->addColumn('action',
|
46 |
+
array(
|
47 |
+
'header' => Mage::helper('enquiry')->__('Action'),
|
48 |
+
'width' => '100',
|
49 |
+
'type' => 'action',
|
50 |
+
'getter' => 'getId',
|
51 |
+
'actions' => array(
|
52 |
+
array(
|
53 |
+
'caption' => Mage::helper('enquiry')->__('View'),
|
54 |
+
'url' => array('base'=> '*/*/edit'),
|
55 |
+
'field' => 'id'
|
56 |
+
)
|
57 |
+
),
|
58 |
+
'filter' => false,
|
59 |
+
'sortable' => false,
|
60 |
+
'index' => 'stores',
|
61 |
+
'is_system' => true,
|
62 |
+
));
|
63 |
+
|
64 |
+
$this->addRssList('enquiry/adminhtml_rss_rss/enquiry', Mage::helper('enquiry')->__('RSS'));
|
65 |
+
$this->addExportType('*/*/exportCsv', Mage::helper('sales')->__('CSV'));
|
66 |
+
$this->addExportType('*/*/exportExcel', Mage::helper('sales')->__('Excel'));
|
67 |
+
|
68 |
+
return parent::_prepareColumns();
|
69 |
+
}
|
70 |
+
|
71 |
+
public function getRowUrl($row)
|
72 |
+
{
|
73 |
+
return $this->getUrl("*/*/edit", array("id" => $row->getId()));
|
74 |
+
}
|
75 |
+
|
76 |
+
protected function _prepareMassaction()
|
77 |
+
{
|
78 |
+
$this->setMassactionIdField('enquiry_id');
|
79 |
+
$this->getMassactionBlock()->setFormFieldName('enquiry_ids');
|
80 |
+
$this->getMassactionBlock()->setUseSelectAll(true);
|
81 |
+
$this->getMassactionBlock()->addItem('remove_enquiry', array(
|
82 |
+
'label'=> Mage::helper('enquiry')->__('Remove Enquiry'),
|
83 |
+
'url' => $this->getUrl('*/adminhtml_enquiry/massRemove'),
|
84 |
+
'confirm' => Mage::helper('enquiry')->__('Are you sure?')
|
85 |
+
));
|
86 |
+
return $this;
|
87 |
+
}
|
88 |
+
|
89 |
+
static public function getOptionArray2()
|
90 |
+
{
|
91 |
+
$data_array=array();
|
92 |
+
$data_array[0]='Not Replied';
|
93 |
+
$data_array[1]='Replied';
|
94 |
+
return($data_array);
|
95 |
+
}
|
96 |
+
static public function getValueArray2()
|
97 |
+
{
|
98 |
+
$data_array=array();
|
99 |
+
foreach(SSTech_Enquiry_Block_Adminhtml_Enquiry_Grid::getOptionArray2() as $k=>$v){
|
100 |
+
$data_array[]=array('value'=>$k,'label'=>$v);
|
101 |
+
}
|
102 |
+
return($data_array);
|
103 |
+
|
104 |
+
}
|
105 |
+
}
|
app/code/community/SSTech/Enquiry/Block/Adminhtml/Enquirybackend.php
ADDED
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class SSTech_Enquiry_Block_Adminhtml_Enquirybackend extends Mage_Adminhtml_Block_Template {
|
3 |
+
public function __construct()
|
4 |
+
{
|
5 |
+
|
6 |
+
$this->_controller = "adminhtml_enquiry";
|
7 |
+
$this->_blockGroup = "enquiry";
|
8 |
+
$this->_headerText = Mage::helper("enquiry")->__("Quick Enquiry Manage");
|
9 |
+
parent::__construct();
|
10 |
+
$this->_removeButton('add');
|
11 |
+
|
12 |
+
}
|
13 |
+
}
|
app/code/community/SSTech/Enquiry/Block/Enquiry.php
ADDED
@@ -0,0 +1,37 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class SSTech_Enquiry_Block_Enquiry extends Mage_Core_Block_Template{
|
3 |
+
public function __construct()
|
4 |
+
{
|
5 |
+
parent::__construct();
|
6 |
+
$datasets=Mage::getModel('enquiry/enquiry')->getCollection();
|
7 |
+
$this->setDatasets($datasets);
|
8 |
+
}
|
9 |
+
protected function _prepareLayout()
|
10 |
+
{
|
11 |
+
parent::_prepareLayout();
|
12 |
+
$pager = $this->getLayout()->createBlock('page/html_pager')->setCollection($this->getDatasets());
|
13 |
+
$this->setChild('pager', $pager);
|
14 |
+
$this->getDatasets()->load();
|
15 |
+
return $this;
|
16 |
+
}
|
17 |
+
public function addToTopLink() {
|
18 |
+
|
19 |
+
$topBlock = $this->getParentBlock();
|
20 |
+
if($topBlock)
|
21 |
+
{
|
22 |
+
$topBlock->addLink($this->__('Enquiry'),'enquiry',
|
23 |
+
'enquirysystem',true,array(),10);
|
24 |
+
}
|
25 |
+
}
|
26 |
+
|
27 |
+
public function getPagerHtml()
|
28 |
+
{
|
29 |
+
return $this->getChildHtml('pager');
|
30 |
+
}
|
31 |
+
|
32 |
+
public function getEnquiryActionUrl()
|
33 |
+
{
|
34 |
+
return Mage::getUrl('enquiry/enquiry/enquiry');
|
35 |
+
}
|
36 |
+
|
37 |
+
}
|
app/code/community/SSTech/Enquiry/Block/Index.php
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class SSTech_Enquiry_Block_Index extends Mage_Core_Block_Template{
|
3 |
+
}
|
app/code/community/SSTech/Enquiry/Helper/Data.php
ADDED
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class SSTech_Enquiry_Helper_Data extends Mage_Core_Helper_Abstract
|
3 |
+
{
|
4 |
+
}
|
5 |
+
|
app/code/community/SSTech/Enquiry/Model/Enquiry.php
ADDED
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class SSTech_Enquiry_Model_Enquiry extends Mage_Core_Model_Abstract
|
4 |
+
{
|
5 |
+
protected function _construct(){
|
6 |
+
|
7 |
+
$this->_init("enquiry/enquiry");
|
8 |
+
|
9 |
+
}
|
10 |
+
|
11 |
+
}
|
12 |
+
|
app/code/community/SSTech/Enquiry/Model/Mysql4/Enquiry.php
ADDED
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class SSTech_Enquiry_Model_Mysql4_Enquiry extends Mage_Core_Model_Mysql4_Abstract
|
3 |
+
{
|
4 |
+
protected function _construct()
|
5 |
+
{
|
6 |
+
$this->_init("enquiry/enquiry", "enquiry_id");
|
7 |
+
}
|
8 |
+
}
|
app/code/community/SSTech/Enquiry/Model/Mysql4/Enquiry/Collection.php
ADDED
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class SSTech_Enquiry_Model_Mysql4_Enquiry_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
|
3 |
+
{
|
4 |
+
public function _construct(){
|
5 |
+
$this->_init("enquiry/enquiry");
|
6 |
+
}
|
7 |
+
|
8 |
+
}
|
9 |
+
|
app/code/community/SSTech/Enquiry/controllers/Adminhtml/EnquiryController.php
ADDED
@@ -0,0 +1,203 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class SSTech_Enquiry_Adminhtml_EnquiryController extends Mage_Adminhtml_Controller_Action
|
3 |
+
{
|
4 |
+
protected function _initAction()
|
5 |
+
{
|
6 |
+
$this->loadLayout()->_setActiveMenu("enquiry/enquiry")->_addBreadcrumb(Mage::helper("adminhtml")->__("Quick Enquiry Manage"),Mage::helper("adminhtml")->__("Quick Enquiry Manage"));
|
7 |
+
return $this;
|
8 |
+
}
|
9 |
+
public function indexAction()
|
10 |
+
{
|
11 |
+
$this->_title($this->__("Quick Enquiry"));
|
12 |
+
$this->_title($this->__("Quick Enquiry Manage"));
|
13 |
+
|
14 |
+
$this->_initAction();
|
15 |
+
$this->renderLayout();
|
16 |
+
}
|
17 |
+
public function editAction()
|
18 |
+
{
|
19 |
+
$this->_title($this->__("Enquiry"));
|
20 |
+
$this->_title($this->__("Enquiry"));
|
21 |
+
$this->_title($this->__("Edit Item"));
|
22 |
+
|
23 |
+
$id = $this->getRequest()->getParam("id");
|
24 |
+
$model = Mage::getModel("enquiry/enquiry")->load($id);
|
25 |
+
if ($model->getId()) {
|
26 |
+
Mage::register("enquiry_data", $model);
|
27 |
+
$this->loadLayout();
|
28 |
+
$this->_setActiveMenu("enquiry/enquiry");
|
29 |
+
$this->_addBreadcrumb(Mage::helper("adminhtml")->__("Enquiry Manager"), Mage::helper("adminhtml")->__("Quick Enquiry Manage"));
|
30 |
+
$this->_addBreadcrumb(Mage::helper("adminhtml")->__("Enquiry Description"), Mage::helper("adminhtml")->__("Enquiry Description"));
|
31 |
+
$this->getLayout()->getBlock("head")->setCanLoadExtJs(true);
|
32 |
+
$this->_addContent($this->getLayout()->createBlock("enquiry/adminhtml_enquiry_edit"))->_addLeft($this->getLayout()->createBlock("enquiry/adminhtml_enquiry_edit_tabs"));
|
33 |
+
$this->renderLayout();
|
34 |
+
}
|
35 |
+
else {
|
36 |
+
Mage::getSingleton("adminhtml/session")->addError(Mage::helper("enquiry")->__("Item does not exist."));
|
37 |
+
$this->_redirect("*/*/");
|
38 |
+
}
|
39 |
+
}
|
40 |
+
|
41 |
+
public function newAction()
|
42 |
+
{
|
43 |
+
|
44 |
+
$this->_title($this->__("Enquiry"));
|
45 |
+
$this->_title($this->__("Enquiry"));
|
46 |
+
$this->_title($this->__("New Item"));
|
47 |
+
|
48 |
+
$id = $this->getRequest()->getParam("id");
|
49 |
+
$model = Mage::getModel("enquiry/enquiry")->load($id);
|
50 |
+
|
51 |
+
$data = Mage::getSingleton("adminhtml/session")->getFormData(true);
|
52 |
+
if (!empty($data)) {
|
53 |
+
$model->setData($data);
|
54 |
+
}
|
55 |
+
|
56 |
+
Mage::register("enquiry_data", $model);
|
57 |
+
|
58 |
+
$this->loadLayout();
|
59 |
+
$this->_setActiveMenu("enquiry/enquiry");
|
60 |
+
|
61 |
+
$this->getLayout()->getBlock("head")->setCanLoadExtJs(true);
|
62 |
+
|
63 |
+
$this->_addBreadcrumb(Mage::helper("adminhtml")->__("Enquiry Manager"), Mage::helper("adminhtml")->__("Quick Enquiry Manage"));
|
64 |
+
$this->_addBreadcrumb(Mage::helper("adminhtml")->__("Enquiry Description"), Mage::helper("adminhtml")->__("Enquiry Description"));
|
65 |
+
|
66 |
+
|
67 |
+
$this->_addContent($this->getLayout()->createBlock("enquiry/adminhtml_enquiry_edit"))->_addLeft($this->getLayout()->createBlock("enquiry/adminhtml_enquiry_edit_tabs"));
|
68 |
+
|
69 |
+
$this->renderLayout();
|
70 |
+
|
71 |
+
}
|
72 |
+
public function saveAction()
|
73 |
+
{
|
74 |
+
|
75 |
+
$post_data=$this->getRequest()->getPost();
|
76 |
+
$username=Mage::getStoreConfig('enquiries/settings/sendername');
|
77 |
+
$senderemail=Mage::getStoreConfig('enquiries/settings/senderemail');
|
78 |
+
|
79 |
+
if ($this->getRequest()->getParam("reply_message") && $username && $senderemail) {
|
80 |
+
|
81 |
+
try {
|
82 |
+
$model = Mage::getModel("enquiry/enquiry")
|
83 |
+
->addData($post_data)
|
84 |
+
->setId($this->getRequest()->getParam("id"))
|
85 |
+
->setStatusId(1)
|
86 |
+
->save();
|
87 |
+
|
88 |
+
Mage::getSingleton("adminhtml/session")->addSuccess(Mage::helper("adminhtml")->__("Enquiry was successfully saved"));
|
89 |
+
Mage::getSingleton("adminhtml/session")->setEnquiryData(false);
|
90 |
+
|
91 |
+
if ($this->getRequest()->getParam("back")) {
|
92 |
+
$this->_redirect("*/*/edit", array("id" => $model->getId()));
|
93 |
+
return;
|
94 |
+
}
|
95 |
+
$this->sendMail($this->getRequest()->getParam("id"));
|
96 |
+
$this->_redirect("*/*/");
|
97 |
+
return;
|
98 |
+
}
|
99 |
+
catch (Exception $e) {
|
100 |
+
Mage::getSingleton("adminhtml/session")->addError($e->getMessage());
|
101 |
+
Mage::getSingleton("adminhtml/session")->setEnquiryData($this->getRequest()->getPost());
|
102 |
+
$this->_redirect("*/*/edit", array("id" => $this->getRequest()->getParam("id")));
|
103 |
+
return;
|
104 |
+
}
|
105 |
+
|
106 |
+
|
107 |
+
}else{
|
108 |
+
if($username && $senderemail){
|
109 |
+
Mage::getSingleton("adminhtml/session")->addError(Mage::helper("adminhtml")->__("Enter Reply Message "));
|
110 |
+
}else{
|
111 |
+
Mage::getSingleton("adminhtml/session")->addError(Mage::helper("adminhtml")->__("Fill Sender Name,Sender Email in Config "));
|
112 |
+
}
|
113 |
+
$this->_redirect("*/*/edit", array("id" => $this->getRequest()->getParam("id")));
|
114 |
+
}
|
115 |
+
|
116 |
+
}
|
117 |
+
//added the code for saving the data in Email Template
|
118 |
+
public function sendMail($id) {
|
119 |
+
$model = Mage::getModel("enquiry/enquiry")->load($id);
|
120 |
+
$email = $model->getEmail();
|
121 |
+
$name = $model->getName();
|
122 |
+
$comment =$model->getComment();
|
123 |
+
$telephone = $model->getTelephone();
|
124 |
+
$reply = $model->getReplyMessage();
|
125 |
+
try {
|
126 |
+
$customerEmailId = $email;
|
127 |
+
$customerName = $name;
|
128 |
+
$emailTemplate = Mage::getModel('core/email_template')
|
129 |
+
->loadDefault('comment_template');
|
130 |
+
$emailTemplateVariables = array();
|
131 |
+
$emailTemplateVariables['comment'] = $comment;
|
132 |
+
$emailTemplateVariables['reply'] = $reply;
|
133 |
+
$emailTemplateVariables['name'] = $customerName;
|
134 |
+
$emailTemplateVariables['telephone'] = $telephone;
|
135 |
+
$username=Mage::getStoreConfig('enquiries/settings/sendername');
|
136 |
+
$senderemail=Mage::getStoreConfig('enquiries/settings/senderemail');
|
137 |
+
$emailTemplate->setSenderName($username);
|
138 |
+
$emailTemplate->setSenderEmail($senderemail);
|
139 |
+
$emailTemplate->setType('html');
|
140 |
+
$emailTemplate->setTemplateSubject($comment);
|
141 |
+
$emailTemplate->send($customerEmailId, $customerName, $emailTemplateVariables);
|
142 |
+
return true;
|
143 |
+
} catch (Exception $e) {
|
144 |
+
$errorMessage = $e->getMessage();
|
145 |
+
return $errorMessage;
|
146 |
+
}
|
147 |
+
}
|
148 |
+
|
149 |
+
|
150 |
+
|
151 |
+
public function deleteAction()
|
152 |
+
{
|
153 |
+
if( $this->getRequest()->getParam("id") > 0 ) {
|
154 |
+
try {
|
155 |
+
$model = Mage::getModel("enquiry/enquiry");
|
156 |
+
$model->setId($this->getRequest()->getParam("id"))->delete();
|
157 |
+
Mage::getSingleton("adminhtml/session")->addSuccess(Mage::helper("adminhtml")->__("Item was successfully deleted"));
|
158 |
+
$this->_redirect("*/*/");
|
159 |
+
}
|
160 |
+
catch (Exception $e) {
|
161 |
+
Mage::getSingleton("adminhtml/session")->addError($e->getMessage());
|
162 |
+
$this->_redirect("*/*/edit", array("id" => $this->getRequest()->getParam("id")));
|
163 |
+
}
|
164 |
+
}
|
165 |
+
$this->_redirect("*/*/");
|
166 |
+
}
|
167 |
+
|
168 |
+
|
169 |
+
public function massRemoveAction()
|
170 |
+
{
|
171 |
+
try {
|
172 |
+
$ids = $this->getRequest()->getPost('enquiry_ids', array());
|
173 |
+
foreach ($ids as $id) {
|
174 |
+
$model = Mage::getModel("enquiry/enquiry");
|
175 |
+
$model->setId($id)->delete();
|
176 |
+
}
|
177 |
+
Mage::getSingleton("adminhtml/session")->addSuccess(Mage::helper("adminhtml")->__("Item(s) was successfully removed"));
|
178 |
+
}
|
179 |
+
catch (Exception $e) {
|
180 |
+
Mage::getSingleton("adminhtml/session")->addError($e->getMessage());
|
181 |
+
}
|
182 |
+
$this->_redirect('*/*/');
|
183 |
+
}
|
184 |
+
|
185 |
+
/**
|
186 |
+
* Export order grid to CSV format
|
187 |
+
*/
|
188 |
+
public function exportCsvAction()
|
189 |
+
{
|
190 |
+
$fileName = 'enquiry.csv';
|
191 |
+
$grid = $this->getLayout()->createBlock('enquiry/adminhtml_enquiry_grid');
|
192 |
+
$this->_prepareDownloadResponse($fileName, $grid->getCsvFile());
|
193 |
+
}
|
194 |
+
/**
|
195 |
+
* Export order grid to Excel XML format
|
196 |
+
*/
|
197 |
+
public function exportExcelAction()
|
198 |
+
{
|
199 |
+
$fileName = 'enquiry.xml';
|
200 |
+
$grid = $this->getLayout()->createBlock('enquiry/adminhtml_enquiry_grid');
|
201 |
+
$this->_prepareDownloadResponse($fileName, $grid->getExcelFile($fileName));
|
202 |
+
}
|
203 |
+
}
|
app/code/community/SSTech/Enquiry/controllers/Adminhtml/EnquirybackendController.php
ADDED
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class SSTech_Enquiry_Adminhtml_EnquirybackendController extends Mage_Adminhtml_Controller_Action
|
3 |
+
{
|
4 |
+
public function indexAction()
|
5 |
+
{
|
6 |
+
$this->loadLayout();
|
7 |
+
$this->_title($this->__("Manage Enquiry"));
|
8 |
+
$this->renderLayout();
|
9 |
+
}
|
10 |
+
}
|
app/code/community/SSTech/Enquiry/controllers/Adminhtml/Rss/RssController.php
ADDED
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class SSTech_Enquiry_Adminhtml_Rss_RssController extends Mage_Core_Controller_Front_Action
|
4 |
+
{
|
5 |
+
public function enquiryAction()
|
6 |
+
{
|
7 |
+
|
8 |
+
$this->getResponse()->setHeader('Content-type', 'text/xml; charset=UTF-8');
|
9 |
+
$this->loadLayout(false);
|
10 |
+
$this->renderLayout();
|
11 |
+
}
|
12 |
+
|
13 |
+
public function preDispatch()
|
14 |
+
{
|
15 |
+
|
16 |
+
if ($this->getRequest()->getActionName() == 'enquiry') {
|
17 |
+
$this->_currentArea = 'adminhtml';
|
18 |
+
Mage::helper('rss')->authAdmin('mg/enquiry');
|
19 |
+
}
|
20 |
+
|
21 |
+
return parent::preDispatch();
|
22 |
+
}
|
23 |
+
}
|
24 |
+
|
25 |
+
|
app/code/community/SSTech/Enquiry/controllers/EnquiryController.php
ADDED
@@ -0,0 +1,42 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class SSTech_Enquiry_EnquiryController extends Mage_Core_Controller_Front_Action{
|
3 |
+
public function IndexAction() {
|
4 |
+
|
5 |
+
$this->loadLayout();
|
6 |
+
$this->getLayout()->getBlock("head")->setTitle($this->__("Enquiry"));
|
7 |
+
$breadcrumbs = $this->getLayout()->getBlock("breadcrumbs");
|
8 |
+
$breadcrumbs->addCrumb("home", array(
|
9 |
+
"label" => $this->__("Home Page"),
|
10 |
+
"title" => $this->__("Home Page"),
|
11 |
+
"link" => Mage::getBaseUrl()
|
12 |
+
));
|
13 |
+
|
14 |
+
$breadcrumbs->addCrumb("enquiries", array(
|
15 |
+
"label" => $this->__("Enquiry"),
|
16 |
+
"title" => $this->__("Enquiry")
|
17 |
+
));
|
18 |
+
|
19 |
+
$this->renderLayout();
|
20 |
+
}
|
21 |
+
|
22 |
+
public function enquiryAction() {
|
23 |
+
$postData = Mage::app()->getRequest()->getPost();
|
24 |
+
|
25 |
+
try{
|
26 |
+
$model = Mage::getModel('enquiry/enquiry');
|
27 |
+
$postData['telephone'] = preg_replace("/[^0-9]/","",$postData['telephone']);
|
28 |
+
$model->setData($postData);
|
29 |
+
$model->setCreatedDate(now());
|
30 |
+
$model->setUpdatedDate(now());
|
31 |
+
$model->setCreatedBy($postData['name']);
|
32 |
+
$model->save();
|
33 |
+
$message = $this->__('You Have Submitted Your Enquiry Successfully.');
|
34 |
+
Mage::getSingleton('core/session')->addSuccess($message);
|
35 |
+
$this->_redirect("*/*/");
|
36 |
+
}
|
37 |
+
catch(Exception $ex)
|
38 |
+
{
|
39 |
+
|
40 |
+
}
|
41 |
+
}
|
42 |
+
}
|
app/code/community/SSTech/Enquiry/controllers/IndexController.php
ADDED
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class SSTech_Enquiry_IndexController extends Mage_Core_Controller_Front_Action{
|
3 |
+
public function IndexAction() {
|
4 |
+
|
5 |
+
$this->loadLayout();
|
6 |
+
$this->getLayout()->getBlock("head")->setTitle($this->__("Enquiry"));
|
7 |
+
$breadcrumbs = $this->getLayout()->getBlock("breadcrumbs");
|
8 |
+
$breadcrumbs->addCrumb("home", array(
|
9 |
+
"label" => $this->__("Home Page"),
|
10 |
+
"title" => $this->__("Home Page"),
|
11 |
+
"link" => Mage::getBaseUrl()
|
12 |
+
));
|
13 |
+
|
14 |
+
$breadcrumbs->addCrumb("enquiries", array(
|
15 |
+
"label" => $this->__("Enquiry"),
|
16 |
+
"title" => $this->__("Enquiry")
|
17 |
+
));
|
18 |
+
|
19 |
+
$this->renderLayout();
|
20 |
+
|
21 |
+
}
|
22 |
+
}
|
app/code/community/SSTech/Enquiry/etc/adminhtml.xml
ADDED
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<config>
|
3 |
+
<acl>
|
4 |
+
<resources>
|
5 |
+
<admin>
|
6 |
+
<children>
|
7 |
+
<system>
|
8 |
+
<children>
|
9 |
+
<config>
|
10 |
+
<children>
|
11 |
+
<enquiries translate="title" module="enquiry">
|
12 |
+
<title>Enquiries Section</title>
|
13 |
+
<sort_order>0</sort_order>
|
14 |
+
</enquiries>
|
15 |
+
</children>
|
16 |
+
</config>
|
17 |
+
</children>
|
18 |
+
</system>
|
19 |
+
</children>
|
20 |
+
</admin>
|
21 |
+
</resources>
|
22 |
+
</acl>
|
23 |
+
</config>
|
app/code/community/SSTech/Enquiry/etc/config.xml
ADDED
@@ -0,0 +1,163 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<config>
|
3 |
+
<modules>
|
4 |
+
<SSTech_Enquiry>
|
5 |
+
<version>0.1.0</version>
|
6 |
+
</SSTech_Enquiry>
|
7 |
+
</modules>
|
8 |
+
<frontend>
|
9 |
+
<routers>
|
10 |
+
<enquiry>
|
11 |
+
<use>standard</use>
|
12 |
+
<args>
|
13 |
+
<module>SSTech_Enquiry</module>
|
14 |
+
<frontName>enquiry</frontName>
|
15 |
+
</args>
|
16 |
+
</enquiry>
|
17 |
+
</routers>
|
18 |
+
<layout>
|
19 |
+
<updates>
|
20 |
+
<enquiry>
|
21 |
+
<file>enquiry.xml</file>
|
22 |
+
</enquiry>
|
23 |
+
</updates>
|
24 |
+
</layout>
|
25 |
+
<translate>
|
26 |
+
<modules>
|
27 |
+
<SSTech_Enquiry>
|
28 |
+
<files>
|
29 |
+
<default>SSTech_Enquiry.csv</default>
|
30 |
+
</files>
|
31 |
+
</SSTech_Enquiry>
|
32 |
+
</modules>
|
33 |
+
</translate>
|
34 |
+
</frontend>
|
35 |
+
<global>
|
36 |
+
<helpers>
|
37 |
+
<enquiry>
|
38 |
+
<class>SSTech_Enquiry_Helper</class>
|
39 |
+
</enquiry>
|
40 |
+
</helpers>
|
41 |
+
<template>
|
42 |
+
<email>
|
43 |
+
<comment_template module="enquiry">
|
44 |
+
<file>comment_template.html</file>
|
45 |
+
<type>html</type>
|
46 |
+
</comment_template>
|
47 |
+
</email>
|
48 |
+
</template>
|
49 |
+
<blocks>
|
50 |
+
<enquiry>
|
51 |
+
<class>SSTech_Enquiry_Block</class>
|
52 |
+
</enquiry>
|
53 |
+
</blocks>
|
54 |
+
<models>
|
55 |
+
<enquiry>
|
56 |
+
<class>SSTech_Enquiry_Model</class>
|
57 |
+
<resourceModel>enquiry_mysql4</resourceModel>
|
58 |
+
</enquiry>
|
59 |
+
<enquiry_mysql4>
|
60 |
+
<class>SSTech_Enquiry_Model_Mysql4</class>
|
61 |
+
<entities>
|
62 |
+
<enquiry>
|
63 |
+
<table>enquiry</table>
|
64 |
+
</enquiry>
|
65 |
+
</entities>
|
66 |
+
</enquiry_mysql4>
|
67 |
+
</models>
|
68 |
+
<resources>
|
69 |
+
<enquiry_setup>
|
70 |
+
<setup>
|
71 |
+
<module>SSTech_Enquiry</module>
|
72 |
+
</setup>
|
73 |
+
<connection>
|
74 |
+
<use>core_setup</use>
|
75 |
+
</connection>
|
76 |
+
</enquiry_setup>
|
77 |
+
<enquiry_write>
|
78 |
+
<connection>
|
79 |
+
<use>core_write</use>
|
80 |
+
</connection>
|
81 |
+
</enquiry_write>
|
82 |
+
<enquiry_read>
|
83 |
+
<connection>
|
84 |
+
<use>core_read</use>
|
85 |
+
</connection>
|
86 |
+
</enquiry_read>
|
87 |
+
</resources>
|
88 |
+
</global>
|
89 |
+
<admin>
|
90 |
+
<routers>
|
91 |
+
<enquiry>
|
92 |
+
<use>admin</use>
|
93 |
+
<args>
|
94 |
+
<module>SSTech_Enquiry</module>
|
95 |
+
<frontName>enquiry</frontName>
|
96 |
+
</args>
|
97 |
+
</enquiry>
|
98 |
+
</routers>
|
99 |
+
</admin>
|
100 |
+
<adminhtml>
|
101 |
+
<menu>
|
102 |
+
<enquiry module="enquiry">
|
103 |
+
<title>Enquiry</title>
|
104 |
+
<sort_order>100</sort_order>
|
105 |
+
<children>
|
106 |
+
<setting module="enquiry">
|
107 |
+
<title>Settings</title>
|
108 |
+
<sort_order>4</sort_order>
|
109 |
+
<action>adminhtml/system_config/edit/section/enquiries</action>
|
110 |
+
</setting>
|
111 |
+
<enquiry module="enquiry">
|
112 |
+
<title>Manage Enquiry</title>
|
113 |
+
<sort_order>0</sort_order>
|
114 |
+
<action>enquiry/adminhtml_enquiry</action>
|
115 |
+
</enquiry>
|
116 |
+
</children>
|
117 |
+
</enquiry>
|
118 |
+
</menu>
|
119 |
+
<acl>
|
120 |
+
<resources>
|
121 |
+
<all>
|
122 |
+
<title>Allow Everything</title>
|
123 |
+
</all>
|
124 |
+
<admin>
|
125 |
+
<children>
|
126 |
+
<enquiry translate="title" module="enquiry">
|
127 |
+
<title>Enquiry</title>
|
128 |
+
<sort_order>1000</sort_order>
|
129 |
+
<children>
|
130 |
+
<setting module="enquiry">
|
131 |
+
<title>Settings</title>
|
132 |
+
<sort_order>4</sort_order>
|
133 |
+
<action>adminhtml/system_config/edit/section/enquiries</action>
|
134 |
+
</setting>
|
135 |
+
|
136 |
+
<enquiry translate="title">
|
137 |
+
<title>Manage Enquiry</title>
|
138 |
+
<sort_order>0</sort_order>
|
139 |
+
</enquiry>
|
140 |
+
</children>
|
141 |
+
</enquiry>
|
142 |
+
</children>
|
143 |
+
</admin>
|
144 |
+
</resources>
|
145 |
+
</acl>
|
146 |
+
<layout>
|
147 |
+
<updates>
|
148 |
+
<enquiry>
|
149 |
+
<file>enquiry.xml</file>
|
150 |
+
</enquiry>
|
151 |
+
</updates>
|
152 |
+
</layout>
|
153 |
+
<translate>
|
154 |
+
<modules>
|
155 |
+
<SSTech_Enquiry>
|
156 |
+
<files>
|
157 |
+
<default>SSTech_Enquiry.csv</default>
|
158 |
+
</files>
|
159 |
+
</SSTech_Enquiry>
|
160 |
+
</modules>
|
161 |
+
</translate>
|
162 |
+
</adminhtml>
|
163 |
+
</config>
|
app/code/community/SSTech/Enquiry/etc/system.xml
ADDED
@@ -0,0 +1,60 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<config>
|
3 |
+
<tabs>
|
4 |
+
<sstech translate="label" module="enquiry">
|
5 |
+
<label>SSTech</label>
|
6 |
+
<sort_order>0</sort_order>
|
7 |
+
</sstech>
|
8 |
+
</tabs>
|
9 |
+
<sections>
|
10 |
+
<enquiries translate="label" module="enquiry">
|
11 |
+
<label>Quick Enquiry</label>
|
12 |
+
<tab>sstech</tab>
|
13 |
+
<frontend_type>text</frontend_type>
|
14 |
+
<sort_order>0</sort_order>
|
15 |
+
<show_in_default>1</show_in_default>
|
16 |
+
<show_in_website>1</show_in_website>
|
17 |
+
<show_in_store>1</show_in_store>
|
18 |
+
<groups>
|
19 |
+
<settings translate="label">
|
20 |
+
<label>Settings</label>
|
21 |
+
<frontend_type>text</frontend_type>
|
22 |
+
<sort_order>0</sort_order>
|
23 |
+
<show_in_default>1</show_in_default>
|
24 |
+
<show_in_website>1</show_in_website>
|
25 |
+
<show_in_store>1</show_in_store>
|
26 |
+
<fields>
|
27 |
+
<enabled translate="label">
|
28 |
+
<label>Enabled</label>
|
29 |
+
<frontend_type>select</frontend_type>
|
30 |
+
<source_model>adminhtml/system_config_source_enabledisable</source_model>
|
31 |
+
<sort_order>0</sort_order>
|
32 |
+
<show_in_default>1</show_in_default>
|
33 |
+
<show_in_website>1</show_in_website>
|
34 |
+
<show_in_store>1</show_in_store>
|
35 |
+
<comment>settings to enable and disable the Top links</comment>
|
36 |
+
</enabled>
|
37 |
+
<sendername translate="label">
|
38 |
+
<label>Sender Name</label>
|
39 |
+
<frontend_type>Text</frontend_type>
|
40 |
+
<sort_order>1</sort_order>
|
41 |
+
<show_in_default>1</show_in_default>
|
42 |
+
<show_in_website>1</show_in_website>
|
43 |
+
<show_in_store>1</show_in_store>
|
44 |
+
<comment>Name of the sender </comment>
|
45 |
+
</sendername>
|
46 |
+
<senderemail translate="label">
|
47 |
+
<label>Sender Email</label>
|
48 |
+
<frontend_type>Text</frontend_type>
|
49 |
+
<sort_order>2</sort_order>
|
50 |
+
<show_in_default>1</show_in_default>
|
51 |
+
<show_in_website>1</show_in_website>
|
52 |
+
<show_in_store>1</show_in_store>
|
53 |
+
<comment>Email id of Sender</comment>
|
54 |
+
</senderemail>
|
55 |
+
</fields>
|
56 |
+
</settings>
|
57 |
+
</groups>
|
58 |
+
</enquiries>
|
59 |
+
</sections>
|
60 |
+
</config>
|
app/code/community/SSTech/Enquiry/sql/enquiry_setup/mysql4-install-0.1.0.php
ADDED
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
$installer = $this;
|
3 |
+
$installer->startSetup();
|
4 |
+
$sql=<<<SQLTEXT
|
5 |
+
CREATE TABLE IF NOT EXISTS `enquiry` (
|
6 |
+
`name` varchar(255) NOT NULL,
|
7 |
+
`email` varchar(255) NOT NULL,
|
8 |
+
`address` varchar(255) NOT NULL,
|
9 |
+
`telephone` int(20) NOT NULL,
|
10 |
+
`comment` varchar(1000) NOT NULL,
|
11 |
+
`reply_message` varchar(1000) NOT NULL,
|
12 |
+
`created_date` datetime NOT NULL,
|
13 |
+
`updated_date` datetime NOT NULL,
|
14 |
+
`enquiry_id` int(255) NOT NULL AUTO_INCREMENT,
|
15 |
+
`created_By` varchar(255) NOT NULL,
|
16 |
+
`updated_By` varchar(255) NOT NULL,
|
17 |
+
`status_id` tinyint(100) NOT NULL,
|
18 |
+
PRIMARY KEY (`enquiry_id`)
|
19 |
+
)
|
20 |
+
|
21 |
+
SQLTEXT;
|
22 |
+
$installer->run($sql);
|
23 |
+
$installer->endSetup();
|
24 |
+
|
app/design/adminhtml/default/default/layout/enquiry.xml
ADDED
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<layout version="0.1.0">
|
3 |
+
<enquiry_adminhtml_enquirybackend_index>
|
4 |
+
<reference name="content">
|
5 |
+
<block type="enquiry/adminhtml_enquirybackend" name="enquirybackend" template="enquiry/enquirybackend.phtml"/>
|
6 |
+
</reference>
|
7 |
+
</enquiry_adminhtml_enquirybackend_index>
|
8 |
+
<enquiry_adminhtml_enquiry_index>
|
9 |
+
<reference name="content">
|
10 |
+
<block type="enquiry/adminhtml_enquiry" name="enquiry" />
|
11 |
+
</reference>
|
12 |
+
</enquiry_adminhtml_enquiry_index>
|
13 |
+
</layout>
|
app/design/adminhtml/default/default/template/enquiry/information.phtml
ADDED
@@ -0,0 +1,86 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
$session = Mage::registry('enquiry_data');
|
3 |
+
$data = $session->getReplyMessage();
|
4 |
+
$status = 0;
|
5 |
+
if(strlen($data) == '0')
|
6 |
+
{
|
7 |
+
$status = 1;
|
8 |
+
}
|
9 |
+
?>
|
10 |
+
<div class="entry-edit">
|
11 |
+
<div class="entry-edit-head">
|
12 |
+
<h4 class="icon-head head-edit-form fieldset-legend"><?php echo $this->__('Enquiry Information') ?></h4>
|
13 |
+
</div>
|
14 |
+
<div class="fieldset">
|
15 |
+
<table cellspacing="0" class="form-list">
|
16 |
+
<tbody>
|
17 |
+
<tr>
|
18 |
+
<td class="label"><label for="title"><?php echo $this->__('Status') ?></label></td>
|
19 |
+
<td class="value" style="font-weight: bold; white-space: nowrap;">
|
20 |
+
|
21 |
+
<?php if($session->getStatusId()==0){ ?>
|
22 |
+
<?php echo "Not Replied" ?>
|
23 |
+
<?php } else{ ?>
|
24 |
+
<?php echo "Replied" ?>
|
25 |
+
<?php } ?>
|
26 |
+
|
27 |
+
</td>
|
28 |
+
<td style="width: 100%;"></td>
|
29 |
+
</tr>
|
30 |
+
<tr>
|
31 |
+
<td class="label"><label for="title"><?php echo $this->__('Name') ?></label></td>
|
32 |
+
<td class="value" style="font-weight: bold; white-space: nowrap;">
|
33 |
+
<?php echo $session->getName() ?>
|
34 |
+
</td>
|
35 |
+
<td style="width: 100%;"></td>
|
36 |
+
</tr>
|
37 |
+
<tr>
|
38 |
+
<td class="label"><label for="title"><?php echo $this->__('Email') ?></label></td>
|
39 |
+
<td class="value" style="font-weight: bold; white-space: nowrap;">
|
40 |
+
<?php echo $session->getEmail() ?>
|
41 |
+
</td>
|
42 |
+
<td style="width: 100%;"></td>
|
43 |
+
</tr>
|
44 |
+
<tr>
|
45 |
+
<td class="label"><label for="title"><?php echo $this->__('Address') ?></label></td>
|
46 |
+
<td class="value" style="font-weight: bold; white-space: nowrap;">
|
47 |
+
<?php echo $session->getAddress() ?>
|
48 |
+
</td>
|
49 |
+
<td style="width: 100%;"></td>
|
50 |
+
</tr>
|
51 |
+
<tr>
|
52 |
+
<td class="label"><label for="title"><?php echo $this->__('Telephone') ?></label></td>
|
53 |
+
<td class="value" style="font-weight: bold; white-space: nowrap;">
|
54 |
+
<?php echo $session->getTelephone() ?>
|
55 |
+
</td>
|
56 |
+
<td style="width: 100%;"></td>
|
57 |
+
</tr>
|
58 |
+
<tr>
|
59 |
+
<td class="label"><label for="title"><?php echo $this->__('Comment') ?></label></td>
|
60 |
+
<td class="value" style="font-weight: bold; white-space: nowrap;">
|
61 |
+
<?php echo $session->getComment() ?>
|
62 |
+
</td>
|
63 |
+
<td style="width: 100%;"></td>
|
64 |
+
</tr>
|
65 |
+
<?php if($status){ ?>
|
66 |
+
<tr>
|
67 |
+
<td class="label"><label for="title"><?php echo $this->__('Your Message') ?></label></td>
|
68 |
+
<td class="value" style="font-weight: bold; white-space: nowrap;">
|
69 |
+
<textarea name="reply_message" id="reply_message" title="<?php echo $this->__('reply_message') ?>" class="input-text"></textarea>
|
70 |
+
|
71 |
+
</td>
|
72 |
+
<td style="width: 100%;"></td>
|
73 |
+
</tr>
|
74 |
+
<?php } else{ ?>
|
75 |
+
<tr>
|
76 |
+
<td class="label"><label for="title"><?php echo $this->__('Your Message') ?></label></td>
|
77 |
+
<td class="value" style="font-weight: bold; white-space: nowrap;">
|
78 |
+
<?php echo $session->getReplyMessage() ?>
|
79 |
+
</td>
|
80 |
+
<td style="width: 100%;"></td>
|
81 |
+
</tr>
|
82 |
+
<?php } ?>
|
83 |
+
</tbody>
|
84 |
+
</table>
|
85 |
+
</div>
|
86 |
+
</div>
|
app/design/frontend/base/default/layout/enquiry.xml
ADDED
@@ -0,0 +1,31 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<layout version="0.1.0">
|
3 |
+
<default>
|
4 |
+
<reference name="top.links">
|
5 |
+
<block type="enquiry/enquiry" name="enquiry.toplink" >
|
6 |
+
<action method="addToTopLink" ifconfig="enquiries/settings/enabled"></action>
|
7 |
+
</block>
|
8 |
+
</reference>
|
9 |
+
<reference name="head">
|
10 |
+
<block type="enquiry/enquiry" name="enquiry.toplink" >
|
11 |
+
</block>
|
12 |
+
</reference>
|
13 |
+
</default>
|
14 |
+
<enquiry_index_index>
|
15 |
+
<reference name="root">
|
16 |
+
<action method="setTemplate"><template>page/2columns-left.phtml</template></action>
|
17 |
+
</reference>
|
18 |
+
<reference name="content">
|
19 |
+
<block type="enquiry/enquiry" name="enquiry_enquiry" template="enquiry/enquiry.phtml"/>
|
20 |
+
</reference>
|
21 |
+
</enquiry_index_index>
|
22 |
+
<enquiry_enquiry_index>
|
23 |
+
<reference name="root">
|
24 |
+
<action method="setTemplate"><template>page/2columns-left.phtml</template></action>
|
25 |
+
</reference>
|
26 |
+
<reference name="content">
|
27 |
+
<block type="enquiry/enquiry" name="enquiry_enquiry" template="enquiry/enquiry.phtml"/>
|
28 |
+
</reference>
|
29 |
+
</enquiry_enquiry_index>
|
30 |
+
</layout>
|
31 |
+
|
app/design/frontend/base/default/template/enquiry/enquiry.phtml
ADDED
@@ -0,0 +1,48 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<div class="account-create">
|
2 |
+
<form action="<?php echo $this->getEnquiryActionUrl() ?>" method="post" id="form-validate">
|
3 |
+
<div class="fieldset">
|
4 |
+
<h2 class="legend"><?php echo $this->__('Quick Enquiry') ?></h2>
|
5 |
+
<ul class="form-list">
|
6 |
+
<li>
|
7 |
+
<label for="name" class="required"><em>*</em><?php echo $this->__('Name') ?></label>
|
8 |
+
<div class="input-box">
|
9 |
+
<input type="text" name="name" id="name" title="<?php echo $this->__('Name') ?>" class="input-text required-entry" />
|
10 |
+
</div>
|
11 |
+
</li>
|
12 |
+
<li>
|
13 |
+
<label for="email_address" class="required"><em>*</em><?php echo $this->__('Email Address') ?></label>
|
14 |
+
<div class="input-box">
|
15 |
+
<input type="text" name="email" id="email_address" title="<?php echo $this->__('Email Address') ?>" class="input-text validate-email required-entry" />
|
16 |
+
</div>
|
17 |
+
</li>
|
18 |
+
<li>
|
19 |
+
<label for="telephone"><?php echo $this->__('Telephone') ?></label>
|
20 |
+
<div class="input-box">
|
21 |
+
<input type="text" name="telephone" id="telephone" title="<?php echo $this->__('Telephone') ?>" class="input-text validate-phoneLax" />
|
22 |
+
</div>
|
23 |
+
</li>
|
24 |
+
<li>
|
25 |
+
<label for="address"><?php echo $this->__('Address') ?></label>
|
26 |
+
<div class="input-box">
|
27 |
+
<input type="text" name="address" id="address" title="<?php echo $this->__('Address') ?>" class="input-text" />
|
28 |
+
</div>
|
29 |
+
</li>
|
30 |
+
</li>
|
31 |
+
<li>
|
32 |
+
<label for="comment" class="required"><em>*</em><?php echo $this->__('Comment') ?></label>
|
33 |
+
<div class="input-box">
|
34 |
+
<textarea name="comment" id="comment" title="<?php echo $this->__('Comment') ?>" class="input-text required-entry" ></textarea>
|
35 |
+
</div>
|
36 |
+
</li>
|
37 |
+
<input type="hidden" name="store_id" value="<?php echo Mage::app()->getStore()->getStoreId() ?>">
|
38 |
+
<div class="buttons-set">
|
39 |
+
<button type="submit" title="<?php echo $this->__('Submit') ?>" class="button"><span><span><?php echo $this->__('Submit') ?></span></span></button>
|
40 |
+
</div>
|
41 |
+
</div>
|
42 |
+
</form>
|
43 |
+
<script type="text/javascript">
|
44 |
+
//<![CDATA[
|
45 |
+
var dataForm = new VarienForm('form-validate', true);
|
46 |
+
//]]>
|
47 |
+
</script>
|
48 |
+
</div>
|
app/design/frontend/base/default/template/enquiry/index.phtml
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
Demo Page
|
app/etc/modules/SSTech_Enquiry.xml
ADDED
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<config>
|
3 |
+
<modules>
|
4 |
+
<SSTech_Enquiry>
|
5 |
+
<active>true</active>
|
6 |
+
<codePool>community</codePool>
|
7 |
+
<version>0.1.0</version>
|
8 |
+
</SSTech_Enquiry>
|
9 |
+
</modules>
|
10 |
+
</config>
|
app/locale/en_US/template/email/comment_template.html
ADDED
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<!--@subject Quickenquiry Form@-->
|
2 |
+
|
3 |
+
Thank you For contacting Us
|
4 |
+
|
5 |
+
Name: {{var name}}
|
6 |
+
E-mail: {{var email}}
|
7 |
+
Telephone: {{var telephone}}
|
8 |
+
|
9 |
+
Customer Enquiry : {{var comment}}
|
10 |
+
|
11 |
+
Support Answer: {{var reply}}
|
12 |
+
|
13 |
+
let us know if you have any Query .......
|
package.xml
ADDED
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<package>
|
3 |
+
<name>SSTech_Enquiry</name>
|
4 |
+
<version>0.1.0</version>
|
5 |
+
<stability>stable</stability>
|
6 |
+
<license>Open source License</license>
|
7 |
+
<channel>community</channel>
|
8 |
+
<extends/>
|
9 |
+
<summary>Extension which will allow to get the Quick Response </summary>
|
10 |
+
<description>Extension which will allow to get the Quick Response </description>
|
11 |
+
<notes>Stable Version </notes>
|
12 |
+
<authors><author><name>SSTech</name><user>ssteech</user><email>sandynareshg@gmail.com</email></author></authors>
|
13 |
+
<date>2014-06-14</date>
|
14 |
+
<time>13:04:40</time>
|
15 |
+
<contents><target name="mageetc"><dir name="modules"><file name="SSTech_Enquiry.xml" hash="704104c230cbcdc082782fef87822cfb"/></dir></target><target name="magecommunity"><dir name="SSTech"><dir name="Enquiry"><dir name="Block"><dir name="Adminhtml"><dir name="Enquiry"><dir name="Edit"><file name="Form.php" hash="e7f4d89a63636e568726ed4b11a3e663"/><dir name="Tab"><file name="Form.php" hash="7397c0c442775f91648358ed9925d057"/></dir><file name="Tabs.php" hash="3b6d454934d9f16cfddab6be924915d9"/></dir><file name="Edit.php" hash="b8fee14b0677c05a284b1fa607eef1d2"/><file name="Grid.php" hash="99b2c9a8ba15510021f51e95b705c1ef"/></dir><file name="Enquiry.php" hash="01cd9d5dd8354604798bbc6468cc429c"/><file name="Enquirybackend.php" hash="d875d9ab2d274002f94e4f9742458774"/></dir><file name="Enquiry.php" hash="ebc6c54f563bd627821fb02bdaa77746"/><file name="Index.php" hash="eeb1ec9bcc0364721784cafc8d301d41"/></dir><dir name="Helper"><file name="Data.php" hash="17840f7adf95102d826896d3dc151635"/></dir><dir name="Model"><file name="Enquiry.php" hash="bd754a914df5cf064e5f2c3bdeb94a34"/><dir name="Mysql4"><dir name="Enquiry"><file name="Collection.php" hash="c4f95199ac292ae0f32279134b368916"/></dir><file name="Enquiry.php" hash="47054d65c2301b98fe07e5de6cb83758"/></dir></dir><dir name="controllers"><dir name="Adminhtml"><file name="EnquiryController.php" hash="b3ec9895d96edaaad9f63c88bc8b63ea"/><file name="EnquirybackendController.php" hash="87c35f5232cb3589c42f77dbaaaeee26"/><dir name="Rss"><file name="RssController.php" hash="71d30fa9f60754f4a298105b2ece02db"/></dir></dir><file name="EnquiryController.php" hash="fef4f35d21731208accee243b7e42d73"/><file name="IndexController.php" hash="e2aafae385fb7fba4229d04161bfee40"/></dir><dir name="etc"><file name="adminhtml.xml" hash="6d35e4b64a0d26d0715eaf5a098bc08b"/><file name="config.xml" hash="a55b618375bef9f928a5659d7c7c7220"/><file name="system.xml" hash="0ac6acdc303ecb6f6a45047f5d1f05fe"/></dir><dir name="sql"><dir name="enquiry_setup"><file name="mysql4-install-0.1.0.php" hash="9da224b112d61bb9fd8f5a64cd0715d1"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="template"><dir name="enquiry"><file name="enquiry.phtml" hash="0f178a230af4a96d1a0f5aeff324539b"/><file name="index.phtml" hash="395b5512423d31a9526f94e3d7dcc13a"/></dir></dir><dir name="layout"><file name="enquiry.xml" hash="d756102d2c32c6e9cb89e9c53d36a9a3"/></dir></dir></dir></dir><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="enquiry.xml" hash="73eed49ae3129b0d81529befb3bc8cdc"/></dir><dir name="template"><dir name="enquiry"><file name="information.phtml" hash="d05134c9f3f1d07b067cb388ae385f8c"/></dir></dir></dir></dir></dir></target><target name="magelocale"><dir name="en_US"><dir name="template"><dir name="email"><file name="comment_template.html" hash="ac11096de4e1d7188168c1e829d9c7da"/></dir></dir></dir></target></contents>
|
16 |
+
<compatible/>
|
17 |
+
<dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php></required></dependencies>
|
18 |
+
</package>
|