Version Notes
Ticket Support
Download this release
Release Info
Developer | iMedia inc. |
Extension | Imedia_TicketSupport |
Version | 1.0.0.1 |
Comparing to | |
See all releases |
Version 1.0.0.1
- app/code/community/Imedia/TicketSupport/Block/Adminhtml/Customform.php +23 -0
- app/code/community/Imedia/TicketSupport/Block/Adminhtml/Support.php +15 -0
- app/code/community/Imedia/TicketSupport/Block/Adminhtml/Support/Edit.php +31 -0
- app/code/community/Imedia/TicketSupport/Block/Adminhtml/Support/Edit/Form.php +123 -0
- app/code/community/Imedia/TicketSupport/Block/Adminhtml/Support/Edit/Tab.php +23 -0
- app/code/community/Imedia/TicketSupport/Block/Adminhtml/Support/Grid.php +125 -0
- app/code/community/Imedia/TicketSupport/Block/Tickets.php +34 -0
- app/code/community/Imedia/TicketSupport/Block/Viewticket.php +30 -0
- app/code/community/Imedia/TicketSupport/Helper/Data.php +8 -0
- app/code/community/Imedia/TicketSupport/Model/Details.php +9 -0
- app/code/community/Imedia/TicketSupport/Model/Mysql4/Details.php +9 -0
- app/code/community/Imedia/TicketSupport/Model/Mysql4/Details/Collection.php +10 -0
- app/code/community/Imedia/TicketSupport/Model/Mysql4/Support.php +9 -0
- app/code/community/Imedia/TicketSupport/Model/Mysql4/Support/Collection.php +10 -0
- app/code/community/Imedia/TicketSupport/Model/Support.php +9 -0
- app/code/community/Imedia/TicketSupport/controllers/Adminhtml/SupportController.php +219 -0
- app/code/community/Imedia/TicketSupport/controllers/IndexController.php +195 -0
- app/code/community/Imedia/TicketSupport/etc/adminhtml.xml +56 -0
- app/code/community/Imedia/TicketSupport/etc/config.xml +117 -0
- app/code/community/Imedia/TicketSupport/etc/system.xml +51 -0
- app/code/community/Imedia/TicketSupport/sql/imedia_ticketsupport_setup/mysql4-install-0.0.1.php +40 -0
- app/design/adminhtml/default/default/layout/imedia/ticketsupport.xml +13 -0
- app/design/adminhtml/default/default/template/imedia/tickets.phtml +91 -0
- app/design/frontend/base/default/layout/imedia/imedia_ticketsupport.xml +42 -0
- app/design/frontend/base/default/template/imedia/im_ticket.phtml +45 -0
- app/design/frontend/base/default/template/imedia/tickets.phtml +61 -0
- app/design/frontend/base/default/template/imedia/viewticket.phtml +88 -0
- app/etc/modules/Imedia_TicketSupport.xml +10 -0
- app/locale/en_US/template/email/imedia/ticket_admin_notification.html +65 -0
- app/locale/en_US/template/email/imedia/ticket_customer_notification.html +66 -0
- app/locale/en_US/template/email/imedia/ticket_customer_replied_notification.html +65 -0
- package.xml +18 -0
- skin/adminhtml/default/default/ticketsupport.css +134 -0
app/code/community/Imedia/TicketSupport/Block/Adminhtml/Customform.php
ADDED
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
*iMedia Ticket Support Form
|
4 |
+
*/
|
5 |
+
class Imedia_TicketSupport_Block_Adminhtml_Customform extends Mage_Adminhtml_Block_Template
|
6 |
+
|
7 |
+
{
|
8 |
+
|
9 |
+
public function __construct() {
|
10 |
+
|
11 |
+
parent::__construct();
|
12 |
+
|
13 |
+
$this->setTemplate('imedia/tickets.phtml');
|
14 |
+
|
15 |
+
$post = $this->getRequest()->getParams();
|
16 |
+
$id = $post['id'];
|
17 |
+
|
18 |
+
$this->setFormAction(Mage::helper("adminhtml")->getUrl("*/*/updateticket",array("id"=>$id))); // If you want we can set the .html form action here
|
19 |
+
|
20 |
+
}
|
21 |
+
|
22 |
+
}
|
23 |
+
?>
|
app/code/community/Imedia/TicketSupport/Block/Adminhtml/Support.php
ADDED
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
*iMedia Ticket Support Widget Grid Container
|
4 |
+
*/
|
5 |
+
class Imedia_TicketSupport_Block_Adminhtml_Support extends Mage_Adminhtml_Block_Widget_Grid_Container
|
6 |
+
{
|
7 |
+
public function __construct()
|
8 |
+
{
|
9 |
+
$this->_blockGroup='imedia_ticketsupport';
|
10 |
+
$this->_controller='adminhtml_support';
|
11 |
+
$this->_headerText= Mage::helper('imedia_ticketsupport')->__('Imedia Ticket Support');
|
12 |
+
parent::__construct();
|
13 |
+
$this->removeButton('add');
|
14 |
+
}
|
15 |
+
}
|
app/code/community/Imedia/TicketSupport/Block/Adminhtml/Support/Edit.php
ADDED
@@ -0,0 +1,31 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
*iMedia Ticket Support form Container
|
4 |
+
*/
|
5 |
+
class Imedia_TicketSupport_Block_Adminhtml_Support_Edit extends Mage_Adminhtml_Block_Widget_Form_Container
|
6 |
+
{
|
7 |
+
public function __construct()
|
8 |
+
{
|
9 |
+
$this->_blockGroup = 'imedia_ticketsupport';
|
10 |
+
$this->_controller = 'adminhtml_support';
|
11 |
+
|
12 |
+
parent::__construct();
|
13 |
+
|
14 |
+
|
15 |
+
}
|
16 |
+
|
17 |
+
/**
|
18 |
+
* Get Header text
|
19 |
+
*
|
20 |
+
* @return string
|
21 |
+
*/
|
22 |
+
public function getHeaderText()
|
23 |
+
{
|
24 |
+
if (Mage::registry('imedia_ticketsupport')->getId()) {
|
25 |
+
return Mage::helper('imedia_ticketsupport')->__('Edit Ticket Support');
|
26 |
+
}
|
27 |
+
else {
|
28 |
+
return Mage::helper('imedia_ticketsupport')->__('New Ticket Support');
|
29 |
+
}
|
30 |
+
}
|
31 |
+
}
|
app/code/community/Imedia/TicketSupport/Block/Adminhtml/Support/Edit/Form.php
ADDED
@@ -0,0 +1,123 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
*iMedia Ticket Support Widget Form
|
4 |
+
*/
|
5 |
+
class Imedia_TicketSupport_Block_Adminhtml_Support_Edit_Form extends Mage_Adminhtml_Block_Widget_Form
|
6 |
+
{
|
7 |
+
/**
|
8 |
+
* Init class
|
9 |
+
*/
|
10 |
+
public function __construct()
|
11 |
+
{
|
12 |
+
parent::__construct();
|
13 |
+
|
14 |
+
$this->setId('imedia_ticketsupport_support_form');
|
15 |
+
$this->setTitle(Mage::helper('imedia_ticketsupport')->__('Ticket Support Information'));
|
16 |
+
}
|
17 |
+
|
18 |
+
/**
|
19 |
+
* Setup form fields for inserts/updates
|
20 |
+
*
|
21 |
+
* return Mage_Adminhtml_Block_Widget_Form
|
22 |
+
*/
|
23 |
+
protected function _prepareForm()
|
24 |
+
{
|
25 |
+
$model = Mage::registry('imedia_ticketsupport');
|
26 |
+
|
27 |
+
|
28 |
+
$inquiryCollections = Mage::getModel('imedia_ticketsupport/support')->getCollection()
|
29 |
+
->addFieldToFilter('id', $model->getData('id'))
|
30 |
+
->getFirstItem();
|
31 |
+
|
32 |
+
$active = $inquiryCollections->getIsActive();
|
33 |
+
|
34 |
+
|
35 |
+
$form = new Varien_Data_Form(array(
|
36 |
+
'id' => 'edit_form',
|
37 |
+
'action' =>$this->getUrl('*/*/save', array('id' => $this->getRequest()->getParam('id'))),
|
38 |
+
'method' => 'post'
|
39 |
+
));
|
40 |
+
|
41 |
+
$fieldset = $form->addFieldset('base_fieldset', array(
|
42 |
+
'legend' => Mage::helper('imedia_ticketsupport')->__('Ticket Support Information'),
|
43 |
+
'class' => 'fieldset-wide',
|
44 |
+
));
|
45 |
+
|
46 |
+
if ($model->getId()) {
|
47 |
+
$fieldset->addField('id', 'hidden', array(
|
48 |
+
'name' => 'id',
|
49 |
+
));
|
50 |
+
}
|
51 |
+
|
52 |
+
$fieldset->addField('created_at', 'label', array(
|
53 |
+
'created_at' => 'created_at',
|
54 |
+
'label' => Mage::helper('imedia_ticketsupport')->__('created time'),
|
55 |
+
'title' => Mage::helper('imedia_ticketsupport')->__('created time'),
|
56 |
+
));
|
57 |
+
|
58 |
+
$fieldset->addField('title', 'label', array(
|
59 |
+
'title' => 'title',
|
60 |
+
'label' => Mage::helper('imedia_ticketsupport')->__('Title'),
|
61 |
+
'title' => Mage::helper('imedia_ticketsupport')->__('Title'),
|
62 |
+
));
|
63 |
+
|
64 |
+
$fieldset->addField('dept', 'label', array(
|
65 |
+
'dept' => 'dept',
|
66 |
+
'label' => Mage::helper('imedia_ticketsupport')->__('Department'),
|
67 |
+
'title' => Mage::helper('imedia_ticketsupport')->__('Department'),
|
68 |
+
));
|
69 |
+
|
70 |
+
$fieldset->addField('priority', 'label', array(
|
71 |
+
'priority' => 'priority',
|
72 |
+
'label' => Mage::helper('imedia_ticketsupport')->__('Priority'),
|
73 |
+
'title' => Mage::helper('imedia_ticketsupport')->__('Priority'),
|
74 |
+
));
|
75 |
+
|
76 |
+
$fieldset->addField('message', 'label', array(
|
77 |
+
'priority' => 'priority',
|
78 |
+
'label' => Mage::helper('imedia_ticketsupport')->__('Message'),
|
79 |
+
'title' => Mage::helper('imedia_ticketsupport')->__('Message'),
|
80 |
+
));
|
81 |
+
|
82 |
+
$fieldset->addField('status', 'label', array(
|
83 |
+
'status' => 'status',
|
84 |
+
'label' => Mage::helper('imedia_ticketsupport')->__('Status'),
|
85 |
+
'title' => Mage::helper('imedia_ticketsupport')->__('Status'),
|
86 |
+
));
|
87 |
+
|
88 |
+
/*$fieldset->addField('user_question', 'label', array(
|
89 |
+
'user_question' => 'user_question',
|
90 |
+
'label' => Mage::helper('imedia_productinquiry')->__('Question'),
|
91 |
+
'title' => Mage::helper('imedia_productinquiry')->__('Question'),
|
92 |
+
));
|
93 |
+
|
94 |
+
$fieldset->addField('admin_answer', 'textarea', array(
|
95 |
+
'label' => Mage::helper('imedia_productinquiry')->__('Answer'),
|
96 |
+
'class' => 'required-entry',
|
97 |
+
'required' => true,
|
98 |
+
'name' => 'admin_answer',
|
99 |
+
));
|
100 |
+
|
101 |
+
$fieldset->addField('is_active', 'select', array(
|
102 |
+
'label' => Mage::helper('imedia_productinquiry')->__('Is Active'),
|
103 |
+
'class' => 'required-entry',
|
104 |
+
'name' => 'is_active',
|
105 |
+
'required' => true,
|
106 |
+
'value'=>$active,
|
107 |
+
'values' => array('Yes' => 'Yes','No' => 'No'),
|
108 |
+
'after_element_html' => '<br/><small>Select Yes to show this answer on Product Page</small>',
|
109 |
+
));
|
110 |
+
$fieldset->addField('sand_mail', 'checkbox', array(
|
111 |
+
'label' => Mage::helper('imedia_productinquiry')->__('Notify User by Email'),
|
112 |
+
'onclick' => 'this.value = this.checked ? 1 : 0;',
|
113 |
+
'name' => 'send_mail',
|
114 |
+
));*/
|
115 |
+
|
116 |
+
$form_data = $model->getData();
|
117 |
+
$form->setValues($form_data);
|
118 |
+
$form->setUseContainer(true);
|
119 |
+
$this->setForm($form);
|
120 |
+
|
121 |
+
return parent::_prepareForm();
|
122 |
+
}
|
123 |
+
}
|
app/code/community/Imedia/TicketSupport/Block/Adminhtml/Support/Edit/Tab.php
ADDED
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
*iMedia Ticket Support Widget Tabs
|
4 |
+
*/
|
5 |
+
class Imedia_TicketSupport_Block_Adminhtml_Support_Edit_Tab extends Mage_Adminhtml_Block_Widget_Tabs
|
6 |
+
{
|
7 |
+
public function __construct()
|
8 |
+
{
|
9 |
+
parent::__construct();
|
10 |
+
$this->setId('form_tabs');
|
11 |
+
$this->setDestElementId('edit_form');
|
12 |
+
$this->setTitle(Mage::helper('imedia_ticketsupport')->__('Ticket Support Information'));
|
13 |
+
}
|
14 |
+
protected function _beforeToHtml()
|
15 |
+
{
|
16 |
+
$this->addTab('form_section', array(
|
17 |
+
'label' => Mage::helper('imedia_ticketsupport')->__('Ticket Support Information'),
|
18 |
+
'title' => Mage::helper('imedia_ticketsupport')->__('Ticket Support Information'),
|
19 |
+
));
|
20 |
+
|
21 |
+
return parent::_beforeToHtml();
|
22 |
+
}
|
23 |
+
}
|
app/code/community/Imedia/TicketSupport/Block/Adminhtml/Support/Grid.php
ADDED
@@ -0,0 +1,125 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
*iMedia Ticket Support Widget Grid
|
4 |
+
*/
|
5 |
+
class Imedia_TicketSupport_Block_Adminhtml_Support_Grid extends Mage_Adminhtml_Block_Widget_Grid
|
6 |
+
{
|
7 |
+
public function __construct()
|
8 |
+
{
|
9 |
+
parent::__construct();
|
10 |
+
|
11 |
+
$this->setDefaultSort('id');
|
12 |
+
$this->setId('imedia_ticketsupport_support_grid');
|
13 |
+
$this->setDefaultDir('asc');
|
14 |
+
$this->setSaveParametersInSession(true);
|
15 |
+
}
|
16 |
+
|
17 |
+
protected function _getCollectionClass()
|
18 |
+
{
|
19 |
+
return 'imedia_ticketsupport/support_collection';
|
20 |
+
}
|
21 |
+
|
22 |
+
protected function _prepareCollection()
|
23 |
+
{
|
24 |
+
|
25 |
+
$collection = Mage::getResourceModel($this->_getCollectionClass());
|
26 |
+
$this->setCollection($collection);
|
27 |
+
return parent::_prepareCollection();
|
28 |
+
|
29 |
+
}
|
30 |
+
|
31 |
+
protected function _prepareColumns()
|
32 |
+
{
|
33 |
+
|
34 |
+
$this->addColumn('id',array(
|
35 |
+
'header'=> Mage::helper('imedia_ticketsupport')->__('ID'),
|
36 |
+
'align' =>'right',
|
37 |
+
'width' => '50px',
|
38 |
+
'index' => 'id'
|
39 |
+
)
|
40 |
+
);
|
41 |
+
|
42 |
+
$this->addColumn('title',
|
43 |
+
array(
|
44 |
+
'header'=> Mage::helper('imedia_ticketsupport')->__('title'),
|
45 |
+
'index' => 'title'
|
46 |
+
)
|
47 |
+
);
|
48 |
+
|
49 |
+
$this->addColumn('dept',
|
50 |
+
array(
|
51 |
+
'header'=> Mage::helper('imedia_ticketsupport')->__('Department'),
|
52 |
+
'index' => 'dept'
|
53 |
+
)
|
54 |
+
);
|
55 |
+
$this->addColumn('priority',
|
56 |
+
array(
|
57 |
+
'header'=> Mage::helper('imedia_ticketsupport')->__('Priority'),
|
58 |
+
'index' => 'priority'
|
59 |
+
)
|
60 |
+
);
|
61 |
+
$this->addColumn('created_at',
|
62 |
+
array(
|
63 |
+
'header'=> Mage::helper('imedia_ticketsupport')->__('Created on'),
|
64 |
+
'index' => 'created_at'
|
65 |
+
)
|
66 |
+
);
|
67 |
+
$this->addColumn('status',
|
68 |
+
array(
|
69 |
+
'header'=> Mage::helper('imedia_ticketsupport')->__('status'),
|
70 |
+
'index' => 'status'
|
71 |
+
)
|
72 |
+
);
|
73 |
+
|
74 |
+
$this->addColumn('action',
|
75 |
+
array(
|
76 |
+
'header' => Mage::helper('imedia_ticketsupport')->__('Action'),
|
77 |
+
'width' => '50px',
|
78 |
+
'type' => 'action',
|
79 |
+
'getter' => 'getId',
|
80 |
+
'actions' => array(
|
81 |
+
array(
|
82 |
+
'caption' => Mage::helper('imedia_ticketsupport')->__('View'),
|
83 |
+
'url' => array(
|
84 |
+
'base'=>'*/*/edit',
|
85 |
+
'params'=>array('store'=>$this->getRequest()->getParam('store'))
|
86 |
+
),
|
87 |
+
'field' => 'id'
|
88 |
+
)
|
89 |
+
),
|
90 |
+
'filter' => false,
|
91 |
+
'sortable' => false,
|
92 |
+
'index' => 'stores',
|
93 |
+
));
|
94 |
+
|
95 |
+
return parent::_prepareColumns();
|
96 |
+
}
|
97 |
+
protected function _prepareMassAction()
|
98 |
+
{
|
99 |
+
$this->setMassactionIdField('id');
|
100 |
+
$this->getMassactionBlock()->setFormFieldName('id');
|
101 |
+
|
102 |
+
$this->getMassactionBlock()->addItem('delete', array(
|
103 |
+
'label'=> Mage::helper('imedia_ticketsupport')->__('Delete'),
|
104 |
+
'url' => $this->getUrl('*/*/massDelete', array('' => '')),
|
105 |
+
'confirm' => Mage::helper('imedia_ticketsupport')->__('Are you sure you want to delete the selected listing(s)?')
|
106 |
+
));
|
107 |
+
|
108 |
+
$this->getMassactionBlock()->addItem('closed', array(
|
109 |
+
'label'=> Mage::helper('imedia_ticketsupport')->__('Close Ticket'),
|
110 |
+
'url' => $this->getUrl('*/*/massClose', array('_current'=>true)),
|
111 |
+
));
|
112 |
+
|
113 |
+
$this->getMassactionBlock()->addItem('open', array(
|
114 |
+
'label'=> Mage::helper('imedia_ticketsupport')->__('Open Ticket'),
|
115 |
+
'url' => $this->getUrl('*/*/massOpen', array('_current'=>true)),
|
116 |
+
));
|
117 |
+
|
118 |
+
return $this;
|
119 |
+
}
|
120 |
+
public function getRowUrl($row)
|
121 |
+
{
|
122 |
+
return $this->getUrl('*/*/edit', array('id' => $row->getId()));
|
123 |
+
}
|
124 |
+
|
125 |
+
}
|
app/code/community/Imedia/TicketSupport/Block/Tickets.php
ADDED
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
*iMedia Ticket Support Ticket Block
|
4 |
+
*/
|
5 |
+
class Imedia_TicketSupport_Block_Tickets extends Mage_Core_Block_Template
|
6 |
+
{
|
7 |
+
|
8 |
+
public function __construct() {
|
9 |
+
parent::__construct();
|
10 |
+
$collection = Mage::getModel('imedia_ticketsupport/support')->getCollection();
|
11 |
+
if (Mage::getSingleton('customer/session')->isLoggedIn()) {
|
12 |
+
$customer = Mage::getSingleton('customer/session')->getCustomer();
|
13 |
+
$cust_id = $customer->getId();
|
14 |
+
}
|
15 |
+
$collection->addFieldToFilter( 'customerid', $cust_id );
|
16 |
+
$collection->addFieldToFilter( 'status','open');
|
17 |
+
$collection->getSelect()->order('created_at desc');
|
18 |
+
$this->setCollection($collection);
|
19 |
+
}
|
20 |
+
|
21 |
+
protected function _prepareLayout() {
|
22 |
+
parent::_prepareLayout();
|
23 |
+
$pager = $this->getLayout()->createBlock('page/html_pager', 'custom.pager');
|
24 |
+
$pager->setAvailableLimit(array(10=>10,20=>20,30=>30,'all'=>'all'));
|
25 |
+
$pager->setCollection($this->getCollection());
|
26 |
+
$this->setChild('pager', $pager);
|
27 |
+
$this->getCollection()->load();
|
28 |
+
return $this;
|
29 |
+
}
|
30 |
+
|
31 |
+
public function getPagerHtml() {
|
32 |
+
return $this->getChildHtml('pager');
|
33 |
+
}
|
34 |
+
}
|
app/code/community/Imedia/TicketSupport/Block/Viewticket.php
ADDED
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
*iMedia Ticket Support View Ticket
|
4 |
+
*/
|
5 |
+
class Imedia_TicketSupport_Block_Viewticket extends Mage_Core_Block_Template
|
6 |
+
{
|
7 |
+
|
8 |
+
public function __construct() {
|
9 |
+
parent::__construct();
|
10 |
+
$ticketid = $this->getRequest()->getParam('id');
|
11 |
+
$collection = Mage::getModel('imedia_ticketsupport/details')->getCollection();
|
12 |
+
$collection->addFieldToFilter('ticketid', $ticketid );
|
13 |
+
$collection->getSelect()->order('commentdate desc');
|
14 |
+
$this->setCollection($collection);
|
15 |
+
}
|
16 |
+
|
17 |
+
protected function _prepareLayout() {
|
18 |
+
parent::_prepareLayout();
|
19 |
+
$pager = $this->getLayout()->createBlock('page/html_pager', 'custom.pager');
|
20 |
+
$pager->setAvailableLimit(array(10=>10,20=>20,30=>30,'all'=>'all'));
|
21 |
+
$pager->setCollection($this->getCollection());
|
22 |
+
$this->setChild('pager', $pager);
|
23 |
+
$this->getCollection()->load();
|
24 |
+
return $this;
|
25 |
+
}
|
26 |
+
|
27 |
+
public function getPagerHtml() {
|
28 |
+
return $this->getChildHtml('pager');
|
29 |
+
}
|
30 |
+
}
|
app/code/community/Imedia/TicketSupport/Helper/Data.php
ADDED
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
*iMedia Ticket Support Helper
|
4 |
+
*/
|
5 |
+
class Imedia_TicketSupport_Helper_Data extends Mage_Core_Helper_Abstract
|
6 |
+
{
|
7 |
+
|
8 |
+
}
|
app/code/community/Imedia/TicketSupport/Model/Details.php
ADDED
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Imedia_TicketSupport_Model_Details extends Mage_Core_Model_Abstract
|
3 |
+
{
|
4 |
+
public function _construct()
|
5 |
+
{
|
6 |
+
parent::_construct();
|
7 |
+
$this->_init('imedia_ticketsupport/details');
|
8 |
+
}
|
9 |
+
}
|
app/code/community/Imedia/TicketSupport/Model/Mysql4/Details.php
ADDED
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Imedia_TicketSupport_Model_Mysql4_Details extends Mage_Core_Model_Mysql4_Abstract
|
4 |
+
{
|
5 |
+
public function _construct()
|
6 |
+
{
|
7 |
+
$this->_init('imedia_ticketsupport/details', 'id');
|
8 |
+
}
|
9 |
+
}
|
app/code/community/Imedia/TicketSupport/Model/Mysql4/Details/Collection.php
ADDED
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Imedia_TicketSupport_Model_Mysql4_Details_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
|
4 |
+
{
|
5 |
+
public function _construct()
|
6 |
+
{
|
7 |
+
parent::_construct();
|
8 |
+
$this->_init('imedia_ticketsupport/details');
|
9 |
+
}
|
10 |
+
}
|
app/code/community/Imedia/TicketSupport/Model/Mysql4/Support.php
ADDED
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Imedia_TicketSupport_Model_Mysql4_Support extends Mage_Core_Model_Mysql4_Abstract
|
4 |
+
{
|
5 |
+
public function _construct()
|
6 |
+
{
|
7 |
+
$this->_init('imedia_ticketsupport/support', 'id');
|
8 |
+
}
|
9 |
+
}
|
app/code/community/Imedia/TicketSupport/Model/Mysql4/Support/Collection.php
ADDED
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Imedia_TicketSupport_Model_Mysql4_Support_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
|
4 |
+
{
|
5 |
+
public function _construct()
|
6 |
+
{
|
7 |
+
parent::_construct();
|
8 |
+
$this->_init('imedia_ticketsupport/support');
|
9 |
+
}
|
10 |
+
}
|
app/code/community/Imedia/TicketSupport/Model/Support.php
ADDED
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Imedia_TicketSupport_Model_Support extends Mage_Core_Model_Abstract
|
3 |
+
{
|
4 |
+
public function _construct()
|
5 |
+
{
|
6 |
+
parent::_construct();
|
7 |
+
$this->_init('imedia_ticketsupport/support');
|
8 |
+
}
|
9 |
+
}
|
app/code/community/Imedia/TicketSupport/controllers/Adminhtml/SupportController.php
ADDED
@@ -0,0 +1,219 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
*iMedia Ticket Support Controller
|
4 |
+
*/
|
5 |
+
class Imedia_TicketSupport_Adminhtml_SupportController extends Mage_Adminhtml_Controller_Action
|
6 |
+
{
|
7 |
+
public function indexAction()
|
8 |
+
{
|
9 |
+
$this->_initAction()->renderLayout();
|
10 |
+
}
|
11 |
+
|
12 |
+
|
13 |
+
/**
|
14 |
+
* Initialize action
|
15 |
+
* @return Mage_Adminhtml_Controller_Action
|
16 |
+
*/
|
17 |
+
protected function _initAction()
|
18 |
+
{
|
19 |
+
$this->loadLayout()
|
20 |
+
->_setActiveMenu('imedia_ticketsupport_support')
|
21 |
+
->_title(Mage::helper('imedia_ticketsupport')->__('Ticket Support'))
|
22 |
+
->_addBreadcrumb(Mage::helper('imedia_ticketsupport')->__('Ticket Support'))
|
23 |
+
->_addBreadcrumb(Mage::helper('imedia_ticketsupport')->__('Ticket Support'));
|
24 |
+
|
25 |
+
return $this;
|
26 |
+
}
|
27 |
+
public function newAction()
|
28 |
+
{
|
29 |
+
$this->_forward('edit');
|
30 |
+
}
|
31 |
+
|
32 |
+
public function editAction()
|
33 |
+
{
|
34 |
+
|
35 |
+
$this->loadLayout();
|
36 |
+
$this->getLayout()->getBlock('content')->append($this->getLayout()->createBlock('imedia_ticketsupport/adminhtml_customform'));
|
37 |
+
$this->renderLayout();
|
38 |
+
|
39 |
+
}
|
40 |
+
public function updateticketAction()
|
41 |
+
{
|
42 |
+
$post = $this->getRequest()->getParams();
|
43 |
+
$content = $post['content'];
|
44 |
+
$ticketid = $post['id'];
|
45 |
+
$commentdate = date('Y-M-d');
|
46 |
+
|
47 |
+
$postData1 = array('ticketid'=>$ticketid,'sender'=>'admin','comments'=> htmlspecialchars ($content),'commentdate'=>$commentdate);
|
48 |
+
|
49 |
+
$detailsModel = Mage::getModel('imedia_ticketsupport/details');
|
50 |
+
$detailsModel->setData($postData1);
|
51 |
+
$detailsModel->save();
|
52 |
+
|
53 |
+
$supportModel = Mage::getModel('imedia_ticketsupport/support')->getCollection()->addFieldToFilter('id',$ticketid)->getFirstItem();
|
54 |
+
$customerid = $supportModel->getCustomerid();
|
55 |
+
$title = $supportModel->getTitle();
|
56 |
+
|
57 |
+
$customer = Mage::getModel('customer/customer')->load($customerid);
|
58 |
+
$customerEmail = $customer->getEmail();
|
59 |
+
$customerName = $customer->getName();
|
60 |
+
|
61 |
+
$customerQues = Mage::getModel('imedia_ticketsupport/details')->getCollection();
|
62 |
+
$customerQues->addFieldToFilter('ticketid', $ticketid );
|
63 |
+
$customerQues->addFieldToFilter('sender', $customerName );
|
64 |
+
$customerQues->getSelect()->order('comments DESC');
|
65 |
+
$custQue = $customerQues->getFirstItem()->getComments();
|
66 |
+
|
67 |
+
//$customerData = Mage::getModel('customer/customer')->load($customerid)->getData();
|
68 |
+
//echo $customerEmail = $customerData->getEmail(); die();
|
69 |
+
|
70 |
+
try{
|
71 |
+
//customer notification email
|
72 |
+
|
73 |
+
$emailTemplate = Mage::getModel('core/email_template')->loadDefault('ticket_customer_notification');
|
74 |
+
//Getting the Store E-Mail Sender Name.
|
75 |
+
$storeName = Mage::getStoreConfig('general/store_information/name');
|
76 |
+
$adminEmail = Mage::getStoreConfig('trans_email/ident_general/email');
|
77 |
+
//Getting the Store General E-Mail.
|
78 |
+
$customerEmail = $customerEmail;
|
79 |
+
//Variables for Confirmation Mail.
|
80 |
+
$emailTemplateVariables = array();
|
81 |
+
$emailTemplateVariables['ticketId'] =' (#'.$ticketid.')';
|
82 |
+
$emailTemplateVariables['adminName'] = ucfirst($storeName);
|
83 |
+
$emailTemplateVariables['adminComment'] = htmlspecialchars($content);
|
84 |
+
$emailTemplateVariables['custlastComment'] = htmlspecialchars($custQue);
|
85 |
+
|
86 |
+
$processedTemplate = $emailTemplate->getProcessedTemplate($emailTemplateVariables);
|
87 |
+
|
88 |
+
$subject = $title.' (#'.$ticketid.')';
|
89 |
+
$mail = Mage::getModel('core/email')
|
90 |
+
->setToName($customerName)
|
91 |
+
->setToEmail($customerEmail)
|
92 |
+
->setBody($processedTemplate)
|
93 |
+
->setSubject('Ticket Support - '.$subject)
|
94 |
+
->setFromEmail($adminEmail)
|
95 |
+
->setFromName($storeName)
|
96 |
+
->setType('html');
|
97 |
+
|
98 |
+
$mail->send();
|
99 |
+
|
100 |
+
Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('imedia_ticketsupport')->__('Comment was successfully posted'));
|
101 |
+
$this->_redirect('*/*/');
|
102 |
+
|
103 |
+
}catch (Exception $e) {
|
104 |
+
Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
|
105 |
+
$this->_redirect('*/*/');
|
106 |
+
}
|
107 |
+
|
108 |
+
}
|
109 |
+
|
110 |
+
public function deleteAction()
|
111 |
+
{
|
112 |
+
if( $this->getRequest()->getParam('id') > 0 ) {
|
113 |
+
try {
|
114 |
+
$model = Mage::getModel('imedia_ticketsupport/support');
|
115 |
+
$model->setId($this->getRequest()->getParam('id'))->delete();
|
116 |
+
Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('imedia_ticketsupport')->__('Ticket was successfully deleted'));
|
117 |
+
$this->_redirect('*/*/');
|
118 |
+
} catch (Exception $e) {
|
119 |
+
Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
|
120 |
+
$this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));
|
121 |
+
}
|
122 |
+
}
|
123 |
+
$this->_redirect('*/*/');
|
124 |
+
}
|
125 |
+
|
126 |
+
|
127 |
+
public function massDeleteAction()
|
128 |
+
{
|
129 |
+
$adListingIds = $this->getRequest()->getParam('id');
|
130 |
+
if(!is_array($adListingIds)) {
|
131 |
+
Mage::getSingleton('adminhtml/session')->addError(Mage::helper('imedia_ticketsupport')->__('Please select Any Listing(s).'));
|
132 |
+
} else {
|
133 |
+
try {
|
134 |
+
$model = Mage::getSingleton('imedia_ticketsupport/support');
|
135 |
+
|
136 |
+
foreach ($adListingIds as $adId) {
|
137 |
+
|
138 |
+
$model->load($adId)->delete();
|
139 |
+
|
140 |
+
}
|
141 |
+
Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('imedia_ticketsupport')->__('Total of %d record(s) were deleted.', count($adListingIds)));
|
142 |
+
} catch (Exception $e) {
|
143 |
+
Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
|
144 |
+
}
|
145 |
+
}
|
146 |
+
$this->_redirect('*/*/');
|
147 |
+
}
|
148 |
+
|
149 |
+
|
150 |
+
public function massOpenAction()
|
151 |
+
{
|
152 |
+
|
153 |
+
$ids = $this->getRequest()->getParam('id');
|
154 |
+
if(!is_array($ids)) {
|
155 |
+
Mage::getSingleton('adminhtml/session')->addError(Mage::helper('adminhtml')->__('Please select the records to change ticket status'));
|
156 |
+
}
|
157 |
+
else {
|
158 |
+
try {
|
159 |
+
$model = Mage::getModel('imedia_ticketsupport/support');
|
160 |
+
foreach ($ids as $id) {
|
161 |
+
$model->load($id)->setStatus('open')->save();
|
162 |
+
}
|
163 |
+
}
|
164 |
+
catch (Exception $e) {
|
165 |
+
Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
|
166 |
+
}
|
167 |
+
}
|
168 |
+
Mage::getSingleton('core/session')->addSuccess($this->__('Ticket status successfully changed for Ticket #id %s',$id));
|
169 |
+
$this->_redirect('*/*/');
|
170 |
+
}
|
171 |
+
|
172 |
+
/**
|
173 |
+
* Set featured product
|
174 |
+
*
|
175 |
+
*/
|
176 |
+
public function massCloseAction()
|
177 |
+
{
|
178 |
+
$ids = $this->getRequest()->getParam('id');
|
179 |
+
if(!is_array($ids)) {
|
180 |
+
Mage::getSingleton('adminhtml/session')->addError(Mage::helper('adminhtml')->__('Please select the records to change ticket status'));
|
181 |
+
}
|
182 |
+
else {
|
183 |
+
try {
|
184 |
+
$model = Mage::getModel('imedia_ticketsupport/support');
|
185 |
+
foreach ($ids as $id) {
|
186 |
+
$model->load($id)->setStatus('close')->save();
|
187 |
+
}
|
188 |
+
}
|
189 |
+
catch (Exception $e) {
|
190 |
+
Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
|
191 |
+
}
|
192 |
+
}
|
193 |
+
Mage::getSingleton('core/session')->addSuccess($this->__('Ticket status successfully changed for Ticket #id %s',$id));
|
194 |
+
$this->_redirect('*/*/');
|
195 |
+
}
|
196 |
+
|
197 |
+
public function closeticketAction()
|
198 |
+
{
|
199 |
+
$id = $this->getRequest()->getParam('id');
|
200 |
+
|
201 |
+
$model = Mage::getModel('imedia_ticketsupport/support');
|
202 |
+
$model->load($id)->setStatus('close')->save();
|
203 |
+
|
204 |
+
Mage::getSingleton('core/session')->addSuccess($this->__('Ticket status successfully changed for Ticket #id %s',$id));
|
205 |
+
$this->_redirect('*/*/');
|
206 |
+
}
|
207 |
+
|
208 |
+
|
209 |
+
public function messageAction()
|
210 |
+
{
|
211 |
+
$data = Mage::getModel('imedia_ticketsupport/support')->load($this->getRequest()->getParam('id'));
|
212 |
+
echo $data->getContent();
|
213 |
+
}
|
214 |
+
protected function _isAllowed()
|
215 |
+
{
|
216 |
+
return Mage::getSingleton('admin/session')->isAllowed('imedia_ticketsupport_support');
|
217 |
+
}
|
218 |
+
|
219 |
+
}
|
app/code/community/Imedia/TicketSupport/controllers/IndexController.php
ADDED
@@ -0,0 +1,195 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
*iMedia Ticket Support Controller
|
4 |
+
*/
|
5 |
+
class Imedia_TicketSupport_IndexController extends Mage_Core_Controller_Front_Action
|
6 |
+
{
|
7 |
+
function indexAction()
|
8 |
+
{
|
9 |
+
if( !Mage::getSingleton('customer/session')->isLoggedIn() ) {
|
10 |
+
Mage::getSingleton('customer/session')->authenticate($this);
|
11 |
+
return;
|
12 |
+
}
|
13 |
+
|
14 |
+
$this->loadLayout();
|
15 |
+
$navigationBlock = $this->getLayout()->getBlock('customer_account_navigation');
|
16 |
+
if ($navigationBlock) {
|
17 |
+
$navigationBlock->setActive('ticketsupport/index');
|
18 |
+
}
|
19 |
+
|
20 |
+
$this->renderLayout();
|
21 |
+
}
|
22 |
+
|
23 |
+
function ticketsAction()
|
24 |
+
{
|
25 |
+
if( !Mage::getSingleton('customer/session')->isLoggedIn() ) {
|
26 |
+
Mage::getSingleton('customer/session')->authenticate($this);
|
27 |
+
return;
|
28 |
+
}
|
29 |
+
|
30 |
+
$this->loadLayout();
|
31 |
+
$navigationBlock = $this->getLayout()->getBlock('customer_account_navigation');
|
32 |
+
if ($navigationBlock) {
|
33 |
+
$navigationBlock->setActive('ticketsupport/index/tickets');
|
34 |
+
}
|
35 |
+
|
36 |
+
$this->renderLayout();
|
37 |
+
}
|
38 |
+
|
39 |
+
function sendAction()
|
40 |
+
{
|
41 |
+
|
42 |
+
$post = $this->getRequest()->getPost();
|
43 |
+
$title = $post['ticket_subject'];
|
44 |
+
$department = $post['t_department_id'];
|
45 |
+
$priority = $post['t_priority_id'];
|
46 |
+
$content = $post['content'];
|
47 |
+
$created_time = date('Y-M-d');
|
48 |
+
|
49 |
+
if(Mage::getSingleton('customer/session')->isLoggedIn()) {
|
50 |
+
$customerData = Mage::getSingleton('customer/session')->getCustomer();
|
51 |
+
$customerid = $customerData->getId();
|
52 |
+
$customer_name = $customerData->getName();
|
53 |
+
$customer_email = $customerData->getEmail();
|
54 |
+
}
|
55 |
+
|
56 |
+
$postData = array('title'=>$title,'created_at'=>$created_time, 'dept'=>$department, 'priority'=> $priority, 'customerid'=> $customerid, 'status'=>'open');
|
57 |
+
|
58 |
+
$supportModel = Mage::getModel('imedia_ticketsupport/support');
|
59 |
+
$supportModel->setData($postData);
|
60 |
+
$supportModel->save();
|
61 |
+
|
62 |
+
$ticket_id = $supportModel->getId();
|
63 |
+
|
64 |
+
|
65 |
+
$postData1 = array('ticketid'=>$ticket_id,'sender'=>$customer_name,'comments'=> htmlspecialchars ($content),'commentdate'=>$created_time);
|
66 |
+
|
67 |
+
$detailsModel = Mage::getModel('imedia_ticketsupport/details');
|
68 |
+
|
69 |
+
try{
|
70 |
+
//admin notification email
|
71 |
+
|
72 |
+
$emailTemplate = Mage::getModel('core/email_template')->loadDefault('ticket_admin_notification');
|
73 |
+
//Getting the Store E-Mail Sender Name.
|
74 |
+
$storeName = Mage::getStoreConfig('general/store_information/name');
|
75 |
+
//Getting the Store General E-Mail.
|
76 |
+
$adminEmail = Mage::getStoreConfig('trans_email/ident_general/email');
|
77 |
+
//Variables for Confirmation Mail.
|
78 |
+
$emailTemplateVariables = array();
|
79 |
+
$emailTemplateVariables['ticketId'] =' (#'.$ticketid.')';
|
80 |
+
$emailTemplateVariables['customerName'] = ucfirst($customer_name);
|
81 |
+
$emailTemplateVariables['customerComment'] = htmlspecialchars ($content);
|
82 |
+
|
83 |
+
$processedTemplate = $emailTemplate->getProcessedTemplate($emailTemplateVariables);
|
84 |
+
|
85 |
+
$subject = $title.' (#'.$ticket_id.')';
|
86 |
+
$mail = Mage::getModel('core/email')
|
87 |
+
->setToName($storeName)
|
88 |
+
->setToEmail($adminEmail)
|
89 |
+
->setBody($processedTemplate)
|
90 |
+
->setSubject('Ticket Support - '.$subject)
|
91 |
+
->setFromEmail($customer_email)
|
92 |
+
->setFromName($customer_name)
|
93 |
+
->setType('html');
|
94 |
+
|
95 |
+
$mail->send();
|
96 |
+
|
97 |
+
$detailsModel->setData($postData1);
|
98 |
+
$detailsModel->save();
|
99 |
+
Mage::getSingleton('core/session')->addSuccess('Your ticket has been created.');
|
100 |
+
Mage::app()->getFrontController()->getResponse()->setRedirect(Mage::getUrl("ticketsupport/index/tickets/"));
|
101 |
+
}catch (Exception $e) {
|
102 |
+
Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
|
103 |
+
Mage::app()->getFrontController()->getResponse()->setRedirect(Mage::getUrl("ticketsupport/index/tickets/"));
|
104 |
+
}
|
105 |
+
}
|
106 |
+
function viewticketAction()
|
107 |
+
{
|
108 |
+
|
109 |
+
if( !Mage::getSingleton('customer/session')->isLoggedIn() ) {
|
110 |
+
Mage::getSingleton('customer/session')->authenticate($this);
|
111 |
+
return;
|
112 |
+
}
|
113 |
+
|
114 |
+
$this->loadLayout();
|
115 |
+
$navigationBlock = $this->getLayout()->getBlock('customer_account_navigation');
|
116 |
+
if ($navigationBlock) {
|
117 |
+
$navigationBlock->setActive('ticketsupport/index/tickets');
|
118 |
+
}
|
119 |
+
|
120 |
+
$this->renderLayout();
|
121 |
+
}
|
122 |
+
|
123 |
+
function replyAction()
|
124 |
+
{
|
125 |
+
|
126 |
+
$post = $this->getRequest()->getParams();
|
127 |
+
$content = $post['content'];
|
128 |
+
$ticketid = $post['ticket_id'];
|
129 |
+
$commentdate = date('Y-M-d');
|
130 |
+
|
131 |
+
if(Mage::getSingleton('customer/session')->isLoggedIn()) {
|
132 |
+
$customerData = Mage::getSingleton('customer/session')->getCustomer();
|
133 |
+
$customer_name = $customerData->getName();
|
134 |
+
$customerEmail = $customerData->getEmail();
|
135 |
+
}
|
136 |
+
|
137 |
+
$postData1 = array('ticketid'=>$ticketid,'sender'=>$customer_name,'comments'=> htmlspecialchars ($content),'commentdate'=>$commentdate);
|
138 |
+
|
139 |
+
$detailsModel = Mage::getModel('imedia_ticketsupport/details');
|
140 |
+
$detailsModel->setData($postData1);
|
141 |
+
$detailsModel->save();
|
142 |
+
|
143 |
+
|
144 |
+
$adminReplies = Mage::getModel('imedia_ticketsupport/details')->getCollection();
|
145 |
+
$adminReplies->addFieldToFilter('ticketid', $ticketid );
|
146 |
+
$adminReplies->addFieldToFilter('sender', 'admin' );
|
147 |
+
$adminReplies->getSelect()->order('comments DESC');
|
148 |
+
//$custQue = $customerQues->getFirstItem()->getComments();
|
149 |
+
$adminReply = $adminReplies->getFirstItem()->getComments();
|
150 |
+
|
151 |
+
|
152 |
+
try{
|
153 |
+
//customer notification email
|
154 |
+
|
155 |
+
$emailTemplate = Mage::getModel('core/email_template')->loadDefault('ticket_customer_replied_notification');
|
156 |
+
//Getting the Store E-Mail Sender Name.
|
157 |
+
$storeName = Mage::getStoreConfig('general/store_information/name');
|
158 |
+
$adminEmail = Mage::getStoreConfig('trans_email/ident_general/email');
|
159 |
+
//Getting the Store General E-Mail.
|
160 |
+
$customerEmail = $customerEmail;
|
161 |
+
//Variables for Confirmation Mail.
|
162 |
+
$emailTemplateVariables = array();
|
163 |
+
$emailTemplateVariables['ticketId'] =' (#'.$ticketid.')';
|
164 |
+
$emailTemplateVariables['customerName'] = ucfirst($customer_name);
|
165 |
+
$emailTemplateVariables['customerComment'] = htmlspecialchars($content);
|
166 |
+
$emailTemplateVariables['adminlastComment'] = htmlspecialchars($adminReply);
|
167 |
+
|
168 |
+
$processedTemplate = $emailTemplate->getProcessedTemplate($emailTemplateVariables);
|
169 |
+
|
170 |
+
$subject = $title.' (#'.$ticketid.')';
|
171 |
+
$mail = Mage::getModel('core/email')
|
172 |
+
->setToName($storeName)
|
173 |
+
->setToEmail($adminEmail)
|
174 |
+
->setBody($processedTemplate)
|
175 |
+
->setSubject('Ticket Support - '.$subject)
|
176 |
+
->setFromEmail($customerEmail)
|
177 |
+
->setFromName($customer_name)
|
178 |
+
->setType('html');
|
179 |
+
|
180 |
+
$mail->send();
|
181 |
+
|
182 |
+
Mage::getSingleton('core/session')->addSuccess('Your comment has been submitted.');
|
183 |
+
Mage::app()->getFrontController()->getResponse()->setRedirect(Mage::getUrl("ticketsupport/index/viewticket?id=".$ticketid));
|
184 |
+
|
185 |
+
}catch (Exception $e) {
|
186 |
+
Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
|
187 |
+
Mage::app()->getFrontController()->getResponse()->setRedirect(Mage::getUrl("ticketsupport/index/viewticket?id=".$ticketid));
|
188 |
+
}
|
189 |
+
|
190 |
+
|
191 |
+
|
192 |
+
|
193 |
+
}
|
194 |
+
|
195 |
+
}
|
app/code/community/Imedia/TicketSupport/etc/adminhtml.xml
ADDED
@@ -0,0 +1,56 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<config>
|
3 |
+
<menu>
|
4 |
+
<imedia_ticketsupport_support translate="title" module="imedia_ticketsupport">
|
5 |
+
<title>Ticket Support</title>
|
6 |
+
<sort_order>999</sort_order>
|
7 |
+
<children>
|
8 |
+
<adminhtml_support translate="title">
|
9 |
+
<title>Ticket Support</title>
|
10 |
+
<sort_order>1</sort_order>
|
11 |
+
<action>adminhtml/support</action>
|
12 |
+
</adminhtml_support>
|
13 |
+
</children>
|
14 |
+
</imedia_ticketsupport_support>
|
15 |
+
</menu>
|
16 |
+
<acl>
|
17 |
+
<resources>
|
18 |
+
<admin>
|
19 |
+
<children>
|
20 |
+
<imedia_ticketsupport_support translate="title" module="imedia_ticketsupport">
|
21 |
+
<title>Ticket Support</title>
|
22 |
+
<sort_order>999</sort_order>
|
23 |
+
<children>
|
24 |
+
<adminhtml_support translate="title">
|
25 |
+
<title>Ticket Support</title>
|
26 |
+
<sort_order>1</sort_order>
|
27 |
+
</adminhtml_support>
|
28 |
+
</children>
|
29 |
+
</imedia_ticketsupport_support>
|
30 |
+
</children>
|
31 |
+
</admin>
|
32 |
+
</resources>
|
33 |
+
</acl>
|
34 |
+
<acl>
|
35 |
+
<resources>
|
36 |
+
<all>
|
37 |
+
<title>Allow Everything</title>
|
38 |
+
</all>
|
39 |
+
<admin>
|
40 |
+
<children>
|
41 |
+
<system>
|
42 |
+
<children>
|
43 |
+
<config>
|
44 |
+
<children>
|
45 |
+
<ticketsupport translate="title" module="imedia_ticketsupport">
|
46 |
+
<title>Ticket Support</title>
|
47 |
+
</ticketsupport>
|
48 |
+
</children>
|
49 |
+
</config>
|
50 |
+
</children>
|
51 |
+
</system>
|
52 |
+
</children>
|
53 |
+
</admin>
|
54 |
+
</resources>
|
55 |
+
</acl>
|
56 |
+
</config>
|
app/code/community/Imedia/TicketSupport/etc/config.xml
ADDED
@@ -0,0 +1,117 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<config>
|
2 |
+
<modules>
|
3 |
+
<Imedia_TicketSupport>
|
4 |
+
<version>0.1.0</version>
|
5 |
+
</Imedia_TicketSupport>
|
6 |
+
</modules>
|
7 |
+
<frontend>
|
8 |
+
<routers>
|
9 |
+
<imedia_ticketsupport>
|
10 |
+
<use>standard</use>
|
11 |
+
<args>
|
12 |
+
<module>Imedia_TicketSupport</module>
|
13 |
+
<frontName>ticketsupport</frontName>
|
14 |
+
</args>
|
15 |
+
</imedia_ticketsupport>
|
16 |
+
</routers>
|
17 |
+
<layout>
|
18 |
+
<updates>
|
19 |
+
<imedia_ticketsupport>
|
20 |
+
<file>imedia/imedia_ticketsupport.xml</file>
|
21 |
+
</imedia_ticketsupport>
|
22 |
+
</updates>
|
23 |
+
</layout>
|
24 |
+
</frontend>
|
25 |
+
<global>
|
26 |
+
<helpers>
|
27 |
+
<imedia_ticketsupport>
|
28 |
+
<class>Imedia_TicketSupport_Helper</class>
|
29 |
+
</imedia_ticketsupport>
|
30 |
+
</helpers>
|
31 |
+
<blocks>
|
32 |
+
<imedia_ticketsupport>
|
33 |
+
<class>Imedia_TicketSupport_Block</class>
|
34 |
+
</imedia_ticketsupport>
|
35 |
+
</blocks>
|
36 |
+
<models>
|
37 |
+
<imedia_ticketsupport>
|
38 |
+
<class>Imedia_TicketSupport_Model</class>
|
39 |
+
<resourceModel>imedia_ticketsupport_mysql4</resourceModel>
|
40 |
+
</imedia_ticketsupport>
|
41 |
+
<imedia_ticketsupport_mysql4>
|
42 |
+
<class>Imedia_TicketSupport_Model_Mysql4</class>
|
43 |
+
<entities>
|
44 |
+
<support>
|
45 |
+
<table>ticket_support</table>
|
46 |
+
</support>
|
47 |
+
<details>
|
48 |
+
<table>ticket_details</table>
|
49 |
+
</details>
|
50 |
+
</entities>
|
51 |
+
</imedia_ticketsupport_mysql4>
|
52 |
+
</models>
|
53 |
+
<template>
|
54 |
+
<email>
|
55 |
+
<ticket_admin_notification translate="label" module="imedia_ticketsupport">
|
56 |
+
<label>Customer Ticket Admin Notification</label>
|
57 |
+
<file>imedia/ticket_admin_notification.html</file>
|
58 |
+
<type>html</type>
|
59 |
+
</ticket_admin_notification>
|
60 |
+
</email>
|
61 |
+
<email>
|
62 |
+
<ticket_customer_notification translate="label" module="imedia_ticketsupport">
|
63 |
+
<label>Admin Ticket Reply Mail To User</label>
|
64 |
+
<file>imedia/ticket_customer_notification.html</file>
|
65 |
+
<type>html</type>
|
66 |
+
</ticket_customer_notification>
|
67 |
+
</email>
|
68 |
+
<email>
|
69 |
+
<ticket_customer_replied_notification translate="label" module="imedia_ticketsupport">
|
70 |
+
<label>Customer Comment On Ticket Mail To admin</label>
|
71 |
+
<file>imedia/ticket_customer_replied_notification.html</file>
|
72 |
+
<type>html</type>
|
73 |
+
</ticket_customer_replied_notification>
|
74 |
+
</email>
|
75 |
+
</template>
|
76 |
+
<resources>
|
77 |
+
<imedia_ticketsupport_setup>
|
78 |
+
<setup>
|
79 |
+
<module>Imedia_TicketSupport</module>
|
80 |
+
</setup>
|
81 |
+
<connection>
|
82 |
+
<use>core_setup</use>
|
83 |
+
</connection>
|
84 |
+
</imedia_ticketsupport_setup>
|
85 |
+
<imedia_ticketsupport_write>
|
86 |
+
<connection>
|
87 |
+
<use>core_write</use>
|
88 |
+
</connection>
|
89 |
+
</imedia_ticketsupport_write>
|
90 |
+
<imedia_ticketsupport_read>
|
91 |
+
<connection>
|
92 |
+
<use>core_read</use>
|
93 |
+
</connection>
|
94 |
+
</imedia_ticketsupport_read>
|
95 |
+
</resources>
|
96 |
+
</global>
|
97 |
+
<admin>
|
98 |
+
<routers>
|
99 |
+
<adminhtml>
|
100 |
+
<args>
|
101 |
+
<modules>
|
102 |
+
<Imedia_TicketSupport before="Mage_Adminhtml">Imedia_TicketSupport_Adminhtml</Imedia_TicketSupport>
|
103 |
+
</modules>
|
104 |
+
</args>
|
105 |
+
</adminhtml>
|
106 |
+
</routers>
|
107 |
+
</admin>
|
108 |
+
<adminhtml>
|
109 |
+
<layout>
|
110 |
+
<updates>
|
111 |
+
<imedia_ticketsupport>
|
112 |
+
<file>imedia/ticketsupport.xml</file>
|
113 |
+
</imedia_ticketsupport>
|
114 |
+
</updates>
|
115 |
+
</layout>
|
116 |
+
</adminhtml>
|
117 |
+
</config>
|
app/code/community/Imedia/TicketSupport/etc/system.xml
ADDED
@@ -0,0 +1,51 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" ?>
|
2 |
+
<!--
|
3 |
+
/**
|
4 |
+
* System configuration file
|
5 |
+
*/
|
6 |
+
-->
|
7 |
+
<config>
|
8 |
+
|
9 |
+
<tabs>
|
10 |
+
<imedia translate="label" module="imedia_ticketsupport">
|
11 |
+
<label>Imedia Extentions</label>
|
12 |
+
<sort_order>12</sort_order>
|
13 |
+
</imedia>
|
14 |
+
</tabs>
|
15 |
+
|
16 |
+
<sections>
|
17 |
+
<ticketsupport translate="label">
|
18 |
+
<class>separator-top</class>
|
19 |
+
<label>Ticket Support</label>
|
20 |
+
<tab>imedia</tab>
|
21 |
+
<frontend_type>text</frontend_type>
|
22 |
+
<sort_order>13</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 |
+
|
27 |
+
<groups>
|
28 |
+
<ticketsupport translate="label">
|
29 |
+
<label>Ticket Support Settings</label>
|
30 |
+
<frontend_type>text</frontend_type>
|
31 |
+
<sort_order>1</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 |
+
<fields>
|
36 |
+
<enable_ticket translate="label">
|
37 |
+
<label>Enable Ticket Support</label>
|
38 |
+
<frontend_type>select</frontend_type>
|
39 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
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 |
+
</enable_ticket>
|
45 |
+
</fields>
|
46 |
+
</ticketsupport>
|
47 |
+
</groups>
|
48 |
+
|
49 |
+
</ticketsupport>
|
50 |
+
</sections>
|
51 |
+
</config>
|
app/code/community/Imedia/TicketSupport/sql/imedia_ticketsupport_setup/mysql4-install-0.0.1.php
ADDED
@@ -0,0 +1,40 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
$installer = $this;
|
4 |
+
|
5 |
+
$installer->startSetup();
|
6 |
+
|
7 |
+
|
8 |
+
$installer->run("
|
9 |
+
|
10 |
+
-- DROP TABLE IF EXISTS {$this->getTable('ticket_details')};
|
11 |
+
|
12 |
+
CREATE TABLE IF NOT EXISTS {$this->getTable('ticket_details')} (
|
13 |
+
`id` int(5) NOT NULL AUTO_INCREMENT,
|
14 |
+
`ticketid` int(5) NOT NULL,
|
15 |
+
`sender` varchar(50) NOT NULL,
|
16 |
+
`comments` varchar(300) NOT NULL,
|
17 |
+
`commentdate` date NOT NULL,
|
18 |
+
PRIMARY KEY (`id`)
|
19 |
+
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ;
|
20 |
+
|
21 |
+
|
22 |
+
-- DROP TABLE IF EXISTS {$this->getTable('ticket_support')};
|
23 |
+
|
24 |
+
CREATE TABLE IF NOT EXISTS {$this->getTable('ticket_support')} (
|
25 |
+
`id` int(5) NOT NULL AUTO_INCREMENT,
|
26 |
+
`created_at` date NOT NULL,
|
27 |
+
`title` varchar(100) NOT NULL,
|
28 |
+
`dept` varchar(100) NOT NULL,
|
29 |
+
`priority` varchar(50) NOT NULL,
|
30 |
+
`customerid` int(5) NOT NULL,
|
31 |
+
`status` varchar(10) NOT NULL,
|
32 |
+
PRIMARY KEY (`id`)
|
33 |
+
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ;
|
34 |
+
|
35 |
+
|
36 |
+
|
37 |
+
");
|
38 |
+
|
39 |
+
|
40 |
+
$installer->endSetup();
|
app/design/adminhtml/default/default/layout/imedia/ticketsupport.xml
ADDED
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<layout>
|
3 |
+
<adminhtml_support_index>
|
4 |
+
<reference name="content">
|
5 |
+
<block type="imedia_ticketsupport/adminhtml_support" name="imedia_ticketsupport_support" />
|
6 |
+
</reference>
|
7 |
+
</adminhtml_support_index>
|
8 |
+
<adminhtml_support_edit>
|
9 |
+
<reference name="head">
|
10 |
+
<action method="addCss"><name>ticketsupport.css</name></action>
|
11 |
+
</reference>
|
12 |
+
</adminhtml_support_edit>
|
13 |
+
</layout>
|
app/design/adminhtml/default/default/template/imedia/tickets.phtml
ADDED
@@ -0,0 +1,91 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
$ticketid = $this->getRequest()->getParam('id');
|
3 |
+
$collection_tickets = Mage::getModel('imedia_ticketsupport/support')->getCollection();
|
4 |
+
$collection_tickets->addFieldToFilter( 'id', $ticketid );
|
5 |
+
|
6 |
+
$collection = Mage::getModel('imedia_ticketsupport/details')->getCollection();
|
7 |
+
$collection->addFieldToFilter('ticketid', $ticketid );
|
8 |
+
$collection->getSelect()->order('commentdate desc');
|
9 |
+
?>
|
10 |
+
|
11 |
+
<?php if($collection->count()): ?>
|
12 |
+
|
13 |
+
<div class="page-title">
|
14 |
+
<h1>[Ticket # <?php echo $collection_tickets->getFirstItem()->getId();?>] <?php echo $collection_tickets->getFirstItem()->getTitle();?></h1>
|
15 |
+
</div>
|
16 |
+
|
17 |
+
<div class="fieldset">
|
18 |
+
<h2 class="legend">Ticket Information</h2>
|
19 |
+
<table cellspacing="0" class="form-list">
|
20 |
+
<tbody>
|
21 |
+
<tr>
|
22 |
+
<td align="left" class="label" width="140">Department: </td>
|
23 |
+
<td><strong><?php echo $collection_tickets->getFirstItem()->getDept();?></strong></td>
|
24 |
+
<td align="right" width="250"><a href="<?php echo Mage::helper("adminhtml")->getUrl("*/*/closeticket",array("id"=>$ticketid)) ?>"> Close this ticket </a></td>
|
25 |
+
</tr>
|
26 |
+
<tr>
|
27 |
+
<td align="left" class="label">Status:</td>
|
28 |
+
<td align="left"><strong><?php echo $collection_tickets->getFirstItem()->getStatus();?></strong></td>
|
29 |
+
<td> </td>
|
30 |
+
</tr>
|
31 |
+
</tbody>
|
32 |
+
</table>
|
33 |
+
</div>
|
34 |
+
|
35 |
+
|
36 |
+
<table class="data-table" id="ticket-table">
|
37 |
+
<colgroup><col width="15%">
|
38 |
+
<col>
|
39 |
+
<col width="15%">
|
40 |
+
</colgroup><thead>
|
41 |
+
<tr>
|
42 |
+
<th>Sender</th>
|
43 |
+
<th>Message</th>
|
44 |
+
<th>Date</th>
|
45 |
+
</tr>
|
46 |
+
</thead>
|
47 |
+
<tbody>
|
48 |
+
<?php foreach($collection as $item): ?>
|
49 |
+
<tr>
|
50 |
+
<td><?php echo $item->getSender();?></td>
|
51 |
+
<td><?php echo $item->getComments();?><br>
|
52 |
+
</td>
|
53 |
+
<td><?php echo $item->getcommentdate();?></td>
|
54 |
+
</tr>
|
55 |
+
<?php endforeach; ?>
|
56 |
+
</tbody>
|
57 |
+
</table>
|
58 |
+
|
59 |
+
<script>
|
60 |
+
function validate()
|
61 |
+
{
|
62 |
+
if(document.getElementById("content").value==null || document.getElementById("content").value=="")
|
63 |
+
{
|
64 |
+
alert("Comment field can't be left blank");
|
65 |
+
return false;
|
66 |
+
}
|
67 |
+
}
|
68 |
+
</script>
|
69 |
+
<div class="clearfix"> </div>
|
70 |
+
<form action="<?php echo $this->getFormAction(); ?>" method="post" id="form-send-reply1" enctype="multipart/form-data" onsubmit="return validate();">
|
71 |
+
<input type="hidden" name="form_key" value="<? echo Mage::getSingleton('core/session')->getFormKey(); ?>" />
|
72 |
+
<div class="fieldset">
|
73 |
+
<h2 class="legend">Reply</h2>
|
74 |
+
<div class="form-list">
|
75 |
+
<label for="content" class="required">Message<em>*</em></label>
|
76 |
+
<div class="input-box">
|
77 |
+
<textarea name="content" id="content" title="Message" class="input-text required-entry" style="width:545px"></textarea>
|
78 |
+
</div>
|
79 |
+
</div>
|
80 |
+
<div class="buttons-set button-send">
|
81 |
+
<p class="required">* Required Fields</p>
|
82 |
+
<button type="submit" title="Send" class="button" ><span><span>Send</span></span></button>
|
83 |
+
</div>
|
84 |
+
</div>
|
85 |
+
</form>
|
86 |
+
|
87 |
+
<?php else: ?>
|
88 |
+
<div class="page-title">
|
89 |
+
<h3>This ticket has been closed or not found</h3>
|
90 |
+
</div>
|
91 |
+
<?php endif; ?>
|
app/design/frontend/base/default/layout/imedia/imedia_ticketsupport.xml
ADDED
@@ -0,0 +1,42 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<layout>
|
3 |
+
<!--
|
4 |
+
Customer account home dashboard layout
|
5 |
+
-->
|
6 |
+
|
7 |
+
<customer_account>
|
8 |
+
<reference name="customer_account_navigation">
|
9 |
+
<action method="addLink" ifconfig="ticketsupport/ticketsupport/enable_ticket" translate="label" module="customer"><name>ticketsupport</name><path>ticketsupport/index/index</path><label>Create Tickets</label></action>
|
10 |
+
|
11 |
+
<action method="addLink" ifconfig="ticketsupport/ticketsupport/enable_ticket" translate="label" module="customer"><name>createticketsupport</name><path>ticketsupport/index/tickets</path><label>Tickets</label></action>
|
12 |
+
</reference>
|
13 |
+
</customer_account>
|
14 |
+
|
15 |
+
<imedia_ticketsupport_index_index>
|
16 |
+
<update handle="customer_account"/>
|
17 |
+
<reference name="my.account.wrapper">
|
18 |
+
<block type="customer/account_dashboard" name="customer.account.link.create">
|
19 |
+
<action method="setTemplate" ifconfig="ticketsupport/ticketsupport/enable_ticket"><template>imedia/im_ticket.phtml</template></action>
|
20 |
+
</block>
|
21 |
+
</reference>
|
22 |
+
</imedia_ticketsupport_index_index>
|
23 |
+
|
24 |
+
<imedia_ticketsupport_index_tickets>
|
25 |
+
<update handle="customer_account"/>
|
26 |
+
<reference name="my.account.wrapper">
|
27 |
+
<block type="imedia_ticketsupport/tickets" name="customer.account.link.tickets">
|
28 |
+
<action method="setTemplate" ifconfig="ticketsupport/ticketsupport/enable_ticket"><template>imedia/tickets.phtml</template></action>
|
29 |
+
</block>
|
30 |
+
</reference>
|
31 |
+
</imedia_ticketsupport_index_tickets>
|
32 |
+
|
33 |
+
<imedia_ticketsupport_index_viewticket>
|
34 |
+
<update handle="customer_account"/>
|
35 |
+
<reference name="my.account.wrapper">
|
36 |
+
<block type="imedia_ticketsupport/viewticket" name="customer.account.link.viewticket" >
|
37 |
+
<action method="setTemplate" ifconfig="ticketsupport/ticketsupport/enable_ticket"><template>imedia/viewticket.phtml</template></action>
|
38 |
+
</block>
|
39 |
+
</reference>
|
40 |
+
</imedia_ticketsupport_index_viewticket>
|
41 |
+
|
42 |
+
</layout>
|
app/design/frontend/base/default/template/imedia/im_ticket.phtml
ADDED
@@ -0,0 +1,45 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<form action="<?php echo $this->getUrl('ticketsupport/index/send'); ?>" method="post" id="form-validate" name="ticketsystem_form" enctype="multipart/form-data">
|
2 |
+
<input name="form_key" type="hidden" value="">
|
3 |
+
<div class="fieldset">
|
4 |
+
<h2 class="legend">Add New Ticket</h2>
|
5 |
+
<div class="form-list">
|
6 |
+
<label for="title" class="required">Title<em>*</em></label>
|
7 |
+
<div class="input-box">
|
8 |
+
<input type="text" name="ticket_subject" id="ticket_subject" title="Title" class="input-text required-entry">
|
9 |
+
</div>
|
10 |
+
<label for="department">Department</label>
|
11 |
+
<div class="input-box">
|
12 |
+
<select name="t_department_id" id="t_department_id" title="Department " class="input-text">
|
13 |
+
<option value="Sales">Sales</option>
|
14 |
+
<option value="Support" selected="selected">Support</option>
|
15 |
+
<option value="Customer Service">Customer Service</option>
|
16 |
+
</select>
|
17 |
+
</div>
|
18 |
+
<label for="priority">Priority</label>
|
19 |
+
<div class="input-box">
|
20 |
+
<select name="t_priority_id" id="t_priority_id" title="Priority " class="input-text">
|
21 |
+
<option value="Critical">Critical</option>
|
22 |
+
<option value="Major">Major</option>
|
23 |
+
<option value="Minor" selected="selected">Minor</option>
|
24 |
+
<option value="Low">Low</option>
|
25 |
+
<option value="Trivial">Trivial</option>
|
26 |
+
</select>
|
27 |
+
</div>
|
28 |
+
<label for="content" class="required">Message<em>*</em></label>
|
29 |
+
<div class="input-box">
|
30 |
+
<textarea name="content" id="content" title="Message" class="input-text required-entry" style="width:545px"></textarea>
|
31 |
+
</div>
|
32 |
+
|
33 |
+
</div>
|
34 |
+
<input name="stores[]" id="stores[]" value="1" type="hidden">
|
35 |
+
<div class="buttons-set">
|
36 |
+
<p class="required">* Required Fields</p>
|
37 |
+
<button type="submit" title="Send" class="button"><span><span>Send</span></span></button>
|
38 |
+
</div>
|
39 |
+
</div>
|
40 |
+
</form>
|
41 |
+
<script type="text/javascript">
|
42 |
+
//<![CDATA[
|
43 |
+
var dataForm = new VarienForm('form-validate', true);
|
44 |
+
//]]>
|
45 |
+
</script>
|
app/design/frontend/base/default/template/imedia/tickets.phtml
ADDED
@@ -0,0 +1,61 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
$collection = $this->getCollection();
|
3 |
+
if($collection->count()!= 0):
|
4 |
+
?>
|
5 |
+
|
6 |
+
<div class="page-title">
|
7 |
+
<h1>My Tickets</h1>
|
8 |
+
</div>
|
9 |
+
|
10 |
+
<?php echo $this->getPagerHtml(); ?>
|
11 |
+
|
12 |
+
<table class="data-table" id="tickets-table">
|
13 |
+
<colgroup><col width="1">
|
14 |
+
<col>
|
15 |
+
<col width="1">
|
16 |
+
<col width="1">
|
17 |
+
<col width="1">
|
18 |
+
<col width="1">
|
19 |
+
<col width="1">
|
20 |
+
</colgroup><thead>
|
21 |
+
<tr>
|
22 |
+
<th>Ticket #</th>
|
23 |
+
<th>Title</th>
|
24 |
+
<th> Date </th>
|
25 |
+
<th>Department</th>
|
26 |
+
<th>Priority</th>
|
27 |
+
<th><span class="nobr">Status</span></th>
|
28 |
+
<th><span class="nobr">Replies</span></th>
|
29 |
+
</tr>
|
30 |
+
</thead>
|
31 |
+
<tbody>
|
32 |
+
<?php foreach($collection as $item): ?>
|
33 |
+
<tr>
|
34 |
+
<td class="a-center"><?php echo $item->getId();?></td>
|
35 |
+
<td><a href="<?php echo $this->getUrl('ticketsupport/index/viewticket').'?id='.$item->getId(); ?>"><?php echo $item->getTitle();?></a></td>
|
36 |
+
<td class="a-center"><?php echo $item->getCreatedAt();?></td>
|
37 |
+
<td class="a-center"><?php echo $item->getDept();?></td>
|
38 |
+
<td class="a-center"><?php echo $item->getPriority();?></td>
|
39 |
+
<td class="a-center"><?php echo $item->getStatus();?></td>
|
40 |
+
<?php
|
41 |
+
$collection = Mage::getModel('imedia_ticketsupport/details')->getCollection();
|
42 |
+
$collection->addFieldToFilter('ticketid', $item->getId() );
|
43 |
+
$total_replies = $collection->count()-1;
|
44 |
+
?>
|
45 |
+
<td class="a-center"><?php echo $total_replies; ?></td>
|
46 |
+
</tr>
|
47 |
+
|
48 |
+
<?php endforeach; ?>
|
49 |
+
</tbody>
|
50 |
+
</table>
|
51 |
+
|
52 |
+
|
53 |
+
|
54 |
+
<?php echo $this->getPagerHtml(); ?>
|
55 |
+
|
56 |
+
|
57 |
+
<?php else: ?>
|
58 |
+
<div class="page-title">
|
59 |
+
<h3>No ticket found</h3>
|
60 |
+
</div>
|
61 |
+
<?php endif;?>
|
app/design/frontend/base/default/template/imedia/viewticket.phtml
ADDED
@@ -0,0 +1,88 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
$ticketid = $this->getRequest()->getParam('id');
|
3 |
+
$collection_tickets = Mage::getModel('imedia_ticketsupport/support')->getCollection();
|
4 |
+
$collection_tickets->addFieldToFilter( 'id', $ticketid );
|
5 |
+
|
6 |
+
/*$collection = Mage::getModel('imedia_ticketsupport/details')->getCollection();
|
7 |
+
$collection->addFieldToFilter('ticketid', $ticketid );
|
8 |
+
$collection->getSelect()->order('commentdate desc');*/
|
9 |
+
$collection = $this->getCollection();
|
10 |
+
?>
|
11 |
+
|
12 |
+
<?php if($collection->count()): ?>
|
13 |
+
|
14 |
+
<div class="page-title">
|
15 |
+
<h1>[Ticket # <?php echo $collection_tickets->getFirstItem()->getId();?>] <?php echo $collection_tickets->getFirstItem()->getTitle();?></h1>
|
16 |
+
</div>
|
17 |
+
|
18 |
+
<div class="fieldset">
|
19 |
+
<h2 class="legend">Ticket Information</h2>
|
20 |
+
<table cellspacing="0" class="form-list">
|
21 |
+
<tbody>
|
22 |
+
<tr>
|
23 |
+
<td align="left" class="label" width="140">Department: </td>
|
24 |
+
<td><strong><?php echo $collection_tickets->getFirstItem()->getDept();?></strong></td>
|
25 |
+
</tr>
|
26 |
+
<tr>
|
27 |
+
<td align="left" class="label">Status:</td>
|
28 |
+
<td align="left"><strong><?php echo $collection_tickets->getFirstItem()->getStatus();?></strong></td>
|
29 |
+
</tr>
|
30 |
+
</tbody>
|
31 |
+
</table>
|
32 |
+
</div>
|
33 |
+
|
34 |
+
<?php echo $this->getPagerHtml(); ?>
|
35 |
+
|
36 |
+
<table class="data-table" id="ticket-table">
|
37 |
+
<colgroup><col width="15%">
|
38 |
+
<col>
|
39 |
+
<col width="15%">
|
40 |
+
</colgroup><thead>
|
41 |
+
<tr>
|
42 |
+
<th>Sender</th>
|
43 |
+
<th>Message</th>
|
44 |
+
<th>Date</th>
|
45 |
+
</tr>
|
46 |
+
</thead>
|
47 |
+
<tbody>
|
48 |
+
<?php foreach($collection as $item): ?>
|
49 |
+
<tr>
|
50 |
+
<td><?php echo $item->getSender();?></td>
|
51 |
+
<td><?php echo $item->getComments();?><br>
|
52 |
+
</td>
|
53 |
+
<td><?php echo $item->getcommentdate();?></td>
|
54 |
+
</tr>
|
55 |
+
<?php endforeach; ?>
|
56 |
+
</tbody>
|
57 |
+
</table>
|
58 |
+
|
59 |
+
<?php echo $this->getPagerHtml(); ?>
|
60 |
+
|
61 |
+
<div class="clearfix"> </div>
|
62 |
+
<form action="<?php echo $this->getUrl('ticketsupport/index/reply').'?ticket_id='.$item->getTicketid(); ?>" method="post" id="form-send-reply" enctype="multipart/form-data">
|
63 |
+
<input name="form_key" type="hidden" value="">
|
64 |
+
<div class="fieldset">
|
65 |
+
<h2 class="legend">Reply</h2>
|
66 |
+
<div class="form-list">
|
67 |
+
<label for="content" class="required">Message<em>*</em></label>
|
68 |
+
<div class="input-box">
|
69 |
+
<textarea name="content" id="content" title="Message" class="input-text required-entry" style="width:545px"></textarea>
|
70 |
+
</div>
|
71 |
+
</div>
|
72 |
+
<div class="buttons-set">
|
73 |
+
<p class="required">* Required Fields</p>
|
74 |
+
<button type="submit" title="Send" class="button"><span><span>Send</span></span></button>
|
75 |
+
</div>
|
76 |
+
</div>
|
77 |
+
</form>
|
78 |
+
<script type="text/javascript">
|
79 |
+
//<![CDATA[
|
80 |
+
var dataForm = new VarienForm('form-send-reply', true);
|
81 |
+
//]]>
|
82 |
+
</script>
|
83 |
+
|
84 |
+
<?php else: ?>
|
85 |
+
<div class="page-title">
|
86 |
+
<h3>This ticket has been closed or not found</h3>
|
87 |
+
</div>
|
88 |
+
<?php endif; ?>
|
app/etc/modules/Imedia_TicketSupport.xml
ADDED
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
|
3 |
+
<config>
|
4 |
+
<modules>
|
5 |
+
<Imedia_TicketSupport>
|
6 |
+
<active>true</active>
|
7 |
+
<codePool>community</codePool>
|
8 |
+
</Imedia_TicketSupport>
|
9 |
+
</modules>
|
10 |
+
</config>
|
app/locale/en_US/template/email/imedia/ticket_admin_notification.html
ADDED
@@ -0,0 +1,65 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<!--@subject Email - Header @-->
|
2 |
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
3 |
+
<html xmlns="http://www.w3.org/1999/xhtml">
|
4 |
+
<head>
|
5 |
+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
6 |
+
<meta name="viewport" content="initial-scale=1.0, width=device-width" />
|
7 |
+
</head>
|
8 |
+
<body>
|
9 |
+
{{var non_inline_styles}}
|
10 |
+
<!-- Begin wrapper table -->
|
11 |
+
<table width="100%" cellpadding="0" cellspacing="0" border="0" id="background-table">
|
12 |
+
<tr>
|
13 |
+
<td valign="top" class="container-td" align="center">
|
14 |
+
<table cellpadding="0" cellspacing="0" border="0" align="center" class="container-table">
|
15 |
+
<tr>
|
16 |
+
<td>
|
17 |
+
<table cellpadding="0" cellspacing="0" border="0" class="logo-container">
|
18 |
+
<tr>
|
19 |
+
<td class="logo">
|
20 |
+
<a href="{{store url=""}}">
|
21 |
+
<img
|
22 |
+
{{if logo_width}}
|
23 |
+
width="{{var logo_width}}"
|
24 |
+
{{else}}
|
25 |
+
width="165"
|
26 |
+
{{/if}}
|
27 |
+
|
28 |
+
{{if logo_height}}
|
29 |
+
height="{{var logo_height}}"
|
30 |
+
{{else}}
|
31 |
+
height="48"
|
32 |
+
{{/if}}
|
33 |
+
|
34 |
+
src="{{var logo_url}}"
|
35 |
+
alt="{{var logo_alt}}"
|
36 |
+
border="0"/>
|
37 |
+
</a>
|
38 |
+
</td>
|
39 |
+
</tr>
|
40 |
+
</table>
|
41 |
+
</td>
|
42 |
+
</tr>
|
43 |
+
<tr>
|
44 |
+
<td valign="top" class="top-content">
|
45 |
+
<!-- Begin Content -->
|
46 |
+
<table cellspacing="0" cellpadding="0" border="0" height="100%" width="100%">
|
47 |
+
<tr>
|
48 |
+
<td valign="top" style="padding:20px 10px">
|
49 |
+
<h2 style="font-size:22px; font-weight:normal; line-height:22px; margin:0 0 11px 0;">Dear Admin</h2>
|
50 |
+
<p>Here is the new ticket generated by a customer <strong>{{var customerName}}</strong></p>
|
51 |
+
<p>Ticket Id<strong>{{var ticketId}}</strong></p>
|
52 |
+
<h3>{{var customerComment}}</h3>
|
53 |
+
</td>
|
54 |
+
</tr>
|
55 |
+
</table>
|
56 |
+
<!-- End Content -->
|
57 |
+
</td>
|
58 |
+
</tr>
|
59 |
+
</table>
|
60 |
+
<h5 class="closing-text">Thank you, {{var store.getFrontendName()}}!</h5>
|
61 |
+
</td>
|
62 |
+
</tr>
|
63 |
+
</table>
|
64 |
+
<!-- End wrapper table -->
|
65 |
+
</body>
|
app/locale/en_US/template/email/imedia/ticket_customer_notification.html
ADDED
@@ -0,0 +1,66 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<!--@subject Email - Header @-->
|
2 |
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
3 |
+
<html xmlns="http://www.w3.org/1999/xhtml">
|
4 |
+
<head>
|
5 |
+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
6 |
+
<meta name="viewport" content="initial-scale=1.0, width=device-width" />
|
7 |
+
</head>
|
8 |
+
<body>
|
9 |
+
{{var non_inline_styles}}
|
10 |
+
<!-- Begin wrapper table -->
|
11 |
+
<table width="100%" cellpadding="0" cellspacing="0" border="0" id="background-table">
|
12 |
+
<tr>
|
13 |
+
<td valign="top" class="container-td" align="center">
|
14 |
+
<table cellpadding="0" cellspacing="0" border="0" align="center" class="container-table">
|
15 |
+
<tr>
|
16 |
+
<td>
|
17 |
+
<table cellpadding="0" cellspacing="0" border="0" class="logo-container">
|
18 |
+
<tr>
|
19 |
+
<td class="logo">
|
20 |
+
<a href="{{store url=""}}">
|
21 |
+
<img
|
22 |
+
{{if logo_width}}
|
23 |
+
width="{{var logo_width}}"
|
24 |
+
{{else}}
|
25 |
+
width="165"
|
26 |
+
{{/if}}
|
27 |
+
|
28 |
+
{{if logo_height}}
|
29 |
+
height="{{var logo_height}}"
|
30 |
+
{{else}}
|
31 |
+
height="48"
|
32 |
+
{{/if}}
|
33 |
+
|
34 |
+
src="{{var logo_url}}"
|
35 |
+
alt="{{var logo_alt}}"
|
36 |
+
border="0"/>
|
37 |
+
</a>
|
38 |
+
</td>
|
39 |
+
</tr>
|
40 |
+
</table>
|
41 |
+
</td>
|
42 |
+
</tr>
|
43 |
+
<tr>
|
44 |
+
<td valign="top" class="top-content">
|
45 |
+
<!-- Begin Content -->
|
46 |
+
<table cellspacing="0" cellpadding="0" border="0" height="100%" width="100%">
|
47 |
+
<tr>
|
48 |
+
<td valign="top" style="padding:20px 10px">
|
49 |
+
<h2 style="font-size:22px; font-weight:normal; line-height:22px; margin:0 0 11px 0;">Dear Customer</h2>
|
50 |
+
<p>Here is your ticket replied by the <strong>Customer Care</strong></p>
|
51 |
+
<p>Ticket Id<strong>{{var ticketId}}</strong></p>
|
52 |
+
<h3>Your Ques. : {{var custlastComment}}</h3>
|
53 |
+
<h3>Replied : {{var adminComment}}</h3>
|
54 |
+
</td>
|
55 |
+
</tr>
|
56 |
+
</table>
|
57 |
+
<!-- End Content -->
|
58 |
+
</td>
|
59 |
+
</tr>
|
60 |
+
</table>
|
61 |
+
<h5 class="closing-text">Thank you, {{var store.getFrontendName()}}!</h5>
|
62 |
+
</td>
|
63 |
+
</tr>
|
64 |
+
</table>
|
65 |
+
<!-- End wrapper table -->
|
66 |
+
</body>
|
app/locale/en_US/template/email/imedia/ticket_customer_replied_notification.html
ADDED
@@ -0,0 +1,65 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<!--@subject Email - Header @-->
|
2 |
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
3 |
+
<html xmlns="http://www.w3.org/1999/xhtml">
|
4 |
+
<head>
|
5 |
+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
6 |
+
<meta name="viewport" content="initial-scale=1.0, width=device-width" />
|
7 |
+
</head>
|
8 |
+
<body>
|
9 |
+
{{var non_inline_styles}}
|
10 |
+
<!-- Begin wrapper table -->
|
11 |
+
<table width="100%" cellpadding="0" cellspacing="0" border="0" id="background-table">
|
12 |
+
<tr>
|
13 |
+
<td valign="top" class="container-td" align="center">
|
14 |
+
<table cellpadding="0" cellspacing="0" border="0" align="center" class="container-table">
|
15 |
+
<tr>
|
16 |
+
<td>
|
17 |
+
<table cellpadding="0" cellspacing="0" border="0" class="logo-container">
|
18 |
+
<tr>
|
19 |
+
<td class="logo">
|
20 |
+
<a href="{{store url=""}}">
|
21 |
+
<img
|
22 |
+
{{if logo_width}}
|
23 |
+
width="{{var logo_width}}"
|
24 |
+
{{else}}
|
25 |
+
width="165"
|
26 |
+
{{/if}}
|
27 |
+
|
28 |
+
{{if logo_height}}
|
29 |
+
height="{{var logo_height}}"
|
30 |
+
{{else}}
|
31 |
+
height="48"
|
32 |
+
{{/if}}
|
33 |
+
|
34 |
+
src="{{var logo_url}}"
|
35 |
+
alt="{{var logo_alt}}"
|
36 |
+
border="0"/>
|
37 |
+
</a>
|
38 |
+
</td>
|
39 |
+
</tr>
|
40 |
+
</table>
|
41 |
+
</td>
|
42 |
+
</tr>
|
43 |
+
<tr>
|
44 |
+
<td valign="top" class="top-content">
|
45 |
+
<!-- Begin Content -->
|
46 |
+
<table cellspacing="0" cellpadding="0" border="0" height="100%" width="100%">
|
47 |
+
<tr>
|
48 |
+
<td valign="top" style="padding:20px 10px">
|
49 |
+
<h2 style="font-size:22px; font-weight:normal; line-height:22px; margin:0 0 11px 0;">Dear Admin</h2>
|
50 |
+
<p>Here is your ticket replied by the <strong>{{var customerName}}</strong></p>
|
51 |
+
<p>Ticket Id<strong>{{var ticketId}}</strong></p>
|
52 |
+
<h3>Customer Commented : {{var customerComment}}</h3>
|
53 |
+
</td>
|
54 |
+
</tr>
|
55 |
+
</table>
|
56 |
+
<!-- End Content -->
|
57 |
+
</td>
|
58 |
+
</tr>
|
59 |
+
</table>
|
60 |
+
<h5 class="closing-text">Thank you, {{var store.getFrontendName()}}!</h5>
|
61 |
+
</td>
|
62 |
+
</tr>
|
63 |
+
</table>
|
64 |
+
<!-- End wrapper table -->
|
65 |
+
</body>
|
package.xml
ADDED
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<package>
|
3 |
+
<name>Imedia_TicketSupport</name>
|
4 |
+
<version>1.0.0.1</version>
|
5 |
+
<stability>stable</stability>
|
6 |
+
<license uri="http://opensource.org/licenses/osl-3.0.php">OSLv3.0</license>
|
7 |
+
<channel>community</channel>
|
8 |
+
<extends/>
|
9 |
+
<summary>Customer ticket support syytem</summary>
|
10 |
+
<description>Customer can now raise the support ticket from my account after login into his account.</description>
|
11 |
+
<notes>Ticket Support</notes>
|
12 |
+
<authors><author><name>iMedia inc.</name><user>imedia</user><email>info@imediadesigns.org</email></author></authors>
|
13 |
+
<date>2015-07-30</date>
|
14 |
+
<time>09:37:21</time>
|
15 |
+
<contents><target name="magecommunity"><dir name="Imedia"><dir name="TicketSupport"><dir name="Block"><dir name="Adminhtml"><file name="Customform.php" hash="676fdb9a20faf9357b6ff10020284cc5"/><dir name="Support"><dir name="Edit"><file name="Form.php" hash="7c5bd69e541caea2365f6a0eb2aba1eb"/><file name="Tab.php" hash="7163f1557e9add3b66b573a392b2feb3"/></dir><file name="Edit.php" hash="677cfed04ee75b8477f81a07ed760a06"/><file name="Grid.php" hash="df90a1cc09c0b2287194076959a523d5"/></dir><file name="Support.php" hash="e537a1ba0a398b2b93c17871b43e91da"/></dir><file name="Tickets.php" hash="8dea21fa40a39c358c1b7f2e83e47f8b"/><file name="Viewticket.php" hash="a2e977eb55c4cfda62d0f6466b1eadf4"/></dir><dir name="Helper"><file name="Data.php" hash="853e6d21026b308f7b20049a2cc62c5c"/></dir><dir name="Model"><file name="Details.php" hash="0791110fc1c7a781a20eacd2758f7111"/><dir name="Mysql4"><dir name="Details"><file name="Collection.php" hash="d19b1d2a88c790079260587f957a37aa"/></dir><file name="Details.php" hash="230f566a8cbce8696f4c3cdc15e67eae"/><dir name="Support"><file name="Collection.php" hash="9b1ca4ae091d600aa069cdf2a791fd24"/></dir><file name="Support.php" hash="387095b11aeb599d8c38d261eae1ec02"/></dir><file name="Support.php" hash="14d6048114c392a88f1179955d5c7b24"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="SupportController.php" hash="3778a9a1f85ebc2d558364449c83565d"/></dir><file name="IndexController.php" hash="4ea0b5489c2ca05dae3444c72d6a35a7"/></dir><dir name="etc"><file name="adminhtml.xml" hash="86ada126d3956438bb7e7f552f632f7f"/><file name="config.xml" hash="2789c9d098653691a4b5981e5cb173e1"/><file name="system.xml" hash="6083289c7d0839cded2c6e4d896bb46f"/></dir><dir name="sql"><dir name="imedia_ticketsupport_setup"><file name="mysql4-install-0.0.1.php" hash="55385e4aaaafe3d51450823d2757cb76"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><dir name="imedia"><file name="ticketsupport.xml" hash="4a35b24f42f8baf14989dbb84ed406b9"/></dir></dir><dir name="template"><dir name="imedia"><file name="tickets.phtml" hash="456f2d831d0c2343747fbb96ac377c5d"/></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><dir name="imedia"><file name="imedia_ticketsupport.xml" hash="fb4d235fcd1c607d0c0d53393e48e1bf"/></dir></dir><dir name="template"><dir name="imedia"><file name="im_ticket.phtml" hash="11d061ce29f98f135c13c2a36326d055"/><file name="tickets.phtml" hash="f6fa4231fa368a714d697734ac0277ae"/><file name="viewticket.phtml" hash="9c9c1476d51495740c44ae35e433fc8c"/></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Imedia_TicketSupport.xml" hash="94ff663417e8ecc083e03067b2a70fea"/></dir></target><target name="mageskin"><dir name="adminhtml"><dir name="default"><dir name="default"><file name="ticketsupport.css" hash="6f52f89b8c6d78d28bf5bc6c43eac2cc"/></dir></dir></dir></target><target name="magelocale"><dir name="en_US"><dir name="template"><dir name="email"><dir name="imedia"><file name="ticket_admin_notification.html" hash="87f117f9ecf0f92ad450eb6c4ce9d3d0"/><file name="ticket_customer_notification.html" hash="9e7178a4a0258d3742765e54274fdac6"/><file name="ticket_customer_replied_notification.html" hash="6d83196b2c9f43aa2195caed1d8079d5"/></dir></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>
|
skin/adminhtml/default/default/ticketsupport.css
ADDED
@@ -0,0 +1,134 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
body.adminhtml-support-edit .middle .page-title h1 {
|
2 |
+
border: 0;
|
3 |
+
text-align: left;
|
4 |
+
}
|
5 |
+
.page-title h1, .page-title h2, .product-name h1, .product-name .h1 {
|
6 |
+
text-transform: uppercase;
|
7 |
+
font-size: 24px;
|
8 |
+
font-weight: 600;
|
9 |
+
color: #636363;
|
10 |
+
border-bottom: 1px solid #ededed;
|
11 |
+
padding-bottom: 3px;
|
12 |
+
margin-bottom: 15px;
|
13 |
+
text-transform: uppercase;
|
14 |
+
}
|
15 |
+
body.adminhtml-support-edit .middle .fieldset {
|
16 |
+
margin-top: 30px;
|
17 |
+
margin-bottom: 30px;
|
18 |
+
float: left;
|
19 |
+
width: 100%;
|
20 |
+
}
|
21 |
+
body.adminhtml-support-edit .middle .fieldset h2 {
|
22 |
+
width:100%;
|
23 |
+
display:inline-block;
|
24 |
+
}
|
25 |
+
h2, .h2 {
|
26 |
+
margin: 0;
|
27 |
+
margin-bottom: 0.5em;
|
28 |
+
color: #636363;
|
29 |
+
font-family: "Raleway", "Helvetica Neue", Verdana, Arial, sans-serif;
|
30 |
+
font-size: 24px;
|
31 |
+
font-weight: 400;
|
32 |
+
font-style: normal;
|
33 |
+
line-height: 1.2;
|
34 |
+
text-rendering: optimizeLegibility;
|
35 |
+
text-transform: uppercase;
|
36 |
+
}
|
37 |
+
body, button, input, select, table, textarea {
|
38 |
+
font-family: "Helvetica Neue", Verdana, Arial, sans-serif;
|
39 |
+
color: #636363;
|
40 |
+
line-height: 1.5;
|
41 |
+
}
|
42 |
+
body.adminhtml-support-edit .middle {
|
43 |
+
font-size:14px;
|
44 |
+
}
|
45 |
+
table {
|
46 |
+
border-collapse: collapse;
|
47 |
+
border-spacing: 0;
|
48 |
+
}
|
49 |
+
.form-list td.label {
|
50 |
+
padding:0 !important;
|
51 |
+
}
|
52 |
+
.pager {
|
53 |
+
float: right;
|
54 |
+
overflow: hidden;
|
55 |
+
width:100%;
|
56 |
+
margin:10px 0;
|
57 |
+
}
|
58 |
+
.pager .count-container {
|
59 |
+
float:right;
|
60 |
+
}
|
61 |
+
.pager .count-container .amount, .pager .count-container .limiter {
|
62 |
+
display:inline-block;
|
63 |
+
}
|
64 |
+
.middle .data-table#ticket-table {
|
65 |
+
width:100%;
|
66 |
+
margin-top:5px;
|
67 |
+
}
|
68 |
+
.data-table th {
|
69 |
+
background: #f4f4f4;
|
70 |
+
text-transform: uppercase;
|
71 |
+
font-family: "Raleway", "Helvetica Neue", Verdana, Arial, sans-serif;
|
72 |
+
line-height: 1.4;
|
73 |
+
white-space: nowrap;
|
74 |
+
}
|
75 |
+
.data-table thead th, .data-table tbody td {
|
76 |
+
border-bottom:1px solid silver;
|
77 |
+
}
|
78 |
+
.data-table td, .data-table th {
|
79 |
+
padding: 10px;
|
80 |
+
vertical-align: top;
|
81 |
+
}
|
82 |
+
form .legend {
|
83 |
+
margin: 0;
|
84 |
+
margin-bottom: 10px;
|
85 |
+
color: #636363;
|
86 |
+
font-family: "Raleway", "Helvetica Neue", Verdana, Arial, sans-serif;
|
87 |
+
font-size: 18px;
|
88 |
+
font-weight: 400;
|
89 |
+
font-style: normal;
|
90 |
+
line-height: 1.4;
|
91 |
+
text-rendering: optimizeSpeed;
|
92 |
+
text-transform: uppercase;
|
93 |
+
margin-bottom: 15px;
|
94 |
+
padding-bottom: 7px;
|
95 |
+
border-bottom: 1px solid #ededed;
|
96 |
+
}
|
97 |
+
.fieldset .required {
|
98 |
+
color: #636363 !important;
|
99 |
+
font-weight: 600 !important;
|
100 |
+
font-size:13px;
|
101 |
+
}
|
102 |
+
textarea {
|
103 |
+
padding:5px;
|
104 |
+
min-height: 70px;
|
105 |
+
width: 615px !important;
|
106 |
+
}
|
107 |
+
.buttons-set {
|
108 |
+
clear: both;
|
109 |
+
margin: 10px 0 0;
|
110 |
+
padding-top: 10px;
|
111 |
+
border-top: 1px solid #ededed;
|
112 |
+
text-align: right;
|
113 |
+
}
|
114 |
+
.button-send {
|
115 |
+
width:34%;
|
116 |
+
}
|
117 |
+
.buttons-set .required {
|
118 |
+
display: inline-block;
|
119 |
+
float: right;
|
120 |
+
color:#df280a !important;
|
121 |
+
line-height: 33px;
|
122 |
+
}
|
123 |
+
.buttons-set .button {
|
124 |
+
background:#3399cc;
|
125 |
+
padding: 7px 15px;
|
126 |
+
font-size: 13px;
|
127 |
+
font-weight: normal;
|
128 |
+
min-width: 140px;
|
129 |
+
border:0;
|
130 |
+
color:#fff;
|
131 |
+
}
|
132 |
+
.buttons-set .back-link {
|
133 |
+
float:left;
|
134 |
+
}
|