Deskero - Version 1.0.0

Version Notes

First release

Download this release

Release Info

Developer Fausto Iannuzzi
Extension Deskero
Version 1.0.0
Comparing to
See all releases


Version 1.0.0

app/code/community/Deskero/Deskero/Block/Adminhtml/Menu.php ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Deskero_Deskero_Block_Adminhtml_Menu extends Mage_Adminhtml_Block_Template
4
+ {
5
+ public function __construct()
6
+ {
7
+ parent::__construct();
8
+ $this->setId('page_tabs');
9
+ $this->setTemplate('deskero/left-menu.phtml');
10
+ }
11
+ }
app/code/community/Deskero/Deskero/Block/Adminhtml/Ticket/Create/Create.php ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Deskero_Deskero_Block_Adminhtml_Ticket_Create_Create extends Mage_Adminhtml_Block_Widget_Form_Container {
4
+
5
+ protected function _preparelayout() {
6
+
7
+ $this->removeButton('delete');
8
+ $this->removeButton('back');
9
+ $this->removeButton('reset');
10
+ $this->removeButton('save');
11
+
12
+ $this->_addButton('save', array(
13
+ 'label' => $this->__('Create Ticket'),
14
+ 'onclick' => 'createTicket_form.submit();',
15
+ 'class' => 'save',
16
+ ), 1);
17
+
18
+ $this->setChild('form', $this->getLayout()->createBlock('deskero/adminhtml_ticket_create_form'));
19
+ return parent::_prepareLayout();
20
+ }
21
+
22
+ public function getFormHtml()
23
+ {
24
+ $formHtml = parent::getFormHtml();
25
+ return $formHtml;
26
+ }
27
+
28
+ public function getHeaderText()
29
+ {
30
+ return $this->__('New Ticket');
31
+ }
32
+
33
+ public function getSaveUrl()
34
+ {
35
+ return $this->getUrl('*/*/save', array('_current' => true, 'back' => null));
36
+ }
37
+ }
app/code/community/Deskero/Deskero/Block/Adminhtml/Ticket/Create/Form.php ADDED
@@ -0,0 +1,126 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Deskero_Deskero_Block_Adminhtml_Ticket_Create_Form extends Mage_Adminhtml_Block_Widget_Form
4
+ {
5
+ protected function _prepareForm()
6
+ {
7
+ $form = new Varien_Data_Form(array(
8
+ 'id' => 'createTicket_form',
9
+ 'action' => $this->getData('action'),
10
+ 'method' => 'post'
11
+ ));
12
+
13
+ $fieldset = $form->addFieldset('base', array(
14
+ 'legend'=>$this->__('New Ticket'),
15
+ 'class'=>'fieldset-wide'
16
+ ));
17
+
18
+ $fieldset->addField('customer_email', 'text', array(
19
+ 'name' => 'customer_email',
20
+ 'label' => $this->__('Customer Email'),
21
+ 'title' => $this->__('Customer Email'),
22
+
23
+ 'required' => true
24
+ ));
25
+
26
+ $fieldset->addField('customer_name', 'text', array(
27
+ 'name' => 'customer_name',
28
+ 'label' => $this->__('Customer Name'),
29
+ 'title' => $this->__('Customer Name'),
30
+ 'required' => true
31
+ ));
32
+
33
+ $fieldset->addField('subject', 'text', array(
34
+ 'name' => 'subject',
35
+ 'label' => $this->__('Subject'),
36
+ 'title' => $this->__('Subject'),
37
+ 'required' => true
38
+ ));
39
+
40
+
41
+ $deskeroUrl = 'https://api.deskero.com/';
42
+
43
+ $apiToken = Mage::getStoreConfig('deskero_settings/deskero_general_settings/deskero_api_token');
44
+ $clientID = Mage::getStoreConfig('deskero_settings/deskero_general_settings/deskero_clientid');
45
+
46
+ $authorizationCall = $deskeroUrl.'oauth/token?grant_type=client_credentials';
47
+
48
+ $authCurl = curl_init($authorizationCall);
49
+ curl_setopt($authCurl, CURLOPT_HTTPHEADER, array('Authorization: Basic '.$apiToken));
50
+ curl_setopt($authCurl, CURLOPT_RETURNTRANSFER, true);
51
+ $authResponse = curl_exec($authCurl);
52
+
53
+ curl_close($authCurl);
54
+
55
+ if ($authResponse) {
56
+
57
+ $authData = json_decode($authResponse);
58
+ $accessToken = $authData->access_token;
59
+
60
+ $typeListCall = $deskeroUrl.'ticketType/list?page=1';
61
+
62
+ $typeListCurl = curl_init($typeListCall);
63
+ curl_setopt($typeListCurl, CURLOPT_HTTPHEADER, array('Authorization: Bearer '.$accessToken,
64
+ 'clientId: '.$clientID,
65
+ 'Accept: application/json'));
66
+
67
+ curl_setopt($typeListCurl, CURLOPT_RETURNTRANSFER, true);
68
+ $typeListResponse = curl_exec($typeListCurl);
69
+
70
+ curl_close($typeListCurl);
71
+
72
+ if ($typeListResponse) {
73
+
74
+ $typeListData = json_decode($typeListResponse);
75
+ $locale = Mage::app()->getLocale()->getLocaleCode();
76
+ $locale = explode("_", $locale);
77
+ $locale = $locale[0];
78
+
79
+ foreach ($typeListData->type->records as $type) {
80
+
81
+ if (isset($type->labels->$locale)) {
82
+ $label = $type->labels->$locale;
83
+ } else {
84
+ $label = $type->labels->en;
85
+ }
86
+
87
+ $value = array('label' => $label, 'value' => $type->id);
88
+ $values[]=$value;
89
+ }
90
+
91
+ if ($values) {
92
+
93
+ $fieldset->addField('type', 'select', array(
94
+ 'name' => 'type',
95
+ 'label' => $this->__('Type'),
96
+ 'title' => $this->__('Type'),
97
+ 'required' => true,
98
+ 'values' => $values
99
+
100
+ ));
101
+
102
+ }
103
+
104
+ }
105
+
106
+
107
+ }
108
+
109
+ $fieldset->addField('description', 'textarea', array(
110
+ 'name' => 'description',
111
+ 'label' => $this->__('Description'),
112
+ 'title' => $this->__('Description'),
113
+ 'required' => true
114
+ ));
115
+
116
+ $form->setValues(Mage::getSingleton('adminhtml/session')->getData('createTicket_form'));
117
+
118
+ Mage::getSingleton('adminhtml/session')->setData('createTicket_form','');
119
+
120
+ $form->setUseContainer(true);
121
+ $form->setMethod('post');
122
+ $this->setForm($form);
123
+ return parent::_prepareForm();
124
+ }
125
+
126
+ }
app/code/community/Deskero/Deskero/Block/Widget.php ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Deskero_Deskero_Block_Widget extends Mage_Core_Block_Template
4
+ {
5
+ protected function _toHtml()
6
+ {
7
+ if(!Mage::getStoreConfig('deskero_settings/deskero_widget_settings/deskero_widget_active')) {
8
+ return '';
9
+ }
10
+
11
+ return Mage::getStoreConfig('deskero_settings/deskero_widget_settings/deskero_widget');
12
+ }
13
+ }
app/code/community/Deskero/Deskero/Helper/Data.php ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
1
+ <?php
2
+ class Deskero_Deskero_Helper_Data extends Mage_Core_Helper_Abstract
3
+ {
4
+ }
5
+
app/code/community/Deskero/Deskero/controllers/Adminhtml/DeskeroController.php ADDED
@@ -0,0 +1,269 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Deskero_Deskero_Adminhtml_DeskeroController extends Mage_Adminhtml_Controller_Action
3
+ {
4
+ public function indexAction()
5
+ {
6
+ $this->loadLayout();
7
+ $this->_title($this->__("Deskero Settings"));
8
+ $this->renderLayout();
9
+ }
10
+
11
+ public function launchAction()
12
+ {
13
+
14
+ $token = Mage::getStoreConfig('deskero_settings/deskero_sso_settings/deskero_sso_token');
15
+ $domain = Mage::getStoreConfig('deskero_settings/deskero_general_settings/deskero_subdomain');
16
+ $email = Mage::getStoreConfig('deskero_settings/deskero_sso_settings/deskero_sso_email');
17
+
18
+ if (!filter_var($domain, FILTER_VALIDATE_URL) || $token == "" || $domain == "" || $email == "") {
19
+
20
+ $notifyText = $this->__('Oops! ');
21
+ $notifyText .= "<br/>".$this->__('To launch Deskero, set YOUR DESKERO DOMAIN, TOKEN SSO and AGENT EMAIL!');
22
+
23
+ Mage::getSingleton('adminhtml/session')->addError($notifyText);
24
+
25
+ $this->_redirect('adminhtml/system_config/edit/section/deskero_settings');
26
+
27
+ } else {
28
+
29
+ $url = $domain."/?email=".$email."&hash=".hash('md5',$email.$token);
30
+
31
+ $this->_redirectUrl($url);
32
+
33
+ }
34
+
35
+
36
+
37
+ }
38
+
39
+ public function createTicketAction() {
40
+
41
+ $this->loadLayout();
42
+ $this->_title($this->__("Create Ticket"));
43
+ $this->_addContent($this->getLayout()->createBlock('deskero/adminhtml_ticket_create_create'));
44
+ $this->_addLeft($this->getLayout()->createBlock('deskero/adminhtml_menu'));
45
+ $this->renderLayout();
46
+
47
+ }
48
+
49
+ public function saveAction()
50
+ {
51
+ if ($data = $this->getRequest()->getPost()) {
52
+
53
+ $errorOccurred = false;
54
+
55
+ $customerEmail = trim($data['customer_email']);
56
+ $customerName = trim($data['customer_name']);
57
+
58
+ $type = trim($data['type']);
59
+ $subject = trim($data['subject']);
60
+ $description = trim($data['description']);
61
+
62
+ //validazione campi
63
+ if ($customerEmail=="") {
64
+
65
+ $errorOccurred = true;
66
+ $errorText .= "<br/>".$this->__("Customer Email is required!");
67
+
68
+ }
69
+
70
+ if (!filter_var($customerEmail, FILTER_VALIDATE_EMAIL)) {
71
+
72
+ $errorOccurred = true;
73
+ $errorText .= "<br/>".$this->__("Customer Email is not a valid address!");
74
+
75
+ }
76
+
77
+ if ($customerName=="") {
78
+
79
+ $errorOccurred = true;
80
+ $errorText .= "<br/>".$this->__("Customer Name is required!");
81
+
82
+ }
83
+
84
+ if ($type=="") {
85
+
86
+ $errorOccurred = true;
87
+ $errorText .= "<br/>".$this->__("Type is required!");
88
+
89
+ }
90
+
91
+ if ($subject=="") {
92
+
93
+ $errorOccurred = true;
94
+ $errorText .= "<br/>".$this->__("Subject is required!");
95
+
96
+ }
97
+
98
+ if ($description=="") {
99
+
100
+ $errorOccurred = true;
101
+ $errorText .= "<br/>".$this->__("Description is required!");
102
+
103
+ }
104
+
105
+ if (!$errorOccurred) {
106
+
107
+ $customerJSON = '{"name":"'.$customerName.'", "email":"'.$customerEmail.'"}';
108
+
109
+ $deskeroUrl = 'https://api.deskero.com/';
110
+
111
+ $apiToken = Mage::getStoreConfig('deskero_settings/deskero_general_settings/deskero_api_token');
112
+ $clientID = Mage::getStoreConfig('deskero_settings/deskero_general_settings/deskero_clientid');
113
+
114
+ $authorizationCall = $deskeroUrl.'oauth/token?grant_type=client_credentials';
115
+
116
+ $authCurl = curl_init($authorizationCall);
117
+ curl_setopt($authCurl, CURLOPT_HTTPHEADER, array('Authorization: Basic '.$apiToken));
118
+ curl_setopt($authCurl, CURLOPT_RETURNTRANSFER, true);
119
+ $authResponse = curl_exec($authCurl);
120
+
121
+ curl_close($authCurl);
122
+
123
+ if ($authResponse) {
124
+
125
+ $authData = json_decode($authResponse);
126
+ $accessToken = $authData->access_token;
127
+
128
+ $customerCall = $deskeroUrl.'customer/list?page=1&email='.$customerEmail;
129
+
130
+ $customerCurl = curl_init($customerCall);
131
+ curl_setopt($customerCurl, CURLOPT_HTTPHEADER, array('Authorization: Bearer '.$accessToken,
132
+ 'clientId: '.$clientID,
133
+ 'Accept: application/json'));
134
+
135
+ curl_setopt($customerCurl, CURLOPT_RETURNTRANSFER, true);
136
+ $customerResponse = curl_exec($customerCurl);
137
+
138
+ curl_close($customerCurl);
139
+
140
+ if ($customerResponse) {
141
+
142
+ $customerData = json_decode($customerResponse);
143
+
144
+ $customerId = $customerData->customer->records[0]->id;
145
+
146
+ } else {
147
+
148
+ $newCustomerCall = $deskeroUrl.'customer/insert';
149
+
150
+ $newCustomerCurl = curl_init($newCustomerCall);
151
+ curl_setopt($newCustomerCurl, CURLOPT_HTTPHEADER, array('Authorization: Bearer '.$accessToken,
152
+ 'clientId: '.$clientID,
153
+ 'Accept: application/json',
154
+ "Content-type: application/json"));
155
+
156
+ curl_setopt($newCustomerCurl, CURLOPT_POST, 1 );
157
+ curl_setopt($newCustomerCurl, CURLOPT_POSTFIELDS, $customerJSON);
158
+
159
+ curl_setopt($newCustomerCurl, CURLOPT_RETURNTRANSFER, true);
160
+ $newCustomerResponse = curl_exec($newCustomerCurl);
161
+
162
+ curl_close($newCustomerResponse);
163
+
164
+ if ($newCustomerResponse) {
165
+
166
+ $newCustomerData = json_decode($newCustomerResponse);
167
+ $customerId = $newCustomerData->id;
168
+
169
+ }
170
+
171
+ }
172
+
173
+ if ($customerId) {
174
+
175
+ $openedBy = array('id'=>$customerId);
176
+ $type = array('id'=>$data['type']);
177
+ $newTicket = array(
178
+ 'openedBy' => $openedBy,
179
+ 'subject' => $data['subject'],
180
+ 'description' => $data['description'],
181
+ 'type' => $type,
182
+ 'tags' => array('magento')
183
+ );
184
+
185
+ $newTicketJSON = json_encode($newTicket);
186
+
187
+ $newTicketCall = $deskeroUrl.'ticket/insert';
188
+
189
+ $newTicketCurl = curl_init($newTicketCall);
190
+ curl_setopt($newTicketCurl, CURLOPT_HTTPHEADER, array('Authorization: Bearer '.$accessToken,
191
+ 'clientId: '.$clientID,
192
+ 'Accept: application/json',
193
+ "Content-type: application/json"));
194
+
195
+ curl_setopt($newTicketCurl, CURLOPT_POST, 1 );
196
+ curl_setopt($newTicketCurl, CURLOPT_POSTFIELDS, $newTicketJSON);
197
+
198
+ curl_setopt($newTicketCurl, CURLOPT_RETURNTRANSFER, true);
199
+ $newTicketResponse = curl_exec($newTicketCurl);
200
+
201
+ curl_close($newTicketResponse);
202
+
203
+ if ($newTicketResponse) {
204
+
205
+ $newTicketData = json_decode($newTicketResponse);
206
+
207
+ $getTicketCall = $deskeroUrl.'ticket/'.$newTicketData->id;
208
+
209
+ $getTicketCurl = curl_init($getTicketCall);
210
+ curl_setopt($getTicketCurl, CURLOPT_HTTPHEADER, array('Authorization: Bearer '.$accessToken,
211
+ 'clientId: '.$clientID,
212
+ 'Accept: application/json'));
213
+
214
+ curl_setopt($getTicketCurl, CURLOPT_RETURNTRANSFER, true);
215
+ $getTicketResponse = curl_exec($getTicketCurl);
216
+
217
+ $getTicketData = json_decode($getTicketResponse);
218
+
219
+
220
+ $subdomain = Mage::getStoreConfig('deskero_settings/deskero_general_settings/deskero_subdomain');
221
+
222
+ $notifyText = $this->__('Ticket <b>#%s</b> has been created!',$getTicketData->number);
223
+ $notifyText .= ' <a href="https://' . $subdomain . '.deskero.com/agent/ticket/view/' . $newTicketData->id . '" target="_blank">';
224
+ $notifyText .= $this->__('View ticket in Deskero');
225
+ $notifyText .= '</a>';
226
+
227
+ Mage::getSingleton('adminhtml/session')->addSuccess($notifyText);
228
+
229
+ } else {
230
+
231
+ $errorOccurred = true;
232
+ $errorText = $this->__('Error in ticket creation!');
233
+ }
234
+
235
+ } else {
236
+
237
+ $errorOccurred = true;
238
+ $errorText = $this->__('Customer not found!');
239
+
240
+ }
241
+
242
+ } else {
243
+
244
+ $errorOccurred = true;
245
+ $errorText = $this->__("Can't connect to Deskero API!");
246
+
247
+ }
248
+ }
249
+
250
+ } else {
251
+
252
+ $errorOccurred = true;
253
+ $errorText = $this->__("No data sended!");
254
+ }
255
+
256
+ if ($errorOccurred) {
257
+
258
+ $notifyText = $this->__('Oops! ');
259
+ $notifyText .= $errorText;
260
+
261
+ Mage::getSingleton('adminhtml/session')->addError($notifyText);
262
+ Mage::getSingleton('adminhtml/session' )->setData('createTicket_form', $data);
263
+
264
+ }
265
+
266
+
267
+ $this->_redirect('*/*/createTicket');
268
+ }
269
+ }
app/code/community/Deskero/Deskero/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
+ <deskero_settings translate="title" module="deskero">
12
+ <title>Settings Section</title>
13
+ <sort_order>999</sort_order>
14
+ </deskero_settings>
15
+ </children>
16
+ </config>
17
+ </children>
18
+ </system>
19
+ </children>
20
+ </admin>
21
+ </resources>
22
+ </acl>
23
+ </config>
app/code/community/Deskero/Deskero/etc/config.xml ADDED
@@ -0,0 +1,120 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <Deskero_Deskero>
5
+ <version>0.1.0</version>
6
+ </Deskero_Deskero>
7
+ </modules>
8
+ <global>
9
+ <helpers>
10
+ <deskero>
11
+ <class>Deskero_Deskero_Helper</class>
12
+ </deskero>
13
+ </helpers>
14
+ <blocks>
15
+ <deskero>
16
+ <class>Deskero_Deskero_Block</class>
17
+ </deskero>
18
+ </blocks>
19
+ </global>
20
+
21
+ <frontend>
22
+ <layout>
23
+ <updates>
24
+ <deskero>
25
+ <file>deskero.xml</file>
26
+ </deskero>
27
+ </updates>
28
+ </layout>
29
+ </frontend>
30
+
31
+ <admin>
32
+ <routers>
33
+ <deskero>
34
+ <use>admin</use>
35
+ <args>
36
+ <module>Deskero_Deskero</module>
37
+ <frontName>deskero</frontName>
38
+ </args>
39
+ </deskero>
40
+ </routers>
41
+ </admin>
42
+ <adminhtml>
43
+
44
+ <layout>
45
+ <updates>
46
+ <deskero>
47
+ <file>deskero.xml</file>
48
+ </deskero>
49
+ </updates>
50
+ </layout>
51
+ <translate>
52
+ <modules>
53
+ <Deskero_Deskero>
54
+ <files>
55
+ <default>Deskero_Deskero.csv</default>
56
+ </files>
57
+ </Deskero_Deskero>
58
+ </modules>
59
+ </translate>
60
+
61
+ <menu>
62
+ <deskero module="deskero">
63
+ <title>Deskero</title>
64
+ <sort_order>100</sort_order>
65
+ <children>
66
+
67
+ <deskero module="deskero">
68
+ <title>Deskero Settings</title>
69
+ <sort_order>1</sort_order>
70
+ <action>adminhtml/system_config/edit/section/deskero_settings</action>
71
+ </deskero>
72
+
73
+ <deskerolaunch module="deskero">
74
+ <title>Launch Deskero</title>
75
+ <action>deskero/adminhtml_deskero/launch</action>
76
+ <sort_order>2</sort_order>
77
+ </deskerolaunch>
78
+
79
+ <deskerocreateticket module="deskero">
80
+ <title>Create Ticket</title>
81
+ <action>deskero/adminhtml_deskero/createTicket</action>
82
+ <sort_order>3</sort_order>
83
+ </deskerocreateticket>
84
+
85
+ </children>
86
+ </deskero>
87
+ </menu>
88
+ <acl>
89
+ <resources>
90
+ <all>
91
+ <title>Allow Everything</title>
92
+ </all>
93
+ <admin>
94
+ <children>
95
+ <deskero translate="title" module="deskero">
96
+ <title>Deskero</title>
97
+ <sort_order>999</sort_order>
98
+ <children>
99
+
100
+ <deskero translate="title">
101
+ <title>Deskero Settings</title>
102
+ </deskero>
103
+
104
+ <deskerolaunch translate="title">
105
+ <title>Launch Deskero</title>
106
+ </deskerolaunch>
107
+
108
+ <deskerocreateticket translate="title">
109
+ <title>Create Ticket</title>
110
+ </deskerocreateticket>
111
+
112
+ </children>
113
+ </deskero>
114
+ </children>
115
+ </admin>
116
+ </resources>
117
+ </acl>
118
+
119
+ </adminhtml>
120
+ </config>
app/code/community/Deskero/Deskero/etc/system.xml ADDED
@@ -0,0 +1,133 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <tabs>
4
+ <deskero translate="label" module="deskero">
5
+ <label>Deskero</label>
6
+ <sort_order>999</sort_order>
7
+ </deskero>
8
+ </tabs>
9
+ <sections>
10
+
11
+ <deskero_settings translate="label" module="deskero">
12
+ <label>Settings</label>
13
+ <class>deskero-section</class>
14
+ <header_css>deskero-header</header_css>
15
+ <tab>deskero</tab>
16
+ <frontend_type>text</frontend_type>
17
+ <sort_order>999</sort_order>
18
+ <show_in_default>1</show_in_default>
19
+ <show_in_website>1</show_in_website>
20
+ <show_in_store>1</show_in_store>
21
+ <groups>
22
+
23
+ <deskero_general_settings translate="label">
24
+ <label>General Setting</label>
25
+ <frontend_type>text</frontend_type>
26
+ <sort_order>1</sort_order>
27
+ <show_in_default>1</show_in_default>
28
+ <show_in_website>1</show_in_website>
29
+ <show_in_store>1</show_in_store>
30
+ <fields>
31
+
32
+ <deskero_subdomain translate="label">
33
+ <label>Your Deskero Domain</label>
34
+ <frontend_type>text</frontend_type>
35
+ <sort_order>1</sort_order>
36
+ <show_in_default>1</show_in_default>
37
+ <show_in_website>1</show_in_website>
38
+ <show_in_store>1</show_in_store>
39
+ <comment>Your Deskero Domain. Example: https://yourdomain.deskero.com</comment>
40
+ </deskero_subdomain>
41
+
42
+ <deskero_clientid translate="label">
43
+ <label>Client ID</label>
44
+ <frontend_type>text</frontend_type>
45
+ <sort_order>2</sort_order>
46
+ <show_in_default>1</show_in_default>
47
+ <show_in_website>1</show_in_website>
48
+ <show_in_store>1</show_in_store>
49
+ <comment>Find your Client ID in Deskero on Settings > Security Settings > API management</comment>
50
+ </deskero_clientid>
51
+
52
+ <deskero_api_token translate="label">
53
+ <label>API Token</label>
54
+ <frontend_type>text</frontend_type>
55
+ <sort_order>3</sort_order>
56
+ <show_in_default>1</show_in_default>
57
+ <show_in_website>1</show_in_website>
58
+ <show_in_store>1</show_in_store>
59
+ <comment>Find your API Token in Deskero on Settings > Security Settings > API management</comment>
60
+ </deskero_api_token>
61
+
62
+ </fields>
63
+ </deskero_general_settings>
64
+
65
+ <deskero_widget_settings translate="label">
66
+ <label>Widget Setting</label>
67
+ <frontend_type>text</frontend_type>
68
+ <sort_order>2</sort_order>
69
+ <show_in_default>1</show_in_default>
70
+ <show_in_website>1</show_in_website>
71
+ <show_in_store>1</show_in_store>
72
+ <fields>
73
+ <deskero_widget_active translate="label">
74
+ <label>Widget Active</label>
75
+ <frontend_type>select</frontend_type>
76
+ <source_model>adminhtml/system_config_source_yesno</source_model>
77
+ <sort_order>1</sort_order>
78
+ <show_in_default>1</show_in_default>
79
+ <show_in_website>1</show_in_website>
80
+ <show_in_store>1</show_in_store>
81
+ <comment>If YES, the widget will be shown on all pages.</comment>
82
+ </deskero_widget_active>
83
+
84
+ <deskero_widget translate="label">
85
+ <label>Widget Code</label>
86
+ <frontend_type>textarea</frontend_type>
87
+ <sort_order>2</sort_order>
88
+ <show_in_default>1</show_in_default>
89
+ <show_in_website>1</show_in_website>
90
+ <show_in_store>1</show_in_store>
91
+ <comment>Login to Deskero, go to Settings > Feedback Widget and copy here your widget embed code.</comment>
92
+ </deskero_widget>
93
+ </fields>
94
+ </deskero_widget_settings>
95
+
96
+
97
+ <deskero_sso_settings translate="label">
98
+ <label>SSO Setting</label>
99
+ <frontend_type>text</frontend_type>
100
+ <sort_order>3</sort_order>
101
+ <show_in_default>1</show_in_default>
102
+ <show_in_website>1</show_in_website>
103
+ <show_in_store>1</show_in_store>
104
+ <fields>
105
+
106
+ <deskero_sso_token translate="label">
107
+ <label>SSO Token</label>
108
+ <frontend_type>text</frontend_type>
109
+ <sort_order>1</sort_order>
110
+ <show_in_default>1</show_in_default>
111
+ <show_in_website>1</show_in_website>
112
+ <show_in_store>1</show_in_store>
113
+ <comment>Find your SSO Token in Deskero on Settings > Security Settings > Shared authentication</comment>
114
+ </deskero_sso_token>
115
+
116
+ <deskero_sso_email translate="label">
117
+ <label>Agent Email</label>
118
+ <frontend_type>text</frontend_type>
119
+ <sort_order>2</sort_order>
120
+ <show_in_default>1</show_in_default>
121
+ <show_in_website>1</show_in_website>
122
+ <show_in_store>1</show_in_store>
123
+ <comment>Your Agent Email in Deskero</comment>
124
+ </deskero_sso_email>
125
+
126
+ </fields>
127
+ </deskero_sso_settings>
128
+
129
+
130
+ </groups>
131
+ </deskero_settings>
132
+ </sections>
133
+ </config>
app/design/adminhtml/default/default/layout/deskero.xml ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <layout version="0.1.0">
3
+
4
+ <adminhtml_system_config_edit>
5
+ <reference name="head">
6
+ <action method="addCss"><stylesheet>deskero/deskero.css</stylesheet></action>
7
+ </reference>
8
+ </adminhtml_system_config_edit>
9
+
10
+ </layout>
app/design/adminhtml/default/default/template/deskero/left-menu.phtml ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <h3>Deskero</h3>
2
+ <ul class="tabs">
3
+
4
+ <li>
5
+ <a href="<?php echo $this->getUrl('adminhtml/system_config/edit/section/deskero'); ?>" class="tab-item-link">
6
+ <span><?php echo $this->__('Settings'); ?></span>
7
+ </a>
8
+ </li>
9
+
10
+ <li>
11
+ <a href="<?php echo $this->getUrl('*/*/launch'); ?>" target="_blank" class="tab-item-link">
12
+ <span><?php echo $this->__('Launch Deskero'); ?></span>
13
+ </a>
14
+ </li>
15
+
16
+ <li>
17
+ <a href="<?php echo $this->getUrl('*/*/createTicket'); ?>" class="tab-item-link active">
18
+ <span><?php echo $this->__('Create Ticket'); ?></span>
19
+ </a>
20
+ </li>
21
+
22
+ </ul>
app/design/frontend/base/default/layout/deskero.xml ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * Copyright 2013 Deskero.
5
+ *
6
+ * Licensed under the Apache License, Version 2.0 (the "License");
7
+ * you may not use this file except in compliance with the License.
8
+ * You may obtain a copy of the License at
9
+ *
10
+ * http://www.apache.org/licenses/LICENSE-2.0
11
+ *
12
+ * Unless required by applicable law or agreed to in writing, software
13
+ * distributed under the License is distributed on an "AS IS" BASIS,
14
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+ * See the License for the specific language governing permissions and
16
+ * limitations under the License.
17
+ */
18
+ -->
19
+ <layout>
20
+ <default>
21
+ <reference name="before_body_end">
22
+ <block type="deskero/widget" name="deskero_widget"/>
23
+ </reference>
24
+ </default>
25
+ </layout>
app/etc/modules/Deskero_Deskero.xml ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <Deskero_Deskero>
5
+ <active>true</active>
6
+ <codePool>community</codePool>
7
+ <version>0.1.0</version>
8
+ </Deskero_Deskero>
9
+ </modules>
10
+ </config>
app/locale/en_US/Deskero_Deskero.csv ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ "Deskero Settings","Deskero Settings"
2
+ "Launch Deskero","Launch Deskero"
3
+ "Settings","Settings"
4
+ "General Setting","General Setting"
5
+ "Your Deskero Domain","Your Deskero Domain"
6
+ "Your Deskero Domain. Example: https://yourdomain.deskero.com","Your Deskero Domain. Example: https://yourdomain.deskero.com"
7
+ "Client ID","Client ID"
8
+ "Find your Client ID in Deskero on Settings > Security Settings > API management","Find your Client Id in Deskero on Settings > Security Settings > API management"
9
+ "API Token","API Token"
10
+ "Find your API Token in Deskero on Settings > Security Settings > API management","Find your API Token in Deskero on Settings > Security Settings > API management"
11
+ "Widget Setting","Widget Setting"
12
+ "Widget Active","Widget Active"
13
+ "If YES, the widget will be shown on all pages.","If YES, the widget will be shown on all pages."
14
+ "Widget Code","Widget Code"
15
+ "Login to Deskero, go to Settings > Feedback Widget and copy here your widget embed code.","Login to Deskero, go to Settings > Feedback Widget and copy here your widget embed code."
16
+ "SSO Setting","SSO Setting"
17
+ "SSO Token","SSO Token"
18
+ "Find your SSO Token in Deskero on Settings > Security Settings > Shared authentication","Find your SSO Token in Deskero on Settings > Security Settings > Shared authentication"
19
+ "Agent Email","Agent Email"
20
+ "Your Agent Email in Deskero","Your Agent Email in Deskero"
21
+ "New Ticket","New Ticket"
22
+ "Create Ticket","Create Ticket"
23
+ "Customer Email","Customer Email"
24
+ "Customer Name","Customer Name"
25
+ "Subject","Subject"
26
+ "Type","Type"
27
+ "Description","Description"
28
+ "Ticket <b>#%s</b> has been created!","Ticket <b>#%s</b> has been created!"
29
+ "View ticket in Deskero","View ticket in Deskero"
30
+ "Error in ticket creation!","Error in ticket creation!"
31
+ "Customer not found!","Customer not found!"
32
+ "Can't connect to Deskero API!","Can't connect to Deskero API!"
33
+ "Oops! ","Oops! "
34
+ "Customer Email is required!","Customer Email is required!"
35
+ "Customer Email is not a valid address!","Customer Email is not a valid address!"
36
+ "Customer Name is required!","Customer Name is required!"
37
+ "Type is required!","Type is required!"
38
+ "Subject is required!","Subject is required!"
39
+ "Description is required!","Description is required!"
40
+ "No data sended!","No data sended!"
41
+ "To launch Deskero, set YOUR DESKERO DOMAIN, TOKEN SSO and AGENT EMAIL!","To launch Deskero, set YOUR DESKERO DOMAIN, TOKEN SSO and AGENT EMAIL!"
app/locale/it_IT/Deskero_Deskero.csv ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ "Deskero Settings","Impostazioni Deskero"
2
+ "Launch Deskero","Avvia Deskero"
3
+ "Settings","Impostazioni"
4
+ "General Setting","Impostazioni generali"
5
+ "Your Deskero Domain","Dominio in Deskero"
6
+ "Your Deskero Domain. Example: https://yourdomain.deskero.com","Il tuo dominio in Deskero. Esempio: https://iltuodominio.deskero.com"
7
+ "Client ID","Client ID"
8
+ "Find your Client ID in Deskero on Settings > Security Settings > API management","Trova il tuo Client ID su Deskero nel menù Configurazioni > Sicurezza > Gestione API"
9
+ "API Token","Token API"
10
+ "Find your API Token in Deskero on Settings > Security Settings > API management","Trova il tuo Token SSO su Deskero nel menù Configurazioni > Sicurezza > Gestione API"
11
+ "Widget Setting","Impostazioni widget"
12
+ "Widget Active","Widget Attivo"
13
+ "If YES, the widget will be shown on all pages.","Se YES, il widget apparirà su tutte le pagine."
14
+ "Widget Code","Codice widget"
15
+ "Login to Deskero, go to Settings > Feedback Widget and copy here your widget embed code.","Accedi a Deskero, vai nel menù Configurazioni > Widget per feedback e copia qui il tuo codice da incorporare."
16
+ "SSO Setting","Impostazioni SSO"
17
+ "SSO Token","Token SSO"
18
+ "Find your SSO Token in Deskero on Settings > Security Settings > Shared authentication","Trova il tuo Token SSO su Deskero nel menù Configurazioni > Sicurezza > Autenticazione condivisa"
19
+ "Agent Email","Email agente"
20
+ "Your Agent Email in Deskero","La tua email da operatore in Deskero"
21
+ "New Ticket","Nuovo Ticket"
22
+ "Create Ticket","Crea Ticket"
23
+ "Customer Email","Email del cliente"
24
+ "Customer Name","Nome del cliente"
25
+ "Subject","Oggetto"
26
+ "Type","Tipo"
27
+ "Description","Descrizione"
28
+ "Ticket <b>#%s</b> has been created!","Il ticket <b>#%s</b> è stato creato!"
29
+ "View ticket in Deskero","Leggi il ticket su Deskero"
30
+ "Error in ticket creation!","Errore durante la creazione del ticket"
31
+ "Customer not found!","Cliente non trovato!"
32
+ "Can't connect to Deskero API!","Connessione alle API Deskero non riuscita!"
33
+ "Oops! ","Oops! "
34
+ "Customer Email is required!","L'email del cliente è obbligatoria!"
35
+ "Customer Email is not a valid address!","L'email del cliente non è un indirizzo valido!"
36
+ "Customer Name is required!","Il nome del cliente è obbligatorio!"
37
+ "Type is required!","Il tipo di ticket è obbligatorio!"
38
+ "Subject is required!","L'oggetto è obbligatorio!"
39
+ "Description is required!","La descrizione è obbligatoria!"
40
+ "No data sended!","Nessun dato inviato!"
41
+ "To launch Deskero, set YOUR DESKERO DOMAIN, TOKEN SSO and AGENT EMAIL!","Per avviare Deskero, imposta il TUO DOMINIO IN DESKERO, il TOKEN SSO e l'EMAIL AGENTE!"
package.xml ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <package>
3
+ <name>Deskero</name>
4
+ <version>1.0.0</version>
5
+ <stability>stable</stability>
6
+ <license>GPL</license>
7
+ <channel>community</channel>
8
+ <extends/>
9
+ <summary>Deskero for Magento is a customized extension to integrate your Deskero help desk into your Magento website.</summary>
10
+ <description>&lt;p&gt;&lt;b&gt;Deskero&lt;/b&gt; is an innovative cloud-based &lt;b&gt;help desk software&lt;/b&gt; born from an innovative idea: creating a &lt;b&gt;new kind of relationship with customers&lt;/b&gt; that really focuses on their needs.&lt;/p&gt;&#xD;
11
+ &#xD;
12
+ &lt;p&gt;Emails, phone calls, chats, web sites, social networks: through Deskero every message from your customers will be instantly accessible with a few clicks!&lt;/p&gt;&#xD;
13
+ &#xD;
14
+ &lt;p&gt;This extension lets you manage all the customers&#x2019; requests with Deskero, the cloud-based help desk software that offers companies simple and effective tools to make customer care easier, quicker and more modern.&lt;/p&gt;&#xD;
15
+ &#xD;
16
+ &lt;p&gt;&#xD;
17
+ &lt;b&gt;Features include:&lt;/b&gt;&lt;br /&gt;&#xD;
18
+ - Enable Single Sign-on for administrators&lt;br /&gt;&#xD;
19
+ - Add support tickets in every moment while on Magento website&lt;br /&gt;&#xD;
20
+ - Gather feedback directly from your Magento website through Deskero widget&lt;br /&gt;&#xD;
21
+ &lt;/p&gt;&#xD;
22
+ &#xD;
23
+ &lt;p&gt;Deskero extension for Magento is available only to Business or Power users.&lt;/p&gt;</description>
24
+ <notes>First release</notes>
25
+ <authors><author><name>Fausto Iannuzzi</name><user>faustoiannuzzi</user><email>fausto@deskero.com</email></author></authors>
26
+ <date>2013-08-28</date>
27
+ <time>10:30:02</time>
28
+ <contents><target name="magecommunity"><dir name="Deskero"><dir name="Deskero"><dir name="Block"><dir name="Adminhtml"><file name="Menu.php" hash="2272bbc9281bfac7194a0817cdee2d88"/><dir name="Ticket"><dir name="Create"><file name="Create.php" hash="ac26abca01db34e24831fc5d31fb6c36"/><file name="Form.php" hash="7dadd1df6ff2817c00808fa2d0396bf5"/></dir></dir></dir><file name="Widget.php" hash="0abcc9c7e1852be5b0b69a4b244bb430"/></dir><dir name="Helper"><file name="Data.php" hash="61b36df7759d319fd25e1a58850fbd30"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="DeskeroController.php" hash="21864e4abc6954301f831858d38033c8"/></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="b93362d17b15de9a869a8454d38e9ab2"/><file name="config.xml" hash="f999300462a8af5375a6af81481743bc"/><file name="system.xml" hash="1fbe3307eb6be5e043eaf2cbb7bd8f34"/></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="deskero.xml" hash="dcdec81f7fcc34fb1a2dc9f218360eef"/></dir><dir name="template"><dir name="deskero"><file name="left-menu.phtml" hash="b355e7457cfef5579b342f9a5f9511d4"/></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="deskero.xml" hash="f1c745105450382b869723f9743e27fe"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Deskero_Deskero.xml" hash="7ccffebaf8d06567bd340bc29f583b59"/></dir></target><target name="magelocale"><dir><dir name="en_US"><file name="Deskero_Deskero.csv" hash="8d384bc914d6b7d0b09ad28c7b864071"/></dir><dir name="it_IT"><file name="Deskero_Deskero.csv" hash="0cea6f325b6c15df4db3b17e2aeaa447"/></dir></dir></target><target name="mageskin"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="deskero"><file name="deskero-menu.png" hash="ccb5b77f7074fa8ace567ec5dc28bd54"/><file name="deskero.css" hash="9e87ec2d6645f48089661212d0521e21"/><file name="header-logo.png" hash="1777ad0345115961079a14a4c62eac1e"/></dir></dir></dir></dir></target></contents>
29
+ <compatible/>
30
+ <dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php></required></dependencies>
31
+ </package>
skin/adminhtml/default/default/deskero/deskero-menu.png ADDED
Binary file
skin/adminhtml/default/default/deskero/deskero.css ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ul.tabs a.deskero-section,
2
+ ul.tabs a.deskero-section:hover {
3
+ border-bottom: 1px solid #BEBEBE;
4
+ padding: 0.5em 0.5em 0 1.5em;
5
+ text-indent: -9999px;
6
+ }
7
+
8
+ ul.tabs a.deskero-section.active,
9
+ ul.tabs a.deskero-section.active:hover {
10
+ background: none repeat scroll 0 0 white;
11
+ }
12
+
13
+ ul.tabs a.deskero-section span,
14
+ ul.tabs a.deskero-section:hover span {
15
+ background:url(deskero-menu.png) no-repeat 0 0;
16
+ overflow:hidden;
17
+ padding:0;
18
+ width:120px;
19
+ height:22px;
20
+ }
21
+
22
+
23
+ h3.deskero-header {
24
+ background: url(header-logo.png) no-repeat;
25
+ width: 231px;
26
+ height: 65px;
27
+ padding: 0;
28
+ text-indent: -9999px;
29
+ }
skin/adminhtml/default/default/deskero/header-logo.png ADDED
Binary file