Skip to content

Commit

Permalink
uvdesk url changes
Browse files Browse the repository at this point in the history
  • Loading branch information
webkul-nikhil committed Feb 6, 2017
2 parents ef1656d + 1b92dae commit 06f96db
Show file tree
Hide file tree
Showing 7 changed files with 348 additions and 156 deletions.
13 changes: 13 additions & 0 deletions Changelog.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Legend

+ Features
- Bugs

-------------------------------- Version 2.0.0 --------------------------------------

+Integrate Uvdesk Helpdesk System with magento
+Admin can manage tickets from magento backend.
+Admin can reply on tickets.
+Admin can delete any ticket.
+Customers can reply to tickets from their magento store account on front-end.
+Real time synchronization between Uvdesk Helpdesk System and magento Store tickets.
147 changes: 147 additions & 0 deletions LICENSE.TXT

Large diffs are not rendered by default.

27 changes: 27 additions & 0 deletions Readme.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#Installation

Magento2 UvDesk connector module installation is very easy, please follow the steps for installation-

1. Unzip the respective extension zip and then move "app" folder (inside "src" folder) into magento root directory.

Run Following Command via terminal
-----------------------------------
php bin/magento setup:upgrade
php bin/magento setup:di:compile
php bin/magento setup:static-content:deploy

2. Flush the cache and reindex all.

now module is properly installed

#User Guide

For Magento2 UvDeskConnector UVdesk connector module's working process follow user guide -

#Support

Find us our support policy - https://store.webkul.com/support.html/

#Refund

Find us our refund policy - https://store.webkul.com/refund-policy.html/
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,15 @@ public function execute()
$ticketId = isset($post['ticket_id'])?$post['ticket_id']:null;
$tickeIncrementId = isset($post['incremet_id'])?$post['incremet_id']:null;
$reply = isset($post['product']['description'])?$post['product']['description']:null;
// $actAsType = 'customer';
if (isset($post['addReply']) && $post['addReply'] == 1 ) {
$data = ["threadType"=>"reply", "reply"=>$reply, "status"=>"1"];
// $email = $this->_ticketHelper->getLoggedInUserDetail()['email'];
// if ($email) {
// $data["actAsEmail"]=$email;
// }
$resultRedirect = $this->resultFactory->create(ResultFactory::TYPE_REDIRECT);
$response = $this->_ticketManager->addReplyToTicket($ticketId, $tickeIncrementId, $reply);
$response = $this->_ticketManager->addReplyToTicket($ticketId, $tickeIncrementId, $data);
$resultRedirect->setPath(
'uvdeskcon/tickets/ticketthread/', ['id' => $ticketId,'increment_id'=>$tickeIncrementId]
);
Expand All @@ -63,4 +69,4 @@ protected function _isAllowed()
{
return $this->_authorization->isAllowed('Webkul_UvDeskConnector::tickets_index');
}
}
}
28 changes: 12 additions & 16 deletions src/app/code/Webkul/UvDeskConnector/Model/TicketManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public function getAllTickets($label)
$company_domain = $this->_helperData->getCompanyDomainName();

