Plugin Directory

Changeset 2798663


Ignore:
Timestamp:
10/14/2022 06:15:58 AM (3 years ago)
Author:
supportcandy
Message:

Version 3.0.9

Location:
supportcandy
Files:
511 added
17 edited

Legend:

Unmodified
Added
Removed
  • supportcandy/trunk/class-wpsc-installation.php

    r2793251 r2798663  
    6363                if ( self::$current_version == 0 ) {
    6464
    65                     self::initial_setup();
    66                     self::set_upgrade_complete();
     65                    add_action( 'init', array( __CLASS__, 'initial_setup' ), 1 );
     66                    add_action( 'init', array( __CLASS__, 'set_upgrade_complete' ), 1 );
    6767
    6868                } else {
    6969
    70                     self::upgrade();
     70                    add_action( 'init', array( __CLASS__, 'upgrade' ), 1 );
    7171                }
    7272
  • supportcandy/trunk/framework/style-rtl.css

    r2793251 r2798663  
    132132    cursor: pointer;
    133133}
     134.wpsc-header .log-out{
     135    margin-left: 0;
     136    flex: 1;
     137    justify-content: flex-end;
     138}
    134139.wpsc-humbargar {
    135140    display: flex;
  • supportcandy/trunk/framework/style.css

    r2793251 r2798663  
    131131    cursor: pointer;
    132132}
     133.wpsc-header .log-out{
     134    margin-right: 0;
     135    flex: 1;
     136    justify-content: flex-end;
     137}
    133138.wpsc-humbargar {
    134139    display: flex;
  • supportcandy/trunk/i18n/supportcandy-fr_FR.po

    r2763565 r2798663  
    33"Project-Id-Version: SupportCandy\n"
    44"POT-Creation-Date: 2022-07-23 10:30+0530\n"
    5 "PO-Revision-Date: 2022-07-24 19:31+0100\n"
     5"PO-Revision-Date: 2022-08-23 13:53+0530\n"
    66"Last-Translator: \n"
    77"Language-Team: \n"
     
    1111"Content-Transfer-Encoding: 8bit\n"
    1212"Plural-Forms: nplurals=2; plural=(n > 1);\n"
    13 "X-Generator: Poedit 3.1.1\n"
     13"X-Generator: Poedit 3.0.1\n"
    1414"X-Poedit-Basepath: ..\n"
    1515"X-Poedit-Flags-xgettext: --add-comments=translators:\n"
     
    306306#: class-wpsc-installation.php:1412
    307307msgid "Ticket info"
    308 msgstr "Infos sur les billets"
     308msgstr "Infos sur les tickets"
    309309
    310310#: class-wpsc-installation.php:1414
     
    386386#: framework/class-wpsc-framework.php:346
    387387msgid "Ticket URL copied!"
    388 msgstr "URL du billet copié !"
     388msgstr "URL du ticket copié !"
    389389
    390390#: framework/class-wpsc-framework.php:347
     
    10831083#: includes/admin/agent-settings/class-wpsc-agent-roles.php:572
    10841084msgid "View Tickets"
    1085 msgstr "Voir les billets"
     1085msgstr "Voir les tickets"
    10861086
    10871087#: includes/admin/agent-settings/class-wpsc-agent-roles.php:157
     
    12031203#: includes/admin/agent-settings/class-wpsc-agent-roles.php:800
    12041204msgid "Delete Ticket"
    1205 msgstr "Supprimer le billet"
     1205msgstr "Supprimer le ticket"
    12061206
    12071207#: includes/admin/agent-settings/class-wpsc-agent-roles.php:396
     
    13471347#: includes/frontend/class-wpsc-shortcode-one.php:156
    13481348msgid "Ticket List"
    1349 msgstr "Liste des billets"
     1349msgstr "Liste des tickets"
    13501350
    13511351#: includes/admin/class-wpsc-admin.php:123
     
    15031503#: includes/admin/custom-fields/class-wpsc-tf.php:64
    15041504msgid "Ticket Fields"
    1505 msgstr "Liste des billets"
     1505msgstr "Liste des tickets"
    15061506
    15071507#: includes/admin/custom-fields/class-wpsc-cf-settings.php:115
     
    16651665#: includes/admin/ticket-list/class-wpsc-ticket-list-more-settings.php:441
    16661666msgid "Number of tickets"
    1667 msgstr "Nombre de billets"
     1667msgstr "Nombre de tickets"
    16681668
    16691669#: includes/admin/customers/class-wpsc-customers.php:155
     
    17241724#: includes/admin/email-notifications/class-wpsc-en-change-ticket-category.php:58
    17251725msgid "Change ticket category"
    1726 msgstr "Changer de catégorie de billet"
     1726msgstr "Changer de catégorie de ticket"
    17271727
    17281728#: includes/admin/email-notifications/class-wpsc-en-change-ticket-priority.php:58
    17291729msgid "Change ticket priority"
    1730 msgstr "Modifier la priorité des billets"
     1730msgstr "Modifier la priorité des tickets"
    17311731
    17321732#: includes/admin/email-notifications/class-wpsc-en-change-ticket-status.php:58
     
    17401740#: includes/admin/email-notifications/class-wpsc-en-delete-ticket.php:44
    17411741msgid "Delete ticket"
    1742 msgstr "Supprimer le billet"
     1742msgstr "Supprimer le ticket"
    17431743
    17441744#: includes/admin/email-notifications/class-wpsc-en-guest-login-otp.php:54
     
    18031803#: includes/admin/email-notifications/class-wpsc-en-reply-ticket.php:51
    18041804msgid "Ticket reply"
    1805 msgstr "Réponse aux billets"
     1805msgstr "Réponse aux tickets"
    18061806
    18071807#: includes/admin/email-notifications/class-wpsc-en-settings-gs.php:54
     
    20252025#: includes/admin/settings/class-wpsc-ticket-categories.php:45
    20262026msgid "Ticket Categories"
    2027 msgstr "Catégories de billets"
     2027msgstr "Catégories de tickets"
    20282028
    20292029#: includes/admin/settings/class-wpsc-settings.php:82
     
    20352035#: includes/admin/settings/class-wpsc-ticket-priorities.php:46
    20362036msgid "Ticket Priorities"
    2037 msgstr "Priorités des billets"
     2037msgstr "Priorités des tickets"
    20382038
    20392039#: includes/admin/settings/class-wpsc-settings.php:94
     
    20442044#: includes/admin/settings/class-wpsc-ticket-widgets.php:36
    20452045msgid "Ticket Widgets"
    2046 msgstr "Widgets pour les billets"
     2046msgstr "Widgets pour les tickets"
    20472047
    20482048#: includes/admin/settings/class-wpsc-settings.php:106
     
    21832183#: includes/admin/settings/general-settings/class-wpsc-gs-page-settings.php:112
    21842184msgid "Open ticket page"
    2185 msgstr "Ouvrir la page du billet"
     2185msgstr "Ouvrir la page du ticket"
    21862186
    21872187#: includes/admin/settings/general-settings/class-wpsc-gs-page-settings.php:108
    21882188msgid "Ticket url page"
    2189 msgstr "Page de l'url du billet"
     2189msgstr "Page de l'url du ticket"
    21902190
    21912191#: includes/admin/settings/general-settings/class-wpsc-gs-page-settings.php:117
    21922192msgid "New ticket page"
    2193 msgstr "Nouvelle page de billets"
     2193msgstr "Nouvelle page de tickets"
    21942194
    21952195#: includes/admin/settings/general-settings/class-wpsc-gs-page-settings.php:121
     
    23682368#: includes/class-wpsc-macros.php:50
    23692369msgid "Ticket id"
    2370 msgstr "Identifiant du billet"
     2370msgstr "Identifiant du ticket"
    23712371
    23722372#: includes/admin/settings/miscellaneous-settings/class-wpsc-ms-advanced.php:150
     
    24182418#: includes/admin/settings/miscellaneous-settings/class-wpsc-ms-advanced.php:213
    24192419msgid "Permanently delete tickets"
    2420 msgstr "Supprimer définitivement les billets"
     2420msgstr "Supprimer définitivement les tickets"
    24212421
    24222422#: includes/admin/settings/miscellaneous-settings/class-wpsc-ms-advanced.php:244
     
    24532453#: includes/frontend/class-wpsc-shortcode-three.php:102
    24542454msgid "Ticket ID"
    2455 msgstr "ID du billet"
     2455msgstr "ID du ticket"
    24562456
    24572457#: includes/admin/settings/miscellaneous-settings/class-wpsc-ms-gdpr.php:482
     
    24612461#: includes/admin/settings/miscellaneous-settings/class-wpsc-ms-gdpr.php:503
    24622462msgid "Ticket Records"
    2463 msgstr "Records de billets"
     2463msgstr "Records de tickets"
    24642464
    24652465#. translators: %s: email address
     
    27272727#: includes/admin/ticket-list/class-wpsc-ticket-list-more-settings.php:494
    27282728msgid "Ticket list"
    2729 msgstr "Liste des billets"
     2729msgstr "Liste des tickets"
    27302730
    27312731#: includes/admin/ticket-list/class-wpsc-ticket-list-more-settings.php:300
     
    28622862#: includes/admin/tickets/class-wpsc-individual-ticket.php:467
    28632863msgid "Ticket Details"
    2864 msgstr "Détails du billet"
     2864msgstr "Détails du ticket"
    28652865
    28662866#: includes/admin/tickets/class-wpsc-individual-ticket.php:539
     
    30763076#: includes/admin/tickets/class-wpsc-ticket-list.php:786
    30773077msgid "No tickets found!"
    3078 msgstr "Aucun billet trouvé !"
     3078msgstr "Aucun ticket trouvé !"
    30793079
    30803080#: includes/admin/tickets/class-wpsc-ticket-list.php:829
     
    31203120#: includes/frontend/class-wpsc-shortcode-one.php:166
    31213121msgid "New Ticket"
    3122 msgstr "Nouveau billet"
     3122msgstr "Nouveau ticket"
    31233123
    31243124#: includes/admin/tickets/class-wpsc-tickets.php:94
     
    31753175#: includes/admin/tickets/widgets/class-wpsc-itw-raisedby.php:134
    31763176msgid "All other tickets of this user"
    3177 msgstr "Tous les autres billets de cet utilisateur"
     3177msgstr "Tous les autres tickets de cet utilisateur"
    31783178
    31793179#: includes/admin/tickets/widgets/class-wpsc-itw-raisedby.php:302
     
    33793379#: includes/class-wpsc-macros.php:138
    33803380msgid "Ticket URL"
    3381 msgstr "URL du billet"
     3381msgstr "URL du ticket"
    33823382
    33833383#: includes/class-wpsc-macros.php:175
     
    41694169#: includes/frontend/class-wpsc-frontend.php:265
    41704170msgid "Create new ticket as guest"
    4171 msgstr "Créer un nouveau billet en tant qu'invité"
     4171msgstr "Créer un nouveau ticket en tant qu'invité"
    41724172
    41734173#: includes/frontend/class-wpsc-frontend.php:271
  • supportcandy/trunk/i18n/supportcandy.pot

    r2793251 r2798663  
    33msgstr ""
    44"Project-Id-Version: SupportCandy\n"
    5 "POT-Creation-Date: 2022-10-03 10:55+0530\n"
    6 "PO-Revision-Date: 2022-10-03 10:55+0530\n"
     5"POT-Creation-Date: 2022-10-14 11:14+0530\n"
     6"PO-Revision-Date: 2022-10-14 11:14+0530\n"
    77"Last-Translator: \n"
    88"Language-Team: \n"
     
    5353#: includes/admin/settings/class-wpsc-ticket-statuses.php:304
    5454#: includes/admin/settings/miscellaneous-settings/class-wpsc-ms-gdpr.php:383
    55 #: includes/admin/tickets/class-wpsc-individual-ticket.php:2003
     55#: includes/admin/tickets/class-wpsc-individual-ticket.php:1981
    5656#: includes/admin/tickets/class-wpsc-new-ticket.php:485
    5757#: includes/admin/tickets/class-wpsc-ticket-list.php:1898
     
    6868#: class-wpsc-installation.php:379
    6969#: includes/admin/customers/class-wpsc-customers.php:238
    70 #: includes/admin/tickets/class-wpsc-individual-ticket.php:2011
     70#: includes/admin/tickets/class-wpsc-individual-ticket.php:1989
    7171#: includes/admin/tickets/class-wpsc-new-ticket.php:495
    7272#: includes/admin/tickets/widgets/class-wpsc-itw-raisedby.php:392
     
    8888#: includes/admin/email-notifications/class-wpsc-en-user-reg-otp.php:59
    8989#: includes/admin/settings/miscellaneous-settings/class-wpsc-ms-gdpr.php:453
    90 #: includes/admin/tickets/class-wpsc-individual-ticket.php:1676
    91 #: includes/admin/tickets/class-wpsc-individual-ticket.php:1923
     90#: includes/admin/tickets/class-wpsc-individual-ticket.php:1638
     91#: includes/admin/tickets/class-wpsc-individual-ticket.php:1901
    9292msgid "Subject"
    9393msgstr ""
     
    156156#: class-wpsc-installation.php:547
    157157#: includes/admin/settings/miscellaneous-settings/class-wpsc-ms-gdpr.php:457
    158 #: includes/admin/tickets/class-wpsc-individual-ticket.php:2024
     158#: includes/admin/tickets/class-wpsc-individual-ticket.php:2002
    159159msgid "IP Address"
    160160msgstr ""
    161161
    162162#: class-wpsc-installation.php:562
    163 #: includes/admin/tickets/class-wpsc-individual-ticket.php:2019
     163#: includes/admin/tickets/class-wpsc-individual-ticket.php:1997
    164164#: includes/models/class-wpsc-attachment.php:612
    165165#: includes/models/class-wpsc-attachment.php:785
     
    169169#: class-wpsc-installation.php:576
    170170#: includes/admin/settings/miscellaneous-settings/class-wpsc-ms-gdpr.php:461
    171 #: includes/admin/tickets/class-wpsc-individual-ticket.php:2029
     171#: includes/admin/tickets/class-wpsc-individual-ticket.php:2007
    172172#: includes/custom-field-types/class-wpsc-df-source.php:199
    173173msgid "Browser"
     
    176176#: class-wpsc-installation.php:590
    177177#: includes/admin/settings/miscellaneous-settings/class-wpsc-ms-gdpr.php:465
    178 #: includes/admin/tickets/class-wpsc-individual-ticket.php:2034
     178#: includes/admin/tickets/class-wpsc-individual-ticket.php:2012
    179179msgid "Operating System"
    180180msgstr ""
     
    633633#: includes/admin/tickets/widgets/class-wpsc-itw-ticket-info.php:81
    634634#: includes/admin/tickets/widgets/class-wpsc-itw-ticket-info.php:165
    635 #: includes/class-wpsc-ticket-conditions.php:211
    636 #: includes/class-wpsc-ticket-conditions.php:288
     635#: includes/class-wpsc-ticket-conditions.php:219
     636#: includes/class-wpsc-ticket-conditions.php:296
    637637#: includes/custom-field-types/class-wpsc-df-agent-created.php:569
    638638#: includes/custom-field-types/class-wpsc-df-assigned-agent.php:1223
     
    643643#: includes/frontend/class-wpsc-shortcode-six.php:98
    644644#: includes/frontend/class-wpsc-shortcode-three.php:254
    645 #: includes/models/class-wpsc-agent.php:1088
    646 #: includes/models/class-wpsc-agent.php:1116
     645#: includes/models/class-wpsc-agent.php:1110
     646#: includes/models/class-wpsc-agent.php:1138
    647647#: includes/models/class-wpsc-holiday.php:357
    648648#: includes/models/class-wpsc-wh-exception.php:396
     
    829829#: includes/admin/tickets/class-wpsc-current-user-profile.php:159
    830830#: includes/admin/tickets/class-wpsc-current-user-profile.php:164
    831 #: includes/admin/tickets/class-wpsc-individual-ticket.php:1979
    832 #: includes/admin/tickets/class-wpsc-individual-ticket.php:1984
    833 #: includes/admin/tickets/class-wpsc-individual-ticket.php:1988
    834 #: includes/admin/tickets/class-wpsc-individual-ticket.php:2096
    835 #: includes/admin/tickets/class-wpsc-individual-ticket.php:2100
    836 #: includes/admin/tickets/class-wpsc-individual-ticket.php:2220
    837 #: includes/admin/tickets/class-wpsc-individual-ticket.php:2311
    838 #: includes/admin/tickets/class-wpsc-individual-ticket.php:2460
    839 #: includes/admin/tickets/class-wpsc-individual-ticket.php:2657
     831#: includes/admin/tickets/class-wpsc-individual-ticket.php:1957
     832#: includes/admin/tickets/class-wpsc-individual-ticket.php:1962
     833#: includes/admin/tickets/class-wpsc-individual-ticket.php:1966
     834#: includes/admin/tickets/class-wpsc-individual-ticket.php:2074
     835#: includes/admin/tickets/class-wpsc-individual-ticket.php:2078
     836#: includes/admin/tickets/class-wpsc-individual-ticket.php:2198
     837#: includes/admin/tickets/class-wpsc-individual-ticket.php:2289
     838#: includes/admin/tickets/class-wpsc-individual-ticket.php:2438
     839#: includes/admin/tickets/class-wpsc-individual-ticket.php:2635
    840840#: includes/admin/tickets/class-wpsc-ticket-list.php:1055
    841841#: includes/admin/tickets/class-wpsc-ticket-list.php:1247
     
    868868#: includes/admin/tickets/widgets/class-wpsc-itw-ticket-fields.php:367
    869869#: includes/admin/tickets/widgets/class-wpsc-itw-ticket-info.php:170
    870 #: includes/class-wpsc-ticket-conditions.php:216
    871 #: includes/class-wpsc-ticket-conditions.php:293
    872 #: includes/class-wpsc-ticket-conditions.php:298
     870#: includes/class-wpsc-ticket-conditions.php:224
     871#: includes/class-wpsc-ticket-conditions.php:301
     872#: includes/class-wpsc-ticket-conditions.php:306
    873873#: includes/models/class-wpsc-attachment.php:961
    874874#: includes/models/class-wpsc-attachment.php:968
     
    912912#: includes/admin/ticket-list/class-wpsc-customer-ticket-list-settings.php:789
    913913#: includes/admin/tickets/class-wpsc-current-agent-profile.php:542
    914 #: includes/admin/tickets/class-wpsc-individual-ticket.php:2044
     914#: includes/admin/tickets/class-wpsc-individual-ticket.php:2022
    915915#: includes/admin/tickets/widgets/class-wpsc-itw-additional-recipients.php:230
    916916#: includes/admin/tickets/widgets/class-wpsc-itw-additional-recipients.php:239
     
    12811281#: includes/admin/ticket-list/class-wpsc-ticket-list-more-settings.php:620
    12821282#: includes/admin/tickets/class-wpsc-current-agent-profile.php:566
    1283 #: includes/admin/tickets/class-wpsc-individual-ticket.php:778
    1284 #: includes/admin/tickets/class-wpsc-individual-ticket.php:1691
    1285 #: includes/admin/tickets/class-wpsc-individual-ticket.php:1939
    1286 #: includes/admin/tickets/class-wpsc-individual-ticket.php:2267
     1283#: includes/admin/tickets/class-wpsc-individual-ticket.php:732
     1284#: includes/admin/tickets/class-wpsc-individual-ticket.php:1653
     1285#: includes/admin/tickets/class-wpsc-individual-ticket.php:1917
     1286#: includes/admin/tickets/class-wpsc-individual-ticket.php:2245
    12871287#: includes/admin/tickets/class-wpsc-new-ticket.php:185
    12881288#: includes/admin/tickets/class-wpsc-new-ticket.php:509
     
    13551355#: includes/admin/ticket-list/class-wpsc-customer-ticket-list-settings.php:1458
    13561356#: includes/admin/tickets/class-wpsc-current-agent-profile.php:569
    1357 #: includes/admin/tickets/class-wpsc-individual-ticket.php:1694
    1358 #: includes/admin/tickets/class-wpsc-individual-ticket.php:1942
    1359 #: includes/admin/tickets/class-wpsc-individual-ticket.php:2268
     1357#: includes/admin/tickets/class-wpsc-individual-ticket.php:1656
     1358#: includes/admin/tickets/class-wpsc-individual-ticket.php:1920
     1359#: includes/admin/tickets/class-wpsc-individual-ticket.php:2246
    13601360#: includes/admin/tickets/class-wpsc-new-ticket.php:512
    13611361#: includes/admin/tickets/class-wpsc-ticket-list.php:843
     
    14411441#: includes/admin/ticket-list/class-wpsc-customer-ticket-list-settings.php:174
    14421442#: includes/admin/ticket-list/class-wpsc-customer-ticket-list-settings.php:1020
    1443 #: includes/admin/tickets/class-wpsc-individual-ticket.php:388
     1443#: includes/admin/tickets/class-wpsc-individual-ticket.php:342
    14441444#: includes/admin/tickets/class-wpsc-ticket-list.php:477
    14451445#: includes/models/class-wpsc-wh-exception.php:446
     
    14621462#: includes/admin/ticket-list/class-wpsc-customer-ticket-list-settings.php:175
    14631463#: includes/admin/ticket-list/class-wpsc-customer-ticket-list-settings.php:1021
    1464 #: includes/admin/tickets/class-wpsc-individual-ticket.php:319
    1465 #: includes/admin/tickets/class-wpsc-individual-ticket.php:396
     1464#: includes/admin/tickets/class-wpsc-individual-ticket.php:273
     1465#: includes/admin/tickets/class-wpsc-individual-ticket.php:350
    14661466#: includes/admin/tickets/class-wpsc-ticket-list.php:484
    14671467#: includes/admin/tickets/class-wpsc-ticket-list.php:2141
     
    17191719#: includes/admin/settings/miscellaneous-settings/class-wpsc-ms-advanced.php:276
    17201720#: includes/admin/settings/text-editor-settings/class-wpsc-text-editor.php:125
    1721 #: includes/class-wpsc-ticket-conditions.php:326
     1721#: includes/class-wpsc-ticket-conditions.php:334
    17221722#: includes/custom-field-types/class-wpsc-df-assigned-agent.php:685
    17231723#: includes/custom-field-types/class-wpsc-df-assigned-agent.php:770
     
    17991799#: includes/admin/ticket-list/class-wpsc-ticket-list-settings.php:132
    18001800#: includes/admin/tickets/class-wpsc-tickets.php:76
    1801 #: includes/frontend/class-wpsc-shortcode-one.php:194
     1801#: includes/frontend/class-wpsc-shortcode-one.php:198
    18021802msgid "Ticket List"
    18031803msgstr ""
     
    20672067#: includes/admin/tickets/class-wpsc-ticket-list.php:1431
    20682068#: includes/admin/tickets/class-wpsc-ticket-list.php:1509
    2069 #: includes/class-wpsc-ticket-conditions.php:117
    2070 #: includes/class-wpsc-ticket-conditions.php:173
     2069#: includes/class-wpsc-ticket-conditions.php:125
     2070#: includes/class-wpsc-ticket-conditions.php:181
    20712071msgid "Select field"
    20722072msgstr ""
     
    21042104#: includes/admin/custom-fields/class-wpsc-tff.php:249
    21052105#: includes/admin/custom-fields/class-wpsc-tff.php:508
    2106 #: includes/class-wpsc-ticket-conditions.php:92
     2106#: includes/class-wpsc-ticket-conditions.php:100
    21072107msgid "AND"
    21082108msgstr ""
     
    21102110#: includes/admin/custom-fields/class-wpsc-tff.php:250
    21112111#: includes/admin/custom-fields/class-wpsc-tff.php:509
    2112 #: includes/class-wpsc-ticket-conditions.php:93
     2112#: includes/class-wpsc-ticket-conditions.php:101
    21132113#: includes/frontend/class-wpsc-shortcode-three.php:91
    21142114msgid "OR"
     
    21502150#: includes/admin/customers/class-wpsc-customers.php:277
    21512151#: includes/admin/customers/class-wpsc-customers.php:499
    2152 #: includes/admin/tickets/class-wpsc-individual-ticket.php:303
    2153 #: includes/admin/tickets/class-wpsc-individual-ticket.php:2058
    2154 #: includes/admin/tickets/class-wpsc-individual-ticket.php:2612
    2155 #: includes/admin/tickets/class-wpsc-individual-ticket.php:2709
     2152#: includes/admin/tickets/class-wpsc-individual-ticket.php:257
     2153#: includes/admin/tickets/class-wpsc-individual-ticket.php:2036
     2154#: includes/admin/tickets/class-wpsc-individual-ticket.php:2590
     2155#: includes/admin/tickets/class-wpsc-individual-ticket.php:2687
    21562156#: includes/admin/tickets/widgets/class-wpsc-itw-raisedby.php:688
    21572157#: includes/admin/tickets/widgets/class-wpsc-itw-raisedby.php:794
     
    21662166#. translators: %1$s: User Name, %2$s: Field Name
    21672167#: includes/admin/customers/class-wpsc-customers.php:550
    2168 #: includes/admin/tickets/class-wpsc-individual-ticket.php:1249
     2168#: includes/admin/tickets/class-wpsc-individual-ticket.php:1211
    21692169#: includes/models/class-wpsc-thread.php:626
    21702170#, php-format
     
    23192319#: includes/admin/email-notifications/class-wpsc-en-settings-tn.php:412
    23202320#: includes/admin/settings/general-settings/class-wpsc-gs-thankyou-page-settings.php:75
    2321 #: includes/admin/tickets/class-wpsc-individual-ticket.php:727
     2321#: includes/admin/tickets/class-wpsc-individual-ticket.php:681
    23222322#: includes/custom-field-types/class-wpsc-df-description.php:365
    23232323msgid "Insert Macro"
     
    32803280
    32813281#: includes/admin/tickets/class-wpsc-current-user-profile.php:76
     3282#: includes/admin/tickets/class-wpsc-tickets.php:167
     3283#: includes/admin/tickets/class-wpsc-tickets.php:221
     3284#: includes/frontend/class-wpsc-shortcode-one.php:118
     3285#: includes/frontend/class-wpsc-shortcode-one.php:288
    32823286msgid "Logout"
    32833287msgstr ""
     
    32883292msgstr ""
    32893293
    3290 #: includes/admin/tickets/class-wpsc-individual-ticket.php:272
     3294#: includes/admin/tickets/class-wpsc-individual-ticket.php:226
    32913295#: includes/admin/tickets/class-wpsc-ticket-list.php:552
    32923296msgid "Refresh"
    32933297msgstr ""
    32943298
    3295 #: includes/admin/tickets/class-wpsc-individual-ticket.php:311
    3296 #: includes/admin/tickets/class-wpsc-individual-ticket.php:1669
     3299#: includes/admin/tickets/class-wpsc-individual-ticket.php:265
     3300#: includes/admin/tickets/class-wpsc-individual-ticket.php:1631
    32973301msgid "Duplicate"
    32983302msgstr ""
    32993303
    3300 #: includes/admin/tickets/class-wpsc-individual-ticket.php:326
     3304#: includes/admin/tickets/class-wpsc-individual-ticket.php:280
    33013305msgid "Copy URL"
    33023306msgstr ""
    33033307
    3304 #: includes/admin/tickets/class-wpsc-individual-ticket.php:335
    3305 #: includes/admin/tickets/class-wpsc-individual-ticket.php:2696
     3308#: includes/admin/tickets/class-wpsc-individual-ticket.php:289
     3309#: includes/admin/tickets/class-wpsc-individual-ticket.php:2674
    33063310#: includes/admin/tickets/class-wpsc-ticket-list.php:2153
    33073311msgid "Restore"
    33083312msgstr ""
    33093313
    3310 #: includes/admin/tickets/class-wpsc-individual-ticket.php:343
    3311 #: includes/admin/tickets/class-wpsc-individual-ticket.php:2703
     3314#: includes/admin/tickets/class-wpsc-individual-ticket.php:297
     3315#: includes/admin/tickets/class-wpsc-individual-ticket.php:2681
    33123316#: includes/admin/tickets/class-wpsc-ticket-list.php:2161
    33133317msgid "Delete Permanently"
    33143318msgstr ""
    33153319
    3316 #: includes/admin/tickets/class-wpsc-individual-ticket.php:358
     3320#: includes/admin/tickets/class-wpsc-individual-ticket.php:312
    33173321msgid "Reply"
    33183322msgstr ""
    33193323
    3320 #: includes/admin/tickets/class-wpsc-individual-ticket.php:365
     3324#: includes/admin/tickets/class-wpsc-individual-ticket.php:319
    33213325msgid "Private Note"
    33223326msgstr ""
    33233327
    3324 #: includes/admin/tickets/class-wpsc-individual-ticket.php:375
     3328#: includes/admin/tickets/class-wpsc-individual-ticket.php:329
    33253329#: includes/admin/tickets/widgets/class-wpsc-itw-raisedby.php:129
    33263330msgid "Info"
    33273331msgstr ""
    33283332
    3329 #: includes/admin/tickets/class-wpsc-individual-ticket.php:380
     3333#: includes/admin/tickets/class-wpsc-individual-ticket.php:334
    33303334msgid "Create new ticket from this thread"
    33313335msgstr ""
    33323336
    3333 #: includes/admin/tickets/class-wpsc-individual-ticket.php:491
     3337#: includes/admin/tickets/class-wpsc-individual-ticket.php:445
    33343338msgid "Ticket Details"
    33353339msgstr ""
    33363340
    3337 #: includes/admin/tickets/class-wpsc-individual-ticket.php:522
     3341#: includes/admin/tickets/class-wpsc-individual-ticket.php:476
    33383342msgid "You must sign in to submit a reply"
    33393343msgstr ""
    33403344
    33413345#. translators: %s: Sign in
    3342 #: includes/admin/tickets/class-wpsc-individual-ticket.php:527
     3346#: includes/admin/tickets/class-wpsc-individual-ticket.php:481
    33433347#, php-format
    33443348msgid "%s using email and password (registered user)"
    33453349msgstr ""
    33463350
    3347 #: includes/admin/tickets/class-wpsc-individual-ticket.php:528
    3348 #: includes/admin/tickets/class-wpsc-individual-ticket.php:540
     3351#: includes/admin/tickets/class-wpsc-individual-ticket.php:482
     3352#: includes/admin/tickets/class-wpsc-individual-ticket.php:494
    33493353msgid "Sign in"
    33503354msgstr ""
    33513355
    33523356#. translators: %s: Sign in
    3353 #: includes/admin/tickets/class-wpsc-individual-ticket.php:539
     3357#: includes/admin/tickets/class-wpsc-individual-ticket.php:493
    33543358#, php-format
    33553359msgid "%s using email and one time password (guest user)"
    33563360msgstr ""
    33573361
    3358 #: includes/admin/tickets/class-wpsc-individual-ticket.php:701
     3362#: includes/admin/tickets/class-wpsc-individual-ticket.php:655
    33593363msgid "CC (comma separated list)"
    33603364msgstr ""
    33613365
    3362 #: includes/admin/tickets/class-wpsc-individual-ticket.php:706
     3366#: includes/admin/tickets/class-wpsc-individual-ticket.php:660
    33633367msgid "BCC (comma separated list)"
    33643368msgstr ""
    33653369
    3366 #: includes/admin/tickets/class-wpsc-individual-ticket.php:722
    3367 #: includes/admin/tickets/class-wpsc-individual-ticket.php:2238
     3370#: includes/admin/tickets/class-wpsc-individual-ticket.php:676
     3371#: includes/admin/tickets/class-wpsc-individual-ticket.php:2216
    33683372#: includes/custom-field-types/class-wpsc-df-description.php:359
    33693373msgid "Attach Files"
    33703374msgstr ""
    33713375
    3372 #: includes/admin/tickets/class-wpsc-individual-ticket.php:753
     3376#: includes/admin/tickets/class-wpsc-individual-ticket.php:707
    33733377msgid "SUBMIT AS"
    33743378msgstr ""
    33753379
    3376 #: includes/admin/tickets/class-wpsc-individual-ticket.php:910
    3377 #: includes/admin/tickets/class-wpsc-individual-ticket.php:969
     3380#: includes/admin/tickets/class-wpsc-individual-ticket.php:872
     3381#: includes/admin/tickets/class-wpsc-individual-ticket.php:931
    33783382msgid "Load older communications"
    33793383msgstr ""
    33803384
    3381 #: includes/admin/tickets/class-wpsc-individual-ticket.php:1043
     3385#: includes/admin/tickets/class-wpsc-individual-ticket.php:1005
    33823386#: includes/models/class-wpsc-thread.php:589
    33833387msgid "reported"
    33843388msgstr ""
    33853389
    3386 #: includes/admin/tickets/class-wpsc-individual-ticket.php:1047
     3390#: includes/admin/tickets/class-wpsc-individual-ticket.php:1009
    33873391#: includes/models/class-wpsc-thread.php:593
    33883392msgid "replied"
    33893393msgstr ""
    33903394
    3391 #: includes/admin/tickets/class-wpsc-individual-ticket.php:1051
     3395#: includes/admin/tickets/class-wpsc-individual-ticket.php:1013
    33923396#: includes/models/class-wpsc-thread.php:597
    33933397msgid "added a note"
     
    33953399
    33963400#. translators: %1$s: customer name, %2$s: datetime
    3397 #: includes/admin/tickets/class-wpsc-individual-ticket.php:1093
     3401#: includes/admin/tickets/class-wpsc-individual-ticket.php:1055
    33983402#, php-format
    33993403msgid "This thread was deleted by %1$s on %2$s."
    34003404msgstr ""
    34013405
    3402 #: includes/admin/tickets/class-wpsc-individual-ticket.php:1099
     3406#: includes/admin/tickets/class-wpsc-individual-ticket.php:1061
    34033407msgid "View thread!"
    34043408msgstr ""
    34053409
    3406 #: includes/admin/tickets/class-wpsc-individual-ticket.php:1111
     3410#: includes/admin/tickets/class-wpsc-individual-ticket.php:1073
    34073411msgid "View More ..."
    34083412msgstr ""
    34093413
    3410 #: includes/admin/tickets/class-wpsc-individual-ticket.php:1120
    3411 #: includes/admin/tickets/class-wpsc-individual-ticket.php:2542
    3412 #: includes/admin/tickets/class-wpsc-individual-ticket.php:2582
    3413 #: includes/admin/tickets/class-wpsc-individual-ticket.php:2670
     3414#: includes/admin/tickets/class-wpsc-individual-ticket.php:1082
     3415#: includes/admin/tickets/class-wpsc-individual-ticket.php:2520
     3416#: includes/admin/tickets/class-wpsc-individual-ticket.php:2560
     3417#: includes/admin/tickets/class-wpsc-individual-ticket.php:2648
    34143418msgid "Attachments:"
    34153419msgstr ""
    34163420
    34173421#. translators: %1$s: customer name, %2$s: date time
    3418 #: includes/admin/tickets/class-wpsc-individual-ticket.php:1155
     3422#: includes/admin/tickets/class-wpsc-individual-ticket.php:1117
    34193423#, php-format
    34203424msgid "Modified by %1$s on %2$s."
    34213425msgstr ""
    34223426
    3423 #: includes/admin/tickets/class-wpsc-individual-ticket.php:1161
     3427#: includes/admin/tickets/class-wpsc-individual-ticket.php:1123
    34243428msgid "View change"
    34253429msgstr ""
    34263430
    34273431#. translators: %1$s: customer name, %2$s: date time
    3428 #: includes/admin/tickets/class-wpsc-individual-ticket.php:1169
     3432#: includes/admin/tickets/class-wpsc-individual-ticket.php:1131
    34293433#, php-format
    34303434msgid "Deleted by %1$s on %2$s"
     
    34323436
    34333437#. translators: %1$s: customer name, %2$s: date time
    3434 #: includes/admin/tickets/class-wpsc-individual-ticket.php:1178
     3438#: includes/admin/tickets/class-wpsc-individual-ticket.php:1140
    34353439#, php-format
    34363440msgid "Restored by %1$s on %2$s"
     
    34383442
    34393443#. translators: %1$s: Field Name
    3440 #: includes/admin/tickets/class-wpsc-individual-ticket.php:1258
     3444#: includes/admin/tickets/class-wpsc-individual-ticket.php:1220
    34413445#: includes/models/class-wpsc-thread.php:635
    34423446#, php-format
     
    34443448msgstr ""
    34453449
    3446 #: includes/admin/tickets/class-wpsc-individual-ticket.php:1383
    3447 #: includes/admin/tickets/class-wpsc-individual-ticket.php:1401
    3448 #: includes/admin/tickets/class-wpsc-individual-ticket.php:1490
    3449 #: includes/admin/tickets/class-wpsc-individual-ticket.php:1911
     3450#: includes/admin/tickets/class-wpsc-individual-ticket.php:1345
     3451#: includes/admin/tickets/class-wpsc-individual-ticket.php:1363
     3452#: includes/admin/tickets/class-wpsc-individual-ticket.php:1452
     3453#: includes/admin/tickets/class-wpsc-individual-ticket.php:1889
    34503454#: includes/class-wpsc-current-user.php:386
    34513455#: includes/class-wpsc-current-user.php:472
     
    34553459msgstr ""
    34563460
    3457 #: includes/admin/tickets/class-wpsc-individual-ticket.php:1916
     3461#: includes/admin/tickets/class-wpsc-individual-ticket.php:1894
    34583462msgid "Create ticket from thread"
    34593463msgstr ""
    34603464
    3461 #: includes/admin/tickets/class-wpsc-individual-ticket.php:1975
     3465#: includes/admin/tickets/class-wpsc-individual-ticket.php:1953
    34623466msgid "Thread info"
    34633467msgstr ""
    34643468
    3465 #: includes/admin/tickets/class-wpsc-individual-ticket.php:1993
    3466 #: includes/admin/tickets/class-wpsc-individual-ticket.php:1994
    3467 #: includes/admin/tickets/class-wpsc-individual-ticket.php:1995
    3468 #: includes/admin/tickets/class-wpsc-individual-ticket.php:1996
     3469#: includes/admin/tickets/class-wpsc-individual-ticket.php:1971
     3470#: includes/admin/tickets/class-wpsc-individual-ticket.php:1972
     3471#: includes/admin/tickets/class-wpsc-individual-ticket.php:1973
     3472#: includes/admin/tickets/class-wpsc-individual-ticket.php:1974
    34693473#: includes/admin/tickets/widgets/class-wpsc-itw-agentonly-fields.php:111
    34703474#: includes/admin/tickets/widgets/class-wpsc-itw-biographical-info.php:62
     
    34853489msgstr ""
    34863490
    3487 #: includes/admin/tickets/class-wpsc-individual-ticket.php:2042
     3491#: includes/admin/tickets/class-wpsc-individual-ticket.php:2020
    34883492msgid "Seen"
    34893493msgstr ""
    34903494
    3491 #: includes/admin/tickets/class-wpsc-individual-ticket.php:2525
     3495#: includes/admin/tickets/class-wpsc-individual-ticket.php:2503
    34923496msgid "Thread log"
    34933497msgstr ""
     
    36213625
    36223626#: includes/admin/tickets/class-wpsc-tickets.php:86
    3623 #: includes/frontend/class-wpsc-shortcode-one.php:204
     3627#: includes/frontend/class-wpsc-shortcode-one.php:208
    36243628msgid "New Ticket"
    36253629msgstr ""
    36263630
    36273631#: includes/admin/tickets/class-wpsc-tickets.php:96
    3628 #: includes/frontend/class-wpsc-shortcode-one.php:214
     3632#: includes/frontend/class-wpsc-shortcode-one.php:218
    36293633msgid "My Profile"
    36303634msgstr ""
    36313635
    36323636#: includes/admin/tickets/class-wpsc-tickets.php:106
    3633 #: includes/frontend/class-wpsc-shortcode-one.php:224
     3637#: includes/frontend/class-wpsc-shortcode-one.php:228
    36343638msgid "Agent Profile"
    36353639msgstr ""
     
    36913695msgstr ""
    36923696
    3693 #: includes/class-wpsc-cron.php:34
     3697#: includes/class-wpsc-cron.php:38
    36943698msgid "Every one minute"
    36953699msgstr ""
    36963700
    3697 #: includes/class-wpsc-cron.php:39
     3701#: includes/class-wpsc-cron.php:43
    36983702msgid "Every five minutes"
    36993703msgstr ""
     
    39103914msgstr ""
    39113915
    3912 #: includes/class-wpsc-ticket-conditions.php:251
    3913 #: includes/class-wpsc-ticket-conditions.php:262
     3916#: includes/class-wpsc-ticket-conditions.php:259
     3917#: includes/class-wpsc-ticket-conditions.php:270
    39143918#: includes/custom-field-types/class-wpsc-cf-checkbox.php:212
    39153919#: includes/custom-field-types/class-wpsc-cf-date.php:209
     
    39463950msgstr ""
    39473951
    3948 #: includes/class-wpsc-ticket-conditions.php:252
    3949 #: includes/class-wpsc-ticket-conditions.php:263
     3952#: includes/class-wpsc-ticket-conditions.php:260
     3953#: includes/class-wpsc-ticket-conditions.php:271
    39503954#: includes/custom-field-types/class-wpsc-cf-checkbox.php:213
    39513955#: includes/custom-field-types/class-wpsc-cf-date.php:210
     
    39793983msgstr ""
    39803984
    3981 #: includes/class-wpsc-ticket-conditions.php:264
     3985#: includes/class-wpsc-ticket-conditions.php:272
    39823986#: includes/custom-field-types/class-wpsc-cf-checkbox.php:214
    39833987#: includes/custom-field-types/class-wpsc-cf-email.php:214
     
    40034007msgstr ""
    40044008
    4005 #: includes/class-wpsc-ticket-conditions.php:265
     4009#: includes/class-wpsc-ticket-conditions.php:273
    40064010#: includes/custom-field-types/class-wpsc-cf-checkbox.php:215
    40074011#: includes/custom-field-types/class-wpsc-cf-email.php:215
     
    40274031msgstr ""
    40284032
    4029 #: includes/class-wpsc-ticket-conditions.php:325
     4033#: includes/class-wpsc-ticket-conditions.php:333
    40304034msgid "User"
    40314035msgstr ""
  • supportcandy/trunk/includes/admin/tickets/class-wpsc-individual-ticket.php

    r2793251 r2798663  
    212212                wp_send_json_error( new WP_Error( '003', 'Unauthorized!' ), 401 );
    213213            }
    214         }
    215 
    216         /**
    217          * Load ticket for non-ajax based fucntionality like
    218          * bulk delete, change status etc.
    219          * Ignore phpcs nonce issue as we already checked where it is called from.
    220          *
    221          * @param integer $ticket_id - ticket id.
    222          * @return boolean
    223          */
    224         public static function load_ticket( $ticket_id ) {
    225 
    226             $current_user = WPSC_Current_User::$current_user;
    227 
    228             $id = isset( $_POST['ticket_id'] ) ? intval( $_POST['ticket_id'] ) : 0; // phpcs:ignore
    229             if ( ! $ticket_id ) {
    230                 return false;
    231             }
    232 
    233             $ticket = new WPSC_Ticket( $ticket_id );
    234             if ( ! $ticket->id ) {
    235                 return false;
    236             }
    237 
    238             self::$ticket = $ticket;
    239 
    240             // Check whether view profile is a customer.
    241             if ( self::is_customer() ) {
    242                 self::$view_profile = 'customer';
    243             }
    244 
    245             // Check whether view profile is an agent.
    246             if ( $current_user->is_agent && self::has_ticket_cap( 'view' ) ) {
    247                 self::$view_profile = 'agent';
    248             }
    249 
    250             if ( ! self::$view_profile ) {
    251                 return false;
    252             }
    253 
    254             // Check if ticket is deleted and whether current user has access to deleted tickets.
    255             if ( ! self::$ticket->is_active && ! ( self::$view_profile == 'agent' && $current_user->agent->has_cap( 'dtt-access' ) ) ) {
    256                 return false;
    257             }
    258 
    259             return true;
    260214        }
    261215
     
    784738                        </div>
    785739                    </div>
     740                    <?php
     741                    $recaptcha = get_option( 'wpsc-recaptcha-settings' );
     742                    if ( $recaptcha['allow-recaptcha'] === 1 && $recaptcha['recaptcha-version'] == 3 && $recaptcha['recaptcha-site-key'] && $recaptcha['recaptcha-secret-key'] ) {
     743                        ?>
     744                        <script src="https://www.google.com/recaptcha/api.js?render=<?php echo esc_attr( $recaptcha['recaptcha-site-key'] ); ?>"></script> <?php // phpcs:ignore ?>
     745                        <?php
     746                    }
     747                    ?>
    786748                </form>
    787749            </div>
     
    17481710                    'df_sf_rating',
    17491711                    'df_time_spent',
     1712                    'df_usergroups',
    17501713                )
    17511714            );
     
    18011764                wp_send_json_error( 'Unauthorised request!', 401 );
    18021765            }
     1766
     1767            $current_user = WPSC_Current_User::$current_user;
     1768            if ( ! $current_user->is_agent ) {
     1769                wp_send_json_error( 'Unauthorised request!', 401 );
     1770            }
     1771
    18031772            self::load_current_ticket();
    1804             self::delete_ticket( self::$ticket->id );
     1773
     1774            if ( ! self::$ticket->is_active || ! self::has_ticket_cap( 'dtt' ) ) {
     1775                wp_send_json_error( 'Unauthorised request!', 401 );
     1776            }
     1777
     1778            self::delete_ticket();
    18051779            wp_die();
    18061780        }
    18071781
    18081782        /**
    1809          * Delete ticket
    1810          *
    1811          * @param integer $ticket_id - ticket id.
    1812          * @return void
    1813          */
    1814         public static function delete_ticket( $ticket_id ) {
    1815 
    1816             $flag = self::load_ticket( $ticket_id );
    1817             if ( ! $flag ) {
    1818                 return;
    1819             }
     1783         * Delete current ticket
     1784         *
     1785         * @return void
     1786         */
     1787        public static function delete_ticket() {
    18201788
    18211789            self::$ticket->is_active = 0;
     1790            self::$ticket->date_updated = new DateTime();
    18221791            self::$ticket->save();
    18231792            do_action( 'wpsc_delete_ticket', self::$ticket );
     
    18351804            }
    18361805
     1806            $current_user = WPSC_Current_User::$current_user;
     1807            if ( ! $current_user->is_agent ) {
     1808                wp_send_json_error( 'Unauthorised request!', 401 );
     1809            }
     1810
    18371811            self::load_current_ticket();
    1838             self::restore_ticket( self::$ticket->id );
     1812
     1813            if ( self::$ticket->is_active || ! self::has_ticket_cap( 'dtt' ) ) {
     1814                wp_send_json_error( 'Unauthorised request!', 401 );
     1815            }
     1816
     1817            self::restore_ticket();
    18391818            wp_die();
    18401819        }
    18411820
    18421821        /**
    1843          * Restore ticket
    1844          *
    1845          * @param integer $ticket_id - ticket id.
    1846          * @return void
    1847          */
    1848         public static function restore_ticket( $ticket_id ) {
    1849 
    1850             $flag = self::load_ticket( $ticket_id );
    1851             if ( ! $flag ) {
    1852                 return;
    1853             }
     1822         * Restore current ticket
     1823         *
     1824         * @return void
     1825         */
     1826        public static function restore_ticket() {
    18541827
    18551828            self::$ticket->is_active = 1;
     1829            self::$ticket->date_updated = new DateTime();
    18561830            self::$ticket->save();
    18571831            do_action( 'wpsc_ticket_restore', self::$ticket );
     
    18691843            }
    18701844
     1845            $current_user = WPSC_Current_User::$current_user;
     1846            if ( ! $current_user->is_agent ) {
     1847                wp_send_json_error( 'Unauthorised request!', 401 );
     1848            }
     1849
    18711850            self::load_current_ticket();
    1872             self::delete_permanently( self::$ticket->id );
     1851
     1852            if ( self::$ticket->is_active || ! self::has_ticket_cap( 'dtt' ) ) {
     1853                wp_send_json_error( 'Unauthorised request!', 401 );
     1854            }
     1855
     1856            self::delete_permanently();
    18731857            wp_die();
    18741858        }
    18751859
    18761860        /**
    1877          * Permanently delete ticket
    1878          *
    1879          * @param integer $ticket_id - ticket id.
    1880          * @return void
    1881          */
    1882         public static function delete_permanently( $ticket_id ) {
    1883 
    1884             $flag = self::load_ticket( $ticket_id );
    1885             if ( ! $flag ) {
    1886                 return;
    1887             }
     1861         * Permanently delete current ticket
     1862         *
     1863         * @return void
     1864         */
     1865        public static function delete_permanently() {
    18881866
    18891867            WPSC_Ticket::destroy( self::$ticket );
    1890             do_action( 'wpsc_ticket_delete_permanently', $ticket_id );
     1868            do_action( 'wpsc_ticket_delete_permanently', self::$ticket->id );
    18911869        }
    18921870
     
    21012079            }
    21022080
    2103             $ignore_cft = apply_filters( 'wpsc_thread_new_ticket_ignore_cft', array( 'cf_html', 'df_description', 'df_id', 'df_ip_address', 'df_browser', 'df_assigned_agent', 'df_add_recipients', 'df_ip_address', 'df_os', 'df_prev_assignee', 'df_date_closed', 'df_sf_rating', 'df_sf_feedback', 'df_sf_date', 'df_time_spent', 'df_sla', 'df_last_reply_on', 'df_last_reply_by' ) );
     2081            $ignore_cft = apply_filters( 'wpsc_thread_new_ticket_ignore_cft', array( 'cf_html', 'df_description', 'df_id', 'df_ip_address', 'df_browser', 'df_assigned_agent', 'df_add_recipients', 'df_ip_address', 'df_os', 'df_prev_assignee', 'df_date_closed', 'df_sf_rating', 'df_sf_feedback', 'df_sf_date', 'df_time_spent', 'df_sla', 'df_last_reply_on', 'df_last_reply_by', 'df_usergroups' ) );
    21042082            $data       = array();
    21052083            foreach ( WPSC_Custom_Field::$custom_fields as $cf ) {
  • supportcandy/trunk/includes/admin/tickets/class-wpsc-ticket-list.php

    r2793251 r2798663  
    20452045            }
    20462046
     2047            $current_user = WPSC_Current_User::$current_user;
     2048            if ( ! $current_user->is_agent ) {
     2049                wp_send_json_error( 'Unauthorised request!', 401 );
     2050            }
     2051
    20472052            $ticket_ids = isset( $_POST['ticket_ids'] ) ? array_filter( array_map( 'intval', $_POST['ticket_ids'] ) ) : array();
    20482053            if ( ! $ticket_ids ) {
     
    20532058
    20542059                $ticket = new WPSC_Ticket( $ticket_id );
    2055                 if ( ! $ticket->id ) {
     2060                WPSC_Individual_Ticket::$ticket = $ticket;
     2061                if ( ! $ticket->id || ! $ticket->is_active || ! WPSC_Individual_Ticket::has_ticket_cap( 'dtt' ) ) {
    20562062                    continue;
    20572063                }
    20582064
    2059                 WPSC_Individual_Ticket::$ticket = $ticket;
    2060                 $current_user                   = WPSC_Current_User::$current_user;
    2061                 if ( $ticket->is_active && ! ( $current_user->is_agent && WPSC_Individual_Ticket::has_ticket_cap( 'dtt' ) ) ) {
    2062                     continue;
    2063                 }
    2064 
    2065                 WPSC_Individual_Ticket::delete_ticket( $ticket_id );
     2065                WPSC_Individual_Ticket::delete_ticket();
    20662066            }
    20672067            wp_die();
     
    22042204            }
    22052205
     2206            $current_user = WPSC_Current_User::$current_user;
     2207            if ( ! $current_user->is_agent ) {
     2208                wp_send_json_error( 'Unauthorised request!', 401 );
     2209            }
     2210
    22062211            $ticket_ids = isset( $_POST['ticket_ids'] ) ? array_filter( array_map( 'intval', $_POST['ticket_ids'] ) ) : array();
    22072212            if ( ! $ticket_ids ) {
     
    22122217
    22132218                $ticket = new WPSC_Ticket( $ticket_id );
    2214                 if ( ! $ticket->id ) {
     2219                WPSC_Individual_Ticket::$ticket = $ticket;
     2220                if ( ! $ticket->id || $ticket->is_active || ! WPSC_Individual_Ticket::has_ticket_cap( 'dtt' ) ) {
    22152221                    continue;
    22162222                }
    22172223
    2218                 WPSC_Individual_Ticket::$ticket = $ticket;
    2219                 $current_user                   = WPSC_Current_User::$current_user;
    2220                 if ( ! ( $current_user->is_agent && WPSC_Individual_Ticket::has_ticket_cap( 'dtt' ) ) ) {
    2221                     continue;
    2222                 }
    2223 
    2224                 $nonce = wp_create_nonce( 'wpsc_it_ticket_restore' );
    2225                 WPSC_Individual_Ticket::restore_ticket( $ticket_id, $nonce );
     2224                WPSC_Individual_Ticket::restore_ticket();
    22262225            }
    22272226            wp_die();
     
    22362235
    22372236            if ( check_ajax_referer( 'wpsc_bulk_delete_tickets_permanently', '_ajax_nonce', false ) != 1 ) {
     2237                wp_send_json_error( 'Unauthorised request!', 401 );
     2238            }
     2239
     2240            $current_user = WPSC_Current_User::$current_user;
     2241            if ( ! $current_user->is_agent ) {
    22382242                wp_send_json_error( 'Unauthorised request!', 401 );
    22392243            }
     
    22472251
    22482252                $ticket = new WPSC_Ticket( $ticket_id );
    2249                 if ( ! $ticket->id ) {
     2253                WPSC_Individual_Ticket::$ticket = $ticket;
     2254                if ( ! $ticket->id || $ticket->is_active || ! WPSC_Individual_Ticket::has_ticket_cap( 'dtt' ) ) {
    22502255                    continue;
    22512256                }
    22522257
    2253                 WPSC_Individual_Ticket::$ticket = $ticket;
    2254                 $current_user                   = WPSC_Current_User::$current_user;
    2255                 if ( ! ( $current_user->is_agent && WPSC_Individual_Ticket::has_ticket_cap( 'dtt' ) ) ) {
    2256                     continue;
    2257                 }
    2258 
    2259                 WPSC_Individual_Ticket::delete_permanently( $ticket_id );
     2258                WPSC_Individual_Ticket::delete_permanently();
    22602259            }
    22612260            wp_die();
  • supportcandy/trunk/includes/admin/tickets/class-wpsc-tickets.php

    r2766451 r2798663  
    163163                            endforeach;
    164164                            ?>
     165                            <div class="wpsc-tickets-nav log-out" onclick="wpsc_user_logout(this, '<?php echo esc_attr( wp_create_nonce( 'wpsc_user_logout' ) ); ?>');">
     166                                <?php WPSC_Icons::get( 'log-out' ); ?>
     167                                <label><?php echo esc_attr__( 'Logout', 'supportcandy' ); ?></label>
     168                            </div>
    165169                        </div>
    166170                        <div class="wpsc-header wpsc-visible-xs">
     
    213217                        </div>
    214218                    <?php endforeach; ?>
     219                    <div class="wpsc-humbargar-menu-item log-out" onclick="wpsc_user_logout(this, '<?php echo esc_attr( wp_create_nonce( 'wpsc_user_logout' ) ); ?>');">
     220                        <?php WPSC_Icons::get( 'log-out' ); ?>
     221                        <label><?php echo esc_attr__( 'Logout', 'supportcandy' ); ?></label>
     222                    </div>
    215223                </div>
    216224            </div>
  • supportcandy/trunk/includes/class-wpsc-cron.php

    r2763565 r2798663  
    2020            // Schedule cron jobs.
    2121            add_action( 'init', array( __CLASS__, 'schedule_events' ) );
     22
     23            // cron event callbacks.
     24            add_action( 'wpsc_auto_delete_closed_tickets', array( __CLASS__, 'auto_delete_closed_tickets' ) );
     25            add_action( 'wpsc_permenently_delete_tickets', array( __CLASS__, 'permenently_delete_tickets' ) );
    2226        }
    2327
     
    7478                    'daily',
    7579                    'wpsc_cron_daily'
     80                );
     81            }
     82
     83            // Auto-delete closed tickets.
     84            if ( ! wp_next_scheduled( 'wpsc_auto_delete_closed_tickets' ) ) {
     85                wp_schedule_event(
     86                    time(),
     87                    'hourly',
     88                    'wpsc_auto_delete_closed_tickets'
     89                );
     90            }
     91
     92            // Permenently delete tickets.
     93            if ( ! wp_next_scheduled( 'wpsc_permenently_delete_tickets' ) ) {
     94                wp_schedule_event(
     95                    time(),
     96                    'hourly',
     97                    'wpsc_permenently_delete_tickets'
    7698                );
    7799            }
     
    118140            return $date->getTimestamp();
    119141        }
     142
     143        /**
     144         * Auto delete closed ticket after x days/months/years
     145         *
     146         * @return void
     147         */
     148        public static function auto_delete_closed_tickets() {
     149
     150            $tz = wp_timezone();
     151            $today = new DateTime( 'now', $tz );
     152            $transient_label = 'wpsc_auto_delete_closed_tickets_cron_' . $today->format( 'Y-m-d' );
     153            $cron_status = get_transient( $transient_label );
     154            if ( false === $cron_status ) {
     155                $cron_status = 'active';
     156            }
     157
     158            // return if today's tickets finished checking.
     159            if ( $cron_status == 'finished' ) {
     160                return;
     161            }
     162
     163            $ad_settings = get_option( 'wpsc-tl-ms-advanced' );
     164            $ms_settings = get_option( 'wpsc-ms-advanced-settings' );
     165
     166            if ( ! $ms_settings['auto-delete-tickets-time'] ) {
     167                return;
     168            }
     169
     170            $age = clone $today;
     171            switch ( $ms_settings['auto-delete-tickets-unit'] ) {
     172
     173                case 'days':
     174                    $age->sub( new DateInterval( 'P' . $ms_settings['auto-delete-tickets-time'] . 'D' ) );
     175                    break;
     176
     177                case 'month':
     178                    $age->sub( new DateInterval( 'P' . $ms_settings['auto-delete-tickets-time'] . 'M' ) );
     179                    break;
     180
     181                case 'year':
     182                    $age->sub( new DateInterval( 'P' . $ms_settings['auto-delete-tickets-time'] . 'Y' ) );
     183                    break;
     184            }
     185
     186            $tickets = WPSC_Ticket::find(
     187                array(
     188                    'items_per_page' => 20,
     189                    'orderby'        => 'date_closed',
     190                    'order'          => 'ASC',
     191                    'meta_query'     => array(
     192                        'relation' => 'AND',
     193                        array(
     194                            'slug'    => 'status',
     195                            'compare' => 'IN',
     196                            'val'     => $ad_settings['closed-ticket-statuses'],
     197                        ),
     198                        array(
     199                            'slug'    => 'date_closed',
     200                            'compare' => '<',
     201                            'val'     => $age->format( 'Y-m-d' ),
     202                        ),
     203                    ),
     204                )
     205            );
     206
     207            // update cron status.
     208            delete_transient( $transient_label );
     209            $cron_status = $tickets['has_next_page'] ? 'active' : 'finished';
     210            set_transient( $transient_label, $cron_status, MINUTE_IN_SECONDS * 60 * 24 );
     211
     212            // delete applicable tickets.
     213            if ( $tickets['total_items'] > 0 ) {
     214                foreach ( $tickets['results'] as $ticket ) {
     215                    WPSC_Individual_Ticket::$ticket = $ticket;
     216                    WPSC_Individual_Ticket::delete_ticket();
     217                }
     218            }
     219        }
     220
     221        /**
     222         * Permenently delete tickets after x days/months/years
     223         *
     224         * @return void
     225         */
     226        public static function permenently_delete_tickets() {
     227
     228            $tz = wp_timezone();
     229            $today = new DateTime( 'now', $tz );
     230            $transient_label = 'wpsc_permenently_delete_tickets_cron_' . $today->format( 'Y-m-d' );
     231            $cron_status = get_transient( $transient_label );
     232            if ( false === $cron_status ) {
     233                $cron_status = 'active';
     234            }
     235
     236            // return if today's tickets finished checking.
     237            if ( $cron_status == 'finished' ) {
     238                return;
     239            }
     240
     241            $ms_settings = get_option( 'wpsc-ms-advanced-settings' );
     242
     243            if ( ! $ms_settings['permanent-delete-tickets-time'] ) {
     244                return;
     245            }
     246
     247            $age = clone $today;
     248            switch ( $ms_settings['permanent-delete-tickets-unit'] ) {
     249
     250                case 'days':
     251                    $age->sub( new DateInterval( 'P' . $ms_settings['permanent-delete-tickets-time'] . 'D' ) );
     252                    break;
     253
     254                case 'month':
     255                    $age->sub( new DateInterval( 'P' . $ms_settings['permanent-delete-tickets-time'] . 'M' ) );
     256                    break;
     257
     258                case 'year':
     259                    $age->sub( new DateInterval( 'P' . $ms_settings['permanent-delete-tickets-time'] . 'Y' ) );
     260                    break;
     261            }
     262
     263            $tickets = WPSC_Ticket::find(
     264                array(
     265                    'items_per_page' => 5,
     266                    'orderby'        => 'date_closed',
     267                    'order'          => 'ASC',
     268                    'is_active'      => 0,
     269                    'meta_query'     => array(
     270                        'relation' => 'AND',
     271                        array(
     272                            'slug'    => 'date_updated',
     273                            'compare' => '<',
     274                            'val'     => $age->format( 'Y-m-d' ),
     275                        ),
     276                    ),
     277                )
     278            );
     279
     280            // update cron status.
     281            delete_transient( $transient_label );
     282            $cron_status = $tickets['has_next_page'] ? 'active' : 'finished';
     283            set_transient( $transient_label, $cron_status, MINUTE_IN_SECONDS * 60 * 24 );
     284
     285            // delete applicable tickets.
     286            if ( $tickets['total_items'] > 0 ) {
     287                foreach ( $tickets['results'] as $ticket ) {
     288                    WPSC_Individual_Ticket::$ticket = $ticket;
     289                    WPSC_Individual_Ticket::delete_permanently();
     290                }
     291            }
     292        }
    120293    }
    121294endif;
  • supportcandy/trunk/includes/class-wpsc-icons.php

    r2763565 r2798663  
    8282                'arrow-right'          => file_get_contents( WPSC_ABSPATH . 'asset/icons/arrow-right-solid.svg' ), //phpcs:ignore
    8383                'arrow-left'           => file_get_contents( WPSC_ABSPATH . 'asset/icons/arrow-left-solid.svg' ), //phpcs:ignore
     84                'log-out'              => file_get_contents( WPSC_ABSPATH . 'asset/icons/log-out.svg' ), //phpcs:ignore
    8485            );
    8586            self::$icons = apply_filters( 'wpsc_icons', $icons );
  • supportcandy/trunk/includes/class-wpsc-ticket-conditions.php

    r2793251 r2798663  
    7373         * Print condition input in the form
    7474         *
    75          * @param string $relation - relation between conditions (AND/OR).
    76          * @param array  $conditions - conditions to preset.
    77          * @param array  $ignore_cft - ignore custom field types.
    78          * @return void
    79          */
    80         public static function print_condition_input( $relation = 'AND', $conditions = array(), $ignore_cft = array() ) {
     75         * @param string  $relation - relation between conditions (AND/OR).
     76         * @param array   $conditions - conditions to preset.
     77         * @param array   $ignore_cft - ignore custom field types.
     78         * @param boolean $required - condition is required or not.
     79         * @return void
     80         */
     81        public static function print_condition_input( $relation = 'AND', $conditions = array(), $ignore_cft = array(), $required = false ) {
    8182
    8283            $conditions = $conditions ? json_decode( html_entity_decode( $conditions ), true ) : array();
     
    8687                <div class="label-container">
    8788                    <label for="">
    88                         <?php echo esc_attr( wpsc__( 'Conditions', 'supportcandy' ) ); ?>
     89                        <?php
     90                        echo esc_attr( wpsc__( 'Conditions', 'supportcandy' ) );
     91                        if ( $required ) {
     92                            ?>
     93                            <span class="required-char">*</span>
     94                            <?php
     95                        }
     96                        ?>
    8997                    </label>
    9098                </div>
  • supportcandy/trunk/includes/frontend/class-wpsc-shortcode-one.php

    r2793251 r2798663  
    114114                            endforeach;
    115115                            ?>
     116                            <div class="wpsc-tickets-nav log-out" onclick="wpsc_user_logout(this, '<?php echo esc_attr( wp_create_nonce( 'wpsc_user_logout' ) ); ?>');">
     117                                <?php WPSC_Icons::get( 'log-out' ); ?>
     118                                <label><?php echo esc_attr__( 'Logout', 'supportcandy' ); ?></label>
     119                            </div>
    116120                            </div>
    117121                            <div class="wpsc-header wpsc-visible-xs">
     
    280284                        </div>
    281285                    <?php endforeach; ?>
     286                    <div class="wpsc-humbargar-menu-item log-out" onclick="wpsc_user_logout(this, '<?php echo esc_attr( wp_create_nonce( 'wpsc_user_logout' ) ); ?>');">
     287                        <?php WPSC_Icons::get( 'log-out' ); ?>
     288                        <label><?php echo esc_attr__( 'Logout', 'supportcandy' ); ?></label>
     289                    </div>
    282290                </div>
    283291            </div>
  • supportcandy/trunk/includes/models/class-wpsc-agent.php

    r2793251 r2798663  
    10231023        public static function delete_ticket( $ticket ) {
    10241024
     1025            $tl_advanced = get_option( 'wpsc-tl-ms-advanced' );
     1026            if ( in_array( $ticket->status->id, $tl_advanced['closed-ticket-statuses'] ) ) {
     1027                return;
     1028            }
     1029
    10251030            // reset workload for applicable agents.
    10261031            foreach ( $ticket->assigned_agent as $agent ) {
     1032                if ( ! $agent->is_active ) {
     1033                    continue;
     1034                }
    10271035                $agent->reset_workload();
    10281036            }
     
    10311039            $agents = $ticket->get_current_read_permission_agents();
    10321040            foreach ( $agents as $agent ) {
     1041                if ( ! $agent->is_active ) {
     1042                    continue;
     1043                }
    10331044                $agent->reset_unresolved_count();
    10341045            }
     
    10421053         */
    10431054        public static function restore_ticket( $ticket ) {
     1055
     1056            $tl_advanced = get_option( 'wpsc-tl-ms-advanced' );
     1057            if ( in_array( $ticket->status->id, $tl_advanced['closed-ticket-statuses'] ) ) {
     1058                return;
     1059            }
    10441060
    10451061            // reset workload for applicable agents.
    10461062            foreach ( $ticket->assigned_agent as $agent ) {
     1063                if ( ! $agent->is_active ) {
     1064                    continue;
     1065                }
    10471066                $agent->reset_workload();
    10481067            }
     
    10511070            $agents = $ticket->get_current_read_permission_agents();
    10521071            foreach ( $agents as $agent ) {
     1072                if ( ! $agent->is_active ) {
     1073                    continue;
     1074                }
    10531075                $agent->reset_unresolved_count();
    10541076            }
  • supportcandy/trunk/includes/models/class-wpsc-ticket.php

    r2769683 r2798663  
    4848            // Get object of this class.
    4949            add_filter( 'wpsc_load_ref_classes', array( __CLASS__, 'load_ref_class' ) );
    50 
    51             // Auto delete tickets.
    52             add_action( 'wpsc_cron_daily', array( __CLASS__, 'auto_delete_tickets' ) );
    53 
    54             // Auto delete tickets.
    55             add_action( 'wpsc_cron_daily', array( __CLASS__, 'permanent_delete_tickets' ) );
    5650        }
    5751
     
    974968            return $results ? $results[0] : false;
    975969        }
    976 
    977         /**
    978          * Auto delete tickets
    979          *
    980          * @return void
    981          */
    982         public static function auto_delete_tickets() {
    983 
    984             $ad_settings = get_option( 'wpsc-tl-ms-advanced' );
    985             $ms_settings = get_option( 'wpsc-ms-advanced-settings' );
    986 
    987             if ( $ms_settings['auto-delete-tickets-time'] ) :
    988 
    989                 $filters = array(
    990                     'meta_query' => array(
    991                         'relation' => 'AND',
    992                         array(
    993                             'slug'    => 'status',
    994                             'compare' => 'IN',
    995                             'val'     => $ad_settings['closed-ticket-statuses'],
    996                         ),
    997                     ),
    998                 );
    999 
    1000                 $tickets = self::find( $filters )['results'];
    1001                 foreach ( $tickets as $ticket ) :
    1002 
    1003                     $now  = new DateTime();
    1004                     $diff = $now->diff( $ticket->date_closed );
    1005                     switch ( $ms_settings['auto-delete-tickets-unit'] ) {
    1006 
    1007                         case 'days':
    1008                             if ( $diff->days > $ms_settings['auto-delete-tickets-time'] ) :
    1009 
    1010                                 $ticket->is_active = 0;
    1011                                 $ticket->save();
    1012 
    1013                                 do_action( 'wpsc_delete_ticket', $ticket );
    1014                             endif;
    1015                             break;
    1016 
    1017                         case 'month':
    1018                             $months = ( $diff->y * 12 ) + $diff->m;
    1019                             if ( $months > $ms_settings['auto-delete-tickets-time'] ) :
    1020 
    1021                                 $ticket->is_active = 0;
    1022                                 $ticket->save();
    1023 
    1024                                 do_action( 'wpsc_delete_ticket', $ticket );
    1025                             endif;
    1026                             break;
    1027 
    1028                         case 'year':
    1029                             if ( $diff->y > $ms_settings['auto-delete-tickets-time'] ) :
    1030 
    1031                                 $ticket->is_active = 0;
    1032                                 $ticket->save();
    1033 
    1034                                 do_action( 'wpsc_delete_ticket', $ticket );
    1035                             endif;
    1036                             break;
    1037                     }
    1038                 endforeach;
    1039             endif;
    1040         }
    1041 
    1042         /**
    1043          * Permenently delete tickets cron
    1044          *
    1045          * @return void
    1046          */
    1047         public static function permanent_delete_tickets() {
    1048 
    1049             $ms_settings = get_option( 'wpsc-ms-advanced-settings' );
    1050             if ( $ms_settings['permanent-delete-tickets-time'] ) :
    1051 
    1052                 $filters = array(
    1053                     'items_per_page' => 0,
    1054                     'is_active'      => 0,
    1055                 );
    1056 
    1057                 $tickets = self::find( $filters )['results'];
    1058                 foreach ( $tickets as $ticket ) :
    1059 
    1060                     $now  = new DateTime();
    1061                     $diff = $now->diff( $ticket->date_updated );
    1062                     switch ( $ms_settings['permanent-delete-tickets-unit'] ) {
    1063 
    1064                         case 'days':
    1065                             if ( $diff->days > $ms_settings['permanent-delete-tickets-time'] ) :
    1066                                 self::destroy( $ticket );
    1067                             endif;
    1068                             break;
    1069 
    1070                         case 'month':
    1071                             $months = ( $diff->y * 12 ) + $diff->m;
    1072                             if ( $months > $ms_settings['permanent-delete-tickets-time'] ) :
    1073                                 self::destroy( $ticket );
    1074                             endif;
    1075                             break;
    1076 
    1077                         case 'year':
    1078                             if ( $diff->y > $ms_settings['permanent-delete-tickets-time'] ) :
    1079                                 self::destroy( $ticket );
    1080                             endif;
    1081                             break;
    1082                     }
    1083                 endforeach;
    1084             endif;
    1085         }
    1086970    }
    1087971endif;
  • supportcandy/trunk/readme.txt

    r2793251 r2798663  
    66Tested up to: 6.0
    77Requires PHP: 7.4
    8 Stable tag: 3.0.8
     8Stable tag: 3.0.9
    99
    1010== Description ==
     
    7777* Spanish (Spain)
    7878* Chinese (China)
     79* Chinese (Traditional)
    7980* Russian
    8081* Hebrew
     82* Greek
    8183
    8284If you are a translator, you can get free access to all premium add-ons for a year in exchange for translating them into your language if it is not available already. We will renew the Premium subscription next year if you continue contributing to the translation. If interested, don't hesitate to contact us via our [support page](https://supportcandy.net/support-ticket/).
     
    99101
    100102== Changelog ==
     103
     104= 3.0.9 (October 14, 2022) =
     105* New: Logout button added on the top header.
     106* Fix: Auto delete closed tickets improvements.
     107* Fix: Permanently delete tickets improvements.
     108* Fix: Installation bugs fixed.
     109* Fix: Attachment error if used with Google reCaptcha version 3.
    101110
    102111= 3.0.8 (October 03, 2022) =
  • supportcandy/trunk/supportcandy.php

    r2793251 r2798663  
    44 * Plugin URI: https://wordpress.org/plugins/supportcandy/
    55 * Description: Easy & Powerful support ticket system for WordPress
    6  * Version: 3.0.8
     6 * Version: 3.0.9
    77 * Author: SupportCandy
    88 * Author URI: https://supportcandy.net/
     
    3131         * @var string
    3232         */
    33         public static $version = '3.0.8';
     33        public static $version = '3.0.9';
    3434
    3535        /**
Note: See TracChangeset for help on using the changeset viewer.