Changeset 2427279
- Timestamp:
- 11/27/2020 01:10:32 PM (5 years ago)
- Location:
- hb-freshdesk/trunk
- Files:
-
- 9 edited
-
admin-settings.php (modified) (5 diffs)
-
create_ticket.php (modified) (2 diffs)
-
css/fd-style.css (modified) (2 diffs)
-
faq_page.php (modified) (1 diff)
-
freshdesk.php (modified) (1 diff)
-
get_all_ticket.php (modified) (6 diffs)
-
js/fd-script-frontend.js (modified) (4 diffs)
-
js/fd-script.js (modified) (1 diff)
-
readme.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
hb-freshdesk/trunk/admin-settings.php
r2082036 r2427279 112 112 echo "0"; 113 113 }else { 114 echo "1";114 echo "1"; 115 115 } 116 116 exit(); … … 131 131 132 132 if( $use_apikey == "api" ){ 133 134 133 $apikey = ( $freshdesk_apikey != '' ) ? $freshdesk_apikey : ''; 135 134 $password = ""; … … 142 141 143 142 if($method == "POST") { 144 145 143 $response = wp_remote_post( $urltopost, array( 146 'method' => 'POST', 147 'headers' => array( 'Authorization' => 'Basic ' . base64_encode( $apikey . ':' . $password ), 148 'Content-Type' => 'application/json; charset=utf-8'), 149 'body' => $data 150 ) 151 ); 152 } 153 154 $args = array( 155 'headers' => array( 156 'Authorization' => 'Basic ' . base64_encode( $apikey . ':' . $password ) 157 ) 158 ); 159 160 $response = wp_remote_get( $urltopost, $args ); 161 162 144 'method' => 'POST', 145 'headers' => array( 146 'Authorization' => 'Basic ' . base64_encode( $apikey . ':' . $password ), 147 'Content-Type' => 'application/json; charset=utf-8'), 148 'body' => $data 149 ) 150 ); 151 }else{ 152 $args = array( 153 'headers' => array( 154 'Authorization' => 'Basic ' . base64_encode( $apikey . ':' . $password ) 155 ) 156 ); 157 $response = wp_remote_get( $urltopost, $args ); 158 } 163 159 return $response; 164 160 exit(); … … 178 174 179 175 global $wpdb; 180 $table = $wpdb->prefix . 'freshdesk';176 $table = $wpdb->prefix . 'freshdesk'; 181 177 182 178 $AllArticleData = $wpdb->get_results( "SELECT * FROM ". $table ."" ); … … 390 386 391 387 function CreateNewTicket() { 392 393 388 $data = json_encode($_POST['data_arr'],JSON_NUMERIC_CHECK); 394 395 389 $new_ticket_url = "tickets"; 396 $ this->curl_api_function($new_ticket_url, "POST", $data);390 $results = $this->curl_api_function($new_ticket_url, "POST", $data); 397 391 $TicketData = $this->curl_api_function($new_ticket_url); 392 $response = isset($results['response']['code']) ? $results['response']['code'] : '0'; 393 echo $response; 398 394 exit(); 399 395 } -
hb-freshdesk/trunk/create_ticket.php
r2082036 r2427279 8 8 <div class="content-warp"> 9 9 <form> 10 <div class="ticket-response" style="display: none;"> 11 </div> 10 12 <div class="ticket-field-row"> 11 13 <div class="main-row"> … … 38 40 <div class="ticket-field-label"> 39 41 <select class="form-control" id="ticket_type"> 40 <option value="null">--</option> 41 <option value="Question">Question</option> 42 <option value="Question">Question</option> 42 43 <option value="Incident">Incident</option> 43 44 <option value="Problem">Problem</option> -
hb-freshdesk/trunk/css/fd-style.css
r2082036 r2427279 232 232 padding-bottom: 10px; 233 233 } 234 235 236 234 .ticket_heading { 237 235 font-size: 18px; … … 242 240 padding-left: 15px; 243 241 } 242 .ticket-response { 243 width: 80%; 244 padding: 10px; 245 } 246 244 247 /*# sourceMappingURL=sourcemap/fd-style.css.map */ 245 248 -
hb-freshdesk/trunk/faq_page.php
r2082036 r2427279 2 2 <h1 class="page-heading"> FreshDesk Faq </h1> 3 3 <?php 4 include_once('admin-settings.php');4 include_once('admin-settings.php'); 5 5 $FreshDeskSettingsPage = new FreshDeskSettingsPage(); 6 6 -
hb-freshdesk/trunk/freshdesk.php
r2404532 r2427279 3 3 Plugin Name:HB Freshdesk 4 4 Description: This plugin is used for connect your FreshDesk account in your wordpress site. You can easily to get your FreshDesk FAQs and Ticket, And also create a new ticket in your FreshDesk account directly using this plugin, And also check your ticket conversation. 5 Version: 3. 25 Version: 3.3 6 6 Author: Hiren Patel ,Hike Branding 7 7 Author URI: https://www.hikebranding.com/ -
hb-freshdesk/trunk/get_all_ticket.php
r2082036 r2427279 7 7 include_once('admin-settings.php'); 8 8 9 10 11 9 $FreshDeskSettingsPage = new FreshDeskSettingsPage(); 12 13 14 10 15 11 $all_ticket_url = "tickets"; … … 19 15 $GetAllTicket = $FreshDeskSettingsPage->curl_api_function($all_ticket_url); 20 16 21 22 23 17 $siteUrl = get_permalink(); 24 18 25 19 $get_ticket_id = filter_var($_GET['ticket_id'], FILTER_SANITIZE_STRING); 26 20 27 $ticket_data = isset($get_ticket_id) ? $get_ticket_id : ''; 28 29 21 $ticket_data = isset($get_ticket_id) ? $get_ticket_id : ''; 30 22 31 23 if(isset($ticket_data) && !empty($ticket_data)) { … … 38 30 39 31 } 40 41 42 43 32 ?> 44 33 … … 48 37 49 38 <?php if(isset($TicketData) && !empty($TicketData)) { 50 39 if(isset($TicketData['response']['code']) && $TicketData['response']['code'] == 200){ 51 40 $TicketData_array = json_decode($TicketData['body'], true); 52 41 … … 155 144 </div> 156 145 157 146 <?php } ?> 158 147 159 148 <?php } else { 160 149 161 $GetAllTicket_Array = json_decode($GetAllTicket['body'], true);150 $GetAllTicket_Array = json_decode($GetAllTicket['body'], true); 162 151 163 164 152 if($GetAllTicket_Array['code'] != "invalid_credentials"){ 153 165 154 foreach ($GetAllTicket_Array as $_GetAllTicket) { ?> 166 155 … … 173 162 </div> 174 163 175 <?php } } ?>164 <?php } } } ?> 176 165 177 166 </div> -
hb-freshdesk/trunk/js/fd-script-frontend.js
r2082036 r2427279 14 14 /// Create a New ticket /// 15 15 function create_ticket() { 16 16 jQuery(".ticket-response").hide(); 17 17 18 var email = jQuery('#email').val(); 18 19 var subject = jQuery('#subject').val(); … … 21 22 var ticket_status = 2; 22 23 var ticket_priority = jQuery('#ticket_priority').val(); 23 // var assign_to = jQuery('#assign_to').val();24 24 var description = jQuery('#description').val(); 25 25 … … 35 35 }; 36 36 jQuery.post(hb_ajax_object.ajax_url, data, function(data){ 37 location.reload(); 37 if(data == 400){ 38 jQuery(".ticket-response").empty(); 39 jQuery(".ticket-response").show(); 40 jQuery(".ticket-response").css("border", "1px solid #ff0000"); 41 jQuery(".ticket-response").append("<span style='color: #ff0000 ;'><b>Error:</b> Please enter a valid Email address.</span>"); 42 }else if(data == 201){ 43 jQuery('#email').val(""); 44 jQuery('#subject').val(""); 45 jQuery('#description').val(""); 46 47 jQuery(".ticket-response").empty(); 48 jQuery(".ticket-response").show(); 49 jQuery(".ticket-response").css("border", "1px solid #28a745"); 50 jQuery(".ticket-response").append("<span style='color: #28a745;'> Your ticket has been created.</span>"); 51 }else{ 52 location.reload(); 53 } 38 54 }); 39 55 } … … 42 58 jQuery( document ).ready(function() { 43 59 var data = { 44 action: 'ajaxDataSave',45 data:{}46 };47 jQuery.post(hb_ajax_object.ajax_url, data, function(data){48 //location.reload();60 action: 'ajaxDataSave', 61 data:{} 62 }; 63 jQuery.post(hb_ajax_object.ajax_url, data, function(data){ 64 //location.reload(); 49 65 }); 50 66 }); -
hb-freshdesk/trunk/js/fd-script.js
r2082036 r2427279 31 31 32 32 if(data == "0") { 33 jQuery("#message").text(" invalid credentials!").css("color","red");33 jQuery("#message").text("Invalid credentials!").css("color","red"); 34 34 } else if (data == "1") { 35 35 jQuery("#message").text("Connection successfully established in your Freshdesk account !").css("color","green"); -
hb-freshdesk/trunk/readme.txt
r2424622 r2427279 5 5 Requires at least: 4.1 6 6 Tested up to: 5.6 7 Stable tag: 3. 27 Stable tag: 3.3 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html 10 10 11 A plugin Get your Fresh desk account FAQ's and Crete a new Ticket and view your All ticket with full conversation.11 A plugin Get your Freshdesk account FAQ's and Create a new Ticket and view your All ticket with full conversation. 12 12 13 13 == Description ==
Note: See TracChangeset
for help on using the changeset viewer.