| @@ -754,13 +754,14 @@ | ||
| 754 | 754 | <th class="mxch-leads-col-lead"><?php esc_html_e('Lead', 'mxchat'); ?></th> |
| 755 | 755 | <th class="mxch-leads-col-count"><?php esc_html_e('Conversations', 'mxchat'); ?></th> |
| 756 | 756 | <th class="mxch-leads-col-last"><?php esc_html_e('Last seen', 'mxchat'); ?></th> |
| 757 | 757 | <th class="mxch-leads-col-page"><?php esc_html_e('Top page', 'mxchat'); ?></th> |
| 758 | + <th class="mxch-leads-col-consent"><?php esc_html_e('Consent', 'mxchat'); ?></th> | |
| 758 | 759 | <th class="mxch-leads-col-actions"></th> |
| 759 | 760 | </tr> |
| 760 | 761 | </thead> |
| 761 | 762 | <tbody id="mxch-leads-tbody"> |
| 762 | - <tr><td colspan="6" class="mxch-leads-loading"><span class="spinner is-active"></span></td></tr> | |
| 763 | + <tr><td colspan="7" class="mxch-leads-loading"><span class="spinner is-active"></span></td></tr> | |
| 763 | 764 | </tbody> |
| 764 | 765 | </table> |
| 765 | 766 | </div> |
| 766 | 767 | |
| @@ -832,14 +833,15 @@ | ||
| 832 | 833 | </div> |
| 833 | 834 | |
| 834 | 835 | <div class="mxch-field"> |
| 835 | 836 | <label class="mxch-field-label"><?php esc_html_e('Notification Email', 'mxchat'); ?></label> |
| 836 | - <input type="email" | |
| 837 | + <?php /* type="text", not "email": the browser rejects a comma-separated list outright (plan 2f131a). Validation is server-side in MxChat_Utils. */ ?> | |
| 838 | + <input type="text" | |
| 837 | 839 | name="mxchat_transcripts_options[mxchat_notification_email]" |
| 838 | 840 | class="mxch-input mxchat-autosave-field" |
| 839 | 841 | value="<?php echo esc_attr($email); ?>" |
| 840 | 842 | data-nonce="<?php echo wp_create_nonce('mxchat_autosave_nonce'); ?>"> |
| 841 | - <p class="mxch-field-description"><?php esc_html_e('Email address where notifications will be sent.', 'mxchat'); ?></p> | |
| 843 | + <p class="mxch-field-description"><?php printf(esc_html__('Email address where notifications will be sent. Separate up to %d addresses with commas. Defaults to the site admin email.', 'mxchat'), (int) MxChat_Utils::NOTIFICATION_EMAIL_MAX); ?></p> | |
| 842 | 844 | </div> |
| 843 | 845 | </div> |
| 844 | 846 | </div> |
| 845 | 847 | |
| @@ -911,8 +913,9 @@ | ||
| 911 | 913 | </div> |
| 912 | 914 | <div class="mxch-card-body"> |
| 913 | 915 | <?php |
| 914 | 916 | $auto_delete = isset($options['mxchat_auto_delete_transcripts']) ? $options['mxchat_auto_delete_transcripts'] : 'never'; |
| 917 | + $mxch_custom_retention = isset($options['mxchat_retention_days']) ? (int) $options['mxchat_retention_days'] : 0; | |
| 915 | 918 | ?> |
| 916 | 919 | <div class="mxch-field"> |
| 917 | 920 | <label class="mxch-field-label"><?php esc_html_e('Auto-Delete Old Transcripts', 'mxchat'); ?></label> |
| 918 | 921 | <select name="mxchat_transcripts_options[mxchat_auto_delete_transcripts]" |
| @@ -923,8 +926,19 @@ | ||
| 923 | 926 | <option value="2weeks" <?php selected($auto_delete, '2weeks'); ?>><?php esc_html_e('After 2 Weeks', 'mxchat'); ?></option> |
| 924 | 927 | <option value="1month" <?php selected($auto_delete, '1month'); ?>><?php esc_html_e('After 1 Month', 'mxchat'); ?></option> |
| 925 | 928 | </select> |
| 926 | 929 | <p class="mxch-field-description"><?php esc_html_e('Automatically delete old chat transcripts to manage database size and privacy.', 'mxchat'); ?></p> |
| 930 | + <?php if ($mxch_custom_retention > 0) : ?> | |
| 931 | + <p class="mxch-field-description" id="mxchat-retention-override-note"> | |
| 932 | + <strong><?php | |
| 933 | + printf( | |
| 934 | + /* translators: %d: the custom retention value in days */ | |
| 935 | + esc_html__('Overridden by Custom Retention below: transcripts are deleted after %d days.', 'mxchat'), | |
| 936 | + $mxch_custom_retention | |
| 937 | + ); | |
| 938 | + ?></strong> | |
| 939 | + </p> | |
| 940 | + <?php endif; ?> | |
| 927 | 941 | <?php |
| 928 | 942 | // Surface the cron's real state next to the setting that |
| 929 | 943 | // depends on it (plan-bc08a6): a configured retention whose |
| 930 | 944 | // cleanup event is missing was previously invisible. |
| @@ -945,8 +959,22 @@ | ||
| 945 | 959 | } |
| 946 | 960 | ?> |
| 947 | 961 | </p> |
| 948 | 962 | <?php endif; ?> |
| 963 | + </div> | |
| 964 | + | |
| 965 | + <div class="mxch-field"> | |
| 966 | + <label class="mxch-field-label" for="mxchat_retention_days"><?php esc_html_e('Custom Retention (Days)', 'mxchat'); ?></label> | |
| 967 | + <input type="number" | |
| 968 | + id="mxchat_retention_days" | |
| 969 | + name="mxchat_transcripts_options[mxchat_retention_days]" | |
| 970 | + class="mxch-input mxchat-autosave-field" | |
| 971 | + value="<?php echo esc_attr($mxch_custom_retention); ?>" | |
| 972 | + min="0" | |
| 973 | + max="3650" | |
| 974 | + step="1" | |
| 975 | + data-nonce="<?php echo wp_create_nonce('mxchat_autosave_nonce'); ?>"> | |
| 976 | + <p class="mxch-field-description"><?php esc_html_e('Delete transcripts older than this many days (1–3650). When greater than 0 this overrides the dropdown above; set 0 to use the dropdown. Developers can adjust the final value with the mxchat_transcript_retention_days filter.', 'mxchat'); ?></p> | |
| 949 | 977 | </div> |
| 950 | 978 | </div> |
| 951 | 979 | </div> |
| 952 | 980 | |