// Return tickets
$url = 'http://'.$company_domain.'.voipkul.com/en/api/tickets.json?'.$label;
$url = 'https://'.$company_domain.'.uvdesk.com/en/api/tickets.json?'.$label;
$ch = curl_init($url);
$headers = array(
'Authorization: Bearer '.$access_token,
Expand Down Expand Up @@ -104,7 +104,7 @@ public function getAllTicketss($page=null,$labels=null,$tab=null,$agent=null,$cu
$str=$labels.$str;
}
// Return tickets
$url = 'http://'.$company_domain.'.voipkul.com/en/api/tickets.json?'.$str;
$url = 'https://'.$company_domain.'.uvdesk.com/en/api/tickets.json?'.$str;
$ch = curl_init($url);
$headers = array(
'Authorization: Bearer '.$access_token,
Expand All @@ -131,7 +131,7 @@ public function getFilterDataFor($filterType)
$company_domain = $this->_helperData->getCompanyDomainName();

// Return tickets
$url = 'http://'.$company_domain.'.voipkul.com/en/api/filters.json?'.$filterType.'=1';
$url = 'https://'.$company_domain.'.uvdesk.com/en/api/filters.json?'.$filterType.'=1';
$ch = curl_init($url);
$headers = array(
'Authorization: Bearer '.$access_token,
Expand All @@ -158,7 +158,7 @@ public function createTicket($ticketData)
$access_token = $this->_helperData->getAccessToken();
$company_domain = $this->_helperData->getCompanyDomainName();
// ticket url
$url = 'http://'.$company_domain.'.voipkul.com/en/api/tickets.json';
$url = 'https://'.$company_domain.'.uvdesk.com/en/api/tickets.json';

$data = json_encode($ticketData);
$ch = curl_init($url);
Expand Down Expand Up @@ -203,7 +203,7 @@ public function getCustomerFromEmail($customerEmail = null)
$access_token = $this->_helperData->getAccessToken();
$company_domain = $this->_helperData->getCompanyDomainName();
// ticket url
$url = 'http://'.$company_domain.'.voipkul.com/en/api/customers.json?email='.$customerEmail;
$url = 'https://'.$company_domain.'.uvdesk.com/en/api/customers.json?email='.$customerEmail;
$ch = curl_init($url);
$headers = [
'Authorization: Bearer '.$access_token
Expand All @@ -229,7 +229,7 @@ public function createCustomer()
$access_token = $this->_helperData->getAccessToken();
$company_domain = $this->_helperData->getCompanyDomainName();
// ticket url
$url = 'http://'.$company_domain.'.voipkul.com/en/api/customer.json';
$url = 'https://'.$company_domain.'.uvdesk.com/en/api/customer.json';

$data = json_encode($ticketData);
$ch = curl_init($url);
Expand Down Expand Up @@ -265,7 +265,7 @@ public function getTicketTypes()
$access_token = $this->_helperData->getAccessToken();
$company_domain = $this->_helperData->getCompanyDomainName();
// ticket url
$url = 'http://'.$company_domain.'.voipkul.com/en/api/ticket-types.json?';
$url = 'https://'.$company_domain.'.uvdesk.com/en/api/ticket-types.json?';
$ch = curl_init($url);
$headers = [
'Authorization: Bearer '.$access_token
Expand All @@ -291,7 +291,7 @@ public function getTicketThread($ticketId = 0)
$access_token = $this->_helperData->getAccessToken();
$company_domain = $this->_helperData->getCompanyDomainName();
// Return tickets
$url = 'http://'.$company_domain.'.voipkul.com/en/api/ticket/'.$ticketId.'/threads.json';
$url = 'https://'.$company_domain.'.uvdesk.com/en/api/ticket/'.$ticketId.'/threads.json';
$ch = curl_init($url);
$headers = array(
'Authorization: Bearer '.$access_token,
Expand All @@ -317,7 +317,7 @@ public function getSingleTicketData($ticketIncrementId){
$company_domain = $this->_helperData->getCompanyDomainName();
$str = '';
// Return tickets
$url = 'http://'.$company_domain.'.voipkul.com/en/api/ticket/'.$ticketIncrementId.'.json';
$url = 'https://'.$company_domain.'.uvdesk.com/en/api/ticket/'.$ticketIncrementId.'.json';
$ch = curl_init($url);
$headers = array(
'Authorization: Bearer '.$access_token,
Expand All @@ -339,16 +339,12 @@ public function getSingleTicketData($ticketIncrementId){
}

public function addReplyToTicket($ticketId,$ticketIncrementId ,$data){
// echo $email;die;

$access_token = $this->_helperData->getAccessToken();
$company_domain = $this->_helperData->getCompanyDomainName();
// ticket url
$url = 'http://'.$company_domain.'.voipkul.com/en/api/ticket/'.$ticketId.'/threads.json';
$url = 'https://'.$company_domain.'.uvdesk.com/en/api/ticket/'.$ticketId.'/threads.json';
$data = json_encode($data);
// echo "<pre>";
// print_r($data);
// die;
$ch = curl_init($url);
$headers = [
'Authorization: Bearer '.$access_token,
Expand Down Expand Up @@ -385,7 +381,7 @@ public function downloadAttachment($attachmenId)
$access_token = $this->_helperData->getAccessToken();
$company_domain = $this->_helperData->getCompanyDomainName();
// Return tickets
$url = 'http://'.$company_domain.'.voipkul.com/en/api/ticket/attachment/'.$attachmenId.'.json ';
$url = 'https://'.$company_domain.'.uvdesk.com/en/api/ticket/attachment/'.$attachmenId.'.json ';
$ch = curl_init($url);
$headers = array(
'Authorization: Bearer '.$access_token,
Expand All @@ -411,7 +407,7 @@ public function trashTicket()
$access_token = $this->_helperData->getAccessToken();
$company_domain = $this->_helperData->getCompanyDomainName();
// Return tickets
$url = 'http://'.$company_domain.'.voipkul.com/en/ /api/ticket/4802/trash.json';
$url = 'https://'.$company_domain.'.uvdesk.com/en/ /api/ticket/4802/trash.json';
$ch = curl_init($url);
$headers = array(
'Authorization: Bearer '.$access_token,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
<?php
$ticketThread = $block->getTicketThread();
$ticketData = $block->getSingleTicketData();
$ticketThread = $block->getTicketThread();
$ticketData = $block->getSingleTicketData();
?>
<div class="container-fluid">
<div class="col-sm-3">
<div class="panel panel-default">
<div class="panel-heading"><h3 class="panel-title">Labels</h3></div>
<div class="panel-body" id="uvdesk_backend_ticket_thread_panel">
<?php foreach ($block->getAllTickets()['labels']['predefind'] as $key => $value) { ?>
<a href='<?php echo $block->getUrl("uvdeskcon/tickets/index/");echo 'labels/'.$key ;?>' style="color: #555;"><?php echo ucfirst($key); ?> <span class="label label-success"> <?php echo $value; ?></span>
</a>
<br>
<?php } ?>
<?php foreach ($block->getAllTickets()['labels']['predefind'] as $key => $value) { ?>
<a href='<?php echo $block->getUrl("uvdeskcon/tickets/index/");echo 'labels/'.$key ;?>' style="color: #555;"><?php echo ucfirst($key); ?> <span class="label label-success"> <?php echo $value; ?></span>
</a>
<br>
<?php } ?>
</div>

</div>
Expand Down Expand Up @@ -72,47 +72,50 @@

<div class="ticket-thread">
<?php foreach(array_reverse($ticketThread['threads']) as $key=>$value){?>
<div class="thread">
<div class="col-sm-12 thread-created-info text-center">
<span class="info">
<span id="thread<?php echo $value['id'];?>" class="copy-thread-link">#<?php echo $value['id'];?></span> <?php echo $value['user']['detail']['customer']['name'];?> replied
</span>
<span class="text-right date pull-right"><?php echo $value['formatedCreatedAt'];?>
</span>
</div>
<div class="col-sm-12">
<div class="pull-left">
<span class="round-tabs">
<div class="thread">
<div class="col-sm-12 thread-created-info text-center">
<span class="info">
<span id="thread<?php echo $value['id'];?>" class="copy-thread-link">#<?php echo $value['id'];?></span>
<?php
echo $value['user']['detail'][$value['userType']]['name'];
?> replied
</span>
<span class="text-right date pull-right"><?php echo $value['formatedCreatedAt'];?>
</span>
</div>
<div class="col-sm-12">
<div class="pull-left">
<span class="round-tabs">
<?php if(empty($value['user']['smallThumbnail'])) { ?>
<img src="https://cdn.uvdesk.com/uvdesk/images/d94332c.png"/>
<?php } else {?>
<img src="<?php echo $value['user']['smallThumbnail'];?>">
<?php } ?>
</span>
</div>
<div class="thread-body">
<div class="thread-info">
<div class="thread-info-row first">
<span class="cust-name">
<strong><?php echo $value['user']['detail']['customer']['name'];?></strong>
</span>
<label class="user-type customer label label-info"><?php echo $value['userType'];?></label>
</div>
<div class="thread-info-row">
</div>
</div>
<div class="reply">
<div class="main-reply"><?php echo $value['reply'];?>
</div>
</div>
<div class="attachments">
<?php foreach($value['attachments'] as $key=>$attachment){ ?>
<a href="<?php echo $block->getUrl('uvdeskcon/tickets/downloadattachment').'attachment_id/'.$attachment['id'].'/name/'.$attachment['name'];?>" target="_blank" class="download-attachment">
<i class="fa fa-download"></i>
</a>
<?php } ?>
</div>
</div>
</span>
</div>
<div class="thread-body">
<div class="thread-info">
<div class="thread-info-row first">
<span class="cust-name">
<strong><?php echo $value['user']['detail'][$value['userType']]['name'];?></strong>
</span>
<label class="user-type customer label label-info"><?php echo $value['userType'];?></label>
</div>
<div class="thread-info-row">
</div>
</div>
<div class="reply">
<div class="main-reply"><?php echo $value['reply'];?>
</div>
</div>
<div class="attachments">
<?php foreach($value['attachments'] as $key=>$attachment){ ?>
<a href="<?php echo $block->getUrl('uvdeskcon/tickets/downloadattachment').'attachment_id/'.$attachment['id'].'/name/'.$attachment['name'];?>" target="_blank" class="download-attachment">
<i class="fa fa-download"></i>
</a>
<?php } ?>
</div>
</div>
</div>
</div>
<hr>
Expand All @@ -131,35 +134,35 @@
<form action="<?php echo $block->getUrl('uvdeskcon/tickets/ticketthread') ?>addReply/1" method="post">
<div class="reply border-none">
<?php echo $block->getBlockHtml('formkey')?>
<textarea name="product[description]" class="required-entry input-text" id="custom_wysiwyg" rows="5" cols="75" ></textarea>
<script>
require([
'jquery',
'mage/adminhtml/wysiwyg/tiny_mce/setup'
], function(jQuery){
<textarea name="product[description]" class="required-entry input-text" id="custom_wysiwyg" rows="5" cols="75" ></textarea>
<script>
require([
'jquery',
'mage/adminhtml/wysiwyg/tiny_mce/setup'
], function(jQuery){

tinyMCE.init({
mode : "exact",
elements: "custom_wysiwyg",
theme : "advanced",
plugins : "inlinepopups,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras",
theme_advanced_buttons1 : "newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,styleselect,formatselect,fontselect,fontsizeselect",
theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview,|,forecolor,backcolor",
theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen",
theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops,|,cite,abbr,acronym,del,ins,|,visualchars,nonbreaking",
theme_advanced_toolbar_location : "top",
theme_advanced_toolbar_align : "left",
theme_advanced_path_location : "bottom",
extended_valid_elements : "a[name|href|target|title|onclick],img[class|src|border=0|alt|title|hspace|vspace|width|height|align|onmouseover|onmouseout|name],hr[class|width|size|noshade],font[face|size|color|style],span[class|align|style]",
theme_advanced_resize_horizontal : 'true',
theme_advanced_resizing : 'true',
apply_source_formatting : 'true',
convert_urls : 'false',
force_br_newlines : 'true',
doctype : '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">'
});
});
</script>
tinyMCE.init({
mode : "exact",
elements: "custom_wysiwyg",
theme : "advanced",
plugins : "inlinepopups,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras",
theme_advanced_buttons1 : "newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,styleselect,formatselect,fontselect,fontsizeselect",
theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview,|,forecolor,backcolor",
theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen",
theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops,|,cite,abbr,acronym,del,ins,|,visualchars,nonbreaking",
theme_advanced_toolbar_location : "top",
theme_advanced_toolbar_align : "left",
theme_advanced_path_location : "bottom",
extended_valid_elements : "a[name|href|target|title|onclick],img[class|src|border=0|alt|title|hspace|vspace|width|height|align|onmouseover|onmouseout|name],hr[class|width|size|noshade],font[face|size|color|style],span[class|align|style]",
theme_advanced_resize_horizontal : 'true',
theme_advanced_resizing : 'true',
apply_source_formatting : 'true',
convert_urls : 'false',
force_br_newlines : 'true',
doctype : '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">'
});
});
</script>
<input name="ticket_id" value="<?php echo $ticketData['ticket']['id']?>" type="hidden">
<input name="incremet_id" value="<?php echo $ticketData['ticket']['incrementId']?>" type="hidden">
<div class="ff">
Expand Down
Loading

0 comments on commit 06f96db

Please sign in to comment.