Plugin Directory

Changeset 3188306


Ignore:
Timestamp:
11/14/2024 05:28:00 AM (13 months ago)
Author:
supportcandy
Message:

Version 3.3.0

Location:
supportcandy
Files:
701 added
41 edited

Legend:

Unmodified
Added
Removed
  • supportcandy/trunk/asset/js/admin.js

    r3075593 r3188306  
    4646    var data = {
    4747        action: 'wpsc_get_ticket_list',
    48         _ajax_nonce: supportcandy.nonce
     48        _ajax_nonce: supportcandy.nonce,
     49        is_frontend: supportcandy.is_frontend
    4950    };
    5051    if (typeof supportcandy.ticketList != 'undefined' && typeof supportcandy.ticketList.filters != 'undefined') {
  • supportcandy/trunk/framework/scripts.js

    r3075593 r3188306  
    24162416    action: "wpsc_get_tickets",
    24172417    _ajax_nonce: supportcandy.nonce,
     2418    is_frontend : supportcandy.is_frontend
    24182419  };
    24192420  if (
     
    27142715function wpsc_db_set_filter_duration_dates(duration) {
    27152716
    2716     let dateStr = '';
    2717     let date    = new Date();
     2717  let dateStr = '';
     2718    let date = new Date();
     2719    let from_date, to_date;
     2720
    27182721    switch (duration) {
    27192722
    2720         case 'today':
    2721             dateStr = date.toISOString().split('T')[0];
    2722             date_from_to = {
    2723                 'from' : dateStr,
    2724                 'to' : dateStr
    2725             }
    2726             break;
    2727 
    2728         case 'yesterday':
    2729             date.setDate( date.getDate() - 1 );
    2730             dateStr = date.toISOString().split('T')[0];
    2731             date_from_to = {
    2732                 'from' : dateStr,
    2733                 'to' : dateStr
    2734             }
    2735             break;
    2736 
    2737         case 'this-week':
    2738             if (date.getDay() == 0) {
    2739                 date.setDate( date.getDate() - 6 );
    2740             } else {
    2741                 date.setDate( date.getDate() - date.getDay() + 1 );
    2742             }
    2743             from_date = date.toISOString().split('T')[0];
    2744             date.setDate( date.getDate() + 6 );
    2745             to_date = date.toISOString().split('T')[0];
    2746             date_from_to = {
    2747                 'from' : from_date,
    2748                 'to' : to_date
    2749             }
    2750             break;
    2751 
    2752         case 'last-week':
    2753             if (date.getDay() == 0) {
    2754                 date.setDate( date.getDate() - 13 );
    2755             } else {
    2756                 date.setDate( date.getDate() - date.getDay() - 6 );
    2757             }
    2758             from_date = date.toISOString().split('T')[0];
    2759             date.setDate( date.getDate() + 6 );
    2760             to_date = date.toISOString().split('T')[0];
    2761             date_from_to = {
    2762                 'from' : from_date,
    2763                 'to' : to_date
    2764             }
    2765             break;
    2766 
    2767         case 'last-30-days':
    2768             from_date = date.toISOString().split('T')[0];
    2769             date.setDate( date.getDate() - 29 );
    2770             to_date = date.toISOString().split('T')[0];
    2771             date_from_to = {
    2772                 'from' : to_date,
    2773                 'to' : from_date
    2774             }
    2775             break;
    2776 
    2777         case 'this-month':
    2778             from_date = new Date( date.getFullYear(), date.getMonth(), 1 ).toISOString().split('T')[0];
    2779             to_date = new Date( date.getFullYear(), date.getMonth() + 1, 0 ).toISOString().split('T')[0];
    2780             date_from_to = {
    2781                 'from' : from_date,
    2782                 'to' : to_date
    2783             }
    2784             break;
    2785 
    2786         case 'last-month':
    2787             date.setMonth( date.getMonth(), 0 );
    2788             to_date = date.toISOString().split('T')[0];
    2789             from_date = new Date( date.getFullYear(), date.getMonth(), 1 ).toISOString().split('T')[0];
    2790             date_from_to = {
    2791                 'from' : from_date,
    2792                 'to' : to_date
    2793             }
    2794             break;
    2795     }
     2723    case 'today':
     2724      dateStr = date.toISOString().split('T')[0];
     2725      date_from_to = {
     2726        'from': dateStr,
     2727        'to': dateStr
     2728      };
     2729      break;
     2730   
     2731    case 'yesterday':
     2732      date.setDate(date.getDate() - 1);
     2733      dateStr = date.toISOString().split('T')[0];
     2734      date_from_to = {
     2735        'from': dateStr,
     2736        'to': dateStr
     2737      };
     2738      break;
     2739   
     2740    case 'this-week':
     2741      let firstDayOfWeek = date.getDay() === 0 ? 6 : date.getDay() - 1;
     2742      date.setDate(date.getDate() - firstDayOfWeek);
     2743      from_date = date.toISOString().split('T')[0];
     2744      date.setDate(date.getDate() + 6);
     2745      to_date = date.toISOString().split('T')[0];
     2746      date_from_to = {
     2747        'from': from_date,
     2748        'to': to_date
     2749      };
     2750      break;
     2751   
     2752    case 'last-week':
     2753      let firstDayOfLastWeek = date.getDay() === 0 ? 7 : date.getDay();
     2754      date.setDate(date.getDate() - firstDayOfLastWeek - 6);
     2755      from_date = date.toISOString().split('T')[0];
     2756      date.setDate(date.getDate() + 6);
     2757      to_date = date.toISOString().split('T')[0];
     2758      date_from_to = {
     2759        'from': from_date,
     2760        'to': to_date
     2761      };
     2762      break;
     2763   
     2764    case 'last-7':
     2765      date.setDate(date.getDate() - 1); // Exclude today
     2766      to_date = date.toISOString().split('T')[0];
     2767      date.setDate(date.getDate() - 6); // Last 7 days from yesterday
     2768      from_date = date.toISOString().split('T')[0];
     2769      date_from_to = {
     2770        'from': from_date,
     2771        'to': to_date
     2772      };
     2773      break;
     2774   
     2775    case 'last-30-days':
     2776      date.setDate(date.getDate() - 1); // Exclude today
     2777      to_date = date.toISOString().split('T')[0];
     2778      date.setDate(date.getDate() - 29); // Last 30 days from yesterday
     2779      from_date = date.toISOString().split('T')[0];
     2780      date_from_to = {
     2781        'from': from_date,
     2782        'to': to_date
     2783      };
     2784      break;
     2785   
     2786    case 'this-month':
     2787      let this_month_starts = new Date(date.getFullYear(), date.getMonth(), 1);
     2788      let this_month_ends = new Date(date.getFullYear(), date.getMonth() + 1, 0);
     2789      date_from_to = {
     2790        'from': `${this_month_starts.getFullYear()}-${(this_month_starts.getMonth() + 1).toString().padStart(2, '0')}-${this_month_starts.getDate().toString().padStart(2, '0')}`,
     2791        'to': `${this_month_ends.getFullYear()}-${(this_month_ends.getMonth() + 1).toString().padStart(2, '0')}-${this_month_ends.getDate().toString().padStart(2, '0')}`
     2792      };
     2793      break;
     2794
     2795    case 'last-month':
     2796      date.setMonth(date.getMonth() - 1);
     2797      let last_month_starts = new Date(date.getFullYear(), date.getMonth(), 1);
     2798      let last_month_ends = new Date(date.getFullYear(), date.getMonth() + 1, 0);
     2799      date_from_to = {
     2800        'from': `${last_month_starts.getFullYear()}-${(last_month_starts.getMonth() + 1).toString().padStart(2, '0')}-${last_month_starts.getDate().toString().padStart(2, '0')}`,
     2801        'to': `${last_month_ends.getFullYear()}-${(last_month_ends.getMonth() + 1).toString().padStart(2, '0')}-${last_month_ends.getDate().toString().padStart(2, '0')}`
     2802      };
     2803      break;
     2804
     2805    case 'this-quarter':
     2806      let this_quarter_month_starts = Math.floor(date.getMonth() / 3) * 3;
     2807      let quarter_start = new Date(date.getFullYear(), this_quarter_month_starts, 1);
     2808      let quarter_end = new Date(date.getFullYear(), this_quarter_month_starts + 3, 0);
     2809      date_from_to = {
     2810        'from': `${quarter_start.getFullYear()}-${(quarter_start.getMonth() + 1).toString().padStart(2, '0')}-${quarter_start.getDate().toString().padStart(2, '0')}`,
     2811        'to': `${quarter_end.getFullYear()}-${(quarter_end.getMonth() + 1).toString().padStart(2, '0')}-${quarter_end.getDate().toString().padStart(2, '0')}`
     2812      };
     2813      break;
     2814   
     2815    case 'last-quarter':
     2816      let last_quarter_month_ends = Math.floor(date.getMonth() / 3) * 3 - 1; // End month of last quarter
     2817      let last_quarter_month_starts = last_quarter_month_ends - 2; // Start month of last quarter
     2818      if (last_quarter_month_ends < 0) {
     2819        last_quarter_month_ends += 12;
     2820        last_quarter_month_starts += 12;
     2821      }
     2822      let last_quarter_start = new Date(date.getFullYear(), last_quarter_month_starts, 1);
     2823      let last_quarter_end = new Date(date.getFullYear(), last_quarter_month_ends + 1, 0);
     2824      date_from_to = {
     2825        'from': `${last_quarter_start.getFullYear()}-${(last_quarter_start.getMonth() + 1).toString().padStart(2, '0')}-${last_quarter_start.getDate().toString().padStart(2, '0')}`,
     2826        'to': `${last_quarter_end.getFullYear()}-${(last_quarter_end.getMonth() + 1).toString().padStart(2, '0')}-${last_quarter_end.getDate().toString().padStart(2, '0')}`
     2827      };
     2828      break;
     2829   
     2830    case 'this-year':
     2831      date_from_to = {
     2832        'from': `${date.getFullYear()}-01-01`,
     2833        'to': `${date.getFullYear()}-12-31`
     2834      };
     2835      break;
     2836   
     2837    case 'last-year':
     2838      date_from_to = {
     2839        'from': `${date.getFullYear() - 1}-01-01`,
     2840        'to': `${date.getFullYear() - 1}-12-31`
     2841      };
     2842      break;
     2843  }
    27962844    return date_from_to;
    27972845}
  • supportcandy/trunk/includes/admin/agent-settings/class-wpsc-agent-working-hrs.php

    r3039627 r3188306  
    361361                            </td>
    362362                            <td>
    363                                 <a class="wpsc-link"><span class="edit <?php echo esc_attr( $unique_id ); ?>"><?php esc_attr_e( 'Edit', 'wpsc-cr' ); ?></span></a> |
     363                                <a class="wpsc-link"><span class="edit <?php echo esc_attr( $unique_id ); ?>"><?php esc_attr_e( 'Edit', 'supportcandy' ); ?></span></a> |
    364364                                <a class="wpsc-link"><span class="delete <?php echo esc_attr( $unique_id ); ?>"><?php esc_attr_e( 'Delete', 'supportcandy' ); ?></span></a>
    365365                            </td>
  • supportcandy/trunk/includes/admin/customers/class-wpsc-customers.php

    r3111454 r3188306  
    746746
    747747            // Delete threads if records is exists.
    748             $td_sql = "DELETE thrd FROM wp_psmsc_threads AS thrd LEFT JOIN wp_psmsc_tickets AS t ON thrd.ticket = t.id WHERE t.customer = $customer_id";
     748            $td_sql = "DELETE thrd FROM {$wpdb->prefix}psmsc_threads AS thrd LEFT JOIN {$wpdb->prefix}psmsc_tickets AS t ON thrd.ticket = t.id WHERE t.customer = $customer_id";
    749749            $wpdb->query( $td_sql );
    750750
    751751            // is active 0 attachment if records is exists.
    752             $td_sql = "UPDATE wp_psmsc_attachments AS att LEFT JOIN wp_psmsc_tickets AS t ON att.ticket_id = t.id SET att.is_active = 0 WHERE t.customer = $customer_id";
     752            $td_sql = "UPDATE {$wpdb->prefix}psmsc_attachments AS att LEFT JOIN {$wpdb->prefix}psmsc_tickets AS t ON att.ticket_id = t.id SET att.is_active = 0 WHERE t.customer = $customer_id";
    753753            $wpdb->query( $td_sql );
    754754
    755755            // Delete sla log records if log records is exists.
    756             if ( $wpdb->get_var( "SHOW TABLES LIKE 'wp_psmsc_sla_logs'" ) ) {
    757                 $sl_sql = "DELETE sl FROM wp_psmsc_sla_logs AS sl LEFT JOIN wp_psmsc_tickets AS t ON sl.ticket = t.id WHERE t.customer = $customer_id";
     756            if ( $wpdb->get_var( "SHOW TABLES LIKE '{$wpdb->prefix}psmsc_sla_logs'" ) ) {
     757                $sl_sql = "DELETE sl FROM {$wpdb->prefix}psmsc_sla_logs AS sl LEFT JOIN {$wpdb->prefix}psmsc_tickets AS t ON sl.ticket = t.id WHERE t.customer = $customer_id";
    758758                $wpdb->query( $sl_sql );
    759759            }
    760760
    761761            // Delete timer log records if log records is exists.
    762             if ( $wpdb->get_var( "SHOW TABLES LIKE 'wp_psmsc_timer_logs'" ) ) {
    763                 $tl_sql = "DELETE tl FROM wp_psmsc_timer_logs AS tl LEFT JOIN wp_psmsc_tickets AS t ON tl.ticket = t.id WHERE t.customer = $customer_id";
     762            if ( $wpdb->get_var( "SHOW TABLES LIKE '{$wpdb->prefix}psmsc_timer_logs'" ) ) {
     763                $tl_sql = "DELETE tl FROM {$wpdb->prefix}psmsc_timer_logs AS tl LEFT JOIN {$wpdb->prefix}psmsc_tickets AS t ON tl.ticket = t.id WHERE t.customer = $customer_id";
    764764                $wpdb->query( $tl_sql );
    765765            }
    766766
    767767            // Delete tickets if ticket records is exists.
    768             $td_sql = "DELETE FROM wp_psmsc_tickets WHERE customer = $customer_id";
     768            $td_sql = "DELETE FROM {$wpdb->prefix}psmsc_tickets WHERE customer = $customer_id";
    769769            $wpdb->query( $td_sql );
    770770        }
     
    819819                    <div class="wpsc-up-tab">
    820820                        <?php do_action( 'wpsc_add_before_up_tab' ); ?>
    821                         <label class="wpsc-profile-tab active" data-toggle-target="wpsc-up-tickets"><?php esc_attr_e( 'Tickets', 'suuportcandy' ); ?></label>
    822                         <label class="wpsc-profile-tab" data-toggle-target="wpsc-up-cf"><?php esc_attr_e( 'Custom fields', 'suuportcandy' ); ?></label>
    823                         <label class="wpsc-profile-tab" data-toggle-target="wpsc-up-other"><?php esc_attr_e( 'Other', 'suuportcandy' ); ?></label>
     821                        <label class="wpsc-profile-tab active" data-toggle-target="wpsc-up-tickets"><?php esc_attr_e( 'Tickets', 'supportcandy' ); ?></label>
     822                        <label class="wpsc-profile-tab" data-toggle-target="wpsc-up-cf"><?php esc_attr_e( 'Custom fields', 'supportcandy' ); ?></label>
     823                        <label class="wpsc-profile-tab" data-toggle-target="wpsc-up-other"><?php esc_attr_e( 'Other', 'supportcandy' ); ?></label>
    824824                        <?php do_action( 'wpsc_add_after_up_tab' ); ?>
    825825                    </div>
  • supportcandy/trunk/includes/admin/misc/class-wpsc-addons.php

    r3111454 r3188306  
    216216                        <div class="wpsc-licenses-container">
    217217                            <div class="license-container" onclick="window.open('https://supportcandy.net/downloads/email-piping')">
    218                                 <img src="http://localhost/wp-content/plugins/supportcandy/asset/images/email-piping.png" alt="">
     218                                <img src="<?php echo esc_url( WPSC_PLUGIN_URL . '/asset/images/email-piping.png' ); ?>" alt="">
    219219                                <p>Allows customers and agents to create and reply to tickets directly from their email inboxes.</p>
    220220                            </div>
    221221                            <div class="license-container" onclick="window.open('https://supportcandy.net/downloads/workflows')">
    222                                 <img src="http://localhost/wp-content/plugins/supportcandy/asset/images/workflows.png" alt="">
     222                                <img src="<?php echo esc_url( WPSC_PLUGIN_URL . '/asset/images/workflows.png' ); ?>" alt="">
    223223                                <p>Unlock the power of automation with SupportCandy workflows, revolutionizing the way you manage your processes.</p>
    224224                            </div>
    225225                            <div class="license-container" onclick="window.open('https://supportcandy.net/downloads/sla')">
    226                                 <img src="http://localhost/wp-content/plugins/supportcandy/asset/images/sla.png" alt="">
     226                                <img src="<?php echo esc_url( WPSC_PLUGIN_URL . '/asset/images/sla.png' ); ?>" alt="">
    227227                                <p>You can offer and track the time you take to respond to and resolve different types of incoming tickets from customers.</p>
    228228                            </div>
    229229                            <div class="license-container" onclick="window.open('https://supportcandy.net/downloads/usergroups')">
    230                                 <img src="http://localhost/wp-content/plugins/supportcandy/asset/images/usergroups.png" alt="">
     230                                <img src="<?php echo esc_url( WPSC_PLUGIN_URL . '/asset/images/usergroups.png' ); ?>" alt="">
    231231                                <p>You can create a group of users or companies so that the company’s supervisor can manage all tickets created by the group members.</p>
    232232                            </div>
    233233                            <div class="license-container" onclick="window.open('https://supportcandy.net/downloads/agentgroups')">
    234                                 <img src="http://localhost/wp-content/plugins/supportcandy/asset/images/agentgroups.png" alt="">
     234                                <img src="<?php echo esc_url( WPSC_PLUGIN_URL . '/asset/images/agentgroups.png' ); ?>" alt="">
    235235                                <p>You can create groups of agents to assign tickets just like individual agents. The supervisor of the group can assign tickets to his team members.</p>
    236236                            </div>
    237237                            <div class="license-container" onclick="window.open('https://supportcandy.net/downloads/satisfaction-survey')">
    238                                 <img src="http://localhost/wp-content/plugins/supportcandy/asset/images/satisfaction-survey.png" alt="">
     238                                <img src="<?php echo esc_url( WPSC_PLUGIN_URL . '/asset/images/satisfaction-survey.png' ); ?>" alt="">
    239239                                <p>Collect customer feedback and rating for each ticket. This helps you understand how your team performs.</p>
    240240                            </div>
    241241                            <div class="license-container" onclick="window.open('https://supportcandy.net/downloads/timer')">
    242                                 <img src="http://localhost/wp-content/plugins/supportcandy/asset/images/timer.png" alt="">
     242                                <img src="<?php echo esc_url( WPSC_PLUGIN_URL . '/asset/images/timer.png' ); ?>" alt="">
    243243                                <p>Allows your agents to separately record the time spent on each ticket in the form of a stopwatch.</p>
    244244                            </div>
    245245                            <div class="license-container" onclick="window.open('https://supportcandy.net/downloads/private-credentials')">
    246                                 <img src="http://localhost/wp-content/plugins/supportcandy/asset/images/private-credentials.png" alt="">
     246                                <img src="<?php echo esc_url( WPSC_PLUGIN_URL . '/asset/images/private-credentials.png' ); ?>" alt="">
    247247                                <p>Allows your customers to share sensitive information within the ticket so that it is visible to only agents with permission.</p>
    248248                            </div>
    249249                            <div class="license-container" onclick="window.open('https://supportcandy.net/downloads/schedule-tickets')">
    250                                 <img src="http://localhost/wp-content/plugins/supportcandy/asset/images/schedule-tickets.png" alt="">
     250                                <img src="<?php echo esc_url( WPSC_PLUGIN_URL . '/asset/images/schedule-tickets.png' ); ?>" alt="">
    251251                                <p>Automatically create periodic tickets by setting recurring time and information.</p>
    252252                            </div>
    253253                            <div class="license-container" onclick="window.open('https://supportcandy.net/downloads/canned-reply')">
    254                                 <img src="http://localhost/wp-content/plugins/supportcandy/asset/images/canned-reply.png" alt="">
     254                                <img src="<?php echo esc_url( WPSC_PLUGIN_URL . '/asset/images/canned-reply.png' ); ?>" alt="">
    255255                                <p>Agents can save their replies which can be accessed in just a few clicks while replying to the tickets.</p>
    256256                            </div>
    257257                            <div class="license-container" onclick="window.open('https://supportcandy.net/downloads/automatic-close-tickets')">
    258                                 <img src="http://localhost/wp-content/plugins/supportcandy/asset/images/automatic-close-tickets.png" alt="">
     258                                <img src="<?php echo esc_url( WPSC_PLUGIN_URL . '/asset/images/automatic-close-tickets.png' ); ?>" alt="">
    259259                                <p>Automatically close the ticket after x days of inactivity. You can also send an inactivity warning email to the customer before x days of closing the ticket.</p>
    260260                            </div>
    261261                            <div class="license-container" onclick="window.open('https://supportcandy.net/downloads/reports')">
    262                                 <img src="http://localhost/wp-content/plugins/supportcandy/asset/images/reports.png" alt="">
     262                                <img src="<?php echo esc_url( WPSC_PLUGIN_URL . '/asset/images/reports.png' ); ?>" alt="">
    263263                                <p>Measure and improve the efficiency of your support using our advanced reporting.</p>
    264264                            </div>
    265265                            <div class="license-container" onclick="window.open('https://supportcandy.net/downloads/export-tickets')">
    266                                 <img src="http://localhost/wp-content/plugins/supportcandy/asset/images/export-tickets.png" alt="">
     266                                <img src="<?php echo esc_url( WPSC_PLUGIN_URL . '/asset/images/export-tickets.png' ); ?>" alt="">
    267267                                <p>Export tickets in CSV format as per the current filter from the ticket list page.</p>
    268268                            </div>
    269269                            <div class="license-container" onclick="window.open('https://supportcandy.net/downloads/print-ticket')">
    270                                 <img src="http://localhost/wp-content/plugins/supportcandy/asset/images/print-ticket.png" alt="">
     270                                <img src="<?php echo esc_url( WPSC_PLUGIN_URL . '/asset/images/print-ticket.png' ); ?>" alt="">
    271271                                <p>Add print ticket feature to SupportCandy using custom templates.</p>
    272272                            </div>
    273273                            <div class="license-container" onclick="window.open('https://supportcandy.net/downloads/assign-agent-rules')">
    274                                 <img src="http://localhost/wp-content/plugins/supportcandy/asset/images/assign-agent-rules.png" alt="">
     274                                <img src="<?php echo esc_url( WPSC_PLUGIN_URL . '/asset/images/assign-agent-rules.png' ); ?>" alt="">
    275275                                <p>Conditionally assign agents to new tickets automatically using set rules and workload.</p>
    276276                            </div>
    277277                            <div class="license-container" onclick="window.open('https://supportcandy.net/downloads/productivity-suite/')">
    278                                 <img src="http://localhost/wp-content/plugins/supportcandy/asset/images/productivity-suite.png" alt="">
     278                                <img src="<?php echo esc_url( WPSC_PLUGIN_URL . '/asset/images/productivity-suite.png' ); ?>" alt="">
    279279                                <p>The productivity suite is a collection of features designed to help agents/users perform a variety of tasks more efficiently and effectively.</p>
     280                            </div>
     281                            <div class="license-container" onclick="window.open('https://supportcandy.net/downloads/webhooks/')">
     282                                <img src="<?php echo esc_url( WPSC_PLUGIN_URL . '/asset/images/webhooks.png' ); ?>" alt="">
     283                                <p>Webhooks deliver real-time notifications, ensuring you stay informed during critical support events, from new ticket creation to closures and agent assignments. Tailor your support experience with dynamic, customizable alerts.</p>
    280284                            </div>
    281285                        </div>
     
    292296                        <div class="wpsc-licenses-container">
    293297                            <div class="license-container" onclick="window.open('https://supportcandy.net/downloads/woocommerce-integration')">
    294                                 <img src="http://localhost/wp-content/plugins/supportcandy/asset/images/woocommerce.png" alt="">
     298                                <img src="<?php echo esc_url( WPSC_PLUGIN_URL . '/asset/images/woocommerce.png' ); ?>" alt="">
    295299                                <p>Allows your customers to choose orders and products within the ticket form. Also, allows your agents to view customer orders within the ticket.</p>
    296300                            </div>
    297301                            <div class="license-container" onclick="window.open('https://supportcandy.net/downloads/slack-integration/')">
    298                                 <img src="http://localhost/wp-content/plugins/supportcandy/asset/images/slack.png" alt="">
     302                                <img src="<?php echo esc_url( WPSC_PLUGIN_URL . '/asset/images/slack.png' ); ?>" alt="">
    299303                                <p>Get instant notifications to your Slack Channel and respond directly from Slack thread reply.</p>
    300304                            </div>
    301305                            <div class="license-container" onclick="window.open('https://supportcandy.net/downloads/gravity-forms-integration')">
    302                                 <img src="http://localhost/wp-content/plugins/supportcandy/asset/images/gravity-forms.png" alt="">
     306                                <img src="<?php echo esc_url( WPSC_PLUGIN_URL . '/asset/images/gravity-forms.png' ); ?>" alt="">
    303307                                <p>Integrate Gravity Forms with SupportCandy and allows you to create multiple ticket forms.</p>
    304308                            </div>
    305309                            <div class="license-container" onclick="window.open('https://supportcandy.net/downloads/edd-integration')">
    306                                 <img src="http://localhost/wp-content/plugins/supportcandy/asset/images/edd.png" alt="">
     310                                <img src="<?php echo esc_url( WPSC_PLUGIN_URL . '/asset/images/edd.png' ); ?>" alt="">
    307311                                <p>Allows your customers to choose orders and products within the ticket form. Also, allows your agents to view customer orders within the ticket.</p>
    308312                            </div>
    309313                            <div class="license-container" onclick="window.open('https://supportcandy.net/downloads/faq-integrations')">
    310                                 <img src="http://localhost/wp-content/plugins/supportcandy/asset/images/faq-integrations.png" alt="">
     314                                <img src="<?php echo esc_url( WPSC_PLUGIN_URL . '/asset/images/faq-integrations.png' ); ?>" alt="">
    311315                                <p>Intergrates popular FAQ plugins with SupportCandy.</p>
    312316                            </div>
    313317                            <div class="license-container" onclick="window.open('https://supportcandy.net/downloads/knoledgebase-integrations')">
    314                                 <img src="http://localhost/wp-content/plugins/supportcandy/asset/images/knowledgebase-integrations.png" alt="">
     318                                <img src="<?php echo esc_url( WPSC_PLUGIN_URL . '/asset/images/knowledgebase-integrations.png' ); ?>" alt="">
    315319                                <p>Integrates popular knowledge-base plugins to SupportCandy.</p>
     320                            </div>
     321                            <div class="license-container" onclick="window.open('https://supportcandy.net/downloads/lms-integration')">
     322                                <img src="<?php echo esc_url( WPSC_PLUGIN_URL . '/asset/images/lms-integration.png' ); ?>" alt="">
     323                                <p>Integrates popular LMS plugins to SupportCandy.</p>
     324                            </div>
     325                            <div class="license-container" onclick="window.open('https://supportcandy.net/downloads/email-marketing-tools-integration/')">
     326                                <img src="<?php echo esc_url( WPSC_PLUGIN_URL . '/asset/images/marketing-tool.png' ); ?>" alt="">
     327                                <p>Elevate customer engagement by connecting SupportCandy with leading email marketing tools like MailChimp, GetResponse, and Brevo.</p>
    316328                            </div>
    317329                        </div>
  • supportcandy/trunk/includes/admin/settings/class-wpsc-ticket-categories.php

    r3039627 r3188306  
    542542            // replace in logs.
    543543            $results = $wpdb->get_results(
    544                 "SELECT * FROM wp_psmsc_threads WHERE
     544                "SELECT * FROM {$wpdb->prefix}psmsc_threads WHERE
    545545                    (type = 'log') AND
    546546                    JSON_VALID(body) AND
  • supportcandy/trunk/includes/admin/settings/class-wpsc-ticket-priorities.php

    r3039627 r3188306  
    584584            // replace in logs.
    585585            $results = $wpdb->get_results(
    586                 "SELECT * FROM wp_psmsc_threads WHERE
     586                "SELECT * FROM {$wpdb->prefix}psmsc_threads WHERE
    587587                    (type = 'log') AND
    588588                    JSON_VALID(body) AND
  • supportcandy/trunk/includes/admin/settings/class-wpsc-ticket-statuses.php

    r3039627 r3188306  
    594594            // replace in logs.
    595595            $results = $wpdb->get_results(
    596                 "SELECT * FROM wp_psmsc_threads WHERE
     596                "SELECT * FROM {$wpdb->prefix}psmsc_threads WHERE
    597597                    (type = 'log') AND
    598598                    JSON_VALID(body) AND
  • supportcandy/trunk/includes/admin/settings/dashboard-settings/class-wpsc-dashboard-general-setting.php

    r3111454 r3188306  
    128128                        <option <?php selected( $db_gs['default-date-range'], 'today' ); ?> value="today"><?php esc_attr_e( 'Today', 'supportcandy' ); ?></option>
    129129                        <option <?php selected( $db_gs['default-date-range'], 'yesterday' ); ?> value="yesterday"><?php esc_attr_e( 'Yesterday', 'supportcandy' ); ?></option>
     130                        <option <?php selected( $db_gs['default-date-range'], 'last-7' ); ?> value="last-7"><?php esc_attr_e( 'Last 7 days', 'supportcandy' ); ?></option>
    130131                        <option <?php selected( $db_gs['default-date-range'], 'this-week' ); ?> value="this-week"><?php esc_attr_e( 'This week', 'supportcandy' ); ?></option>
    131132                        <option <?php selected( $db_gs['default-date-range'], 'last-week' ); ?> value="last-week"><?php esc_attr_e( 'Last week', 'supportcandy' ); ?></option>
     
    133134                        <option <?php selected( $db_gs['default-date-range'], 'this-month' ); ?> value="this-month"><?php esc_attr_e( 'This month', 'supportcandy' ); ?></option>
    134135                        <option <?php selected( $db_gs['default-date-range'], 'last-month' ); ?> value="last-month"><?php esc_attr_e( 'Last month', 'supportcandy' ); ?></option>
     136                        <option <?php selected( $db_gs['default-date-range'], 'this-quarter' ); ?> value="this-quarter"><?php esc_attr_e( 'This quarter', 'supportcandy' ); ?></option>
     137                        <option <?php selected( $db_gs['default-date-range'], 'last-quarter' ); ?> value="last-quarter"><?php esc_attr_e( 'Last quarter', 'supportcandy' ); ?></option>
     138                        <option <?php selected( $db_gs['default-date-range'], 'this-year' ); ?> value="this-year"><?php esc_attr_e( 'This year', 'supportcandy' ); ?></option>
     139                        <option <?php selected( $db_gs['default-date-range'], 'last-year' ); ?> value="last-year"><?php esc_attr_e( 'Last year', 'supportcandy' ); ?></option>
    135140                    </select>
    136141                    <script>
  • supportcandy/trunk/includes/admin/settings/dashboard-settings/widgets/class-wpsc-dbw-category-reports.php

    r3031986 r3188306  
    3939                return;
    4040            }
     41            $db_gs = get_option( 'wpsc-db-gs-settings' );
    4142            ?>
    4243            <div class="wpsc-dash-widget wpsc-dash-widget-mid wpsc-<?php echo esc_attr( $slug ); ?>">
     
    5354                    <div class="wpsc-dash-widget-actions">
    5455                        <select name="" id="date_wise_category_report" onchange="wpsc_category_pie_chart();" style="min-height: 18px !important;max-height: 18px !important;line-height: 15px !important;font-size: 12px !important;">
    55                             <option value="last_7"><?php esc_attr_e( 'Last 7 days', 'supportcandy' ); ?></option>
    56                             <option value="last_week"><?php esc_attr_e( 'Last Week', 'supportcandy' ); ?></option>
    57                             <option value="last_30"><?php esc_attr_e( 'Last 30 Days', 'supportcandy' ); ?></option>
    58                             <option value="last_month"><?php esc_attr_e( 'Last Month', 'supportcandy' ); ?></option>
     56                            <option <?php selected( $db_gs['default-date-range'], 'today' ); ?> value="today"><?php esc_attr_e( 'Today', 'supportcandy' ); ?></option>
     57                            <option <?php selected( $db_gs['default-date-range'], 'yesterday' ); ?> value="yesterday"><?php esc_attr_e( 'Yesterday', 'supportcandy' ); ?></option>
     58                            <option <?php selected( $db_gs['default-date-range'], 'last-7' ); ?> value="last-7"><?php esc_attr_e( 'Last 7 days', 'supportcandy' ); ?></option>
     59                            <option <?php selected( $db_gs['default-date-range'], 'this-week' ); ?> value="this-week"><?php esc_attr_e( 'This week', 'supportcandy' ); ?></option>
     60                            <option <?php selected( $db_gs['default-date-range'], 'last-week' ); ?> value="last-week"><?php esc_attr_e( 'Last week', 'supportcandy' ); ?></option>
     61                            <option <?php selected( $db_gs['default-date-range'], 'last-30-days' ); ?> value="last-30-days"><?php esc_attr_e( 'Last 30 days', 'supportcandy' ); ?></option>
     62                            <option <?php selected( $db_gs['default-date-range'], 'this-month' ); ?> value="this-month"><?php esc_attr_e( 'This month', 'supportcandy' ); ?></option>
     63                            <option <?php selected( $db_gs['default-date-range'], 'last-month' ); ?> value="last-month"><?php esc_attr_e( 'Last month', 'supportcandy' ); ?></option>
     64                            <option <?php selected( $db_gs['default-date-range'], 'this-quarter' ); ?> value="this-quarter"><?php esc_attr_e( 'This quarter', 'supportcandy' ); ?></option>
     65                            <option <?php selected( $db_gs['default-date-range'], 'last-quarter' ); ?> value="last-quarter"><?php esc_attr_e( 'Last quarter', 'supportcandy' ); ?></option>
     66                            <option <?php selected( $db_gs['default-date-range'], 'this-year' ); ?> value="this-year"><?php esc_attr_e( 'This year', 'supportcandy' ); ?></option>
     67                            <option <?php selected( $db_gs['default-date-range'], 'last-year' ); ?> value="last-year"><?php esc_attr_e( 'Last year', 'supportcandy' ); ?></option>
    5968                        </select>
    6069                    </div>
  • supportcandy/trunk/includes/admin/settings/dashboard-settings/widgets/class-wpsc-dbw-ticket-statistics.php

    r3039627 r3188306  
    5858                                <option <?php selected( $db_gs['default-date-range'], 'today' ); ?> value="today"><?php esc_attr_e( 'Today', 'supportcandy' ); ?></option>
    5959                                <option <?php selected( $db_gs['default-date-range'], 'yesterday' ); ?> value="yesterday"><?php esc_attr_e( 'Yesterday', 'supportcandy' ); ?></option>
     60                                <option <?php selected( $db_gs['default-date-range'], 'last-7' ); ?> value="last-7"><?php esc_attr_e( 'Last 7 days', 'supportcandy' ); ?></option>
    6061                                <option <?php selected( $db_gs['default-date-range'], 'this-week' ); ?> value="this-week"><?php esc_attr_e( 'This week', 'supportcandy' ); ?></option>
    6162                                <option <?php selected( $db_gs['default-date-range'], 'last-week' ); ?> value="last-week"><?php esc_attr_e( 'Last week', 'supportcandy' ); ?></option>
     
    6364                                <option <?php selected( $db_gs['default-date-range'], 'this-month' ); ?> value="this-month"><?php esc_attr_e( 'This month', 'supportcandy' ); ?></option>
    6465                                <option <?php selected( $db_gs['default-date-range'], 'last-month' ); ?> value="last-month"><?php esc_attr_e( 'Last month', 'supportcandy' ); ?></option>
     66                                <option <?php selected( $db_gs['default-date-range'], 'this-quarter' ); ?> value="this-quarter"><?php esc_attr_e( 'This quarter', 'supportcandy' ); ?></option>
     67                                <option <?php selected( $db_gs['default-date-range'], 'last-quarter' ); ?> value="last-quarter"><?php esc_attr_e( 'Last quarter', 'supportcandy' ); ?></option>
     68                                <option <?php selected( $db_gs['default-date-range'], 'this-year' ); ?> value="this-year"><?php esc_attr_e( 'This year', 'supportcandy' ); ?></option>
     69                                <option <?php selected( $db_gs['default-date-range'], 'last-year' ); ?> value="last-year"><?php esc_attr_e( 'Last year', 'supportcandy' ); ?></option>
    6570                            </select>
    6671                        </div>
  • supportcandy/trunk/includes/admin/settings/dashboard-settings/widgets/class-wpsc-dbw-unresolved-priorities.php

    r3031986 r3188306  
    3939                return;
    4040            }
     41            $db_gs = get_option( 'wpsc-db-gs-settings' );
    4142            ?>
    4243            <div class="wpsc-dash-widget wpsc-dash-widget-mid wpsc-<?php echo esc_attr( $slug ); ?>">
     
    5354                    <div class="wpsc-dash-widget-actions">
    5455                        <select name="" id="date_wise_priority_report" onchange="wpsc_priority_pie_chart();" style="min-height: 18px !important;max-height: 18px !important;line-height: 15px !important;font-size: 12px !important;">
    55                             <option value="last_7"><?php esc_attr_e( 'Last 7 days', 'supportcandy' ); ?></option>
    56                             <option value="last_week"><?php esc_attr_e( 'Last Week', 'supportcandy' ); ?></option>
    57                             <option value="last_30"><?php esc_attr_e( 'Last 30 Days', 'supportcandy' ); ?></option>
    58                             <option value="last_month"><?php esc_attr_e( 'Last Month', 'supportcandy' ); ?></option>
     56                            <option <?php selected( $db_gs['default-date-range'], 'today' ); ?> value="today"><?php esc_attr_e( 'Today', 'supportcandy' ); ?></option>
     57                            <option <?php selected( $db_gs['default-date-range'], 'yesterday' ); ?> value="yesterday"><?php esc_attr_e( 'Yesterday', 'supportcandy' ); ?></option>
     58                            <option <?php selected( $db_gs['default-date-range'], 'last-7' ); ?> value="last-7"><?php esc_attr_e( 'Last 7 days', 'supportcandy' ); ?></option>
     59                            <option <?php selected( $db_gs['default-date-range'], 'this-week' ); ?> value="this-week"><?php esc_attr_e( 'This week', 'supportcandy' ); ?></option>
     60                            <option <?php selected( $db_gs['default-date-range'], 'last-week' ); ?> value="last-week"><?php esc_attr_e( 'Last week', 'supportcandy' ); ?></option>
     61                            <option <?php selected( $db_gs['default-date-range'], 'last-30-days' ); ?> value="last-30-days"><?php esc_attr_e( 'Last 30 days', 'supportcandy' ); ?></option>
     62                            <option <?php selected( $db_gs['default-date-range'], 'this-month' ); ?> value="this-month"><?php esc_attr_e( 'This month', 'supportcandy' ); ?></option>
     63                            <option <?php selected( $db_gs['default-date-range'], 'last-month' ); ?> value="last-month"><?php esc_attr_e( 'Last month', 'supportcandy' ); ?></option>
     64                            <option <?php selected( $db_gs['default-date-range'], 'this-quarter' ); ?> value="this-quarter"><?php esc_attr_e( 'This quarter', 'supportcandy' ); ?></option>
     65                            <option <?php selected( $db_gs['default-date-range'], 'last-quarter' ); ?> value="last-quarter"><?php esc_attr_e( 'Last quarter', 'supportcandy' ); ?></option>
     66                            <option <?php selected( $db_gs['default-date-range'], 'this-year' ); ?> value="this-year"><?php esc_attr_e( 'This year', 'supportcandy' ); ?></option>
     67                            <option <?php selected( $db_gs['default-date-range'], 'last-year' ); ?> value="last-year"><?php esc_attr_e( 'Last year', 'supportcandy' ); ?></option>
    5968                        </select>
    6069                    </div>
  • supportcandy/trunk/includes/admin/settings/dashboard-settings/widgets/class-wpsc-dbw-unresolved-statuses.php

    r3039627 r3188306  
    3939                return;
    4040            }
     41            $db_gs = get_option( 'wpsc-db-gs-settings' );
    4142            ?>
    4243            <div class="wpsc-dash-widget wpsc-dash-widget-mid wpsc-<?php echo esc_attr( $slug ); ?>">
     
    5354                    <div class="wpsc-dash-widget-actions">
    5455                        <select name="" id="date_wise_status_report" onchange="wpsc_status_pie_chart();" style="min-height: 18px !important;max-height: 18px !important;line-height: 15px !important;font-size: 12px !important;">
    55                             <option value="last_7"><?php esc_attr_e( 'Last 7 days', 'supportcandy' ); ?></option>
    56                             <option value="last_week"><?php esc_attr_e( 'Last Week', 'supportcandy' ); ?></option>
    57                             <option value="last_30"><?php esc_attr_e( 'Last 30 Days', 'supportcandy' ); ?></option>
    58                             <option value="last_month"><?php esc_attr_e( 'Last Month', 'supportcandy' ); ?></option>
     56                            <option <?php selected( $db_gs['default-date-range'], 'today' ); ?> value="today"><?php esc_attr_e( 'Today', 'supportcandy' ); ?></option>
     57                            <option <?php selected( $db_gs['default-date-range'], 'yesterday' ); ?> value="yesterday"><?php esc_attr_e( 'Yesterday', 'supportcandy' ); ?></option>
     58                            <option <?php selected( $db_gs['default-date-range'], 'last-7' ); ?> value="last-7"><?php esc_attr_e( 'Last 7 days', 'supportcandy' ); ?></option>
     59                            <option <?php selected( $db_gs['default-date-range'], 'this-week' ); ?> value="this-week"><?php esc_attr_e( 'This week', 'supportcandy' ); ?></option>
     60                            <option <?php selected( $db_gs['default-date-range'], 'last-week' ); ?> value="last-week"><?php esc_attr_e( 'Last week', 'supportcandy' ); ?></option>
     61                            <option <?php selected( $db_gs['default-date-range'], 'last-30-days' ); ?> value="last-30-days"><?php esc_attr_e( 'Last 30 days', 'supportcandy' ); ?></option>
     62                            <option <?php selected( $db_gs['default-date-range'], 'this-month' ); ?> value="this-month"><?php esc_attr_e( 'This month', 'supportcandy' ); ?></option>
     63                            <option <?php selected( $db_gs['default-date-range'], 'last-month' ); ?> value="last-month"><?php esc_attr_e( 'Last month', 'supportcandy' ); ?></option>
     64                            <option <?php selected( $db_gs['default-date-range'], 'this-quarter' ); ?> value="this-quarter"><?php esc_attr_e( 'This quarter', 'supportcandy' ); ?></option>
     65                            <option <?php selected( $db_gs['default-date-range'], 'last-quarter' ); ?> value="last-quarter"><?php esc_attr_e( 'Last quarter', 'supportcandy' ); ?></option>
     66                            <option <?php selected( $db_gs['default-date-range'], 'this-year' ); ?> value="this-year"><?php esc_attr_e( 'This year', 'supportcandy' ); ?></option>
     67                            <option <?php selected( $db_gs['default-date-range'], 'last-year' ); ?> value="last-year"><?php esc_attr_e( 'Last year', 'supportcandy' ); ?></option>
    5968                        </select>
    6069                    </div>
  • supportcandy/trunk/includes/admin/settings/dashboard-settings/widgets/class-wpsc-dbw-week-trend-tickets.php

    r3111454 r3188306  
    3939                return;
    4040            }
     41            $db_gs = get_option( 'wpsc-db-gs-settings' );
    4142            ?>
    4243            <div class="wpsc-dash-widget wpsc-dash-widget-mid wpsc-<?php echo esc_attr( $slug ); ?>">
     
    5354                    <div class="wpsc-dash-widget-actions">
    5455                        <select name="" id="date_wise_avg_tickets_report" onchange="wpsc_avg_tickets_bar_chart();" style="min-height: 18px !important;max-height: 18px !important;line-height: 15px !important;font-size: 12px !important;">
    55                             <option value="last_7"><?php esc_attr_e( 'Last 7 days', 'supportcandy' ); ?></option>
    56                             <option value="last_week"><?php esc_attr_e( 'Last Week', 'supportcandy' ); ?></option>
    57                             <option value="last_30"><?php esc_attr_e( 'Last 30 Days', 'supportcandy' ); ?></option>
    58                             <option value="this_month"><?php esc_attr_e( 'This Month', 'supportcandy' ); ?></option>
    59                             <option value="last_month"><?php esc_attr_e( 'Last Month', 'supportcandy' ); ?></option>
     56                            <option <?php selected( $db_gs['default-date-range'], 'today' ); ?> value="today"><?php esc_attr_e( 'Today', 'supportcandy' ); ?></option>
     57                            <option <?php selected( $db_gs['default-date-range'], 'yesterday' ); ?> value="yesterday"><?php esc_attr_e( 'Yesterday', 'supportcandy' ); ?></option>
     58                            <option <?php selected( $db_gs['default-date-range'], 'last-7' ); ?> value="last-7"><?php esc_attr_e( 'Last 7 days', 'supportcandy' ); ?></option>
     59                            <option <?php selected( $db_gs['default-date-range'], 'this-week' ); ?> value="this-week"><?php esc_attr_e( 'This week', 'supportcandy' ); ?></option>
     60                            <option <?php selected( $db_gs['default-date-range'], 'last-week' ); ?> value="last-week"><?php esc_attr_e( 'Last week', 'supportcandy' ); ?></option>
     61                            <option <?php selected( $db_gs['default-date-range'], 'last-30-days' ); ?> value="last-30-days"><?php esc_attr_e( 'Last 30 days', 'supportcandy' ); ?></option>
     62                            <option <?php selected( $db_gs['default-date-range'], 'this-month' ); ?> value="this-month"><?php esc_attr_e( 'This month', 'supportcandy' ); ?></option>
     63                            <option <?php selected( $db_gs['default-date-range'], 'last-month' ); ?> value="last-month"><?php esc_attr_e( 'Last month', 'supportcandy' ); ?></option>
     64                            <option <?php selected( $db_gs['default-date-range'], 'this-quarter' ); ?> value="this-quarter"><?php esc_attr_e( 'This quarter', 'supportcandy' ); ?></option>
     65                            <option <?php selected( $db_gs['default-date-range'], 'last-quarter' ); ?> value="last-quarter"><?php esc_attr_e( 'Last quarter', 'supportcandy' ); ?></option>
     66                            <option <?php selected( $db_gs['default-date-range'], 'this-year' ); ?> value="this-year"><?php esc_attr_e( 'This year', 'supportcandy' ); ?></option>
     67                            <option <?php selected( $db_gs['default-date-range'], 'last-year' ); ?> value="last-year"><?php esc_attr_e( 'Last year', 'supportcandy' ); ?></option>
    6068                        </select>
    6169                    </div>
  • supportcandy/trunk/includes/admin/tickets/class-wpsc-current-agent-profile.php

    r3039627 r3188306  
    216216                        <span class="name"><?php esc_attr_e( 'Default tab', 'supportcandy' ); ?></span>
    217217                    </div>
    218                     <span class="extra-info"><?php esc_attr_e( 'Select dafault section', 'supportcandy' ); ?></span>
     218                    <span class="extra-info"><?php esc_attr_e( 'Select default section', 'supportcandy' ); ?></span>
    219219                    <select id="wpsc-dt" name="default-tab">
    220220                        <option <?php selected( $tab, 'dashboard' ); ?> value="dashboard"><?php esc_attr_e( 'Dashboard', 'supportcandy' ); ?></option>
     
    492492                                </td>
    493493                                <td>
    494                                     <a class="wpsc-link"><span class="edit <?php echo esc_attr( $unique_id ); ?>"><?php esc_attr_e( 'Edit', 'wpsc-cr' ); ?></span></a> |
     494                                    <a class="wpsc-link"><span class="edit <?php echo esc_attr( $unique_id ); ?>"><?php esc_attr_e( 'Edit', 'supportcandy' ); ?></span></a> |
    495495                                    <a class="wpsc-link"><span class="delete <?php echo esc_attr( $unique_id ); ?>"><?php esc_attr_e( 'Delete', 'supportcandy' ); ?></span></a>
    496496                                </td>
  • supportcandy/trunk/includes/admin/tickets/class-wpsc-individual-ticket.php

    r3134113 r3188306  
    241241
    242242            // Set view profile as 'customer' if the user is either a valid logged-in customer or a guest with a valid auth code.
    243             if ( ( self::is_customer() && ! $current_user->is_guest ) || ( $current_user->is_guest && self::$url_auth ) ) {
     243            if ( self::is_customer() || ( $current_user->is_guest && ! $current_user->is_customer && self::$url_auth ) ) {
    244244                self::$view_profile = 'customer';
    245245            }
     
    252252            if ( ! self::$view_profile ) :
    253253                ?>
    254                 <div style="align-item:center;" ><h6><?php esc_attr_e( 'Unathorized access!' ); ?></h6></div>
     254                <div style="align-item:center;" ><h6><?php esc_attr_e( 'Unauthorized access!', 'supportcandy' ); ?></h6></div>
    255255                <?php
    256256                wp_die();
     
    33863386                wpsc_get_live_agents(<?php echo intval( $current_user->agent->id ); ?>, <?php echo intval( self::$ticket->id ); ?>);
    33873387                function wpsc_get_live_agents( agent_id, ticket_id ){
     3388                   
     3389                    jQuery('.wpsc-live-agents').html('');
     3390                    jQuery('.wpsc-agent-collision').hide();
    33883391                    var current_tid = jQuery('#wpsc-current-ticket').val();
    33893392                    if( current_tid != ticket_id ){
  • supportcandy/trunk/includes/admin/tickets/class-wpsc-new-ticket.php

    r3134113 r3188306  
    9292            ) ) {
    9393                ?>
    94                 <div style="align-item:center;" ><h6><?php esc_attr_e( 'Unathorized access!' ); ?></h6></div>
     94                <div style="align-item:center;" ><h6><?php esc_attr_e( 'Unauthorized access!', 'supportcandy' ); ?></h6></div>
    9595                <?php
    9696                wp_die();
     
    234234                    if (!wpsc_validate_ticket_form()) return;
    235235
     236                    wpsc_clear_hidden_fields();
     237
    236238                    var is_editor = (typeof isWPSCEditor !== 'undefined')  ? isWPSCEditor : 0;
    237239
     
    327329                }
    328330
     331                function wpsc_clear_hidden_fields() {
     332                    var customFields = jQuery('.wpsc-tff.wpsc-hidden');
     333                    jQuery.each(customFields, function(index, customField){
     334                        customField = jQuery(customField);
     335                        var customFieldType = customField.data('cft');
     336                        switch (customFieldType) {
     337                            <?php do_action( 'wpsc_js_clear_value_hidden_fields' ); ?>
     338                        }
     339                    });
     340                }
     341
    329342                function wpsc_get_create_as_customer_fields(nonce) {
    330343
     
    688701
    689702            $response = array();
    690             $tff      = get_option( 'wpsc-tff', array() );
     703            $tff = get_option( 'wpsc-tff', array() );
    691704            foreach ( $tff as $slug => $settings ) {
    692705
     
    738751                $response[ $slug ] = $flag ? 1 : 0;
    739752            }
     753
    740754            wp_send_json( $response );
    741755        }
  • supportcandy/trunk/includes/admin/tickets/class-wpsc-ticket-list.php

    r3111454 r3188306  
    105105         */
    106106        private static $bulk_actions = array();
     107
     108        /**
     109         * Flag for current view
     110         *
     111         * @var integer
     112         */
     113        private static $is_frontend = 0;
    107114
    108115        /**
     
    199206                wp_send_json_error( 'Unauthorised request!', 401 );
    200207            }
     208
     209            self::$is_frontend = isset( $_POST['is_frontend'] ) ? sanitize_text_field( wp_unslash( $_POST['is_frontend'] ) ) : '0';
    201210
    202211            self::load_tickets();
     
    236245                wp_send_json_error( new WP_Error( '001', 'Unauthorized!' ), 400 );
    237246            }
     247
     248            self::$is_frontend = isset( $_POST['is_frontend'] ) ? sanitize_text_field( wp_unslash( $_POST['is_frontend'] ) ) : '0';
    238249
    239250            $filters = null;
     
    786797                            foreach ( self::$tickets as $ticket ) :
    787798                                $class = apply_filters( 'wpsc_ticket_list_tr_classes', array( 'wpsc_tl_tr' ), $ticket );
     799                                $url = WPSC_Functions::get_ticket_url( $ticket->id, self::$is_frontend );
    788800                                ?>
    789                                 <tr class="<?php echo esc_attr( implode( ' ', $class ) ); ?>" onclick="if(link)wpsc_get_individual_ticket(<?php echo esc_attr( $ticket->id ); ?>)">
     801                                <tr class="<?php echo esc_attr( implode( ' ', $class ) ); ?>" onclick="if(link)wpsc_tl_handle_click(event, <?php echo esc_attr( $ticket->id ); ?>, '<?php echo esc_url( $url ); ?>')">
    790802                                    <?php
    791803                                    if ( $current_user->is_agent && self::$bulk_actions ) :
     
    842854                </table>
    843855            </div>
     856            <script>
     857                function wpsc_tl_handle_click(event, id, url) {
     858                    if ( ( event.ctrlKey || event.metaKey ) && url ) {
     859                        window.open(url, '_blank');
     860                    } else {
     861                        wpsc_get_individual_ticket(id);
     862                    }
     863                }
     864            </script>
    844865            <?php
    845866
  • supportcandy/trunk/includes/class-wpsc-functions.php

    r3111454 r3188306  
    995995            $today = new DateTime();
    996996            switch ( $date ) {
    997                 case 'last_7':
    998                     // calculate last 7 days since today's date.
     997                case 'today':
     998                    // Start of today at 00:00:00.
     999                    $today_start = clone $today;
     1000                    $today_start->setTime( 0, 0, 0 );
     1001                    // End of today with the current time.
     1002                    $today_end = clone $today;
     1003                    return array( $today_start->format( 'Y-m-d H:i:s' ), $today_end->format( 'Y-m-d H:i:s' ) );
     1004
     1005                case 'yesterday':
     1006                    // Start of yesterday at 00:00:00.
     1007                    $yesterday_start = clone $today;
     1008                    $yesterday_start->modify( '-1 day' )->setTime( 0, 0, 0 );
     1009                    // End of yesterday at 23:59:59.
     1010                    $yesterday_end = clone $yesterday_start;
     1011                    $yesterday_end->setTime( 23, 59, 59 );
     1012                    return array( $yesterday_start->format( 'Y-m-d H:i:s' ), $yesterday_end->format( 'Y-m-d H:i:s' ) );
     1013
     1014                case 'last-7':
     1015                    // Calculate last 7 days from today's date.
    9991016                    $last7_days_start = clone $today;
    10001017                    $last7_days_start->modify( '-6 days' )->setTime( 0, 0, 0 );
     
    10021019                    $last7_days_end->setTime( 23, 59, 59 );
    10031020                    return array( $last7_days_start->format( 'Y-m-d H:i:s' ), $last7_days_end->format( 'Y-m-d H:i:s' ) );
    1004                 case 'last_week':
    1005                     // calculate last week's start and end datetime from today's date.
     1021
     1022                case 'this-week':
     1023                    // Calculate this week's start and end (Sunday to Saturday).
    10061024                    $week_start = clone $today;
    1007                     $week_start->modify( 'last Sunday' )->sub( new DateInterval( 'P6D' ) )->setTime( 0, 0, 0 );
     1025                    $week_start->modify( 'last Sunday' )->setTime( 0, 0, 0 );
    10081026                    $week_end = clone $week_start;
    1009                     $week_end->modify( 'next Sunday' )->setTime( 23, 59, 59 );
     1027                    $week_end->modify( 'next Saturday' )->setTime( 23, 59, 59 );
    10101028                    return array( $week_start->format( 'Y-m-d H:i:s' ), $week_end->format( 'Y-m-d H:i:s' ) );
    1011                 case 'last_30':
    1012                     // calculate last 30 days since today's date.
     1029
     1030                case 'last-week':
     1031                    // Calculate last week's start and end (Sunday to Saturday).
     1032                    $last_week_start = clone $today;
     1033                    $last_week_start->modify( 'last Sunday' )->sub( new DateInterval( 'P7D' ) )->setTime( 0, 0, 0 );
     1034                    $last_week_end = clone $last_week_start;
     1035                    $last_week_end->modify( 'next Saturday' )->setTime( 23, 59, 59 );
     1036                    return array( $last_week_start->format( 'Y-m-d H:i:s' ), $last_week_end->format( 'Y-m-d H:i:s' ) );
     1037
     1038                case 'last-30-days':
     1039                    // Calculate last 30 days from today's date.
    10131040                    $last30_days_start = clone $today;
    10141041                    $last30_days_start->modify( '-29 days' )->setTime( 0, 0, 0 );
    10151042                    return array( $last30_days_start->format( 'Y-m-d H:i:s' ), $today->format( 'Y-m-d H:i:s' ) );
    1016                 case 'last_month':
    1017                     // calculate last months's start and end datetime from today's date.
     1043
     1044                case 'this-month':
     1045                    // Calculate this month's start and end date.
     1046                    $start_month = clone $today;
     1047                    $start_month->modify( 'first day of this month' )->setTime( 0, 0, 0 );
     1048                    $end_month = clone $today;
     1049                    $end_month->setTime( 23, 59, 59 );
     1050                    return array( $start_month->format( 'Y-m-d H:i:s' ), $end_month->format( 'Y-m-d H:i:s' ) );
     1051
     1052                case 'this-quarter':
     1053                    // Calculate this quarter's start and end date.
     1054                    $month = (int) $today->format( 'n' );
     1055                    $start_quarter = clone $today;
     1056                    $start_quarter->setDate( $today->format( 'Y' ), floor( ( $month - 1 ) / 3 ) * 3 + 1, 1 )->setTime( 0, 0, 0 );
     1057                    return array( $start_quarter->format( 'Y-m-d H:i:s' ), $today->format( 'Y-m-d H:i:s' ) );
     1058
     1059                case 'this-year':
     1060                    // Calculate this year's start date to today.
     1061                    $start_year = clone $today;
     1062                    $start_year->setDate( $today->format( 'Y' ), 1, 1 )->setTime( 0, 0, 0 );
     1063                    return array( $start_year->format( 'Y-m-d H:i:s' ), $today->format( 'Y-m-d H:i:s' ) );
     1064
     1065                case 'last-month':
     1066                    // Calculate last month's start and end date.
    10181067                    $last_month_start = clone $today;
    10191068                    $last_month_start->modify( 'first day of last month' )->setTime( 0, 0, 0 );
     
    10211070                    $last_month_end->modify( 'last day of last month' )->setTime( 23, 59, 59 );
    10221071                    return array( $last_month_start->format( 'Y-m-d H:i:s' ), $last_month_end->format( 'Y-m-d H:i:s' ) );
    1023                 case 'this_month':
    1024                     $start_month = clone $today;
    1025                     $start_month->modify( 'first day of this month' )->setTime( 0, 0, 0 );
    1026                     $end_month = clone $today;
    1027                     $end_month->modify( 'last day of this month' )->setTime( 23, 59, 59 );
    1028                     return array( $start_month->format( 'Y-m-d H:i:s' ), $end_month->format( 'Y-m-d H:i:s' ) );
     1072
     1073                case 'last-quarter':
     1074                    // Last quarter: from the first to the last day of the previous quarter.
     1075                    $current_month = (int) $today->format( 'n' );
     1076
     1077                    // Calculate the first month of the previous quarter.
     1078                    $last_quarter_start_month = 3 * ( floor( ( $current_month - 1 ) / 3 ) ) - 2;
     1079                    if ( $last_quarter_start_month <= 0 ) {
     1080                        // If the calculated month is 0 or negative, it means we are in Q1, so the last quarter is Q4 of the previous year.
     1081                        $last_quarter_start_month += 12;
     1082                        $start_last_quarter = ( clone $today )->setDate( $today->format( 'Y' ) - 1, $last_quarter_start_month, 1 )->setTime( 0, 0, 0 );
     1083                    } else {
     1084                        $start_last_quarter = ( clone $today )->setDate( $today->format( 'Y' ), $last_quarter_start_month, 1 )->setTime( 0, 0, 0 );
     1085                    }
     1086
     1087                    // Calculate the end of the last quarter.
     1088                    $end_last_quarter = clone $start_last_quarter;
     1089                    $end_last_quarter->modify( '+2 months' )->modify( 'last day of this month' )->setTime( 23, 59, 59 );
     1090
     1091                    return array( $start_last_quarter->format( 'Y-m-d H:i:s' ), $end_last_quarter->format( 'Y-m-d H:i:s' ) );
     1092
     1093                case 'last-year':
     1094                    // Calculate last year's start and end date.
     1095                    $start_last_year = clone $today;
     1096                    $start_last_year->setDate( $today->format( 'Y' ) - 1, 1, 1 )->setTime( 0, 0, 0 );
     1097                    $end_last_year = clone $start_last_year;
     1098                    $end_last_year->setDate( $today->format( 'Y' ) - 1, 12, 31 )->setTime( 23, 59, 59 );
     1099                    return array( $start_last_year->format( 'Y-m-d H:i:s' ), $end_last_year->format( 'Y-m-d H:i:s' ) );
    10291100            }
    10301101        }
     
    10861157            }
    10871158
    1088             return $url;
     1159            return apply_filters( 'wpsc_get_ticket_url_by_view', $url, $ticket_id, $view );
    10891160        }
    10901161    }
  • supportcandy/trunk/includes/class-wpsc-macros.php

    r3075593 r3188306  
    207207                                <td class="insert-tag lable" data-label="<?php echo esc_attr( $macro['title'] ); ?>" data-tag="<?php echo esc_attr( $macro['tag'] ); ?>"><?php echo esc_attr( $macro['title'] ); ?></td>
    208208                                <td>
    209                                     <a class="copy-tag wpsc-link" title="<?php echo esc_attr_e( 'Copy Tag' ); ?>"><?php esc_attr_e( 'Copy', 'supportcandy' ); ?></a> |
    210                                     <a class="insert-tag wpsc-link" title="<?php echo esc_attr_e( 'Insert Tag' ); ?>"><?php esc_attr_e( 'Insert', 'supportcandy' ); ?></a>
     209                                    <a class="copy-tag wpsc-link" title="<?php echo esc_attr_e( 'Copy Tag', 'supportcandy' ); ?>"><?php esc_attr_e( 'Copy', 'supportcandy' ); ?></a> |
     210                                    <a class="insert-tag wpsc-link" title="<?php echo esc_attr_e( 'Insert Tag', 'supportcandy' ); ?>"><?php esc_attr_e( 'Insert', 'supportcandy' ); ?></a>
    211211                                </td>
    212212                            </tr>
  • supportcandy/trunk/includes/custom-field-types/class-wpsc-cf-checkbox.php

    r3111454 r3188306  
    171171            add_action( 'wpsc_js_validate_ticket_form', array( __CLASS__, 'js_validate_ticket_form' ) );
    172172            add_filter( 'wpsc_create_ticket_data', array( __CLASS__, 'set_create_ticket_data' ), 10, 3 );
     173            add_action( 'wpsc_js_clear_value_hidden_fields', array( __CLASS__, 'js_clear_value_hidden_fields' ) );
    173174
    174175            // create ticket data for rest api.
     
    17121713            return $option_names ? esc_attr( implode( ', ', $option_names ) ) : esc_attr__( 'None', 'supportcandy' );
    17131714        }
     1715
     1716        /**
     1717         * Clear value of hidden fields
     1718         *
     1719         * @return void
     1720         */
     1721        public static function js_clear_value_hidden_fields() {
     1722            ?>
     1723            case '<?php echo esc_attr( self::$slug ); ?>':
     1724                var checkbox = customField.find('input:checked');
     1725                checkbox.prop("checked", false);
     1726                break;
     1727            <?php
     1728            echo PHP_EOL;
     1729        }
    17141730    }
    17151731endif;
  • supportcandy/trunk/includes/custom-field-types/class-wpsc-cf-date.php

    r3111454 r3188306  
    171171            add_action( 'wpsc_js_validate_ticket_form', array( __CLASS__, 'js_validate_ticket_form' ) );
    172172            add_filter( 'wpsc_create_ticket_data', array( __CLASS__, 'set_create_ticket_data' ), 10, 3 );
     173            add_action( 'wpsc_js_clear_value_hidden_fields', array( __CLASS__, 'js_clear_value_hidden_fields' ) );
    173174
    174175            // create ticket data for rest api.
     
    16651666            return esc_attr( date_i18n( $format, $val->getTimestamp(), false ) );
    16661667        }
     1668
     1669        /**
     1670         * Clear value of hidden fields
     1671         *
     1672         * @return void
     1673         */
     1674        public static function js_clear_value_hidden_fields() {
     1675            ?>
     1676            case '<?php echo esc_attr( self::$slug ); ?>':
     1677                customField.find('input').first().val('');
     1678                break;
     1679            <?php
     1680            echo PHP_EOL;
     1681        }
    16671682    }
    16681683endif;
  • supportcandy/trunk/includes/custom-field-types/class-wpsc-cf-datetime.php

    r3111454 r3188306  
    171171            add_action( 'wpsc_js_validate_ticket_form', array( __CLASS__, 'js_validate_ticket_form' ) );
    172172            add_filter( 'wpsc_create_ticket_data', array( __CLASS__, 'set_create_ticket_data' ), 10, 3 );
     173            add_action( 'wpsc_js_clear_value_hidden_fields', array( __CLASS__, 'js_clear_value_hidden_fields' ) );
    173174
    174175            // create ticket data for rest api.
     
    16451646            return esc_attr( date_i18n( $format, $val->getTimestamp(), false ) );
    16461647        }
     1648
     1649        /**
     1650         * Clear value of hidden fields
     1651         *
     1652         * @return void
     1653         */
     1654        public static function js_clear_value_hidden_fields() {
     1655            ?>
     1656            case '<?php echo esc_attr( self::$slug ); ?>':
     1657                customField.find('input').first().val('');
     1658                break;
     1659            <?php
     1660            echo PHP_EOL;
     1661        }
    16471662    }
    16481663endif;
  • supportcandy/trunk/includes/custom-field-types/class-wpsc-cf-email.php

    r3111454 r3188306  
    171171            add_action( 'wpsc_js_validate_ticket_form', array( __CLASS__, 'js_validate_ticket_form' ) );
    172172            add_filter( 'wpsc_create_ticket_data', array( __CLASS__, 'set_create_ticket_data' ), 10, 3 );
     173            add_action( 'wpsc_js_clear_value_hidden_fields', array( __CLASS__, 'js_clear_value_hidden_fields' ) );
    173174
    174175            // create ticket data for rest api.
     
    14141415            return $val ? esc_attr( $val ) : esc_attr__( 'None', 'supportcandy' );
    14151416        }
     1417
     1418        /**
     1419         * Clear value of hidden fields
     1420         *
     1421         * @return void
     1422         */
     1423        public static function js_clear_value_hidden_fields() {
     1424            ?>
     1425            case '<?php echo esc_attr( self::$slug ); ?>':
     1426                customField.find('input').first().val('');
     1427                break;
     1428            <?php
     1429            echo PHP_EOL;
     1430        }
    14161431    }
    14171432endif;
  • supportcandy/trunk/includes/custom-field-types/class-wpsc-cf-multi-select.php

    r3111454 r3188306  
    171171            add_action( 'wpsc_js_validate_ticket_form', array( __CLASS__, 'js_validate_ticket_form' ) );
    172172            add_filter( 'wpsc_create_ticket_data', array( __CLASS__, 'set_create_ticket_data' ), 10, 3 );
     173            add_action( 'wpsc_js_clear_value_hidden_fields', array( __CLASS__, 'js_clear_value_hidden_fields' ) );
    173174
    174175            // create ticket data for rest api.
     
    16141615            return $option_names ? esc_attr( implode( ', ', $option_names ) ) : esc_attr__( 'None', 'supportcandy' );
    16151616        }
     1617
     1618        /**
     1619         * Clear value of hidden fields
     1620         *
     1621         * @return void
     1622         */
     1623        public static function js_clear_value_hidden_fields() {
     1624            ?>
     1625            case '<?php echo esc_attr( self::$slug ); ?>':
     1626                customField.find('select').first().val('');
     1627                break;
     1628            <?php
     1629            echo PHP_EOL;
     1630        }
    16161631    }
    16171632endif;
  • supportcandy/trunk/includes/custom-field-types/class-wpsc-cf-number.php

    r3111454 r3188306  
    174174            add_action( 'wpsc_js_validate_ticket_form', array( __CLASS__, 'js_validate_ticket_form' ) );
    175175            add_filter( 'wpsc_create_ticket_data', array( __CLASS__, 'set_create_ticket_data' ), 10, 3 );
     176            add_action( 'wpsc_js_clear_value_hidden_fields', array( __CLASS__, 'js_clear_value_hidden_fields' ) );
    176177
    177178            // create ticket data for rest api.
     
    16471648            }
    16481649        }
     1650
     1651        /**
     1652         * Clear value of hidden fields
     1653         *
     1654         * @return void
     1655         */
     1656        public static function js_clear_value_hidden_fields() {
     1657            ?>
     1658            case '<?php echo esc_attr( self::$slug ); ?>':
     1659                customField.find('input').first().val('');
     1660                break;
     1661            <?php
     1662            echo PHP_EOL;
     1663        }
    16491664    }
    16501665endif;
  • supportcandy/trunk/includes/custom-field-types/class-wpsc-cf-radio-button.php

    r3111454 r3188306  
    172172            add_filter( 'wpsc_create_ticket_data', array( __CLASS__, 'set_create_ticket_data' ), 10, 3 );
    173173            add_filter( 'wpsc_ticket_search', array( __CLASS__, 'ticket_search' ), 10, 5 );
     174            add_action( 'wpsc_js_clear_value_hidden_fields', array( __CLASS__, 'js_clear_value_hidden_fields' ) );
    174175
    175176            // create ticket data for rest api.
     
    15441545            return $option->id ? esc_attr( $option->name ) : esc_attr__( 'None', 'supportcandy' );
    15451546        }
     1547
     1548        /**
     1549         * Clear value of hidden fields
     1550         *
     1551         * @return void
     1552         */
     1553        public static function js_clear_value_hidden_fields() {
     1554            ?>
     1555            case '<?php echo esc_attr( self::$slug ); ?>':
     1556                var rb = customField.find('input:checked');
     1557                rb.prop("checked", false);
     1558                break;
     1559            <?php
     1560            echo PHP_EOL;
     1561        }
    15461562    }
    15471563endif;
  • supportcandy/trunk/includes/custom-field-types/class-wpsc-cf-single-select.php

    r3111454 r3188306  
    171171            add_action( 'wpsc_js_validate_ticket_form', array( __CLASS__, 'js_validate_ticket_form' ) );
    172172            add_filter( 'wpsc_create_ticket_data', array( __CLASS__, 'set_create_ticket_data' ), 10, 3 );
     173            add_action( 'wpsc_js_clear_value_hidden_fields', array( __CLASS__, 'js_clear_value_hidden_fields' ) );
    173174
    174175            // create ticket data for rest api.
     
    14771478            return $option->id ? esc_attr( $option->name ) : esc_attr__( 'None', 'supportcandy' );
    14781479        }
     1480
     1481        /**
     1482         * Clear value of hidden fields
     1483         *
     1484         * @return void
     1485         */
     1486        public static function js_clear_value_hidden_fields() {
     1487            ?>
     1488            case '<?php echo esc_attr( self::$slug ); ?>':
     1489                customField.find('select').first().val('');
     1490                break;
     1491            <?php
     1492            echo PHP_EOL;
     1493        }
    14791494    }
    14801495endif;
  • supportcandy/trunk/includes/custom-field-types/class-wpsc-cf-text-field.php

    r3111454 r3188306  
    171171            add_action( 'wpsc_js_validate_ticket_form', array( __CLASS__, 'js_validate_ticket_form' ) );
    172172            add_filter( 'wpsc_create_ticket_data', array( __CLASS__, 'set_create_ticket_data' ), 10, 3 );
     173            add_action( 'wpsc_js_clear_value_hidden_fields', array( __CLASS__, 'js_clear_value_hidden_fields' ) );
    173174
    174175            // create ticket data for rest api.
     
    14511452            return $val ? esc_attr( $val ) : esc_attr__( 'None', 'supportcandy' );
    14521453        }
     1454
     1455        /**
     1456         * Clear value of hidden fields
     1457         *
     1458         * @return void
     1459         */
     1460        public static function js_clear_value_hidden_fields() {
     1461            ?>
     1462            case '<?php echo esc_attr( self::$slug ); ?>':
     1463                customField.find('input').first().val('');
     1464                break;
     1465            <?php
     1466            echo PHP_EOL;
     1467        }
    14531468    }
    14541469endif;
  • supportcandy/trunk/includes/custom-field-types/class-wpsc-cf-textarea.php

    r3111454 r3188306  
    171171            add_action( 'wpsc_js_validate_ticket_form', array( __CLASS__, 'js_validate_ticket_form' ) );
    172172            add_filter( 'wpsc_create_ticket_data', array( __CLASS__, 'set_create_ticket_data' ), 10, 3 );
     173            add_action( 'wpsc_js_clear_value_hidden_fields', array( __CLASS__, 'js_clear_value_hidden_fields' ) );
    173174
    174175            // create ticket data for rest api.
     
    13691370            return $val ? wp_kses_post( str_replace( PHP_EOL, '<br/>', esc_html( $val ) ) ) : esc_attr__( 'None', 'supportcandy' );
    13701371        }
     1372
     1373        /**
     1374         * Clear value of hidden fields
     1375         *
     1376         * @return void
     1377         */
     1378        public static function js_clear_value_hidden_fields() {
     1379            ?>
     1380            case '<?php echo esc_attr( self::$slug ); ?>':
     1381                customField.find('textarea').first().val('');
     1382                break;
     1383            <?php
     1384            echo PHP_EOL;
     1385        }
    13711386    }
    13721387endif;
  • supportcandy/trunk/includes/custom-field-types/class-wpsc-cf-time.php

    r3111454 r3188306  
    171171            add_action( 'wpsc_js_validate_ticket_form', array( __CLASS__, 'js_validate_ticket_form' ) );
    172172            add_filter( 'wpsc_create_ticket_data', array( __CLASS__, 'set_create_ticket_data' ), 10, 3 );
     173            add_action( 'wpsc_js_clear_value_hidden_fields', array( __CLASS__, 'js_clear_value_hidden_fields' ) );
    173174
    174175            // create ticket data for rest api.
     
    16021603            }
    16031604        }
     1605
     1606        /**
     1607         * Clear value of hidden fields
     1608         *
     1609         * @return void
     1610         */
     1611        public static function js_clear_value_hidden_fields() {
     1612            ?>
     1613            case '<?php echo esc_attr( self::$slug ); ?>':
     1614                customField.find('input').first().val('');
     1615                break;
     1616            <?php
     1617            echo PHP_EOL;
     1618        }
    16041619    }
    16051620endif;
  • supportcandy/trunk/includes/custom-field-types/class-wpsc-cf-url.php

    r3111454 r3188306  
    171171            add_action( 'wpsc_js_validate_ticket_form', array( __CLASS__, 'js_validate_ticket_form' ) );
    172172            add_filter( 'wpsc_create_ticket_data', array( __CLASS__, 'set_create_ticket_data' ), 10, 3 );
     173            add_action( 'wpsc_js_clear_value_hidden_fields', array( __CLASS__, 'js_clear_value_hidden_fields' ) );
    173174
    174175            // create ticket data for rest api.
     
    14161417            return $val ? '<a href="' . esc_url_raw( $val ) . '" target="__blank">' . esc_url_raw( $val ) . '</a>' : esc_attr__( 'None', 'supportcandy' );
    14171418        }
     1419
     1420        /**
     1421         * Clear value of hidden fields
     1422         *
     1423         * @return void
     1424         */
     1425        public static function js_clear_value_hidden_fields() {
     1426            ?>
     1427            case '<?php echo esc_attr( self::$slug ); ?>':
     1428                customField.find('input').first().val('');
     1429                break;
     1430            <?php
     1431            echo PHP_EOL;
     1432        }
    14181433    }
    14191434endif;
  • supportcandy/trunk/includes/custom-field-types/class-wpsc-df-additional-recipients.php

    r3111454 r3188306  
    171171            add_action( 'wpsc_js_validate_ticket_form', array( __CLASS__, 'js_validate_ticket_form' ) );
    172172            add_filter( 'wpsc_create_ticket_data', array( __CLASS__, 'set_create_ticket_data' ), 10, 3 );
     173            add_action( 'wpsc_js_clear_value_hidden_fields', array( __CLASS__, 'js_clear_value_hidden_fields' ) );
    173174
    174175            // create ticket data for rest api.
     
    544545            return $val ? esc_attr( implode( ', ', $val ) ) : esc_attr__( 'None', 'supportcandy' );
    545546        }
     547
     548        /**
     549         * Clear value of hidden fields
     550         *
     551         * @return void
     552         */
     553        public static function js_clear_value_hidden_fields() {
     554            ?>
     555            case '<?php echo esc_attr( self::$slug ); ?>':
     556                customField.find('textarea').first().val('');
     557                break;
     558            <?php
     559            echo PHP_EOL;
     560        }
    546561    }
    547562endif;
  • supportcandy/trunk/includes/custom-field-types/class-wpsc-df-assigned-agent.php

    r3111454 r3188306  
    175175            add_action( 'wpsc_js_validate_ticket_form', array( __CLASS__, 'js_validate_ticket_form' ) );
    176176            add_filter( 'wpsc_create_ticket_data', array( __CLASS__, 'set_create_ticket_data' ), 10, 3 );
     177            add_action( 'wpsc_js_clear_value_hidden_fields', array( __CLASS__, 'js_clear_value_hidden_fields' ) );
    177178
    178179            // create ticket data for rest api.
     
    12331234            do_action( 'wpsc_change_assignee', $ticket, array(), $new, $current_user->customer->id );
    12341235
     1236            // Action if current user assigns ticket to self.
     1237            do_action( 'wpsc_self_assign_ticket', $ticket, array(), $new, $current_user->customer->id );
     1238
    12351239            wp_die();
    12361240        }
     
    14491453            return $agent_names ? esc_attr( implode( ', ', $agent_names ) ) : esc_attr__( 'None', 'supportcandy' );
    14501454        }
     1455
     1456        /**
     1457         * Clear value of hidden fields
     1458         *
     1459         * @return void
     1460         */
     1461        public static function js_clear_value_hidden_fields() {
     1462            ?>
     1463            case '<?php echo esc_attr( self::$slug ); ?>':
     1464                customField.find('select').first().val('');
     1465                break;
     1466            <?php
     1467            echo PHP_EOL;
     1468        }
    14511469    }
    14521470endif;
  • supportcandy/trunk/includes/custom-field-types/class-wpsc-df-category.php

    r3111454 r3188306  
    168168            add_action( 'wpsc_js_validate_ticket_form', array( __CLASS__, 'js_validate_ticket_form' ) );
    169169            add_filter( 'wpsc_create_ticket_data', array( __CLASS__, 'set_create_ticket_data' ), 10, 3 );
     170            add_action( 'wpsc_js_clear_value_hidden_fields', array( __CLASS__, 'js_clear_value_hidden_fields' ) );
    170171
    171172            // create ticket data for rest api.
     
    839840            return $category->id ? esc_attr( $category->name ) : esc_attr__( 'None', 'supportcandy' );
    840841        }
     842
     843        /**
     844         * Clear value of hidden fields
     845         *
     846         * @return void
     847         */
     848        public static function js_clear_value_hidden_fields() {
     849            ?>
     850            case '<?php echo esc_attr( self::$slug ); ?>':
     851                customField.find('select').first().val('');
     852                break;
     853            <?php
     854            echo PHP_EOL;
     855        }
    841856    }
    842857endif;
  • supportcandy/trunk/includes/custom-field-types/class-wpsc-df-description.php

    r3111454 r3188306  
    162162            add_action( 'wpsc_js_validate_ticket_form', array( __CLASS__, 'js_validate_ticket_form' ) );
    163163            add_action( 'wpsc_js_create_ticket_formdata', array( __CLASS__, 'js_create_ticket_formdata' ) );
     164            add_action( 'wpsc_js_clear_value_hidden_fields', array( __CLASS__, 'js_clear_value_hidden_fields' ) );
    164165
    165166            // create ticket form.
     
    704705            return $thread && $thread->is_active ? $thread->get_printable_string() : '';
    705706        }
     707
     708        /**
     709         * Clear value of hidden fields
     710         *
     711         * @return void
     712         */
     713        public static function js_clear_value_hidden_fields() {
     714            ?>
     715            case '<?php echo esc_attr( self::$slug ); ?>':
     716                var is_tinymce = (typeof tinyMCE != "undefined") && tinyMCE.activeEditor && !tinyMCE.activeEditor.isHidden();
     717                if (is_tinymce && tinymce.get('description')){
     718                    tinyMCE.get('description').setContent('');
     719                } else {
     720                    jQuery('#description').val('');
     721                }
     722                break;
     723            <?php
     724            echo PHP_EOL;
     725        }
    706726    }
    707727endif;
  • supportcandy/trunk/includes/custom-field-types/class-wpsc-df-priority.php

    r3134113 r3188306  
    168168            add_action( 'wpsc_js_validate_ticket_form', array( __CLASS__, 'js_validate_ticket_form' ) );
    169169            add_filter( 'wpsc_create_ticket_data', array( __CLASS__, 'set_create_ticket_data' ), 10, 3 );
     170            add_action( 'wpsc_js_clear_value_hidden_fields', array( __CLASS__, 'js_clear_value_hidden_fields' ) );
    170171
    171172            // create ticket data for rest api.
     
    860861            return esc_attr( $recent_logs->customer->name ) . ' updated the ' . esc_attr( $cf->name ) . ' of <a href="' . esc_attr( $url ) . '" target="_blank">#' . esc_attr( $recent_logs->ticket->id ) . '</a> to ' . esc_attr( $priority_value );
    861862        }
     863
     864        /**
     865         * Clear value of hidden fields
     866         *
     867         * @return void
     868         */
     869        public static function js_clear_value_hidden_fields() {
     870            ?>
     871            case '<?php echo esc_attr( self::$slug ); ?>':
     872                customField.find('select').first().val('');
     873                break;
     874            <?php
     875            echo PHP_EOL;
     876        }
    862877    }
    863878endif;
  • supportcandy/trunk/includes/custom-field-types/class-wpsc-df-subject.php

    r3111454 r3188306  
    168168            add_action( 'wpsc_js_validate_ticket_form', array( __CLASS__, 'js_validate_ticket_form' ) );
    169169            add_filter( 'wpsc_create_ticket_data', array( __CLASS__, 'set_create_ticket_data' ), 10, 3 );
     170            add_action( 'wpsc_js_clear_value_hidden_fields', array( __CLASS__, 'js_clear_value_hidden_fields' ) );
    170171
    171172            // create ticket data for rest api.
     
    844845            return esc_attr( $val );
    845846        }
     847
     848        /**
     849         * Clear value of hidden fields
     850         *
     851         * @return void
     852         */
     853        public static function js_clear_value_hidden_fields() {
     854            ?>
     855            case '<?php echo esc_attr( self::$slug ); ?>':
     856                customField.find('input').first().val('');
     857                break;
     858            <?php
     859            echo PHP_EOL;
     860        }
    846861    }
    847862endif;
  • supportcandy/trunk/includes/frontend/class-wpsc-shortcode-one.php

    r3033546 r3188306  
    386386                    var data = {
    387387                        action: 'wpsc_get_ticket_list',
    388                         _ajax_nonce: supportcandy.nonce
     388                        _ajax_nonce: supportcandy.nonce,
     389                        is_frontend: supportcandy.is_frontend
    389390                    };
    390391                    search_params.forEach(function(value, key) {
  • supportcandy/trunk/readme.txt

    r3134113 r3188306  
    44Tags: support, helpdesk, ticketing system, customer support, ticket
    55Requires at least: 5.6
    6 Tested up to: 6.6
     6Tested up to: 6.7
    77Requires PHP: 7.4
    8 Stable tag: 3.2.9
     8Stable tag: 3.3.0
    99
    1010Enhance your WordPress site with our helpdesk and support ticket system. Manage customer support, tickets, and email tickets efficiently.
     
    223223== Changelog ==
    224224
     225= 3.3.0 (November 14, 2024) =
     226* New: Option to open tickets in a new tab (use Ctrl+Click to open tickets in a separate tab)
     227* New: Additional date range filters added to dashboard widgets for enhanced filtering
     228* Fix: Values of conditional custom fields not clearing properly in the new ticket form
     229* Fix: Guest users unable to reply to tickets issue resolved
     230* Fix: Deletion issues with ticket statuses, priorities, and categories fixed
     231
    225232= 3.2.9 (August 12, 2024) =
    226233* Fix: Enhanced attachment security to prevent potential vulnerabilities
  • supportcandy/trunk/supportcandy.php

    r3134113 r3188306  
    22/**
    33 * Plugin Name: SupportCandy
    4  * Plugin URI: https://wordpress.org/plugins/supportcandy/
     4 * Plugin URI: https://supportcandy.net/
    55 * Description: Easy & Powerful support ticket system for WordPress
    6  * Version: 3.2.9
     6 * Version: 3.3.0
    77 * Author: SupportCandy
    8  * Author URI: https://supportcandy.net/
     8 * Author URI: https://wordpress.org/plugins/supportcandy/
    99 * Requires at least: 5.6
    1010 * Requires PHP: 7.4
    11  * Tested up to: 6.6
     11 * Tested up to: 6.7
    1212 * Text Domain: supportcandy
    1313 * Domain Path: /i18n
     14 * License: GPLv3 or later
     15 * License URI: https://www.gnu.org/licenses/gpl-3.0.html
    1416 */
    1517
     
    3133         * @var string
    3234         */
    33         public static $version = '3.2.9';
     35        public static $version = '3.3.0';
    3436
    3537        /**
Note: See TracChangeset for help on using the changeset viewer.