Changeset 3038770
- Timestamp:
- 02/20/2024 08:42:03 PM (2 years ago)
- Location:
- hippoo-ticket/trunk
- Files:
-
- 6 edited
-
app/web_api_auth.php (modified) (2 diffs)
-
hippoo-ticket.php (modified) (2 diffs)
-
metabox/ticket_box_html_template.php (modified) (1 diff)
-
readme.txt (modified) (1 diff)
-
shortcode/ticket.php (modified) (2 diffs)
-
shortcode/ticket_html_template.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
hippoo-ticket/trunk/app/web_api_auth.php
r3007682 r3038770 1 1 <?php 2 class HippooTicketControllerWithAuth extends WC_REST_Customers_Controller 3 {2 3 class HippooTicketControllerWithAuth extends WC_REST_Customers_Controller { 4 4 5 5 public function register_routes() … … 258 258 return new WP_REST_Response($cnt, 200); 259 259 } 260 }260 } -
hippoo-ticket/trunk/hippoo-ticket.php
r3007682 r3038770 2 2 /** 3 3 * Plugin Name: Hippoo Ticket 4 * Version: 1.0. 04 * Version: 1.0.1 5 5 * Plugin URI: https://Hippoo.app/ 6 6 * Description: A Free WooCommerce Plugin for Seamless Customer Support and support ticket. … … 15 15 * any later version. 16 16 * 17 * Hippoo! is distributed in the hope that it will be useful, 18 * but WITHOUT ANY WARRANTY; without even the implied warranty of 19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 20 * GNU General Public License for more details. 21 * 22 * You should have received a copy of the GNU General Public License 23 * along with Hippoo!. 24 **/ 17 * Hippoo! is distributed in the hope that it will be useful, 18 * but WITHOUT ANY WARRANTY; without even the implied warranty of 19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 20 * GNU General Public License for more details. 21 * 22 * You should have received a copy of the GNU General Public License 23 * along with Hippoo!. 24 **/ 25 26 25 27 if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly 28 29 define('hippoo_ticket_path',dirname(__file__).DIRECTORY_SEPARATOR); 30 define('hippoo_ticket_url',plugins_url('hippoo-ticket').'/assets/'); 31 global $hippoo_ticket_api_page; 32 $hippoo_ticket_api_page = 10; 33 34 require_once(ABSPATH."wp-admin/includes/image.php"); 35 36 include_once(hippoo_ticket_path.'app'.DIRECTORY_SEPARATOR.'utils.php'); 37 include_once(hippoo_ticket_path.'app'.DIRECTORY_SEPARATOR.'hooks.php'); 38 include_once(hippoo_ticket_path.'app'.DIRECTORY_SEPARATOR.'web_api.php'); 39 include_once(hippoo_ticket_path.'shortcode'.DIRECTORY_SEPARATOR.'ticket.php'); 40 include_once(hippoo_ticket_path.'metabox'.DIRECTORY_SEPARATOR.'ticket_box.php'); 41 42 register_activation_hook(__file__,'hippoo_ticket_register_hook'); 43 44 function hippoo_ticket_register_hook(){ 26 45 27 define('hippoo_ticket_path',dirname(__file__).DIRECTORY_SEPARATOR); 28 define('hippoo_ticket_url',plugins_url('hippoo-ticket').'/assets/'); 29 global $hippoo_ticket_api_page; 30 $hippoo_ticket_api_page = 10; 46 require_once( ABSPATH . 'wp-admin/includes/upgrade.php' ); 47 48 global $wpdb; 49 $hippoo_ticket_table_name = $wpdb->prefix . 'hippoo_ticket'; 50 $sql = "CREATE TABLE IF NOT EXISTS {$hippoo_ticket_table_name} ( 51 id int(11) NOT NULL AUTO_INCREMENT, 52 pid int(11) NOT NULL, 53 uid int(11) NOT NULL, 54 type varchar(7) NOT NULL, 55 date datetime DEFAULT NULL, 56 content text NOT NULL, 57 media_ids text NOT NULL, 58 see int(1) DEFAULT NULL, 59 PRIMARY KEY (id) 60 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;"; 61 $wpdb->query($sql); 31 62 32 require_once(ABSPATH."wp-admin/includes/image.php"); 33 34 include_once(hippoo_ticket_path.'app'.DIRECTORY_SEPARATOR.'utils.php'); 35 include_once(hippoo_ticket_path.'app'.DIRECTORY_SEPARATOR.'hooks.php'); 36 include_once(hippoo_ticket_path.'app'.DIRECTORY_SEPARATOR.'web_api.php'); 37 include_once(hippoo_ticket_path.'shortcode'.DIRECTORY_SEPARATOR.'ticket.php'); 38 include_once(hippoo_ticket_path.'metabox'.DIRECTORY_SEPARATOR.'ticket_box.php'); 63 $pg_ticket = $wpdb->get_var( 64 $wpdb->prepare( 65 "SELECT ID FROM $wpdb->posts WHERE post_type = %s AND post_content LIKE %s", 66 'page', 67 '%[hippoo_ticket]%' 68 ) 69 ); 70 if(empty($pg_ticket)){ 71 $args = [ 72 'post_title' => 'Hippoo Ticket', 73 'post_type' => 'page', 74 'post_content'=> '[hippoo_ticket]', 75 'post_status' =>'publish', 76 'post_author' => get_current_user_id(),]; 77 $pg_ticket = wp_insert_post($args); 78 } 79 $args = [ 80 'sms' => 'A message is sent to you.', 81 'email' => '<p>Dear User %user%</p> 82 <p>A message is sent to you.</p> 83 <p><a url="%url%">%ticket%</a></p>', 84 'pg_ticket'=> $pg_ticket, 85 ]; 86 update_option('hippoo_ticket',$args); 87 } 39 88 40 register_activation_hook(__file__,'hippoo_ticket_register_hook'); 89 function hippoo_ticket_admin_menu(){ 41 90 42 function hippoo_ticket_register_hook(){ 43 44 require_once( ABSPATH . 'wp-admin/includes/upgrade.php' ); 45 46 global $wpdb; 47 $hippoo_ticket_table_name = $wpdb->prefix . 'hippoo_ticket'; 48 $sql = "CREATE TABLE IF NOT EXISTS {$hippoo_ticket_table_name} ( 49 id int(11) NOT NULL AUTO_INCREMENT, 50 pid int(11) NOT NULL, 51 uid int(11) NOT NULL, 52 type varchar(7) NOT NULL, 53 date datetime DEFAULT NULL, 54 content text NOT NULL, 55 media_ids text NOT NULL, 56 see int(1) DEFAULT NULL, 57 PRIMARY KEY (id) 58 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;"; 59 $wpdb->query($sql); 91 // add_submenu_page('edit.php?post_type=hippoo_ticket','Settings','Settings','administrator','hippoo_ticket_con_ticket','hippoo_ticket_con_ticket'); 92 add_menu_page( 93 __( 'Hippoo Ticket', 'hippoo-ticket' ), 94 __( 'Hippoo Ticket', 'hippoo-ticket' ), 95 'manage_options', 96 'hippoo_ticket_con_ticket', 97 'hippoo_ticket_con_ticket', 98 ( HIPPOO_POPUP_URL . '/images/icon.svg' ) 99 ); 60 100 61 $pg_ticket = $wpdb->get_var( 62 $wpdb->prepare( 63 "SELECT ID FROM $wpdb->posts WHERE post_type = %s AND post_content LIKE %s", 64 'page', 65 '%[hippoo_ticket]%' 66 ) 67 ); 68 if(empty($pg_ticket)){ 69 $args = [ 70 'post_title' => 'Hippoo Ticket', 71 'post_type' => 'page', 72 'post_content'=> '[hippoo_ticket]', 73 'post_status' =>'publish', 74 'post_author' => get_current_user_id(),]; 75 $pg_ticket = wp_insert_post($args); 76 } 77 $args = [ 78 'sms' => 'A message is sent to you.', 79 'email' => '<p>Dear User %user%</p> 80 <p>A message is sent to you.</p> 81 <p><a url="%url%">%ticket%</a></p>', 82 'pg_ticket'=> $pg_ticket, 83 ]; 84 update_option('hippoo_ticket',$args); 85 } 86 87 function hippoo_ticket_admin_menu(){ 88 89 global $menu,$wpdb; 90 add_submenu_page('edit.php?post_type=hippoo_ticket','Settings','Settings','administrator','hippoo_ticket_con_ticket','hippoo_ticket_con_ticket'); 91 92 $count = $wpdb->get_var( 93 $wpdb->prepare( 94 "SELECT COUNT(ID) FROM $wpdb->posts WHERE post_type = %s AND post_status = %s", 95 'hippoo_ticket', 96 'hippoo_waiting' 97 ) 98 ); 99 if(!empty($count)){ 100 foreach($menu as $i=>$men){ 101 if($men[2] == 'edit.php?post_type=hippoo_ticket'){ 102 $menu[$i][0] .= " <span class='update-plugins count-$count'><span class='plugin-count'>$count</span></span>"; 103 } 101 global $menu,$wpdb; 102 $count = $wpdb->get_var( 103 $wpdb->prepare( 104 "SELECT COUNT(ID) FROM $wpdb->posts WHERE post_type = %s AND post_status = %s", 105 'hippoo_ticket', 106 'hippoo_waiting' 107 ) 108 ); 109 if(!empty($count)){ 110 foreach($menu as $i=>$men){ 111 if($men[2] == 'edit.php?post_type=hippoo_ticket'){ 112 $menu[$i][0] .= " <span class='update-plugins count-$count'><span class='plugin-count'>$count</span></span>"; 104 113 } 105 114 } 106 115 } 107 add_action('admin_menu','hippoo_ticket_admin_menu'); 108 109 116 } 117 add_action('admin_menu','hippoo_ticket_admin_menu'); 110 118 111 function hippoo_ticket_con_ticket(){112 include_once(hippoo_ticket_path.'app'.DIRECTORY_SEPARATOR.'config.php');113 }119 function hippoo_ticket_con_ticket(){ 120 include_once(hippoo_ticket_path.'app'.DIRECTORY_SEPARATOR.'config.php'); 121 } 114 122 115 123 116 function hippoo_ticket_textdomain() { 117 load_theme_textdomain( 'hippoo', get_template_directory() . '/languages' ); 124 function hippoo_ticket_textdomain() { 125 load_theme_textdomain( 'hippoo', get_template_directory() . '/languages' ); 126 } 127 add_action( 'after_setup_theme', 'hippoo_ticket_textdomain' ); 128 129 function hippoo_ticket_page_style( $hook ) { 130 if ( in_array( $hook, array( 'hippoo_ticket_page_hippoo_ticket_con_ticket' ) ) ) { 131 wp_enqueue_style( 'hippoo_ticket_page_style', 132 hippoo_ticket_url . "css/style.css", null, 1.0); 118 133 } 119 add_action( 'after_setup_theme', 'hippoo_ticket_textdomain' ); 134 } 120 135 121 function hippoo_ticket_page_style( $hook ) { 122 if ( in_array( $hook, array( 'hippoo_ticket_page_hippoo_ticket_con_ticket' ) ) ) { 123 wp_enqueue_style( 'hippoo_ticket_page_style', 124 hippoo_ticket_url . "css/style.css", null, 1.0); 125 } 126 } 127 128 add_action( 'admin_enqueue_scripts', 'hippoo_ticket_page_style' ); 136 add_action( 'admin_enqueue_scripts', 'hippoo_ticket_page_style' ); 129 137 130 138 /** -
hippoo-ticket/trunk/metabox/ticket_box_html_template.php
r3007682 r3038770 29 29 <tr> 30 30 <td colspan="1"> 31 <p>No results found.</p>31 <p>No History Found.</p> 32 32 </td> 33 33 </tr> -
hippoo-ticket/trunk/readme.txt
r3007682 r3038770 5 5 Requires at least: 5.3 6 6 Tested up to: 6.4 7 Stable tag: 1.0. 07 Stable tag: 1.0.1 8 8 License: GPLv2 or later 9 9 License URI: https://www.gnu.org/licenses/gpl-2.0.html -
hippoo-ticket/trunk/shortcode/ticket.php
r3007682 r3038770 18 18 exit(); 19 19 } 20 20 21 21 22 ob_start(); … … 42 43 43 44 44 if (isset($_POST['save']) && isset($_POST['cs fr_token'])) {45 if (wp_verify_nonce($_POST['cs fr_token'], 'csfr_token_save')) {45 if (isset($_POST['save']) && isset($_POST['csrf_token'])) { 46 if (wp_verify_nonce($_POST['csrf_token'], 'csrf_token_save')) { 46 47 47 48 // Check if file upload was successful -
hippoo-ticket/trunk/shortcode/ticket_html_template.php
r3007682 r3038770 43 43 <tr> 44 44 <td> 45 <p>No results found.</p>45 <p>No History Found.</p> 46 46 </td> 47 47 </tr>
Note: See TracChangeset
for help on using the changeset viewer.