Plugin Directory

Changeset 2701411


Ignore:
Timestamp:
03/29/2022 04:33:27 PM (4 years ago)
Author:
simpleform
Message:

fix: incorrect display of the number of entries when moved and incorrect displaying of form status
fix: backslashes removed and line breaks preserved in the message
refactor: restyling of entry data page

Location:
simpleform-contact-form-submissions
Files:
31 added
13 edited

Legend:

Unmodified
Added
Removed
  • simpleform-contact-form-submissions/trunk/README.txt

    r2664815 r2701411  
    66Tested up to: 5.9
    77Requires PHP: 5.6
    8 Stable tag: 2.0
     8Stable tag: 2.0.1
    99License: GPLv2 or later
    1010License URI: https://www.gnu.org/licenses/gpl-2.0.html
     
    8686
    8787== Changelog ==
     88
     89= 2.0.1 (29 March 2022) =
     90* Fixed: the line breaks are preserved in the message
     91* Fixed: backslashes removed in the message
     92* Fixed: incorrect display of the number of entries when entries have been moved
     93* Fixed: incorrect displaying of form status
     94* Fixed: deprecated jQuery functions warning
     95* Changed: restyling of entry data page
     96* Changed: last entries data are recovered upon the plugin activation
    8897
    8998= 2.0 (25 January 2022) =
  • simpleform-contact-form-submissions/trunk/admin/class-admin.php

    r2664815 r2701411  
    333333   
    334334          if ( $last_message ) {
    335            echo '<div id="last-submission"><h3><span class="dashicons dashicons-buddicons-pm"></span>'.__('Last Message Received', 'simpleform-contact-form-submissions' ).'</h3>'.$last_message . '</div>'; echo '<div id="submissions-notice" class="unseen"><h3><span class="dashicons dashicons-editor-help"></span>'.__('Before you go crazy looking for the received messages', 'simpleform-contact-form-submissions' ).'</h3>'.__('Submissions data is not stored in the WordPress database. Open the General Tab in the Settings page, and check the Data Storing option for enabling the display of messages in the dashboard. By default, only last message is temporarily stored. Therefore, it is recommended that you verify the correct SMTP server configuration in case of use, and always keep the notification email enabled if you want to be sure to receive the messages.', 'simpleform-contact-form-submissions' ).'</div>';
     335           echo '<div id="last-submission"><h3><span class="dashicons dashicons-buddicons-pm"></span>'.__('Last Message Received', 'simpleform-contact-form-submissions' ).'</h3>' . wpautop($last_message) . '</div>'; echo '<div id="submissions-notice" class="unseen"><h3><span class="dashicons dashicons-editor-help"></span>'.__('Before you go crazy looking for the received messages', 'simpleform-contact-form-submissions' ).'</h3>'.__('Submissions data is not stored in the WordPress database. Open the General Tab in the Settings page, and check the Data Storing option for enabling the display of messages in the dashboard. By default, only last message is temporarily stored. Therefore, it is recommended that you verify the correct SMTP server configuration in case of use, and always keep the notification email enabled if you want to be sure to receive the messages.', 'simpleform-contact-form-submissions' ).'</div>';
    336336          }
    337337          else  {
     
    491491      else {
    492492       global $wpdb;
    493        $table = $wpdb->prefix . 'sform_submissions';
    494493       $id = isset($_POST['entry']) ? intval($_POST['entry']) : '0';
     494       $selected_form = isset($_POST['selected-form']) ? intval($_POST['selected-form']) : '';
    495495       $entries_counter = isset($_POST['entries-counter']) ? intval($_POST['entries-counter']) : '1';
    496        $entry_data = $wpdb->get_row( "SELECT form, moved_from, status, previous_status, trash_date, movable FROM {$wpdb->prefix}sform_submissions WHERE id = '{$id}'", 'ARRAY_A' );
     496       $entry_data = $wpdb->get_row( "SELECT form, moved_from, date, status, previous_status, trash_date, movable FROM {$wpdb->prefix}sform_submissions WHERE id = '{$id}'", 'ARRAY_A' );
    497497       $current_status = $entry_data['status'];
    498498       $status = isset($_POST['message-status']) ? sanitize_text_field($_POST['message-status']) : 'read';
     
    500500       $entries_view = isset($_POST['entries-view']) ? sanitize_text_field($_POST['entries-view']) : '';
    501501       $previous_status = $status == $current_status ? $entry_data['previous_status'] : $current_status;
     502       $entry_timestamp = strtotime($entry_data['date']);
    502503       $form_id = $entry_data['form'];
    503504       $entry_moved_from = $entry_data['moved_from'];
     
    514515       if ( empty($entries_view) ) {           
    515516         if ( ( $current_status != 'spam' && $current_status != 'trash' && ( $status == 'spam' || $status == 'trash' ) ) ) { $newcounter = $entries_counter - 1; }
    516          // elseif ( ( $current_status == 'spam' || $current_status == 'trash' ) && $status != 'spam' && $status != 'trash' ) { $newcounter = $entries_counter + 1; }
    517517         elseif ( ( $current_status == 'spam' || $current_status == 'trash' ) && ( $status == 'spam' || $status == 'trash' ) ) { $newcounter = $entries_counter - 1; }
    518518         else  { $newcounter = $entries_counter; }
     
    538538         else  { $newcounter = $entries_counter; }
    539539       }
     540       
     541       if ( $selected_form && $entries_form != $moveto ) {         
     542          $newcounter = $entries_counter - 1;
     543       }
    540544             
    541545       if ( !$entry_data) {
     
    556560       if ( in_array($status, array('new','read','answered','spam','trash')) ) {
    557561         
    558          $update_data = $wpdb->update($table, array( 'form' => $moveto, 'moved_from' => $moved_from, 'status' => $status, 'previous_status' => $previous_status, 'trash_date' => $trash_date, 'movable' => $movable ), array('id' => $id));
     562         $update_data = $wpdb->update($wpdb->prefix . 'sform_submissions', array( 'form' => $moveto, 'moved_from' => $moved_from, 'status' => $status, 'previous_status' => $previous_status, 'trash_date' => $trash_date, 'movable' => $movable ), array('id' => $id));
    559563         
    560564         if ( $update_data ) {
     565             
     566           $forms = $wpdb->get_col( "SELECT id FROM {$wpdb->prefix}sform_shortcodes" );
     567           foreach($forms as $form) {
     568             $count_moved = $wpdb->get_var("SELECT COUNT(id) FROM {$wpdb->prefix}sform_submissions WHERE moved_from = '$form' AND object != '' AND object != 'not stored'");
     569             $count_entries = $wpdb->get_var("SELECT COUNT(id) FROM {$wpdb->prefix}sform_submissions WHERE form = '$form' AND object != '' AND object != 'not stored'");
     570             $wpdb->update($wpdb->prefix . 'sform_shortcodes', array('entries' => $count_entries, 'moved_entries' => $count_moved ), array('id' => $form ) );
     571           }
    561572           
     573           $util = new SimpleForm_Submissions_Util();     
     574           $util->update_last_messages( $entry_timestamp, $moved_from, $moveto );
     575           
    562576           $msg = '';
    563577           
     
    585599     
    586600           $message = __('Entry data has been updated', 'simpleform-contact-form-submissions' ) . $msg;
    587            
     601           
    588602           if ( $status == 'new' ) {   
    589603               echo json_encode(array('error' => false, 'update' => true, 'newstatus' => $status, 'prevstatus' => $current_status, 'bubble' => true, 'entries' => $newcounter, 'formname' => $form_name, 'view' => $view, 'moving' => $moving, 'options' => $options, 'message' => $message ));
     
    594608               echo json_encode(array('error' => false, 'update' => true, 'newstatus' => $status, 'prevstatus' => $current_status, 'bubble' => false, 'entries' => $newcounter, 'formname' => $form_name, 'view' => $view, 'moving' => $moving, 'options' => $options, 'message' => $message ));
    595609               exit;
    596             } 
    597              
     610            }
     611           
    598612         }
    599613         
     
    635649        require_once SIMPLEFORM_SUBMISSIONS_PATH . 'includes/class-activator.php';
    636650        SimpleForm_Submissions_Activator::change_db();
     651        SimpleForm_Submissions_Activator::entries_data_recovery();
    637652       }
    638653       
     
    656671             $count_entries = $wpdb->get_var("SELECT COUNT(id) FROM {$wpdb->prefix}sform_submissions WHERE form = '$form' AND object != '' AND object != 'not stored'");
    657672             $count_moved = $wpdb->get_var("SELECT COUNT(id) FROM {$wpdb->prefix}sform_submissions WHERE moved_from = '$form' AND object != '' AND object != 'not stored'");
    658              // $status = $count_entries == '0' ? 'unused' : 'used';
    659673             $form_status = $wpdb->get_var("SELECT status FROM {$wpdb->prefix}sform_shortcodes WHERE id = '$form'");
    660              if ( $form_status != 'trash' ) { $status = $count_entries == '0' ? 'unused' : 'used'; }
     674             if ( $form_status != 'trash' ) { $status = $count_entries == '0' ? 'draft' : 'published'; }
    661675             else { $status = 'trash'; }
    662676             $wpdb->update($table_shortcodes, array('status' => $status, 'entries' => $count_entries, 'moved_entries' => $count_moved ), array('id' => $form ) );
     
    893907          }
    894908         
    895           $referer_view = explode('&view=', $referer_url)[1];
    896           $view = isset($referer_view) ? explode('&', $referer_view)[0] : 'inbox';
     909          $view = isset(explode('&view=', $referer_url)[1]) ? explode('&', explode('&view=', $referer_url)[1])[0] : 'inbox';
    897910          $sform_list_table->prepare_items();
    898911          if ( $view == 'inbox' ) { $filter_by_view = "status != 'trash' AND status != 'spam'"; }
     
    926939          }
    927940 
    928           $view_arg = explode('&view=', $referer_url)[1];
    929           $referer_view = isset($view_arg) ? explode('&', $view_arg)[0] : 'inbox';
     941          $referer_view = isset(explode('&view=', $referer_url)[1]) ? explode('&', explode('&view=', $referer_url)[1])[0] : 'inbox';
    930942          $view = $referer_view != 'inbox' ? '&view='.$referer_view : '';
    931943          $removed_args = array( 'action', 'action2', '_wp_http_referer', '_wpnonce' );
  • simpleform-contact-form-submissions/trunk/admin/css/admin.css

    r2664815 r2701411  
    5959#navigation-buttons { position: relative; margin-bottom: 10px; padding: 0 4px; }
    6060#messages-nav { text-align: center; padding-top: 10px; height: 20px; position: relative; }
    61 #messages-nav a { color: #c0c0c0; }
    62 #messages-nav a:hover { color: #0096dd; }
    63 #messages-info { margin-top: -20px; color: #c0c0c0; text-align: center; }
     61#messages-info { margin-top: -20px; text-align: center; }
     62#navigation-buttons.default, #navigation-buttons.default #messages-nav a { color: rgba(34, 113, 177, .6); }
     63#navigation-buttons.light, #navigation-buttons.light #messages-nav a { color: rgba(4, 164, 204, .6); }
     64#navigation-buttons.modern, #navigation-buttons.modern #messages-nav a { color: rgba(70, 100, 235, .6); }
     65#navigation-buttons.blue, #navigation-buttons.blue #messages-nav a { color: rgba(227, 175, 85, .6); }
     66#navigation-buttons.coffee, #navigation-buttons.coffee #messages-nav a { color: rgba(199, 165, 137, .6); }
     67#navigation-buttons.ectoplasm, #navigation-buttons.ectoplasm #messages-nav a { color: rgba(169, 189, 79, .6); }
     68#navigation-buttons.midnight, #navigation-buttons.midnight #messages-nav a { color: rgba(227, 89, 80, .6); }
     69#navigation-buttons.ocean, #navigation-buttons.ocean #messages-nav a { color: rgba(158, 186, 160, .6); }
     70#navigation-buttons.sunrise, #navigation-buttons.sunrise #messages-nav a { color: rgba(221, 130, 59, .6); }
     71#navigation-buttons.foggy, #navigation-buttons.foggy #messages-nav a { color: rgba(137, 147, 171, .6); }
     72#navigation-buttons.polar, #navigation-buttons.polar #messages-nav a { color: #bbb; }
     73#navigation-buttons.default #messages-nav a:hover { color: #2271b1; }
     74#navigation-buttons.light #messages-nav a:hover { color: #04a4cc; }
     75#navigation-buttons.modern #messages-nav a:hover { color: #3858e9; }
     76#navigation-buttons.blue #messages-nav a:hover { color: #e3af55; }
     77#navigation-buttons.coffee #messages-nav a:hover { color: #c7a589; }
     78#navigation-buttons.ectoplasm #messages-nav a:hover { color: #a9bd4f; }
     79#navigation-buttons.midnight #messages-nav a:hover { color: #e35950; }
     80#navigation-buttons.ocean #messages-nav a:hover { color: #9ebaa0; }
     81#navigation-buttons.sunrise #messages-nav a:hover { color: #dd823b; }
     82#navigation-buttons.foggy #messages-nav a:hover { color: #8993ab; }
     83#navigation-buttons.polar #messages-nav a:hover { color: #53a0de; }
     84
     85
     86
     87
     88
     89
    6490.paginated span { font-weight: 600; transition: none !important; }
    6591#prev { position: absolute; left: 0; }
     
    84110.plaintext.toggle { position: relative; }
    85111.dashicons.contact-info { float: right; }
    86 #toggle-info { cursor: pointer; }
    87 #toggle-info:after { display: block; opacity: 0; pointer-events: none; position: absolute; line-height: 21px; content: attr(data-title); font-weight: 300; font-size: 13px; transform: scale3d(.2,.2,1); transition: all .2s ease-in-out; /* width .2s linear; */ }
    88 #toggle-info:hover:after { opacity: 1; transform: scale3d(1,1,1); }
    89 #toggle-info:hover:after { transition: all .2s .1s ease-in-out; }
     112
     113   
     114   
     115   
     116#toggle-info, #toggle-message { cursor: pointer; }
     117#toggle-info:after, #toggle-message:after { display: block; opacity: 0; pointer-events: none; position: absolute; line-height: 21px; content: attr(data-title); font-weight: 300; font-size: 13px; transform: scale3d(.2,.2,1); transition: all .2s ease-in-out; }
     118#toggle-info:hover:after, #toggle-message:hover:after { opacity: 1; transform: scale3d(1,1,1); transition: all .2s .1s ease-in-out; font-family: sans-serif; }
    90119select.sform { -webkit-appearance: none; -moz-appearance: none; appearance: none; padding: 2px 20px 2px 8px!important; padding-right: 30px!important; height: 42px!important; padding: 10px 15px; -moz-border-radius: 4px; -webkit-border-radius: 4px; border-radius: 4px; background-color: #fff!important; border: 2px solid #dcdfe6 !important; font-size: 14px!important; line-height: 24px!important; }
    91120select.default { border-color: rgb(34 113 177 / 25%); }
     
    206235form.polar .submit-button:hover { background: #77b4e5; color: #fff; }
    207236form.polar .submit-button:active { background: #318dd7; color: #fff; }
     237th.request { vertical-align: top; }
     238td.request p { margin-top: 0 !important; }
    208239
    209240@media screen and (max-width: 782px) {
     
    217248#messages-nav { margin: 0; }
    218249#submission-tab { margin: 0 -10px; border: none; }
    219 #toggle-info { margin-top: -46px; margin-right: -5px; }
    220 #toggle-info:after { top: -36px; right: 35px; }
     250#toggle-info, #toggle-message { margin-top: -46px; margin-right: -5px; }
     251#toggle-info:after, #toggle-message:after { top: -36px; right: 35px; }
    221252th.option.first { padding: 45px 20px 15px; }
    222253th.option, th.option.last { padding: 15px 20px; }
     
    241272.dashicons-external.foggy:hover { color: #72aee6; }
    242273.dashicons-external.polar:hover { color: #53a0de; }
    243 .reply-message.button { display: none; }
     274/*.reply-message.button { display: none; } */
     275
     276.reply-message.button {
     277    margin-left: 2px;
     278    margin-top: 12px !important;
     279}
     280.icon-button {
     281    display: none;
     282}
     283
     284
    244285#submit-wrap { padding: 0 20px 100px; }
    245286/* Entries page */
     
    277318#submitter-data .form-table th { padding: 60px 20px 30px 40px; }
    278319#submitter-data .form-table td { padding-right: 30px; }
    279 #toggle-info:after { right: 60px; top: 62px; }
     320#toggle-info:after, #toggle-message:after { right: 60px; top: 64px; }
    280321th.option.first { padding: 65px 20px 35px 30px; }
    281322th.option { padding: 35px 20px 35px 30px; width: 150px; }
     
    289330td.checkbox-switch { padding: 37px 50px 32px 0; }
    290331td.checkbox-switch.last { padding: 37px 50px 62px 0; }
     332th.topaligned { padding-top: 15px; padding-bottom: 15px; }
     333td.topaligned { padding-bottom: 15px; }
    291334}
    292335
     
    316359#admin-notice > a { text-decoration: none; }
    317360*/
     361
     362@media screen and (max-width: 782px) {
     363.reply-message.button { margin-left: 2px; margin-top: 12px !important; }
     364#h2-editing { padding-left: 20px; }
     365}
     366
     367@media screen and (min-width: 783px) {
     368#h2-editing { padding-left: 30px; }
     369}
     370
     371#h2-editing.closed {
     372    padding-bottom: 60px;
     373}
     374
     375
     376@media screen and (min-width: 783px)
     377.options-heading {
     378    padding: 0 30px;
     379}
     380@media screen and (min-width: 783px)
     381.options-heading, .options-heading span span {
     382    line-height: 60px;
     383}
     384
     385.options-heading span {
     386    cursor: pointer;
     387}
     388
     389@media screen and (min-width: 783px)
     390.options-heading, .options-heading span span {
     391    line-height: 60px;
     392}
     393
     394.toggle.dashicons {
     395    color: #dcdfe6;
     396}
     397@media screen and (min-width: 783px)
     398.options-heading, .options-heading span span {
     399    line-height: 60px;
     400}
     401.options-heading span span {
     402    padding-left: 10px;
     403}
     404.options-heading span {
     405    cursor: pointer;
     406}
     407
     408.section.editing {
     409    max-height: 1500px;
     410    transition: max-height 1.25s linear,opacity 1.5s,font-size 1.5s,margin 1.5s,padding 1.5s;
     411}
     412
     413.dashicons-arrow-up-alt2:hover {
     414    color: #f6866f;
     415}
     416
     417.dashicons-arrow-down-alt2:hover {
     418    color: #9bcc79;
     419}
     420
     421
     422.section.editing.collapsed { font-size: 0; margin: 0; opacity: 0; padding: 0; max-height: 0; overflow: hidden; transition: max-height 0.3s linear, opacity 0.15s, font-size 0.15s, margin .15s, padding .15s; -webkit-transition: max-height 0.3s linear, opacity 0.15s, font-size .15s, margin .15s, padding .15s; -moz-transition: max-height 0.3s linear, opacity 0.15s, font-size .15s, margin .15s, padding .15s; -o-transition: max-height 0.3s linear, opacity 0.15s, font-size .15s, margin .15s, padding .15s; }
     423.section.editing { max-height: 800px; transition: max-height 0.5s linear, opacity 1.0s, font-size 1.0s, margin 1.0s, padding 1.0s; -webkit-transition: max-height 0.5s linear, opacity 1.0s, font-size 1.0s, margin 1.0s, padding 1.0s; -moz-transition: max-height 0.5s linear, opacity 1.0s, font-size 1.0s, margin 1.0s, padding 1.0s; -o-transition: max-height 0.5s linear, opacity 1.0s, font-size 1.0s, margin 1.0s, padding 1.0s;   }
  • simpleform-contact-form-submissions/trunk/admin/js/admin.js

    r2664815 r2701411  
    22    'use strict';
    33   
    4      $( window ).load(function() {
     4     $( window ).on('load', function() {
    55
    66       var toggle = document.getElementsByClassName("contact-info");
     
    1010           var info = document.getElementById("submitter-data");
    1111           info.classList.toggle("unseen");
    12            document.getElementById("thdate").classList.toggle("first");
    13            document.getElementById("tddate").classList.toggle("first");
    14            document.getElementById("submission-id").classList.toggle("unseen");
    15            document.getElementById("entry-form").classList.toggle("unseen");
     12           document.getElementById("toggle-message").classList.toggle("unseen");
    1613           document.getElementById("message-data-column").classList.toggle("fullwidth");
    1714           var prev_link = document.getElementById("prev-link");
     
    5552         });
    5653       }
    57        
    58        $('#message-status').change(function(e){
     54              
     55       $('#message-status').on("change", function(e) {
    5956         var option = $(this).val();
    6057         if ( option != 'spam' && option != 'trash' ) {
     
    9996       });
    10097       
    101        $('#edit-entry').click(function(e){
     98       $('#edit-entry').on( 'click', function(e) {
    10299          $('.message').removeClass('error success unchanged');
    103100          $('#message-wrap').addClass('seen');
     
    131128                }
    132129                else {
    133                   if ( newstatus !== prevstatus ) {
    134                      
    135                     //  if() {
    136                     $('#view-counter').text(entries);
    137                     // }
    138                    
     130                  $('#view-counter').text(entries);
     131                  if ( newstatus !== prevstatus ) {
    139132                    if ( newstatus == 'new' ) {
    140133                      var unread = parseInt($('#unread-messages').text(), 10);
     
    208201       });
    209202
    210        ///////////////////////////////////////////////////////////////////////////////////////
     203       // Prevent duplicate queries by appending the selector to move entries in the bottom bulk actions
     204       if ( document.getElementById("moveto") != null && document.getElementById("bulk-action-selector-bottom") != null ) {
     205         const node = document.getElementById("moveto");
     206         const clone = node.cloneNode(true);
     207         var bottomSelector = document.getElementById("bulk-action-selector-bottom");
     208         bottomSelector.parentNode.insertBefore( clone, bottomSelector.nextSibling );                 
     209       }
    211210           
    212211       $('#bulk-action-selector-top, #bulk-action-selector-bottom').on("change", function() {
    213212         var selectbulk = $(this).val();
    214213         if ( selectbulk === 'bulk-move' ) {
    215              $('#moveto').removeClass('unseen');
     214             $('.moveto').removeClass('unseen');
    216215         }
    217216         else {
    218              $('#moveto').addClass('unseen');
     217             $('.moveto').addClass('unseen');
     218             $('.moveto').val('');
     219             $('#move2').val('');
    219220         }
    220221       });             
    221222       
    222        $('#moveto').on("change", function() {
     223       $('.moveto').on("change", function() {
    223224         var form = $(this).val();
    224225          $('#move2').val(form);
    225        });             
    226 
    227        ///////////////////////////////////////////////////////////////////////////////////////
     226          $('.moveto').val(form);
     227       }); 
     228       
     229       $("span.heading").on("click", function() {
     230         var section = $(this).attr('section');
     231         var prev_link = document.getElementById("prev-link");
     232         var next_link = document.getElementById("next-link");
     233         $('.section.' + section).toggleClass('collapsed');
     234          if ( ! $('.section.' + section).hasClass('collapsed') ) { 
     235            $('span.toggle.' + section).removeClass('dashicons-arrow-down-alt2');
     236            $('span.toggle.' + section).addClass('dashicons-arrow-up-alt2');
     237            $('#h2-' + section).removeClass('closed');
     238             if ( prev_link ) {
     239               var href_prev = prev_link.getAttribute("href");
     240               let prevParams = new URLSearchParams(href_prev);
     241               if ( prevParams.has('editing') === true ) {
     242                 var new_href_prev = href_prev.replace('&editing=hidden', '');
     243                 prev_link.setAttribute('href', new_href_prev);
     244               }
     245             }   
     246             if ( next_link ) {
     247               var href_next = next_link.getAttribute("href");
     248               let nextParams = new URLSearchParams(href_next);
     249               if ( nextParams.has('editing') === true ) {
     250                 var new_href_next = href_next.replace('&editing=hidden', '');
     251                 next_link.setAttribute('href', new_href_next);
     252               }   
     253             }
     254          }
     255          else{
     256            $('span.toggle.' + section).removeClass('dashicons-arrow-up-alt2');
     257            $('span.toggle.' + section).addClass('dashicons-arrow-down-alt2');
     258            $('#h2-' + section).addClass('closed');
     259             if ( prev_link ) {
     260               var href_prev = prev_link.getAttribute("href");
     261               let prevParams = new URLSearchParams(href_prev);
     262               if ( prevParams.has('editing') === false ) {
     263                 var new_href_prev = href_prev + '&editing=hidden';
     264                 prev_link.setAttribute('href', new_href_prev);
     265               }   
     266             }   
     267             if ( next_link ) {
     268               var href_next = next_link.getAttribute("href");
     269               let nextParams = new URLSearchParams(href_next);
     270               if ( nextParams.has('editing') === false ) {
     271                 var new_href_next = href_next + '&editing=hidden';
     272                 next_link.setAttribute('href', new_href_next);
     273               }
     274             }
     275          }
     276       });
    228277   
    229278     });
  • simpleform-contact-form-submissions/trunk/admin/partials/entry.php

    r2664815 r2701411  
    99$color = ! empty( $settings['admin_color'] ) ? esc_attr($settings['admin_color']) : 'default';
    1010$form = isset( $_REQUEST['form'] ) && !empty( $_REQUEST['form'] ) ? '&form=' . absint($_REQUEST['form']) : '';
    11 // $view = isset( $_REQUEST['view'] ) && !empty( $_REQUEST['view'] ) ? '&view=' . sanitize_text_field($_REQUEST['view']) : '&view=inbox';
    1211$view = isset( $_REQUEST['view'] ) && !empty( $_REQUEST['view'] ) ? '&view=' . sanitize_text_field($_REQUEST['view']) : '';
    1312$date = isset ( $_REQUEST['date'] ) && !empty( $_REQUEST['date'] ) ? '&date=' . sanitize_text_field($_REQUEST['date']) : '';
     
    2827if ( $item['status'] == 'trash' ) { $description .= '&nbsp;' . $restoring_desc . '&nbsp;' . __( 'For permanently deleting the entry, back to entries list and use the specific action.','simpleform-contact-form-submissions'); }
    2928$where_form = !empty($form_id) ? "AND form = '$form_id'" : " AND form != '0' AND listable = '1'";
    30 // $view_arg = isset( $_REQUEST['view'] ) && !empty( $_REQUEST['view'] ) ? sanitize_text_field($_REQUEST['view']) : 'inbox';
    3129$view_arg = isset( $_REQUEST['view'] ) && !empty( $_REQUEST['view'] ) ? sanitize_text_field($_REQUEST['view']) : '';
    32 // if ($view_arg == 'inbox') { $where_status = " AND status != 'trash' AND status != 'spam'"; $message_type = 'inbox'; }
    3330if ($view_arg == '') { $where_status = " AND status != 'trash' AND status != 'spam'"; $message_type = 'inbox'; }
    3431if ($view_arg == 'new') { $where_status = " AND status = 'new'"; $message_type = 'unread'; }
     
    3633if ($view_arg == 'spam') { $where_status = " AND status = 'spam'"; $message_type = 'junk'; }
    3734if ($view_arg == 'trash') { $where_status = " AND status = 'trash'"; $message_type = 'trashed'; }
    38 // if ($view_arg == '') { $where_status = ''; }
    3935$ip_storing = ! empty( $settings['ip_storing'] ) ? esc_attr($settings['ip_storing']) : 'true';
    4036$keyword = ( isset( $_REQUEST['s'] ) ) ? sanitize_text_field($_REQUEST['s']) : '';
     
    6864if ( !empty($form_id) ) { $counter = $wpdb->get_var("SELECT COUNT(*) FROM {$wpdb->prefix}sform_submissions WHERE form = {$form_id} $where_status $where_keyword $where_date"); }
    6965else { $counter = $wpdb->get_var("SELECT COUNT(*) FROM {$wpdb->prefix}sform_submissions WHERE form != '0' AND listable = '1' $where_status $where_keyword $where_date"); }
    70 if ( !empty($form_id) ) { $form_name = $wpdb->get_var("SELECT name FROM {$wpdb->prefix}sform_shortcodes WHERE id = '$form_id'"); }
     66if ( !empty($form_id) ) { /* $form_name = $wpdb->get_var("SELECT name FROM {$wpdb->prefix}sform_shortcodes WHERE id = '$form_id'"); */ $form_name = $entry_form_name; }
    7167else { $form_name = 'all forms';  }
    7268if ( esc_attr($item['status']) == 'new' ) { $counter = $counter - 1; }
     
    7470$counter_span = '<span id="view-counter">' . $counter . '</span>';
    7571$count_messages = sprintf( _n( '%1$s %2$s entry in %3$s', '%1$s %2$s entries in %3$s', $counter ), $counter_span, $message_type, $form_name ) . '&nbsp;';
    76 $messages_nav = $counter > 1 ? '<div id="navigation-buttons"><div id="messages-nav">' . $prev_button . $next_button . '</div><div id="messages-info">' . $count_messages . '</div></div>' : '';
     72$messages_nav_class = $counter > 1 ? $color : 'invisible';
     73$messages_nav = '<div id="navigation-buttons" class="' . $messages_nav_class . '"><div id="messages-nav">' . $prev_button . $next_button . '</div><div id="messages-info">' . $count_messages . '</div></div>';
    7774$contact_info = isset( $_REQUEST['info'] ) && $_REQUEST['info'] == 'hidden' ? ' unseen' : '';
    78 $user_type =  esc_attr($item['requester_type']) == 'registered' && esc_attr($item['requester_id']) != '0' ? __('Registered', 'simpleform-contact-form-submissions') : __('Anonymous', 'simpleform-contact-form-submissions') ;
    79 $user_class = esc_attr($item['requester_type']) != 'registered' && empty($name) && empty($lastname) && empty($phone) && empty($ip) && empty($email) ? 'last' : '';
    80 $name = $item['name'] != '' && $item['name'] != 'not stored' ? esc_attr($item['name']) : '';
     75$editing = isset( $_REQUEST['editing'] ) && $_REQUEST['editing'] == 'hidden' ? ' collapsed' : '';
     76$editing_class = $editing ? 'closed' : '';
     77$toggle_message_class = isset( $_REQUEST['info'] ) && $_REQUEST['info'] == 'hidden' ? '' : ' unseen';
     78$dashicons_arrow = $editing ? 'dashicons-arrow-down-alt2' : 'dashicons-arrow-up-alt2';
     79$user_type =  esc_attr($item['requester_type']) == 'registered' && esc_attr($item['requester_id']) != '0' ? __('Registered', 'simpleform-contact-form-submissions') : __('Unregistered', 'simpleform-contact-form-submissions');
     80$name = $item['name'] != '' && $item['name'] != 'not stored' && $item['name'] != 'Anonymous' ? trim(esc_attr($item['name'])) : '';
    8181$lastname = $item['lastname'] != '' && $item['lastname'] != 'not stored' ? esc_attr($item['lastname']) : '';
     82$lastname_separator = ! empty($name) ? '<br>' : '';
     83$fullname = ! empty($name) || ! empty($lastname) ? $name . $lastname_separator . $lastname : __( 'Anonymous', 'simpleform' );
    8284$phone = $item['phone'] != '' && $item['phone'] != 'not stored' ? esc_attr($item['phone']) : '';
    8385$ip = $item['ip'] != '' && $item['ip'] != 'not stored' ? esc_attr($item['ip']) : '';
    8486$email = $item['email'] != '' && $item['email'] != 'not stored' ? esc_attr($item['email']) : '';
     87// $user_class = esc_attr($item['requester_type']) != 'registered' && empty($name) && empty($lastname) && empty($phone) && empty($ip) && empty($email) ? 'last' : '';
    8588$user_data = false;
    8689if ( esc_attr($item['requester_type']) == 'registered' && esc_attr($item['requester_id']) != '0' ) {     
     
    9396  $role_name = translate_user_role($wp_roles->roles[$role]['name']);
    9497}
    95 $role_class = empty($name) && empty($lastname) && empty($phone) && empty($ip) && empty($email) ? 'last' : '';
    96 $name_class = empty($lastname) && empty($phone) && empty($ip) && empty($email) ? 'last' : '';
    97 $lastname_class = empty($phone) && empty($ip) && empty($email) ? 'last' : '';
     98$role_class = empty($phone) && empty($ip) && empty($email) ? 'last' : '';
     99$name_line = empty($name) || empty($lastname) ? '' : 'topaligned';
     100$name_class = empty($phone) && empty($ip) && empty($email) ? 'last ' . $name_line : $name_line;
    98101$phone_class = empty($ip) && empty($email) ? 'last' : '';
    99 $ip_class = empty($email) ? 'last' : '';
     102$email_class = empty($ip) ? 'last' : '';
    100103$data_column_class = isset( $_REQUEST['info'] ) && $_REQUEST['info'] == 'hidden' ? 'fullwidth' : 'first';
    101104$submission_id_class = isset( $_REQUEST['info'] ) && $_REQUEST['info'] == 'hidden' ? '' : 'unseen';
     
    144147<form id="submission-tab" method="post" class="<?php echo $color ?>">
    145148
     149<input type="hidden" id="selected-form" name="selected-form" value="<?php echo $form_id ?>">
    146150<input type="hidden" id="entry" name="entry" value="<?php echo $item['id'] ?>">
    147151<input type="hidden" id="entries-counter" name="entries-counter" value="<?php echo $counter ?>">
    148152<input type="hidden" id="entries-form" name="entries-form" value="<?php echo $form_id ?>">
    149153<input type="hidden" id="entries-view" name="entries-view" value="<?php echo $view_arg ?>">
     154<?php
     155$email= esc_attr($item['email']);
     156$gravemail = md5( strtolower( trim( $email ) ) );
     157$gravsrc = "http://www.gravatar.com/avatar/".$gravemail;
     158$gravcheck = "http://www.gravatar.com/avatar/".$gravemail."?d=404";
     159$response = get_headers($gravcheck);
     160$avatar = strpos( $response[0], '404 Not Found' ) === false ? true : '';
     161?>
    150162
    151163<div class="submission-data">
     
    155167<table class="entrie-table"><tbody>
    156168
    157 <tr><th class="option first"><span><?php _e('Entry ID','simpleform-contact-form-submissions') ?></span></th><td class="plaintext first toggle"># <?php echo $id; ?><span id="toggle-info" data-title="<?php esc_attr_e('Hide','simpleform-contact-form-submissions') ?>" class="dashicons dashicons-arrow-left-alt2 contact-info left"></span></td></tr>
     169<tr><th class="option first"><span><?php _e('ID','simpleform-contact-form-submissions') ?></span></th><td class="plaintext first toggle"># <?php echo $id; ?><span id="toggle-info" data-title="<?php esc_attr_e('Hide','simpleform-contact-form-submissions') ?>" class="dashicons dashicons-arrow-left-alt2 contact-info left"></span></td></tr>
    158170
    159171<tr class="<?php if ( $count_forms < 2 ) { echo 'unseen'; } ?>"><th class="option"><span><?php _e('Form','simpleform') ?></span></th><td class="plaintext"><span class="form-name"><?php echo $entry_form_name ?></span></td></tr>
    160172
    161 <tr><th class="option"><span><?php _e('Profile Picture','simpleform-contact-form-submissions') ?></span></th><td class="plaintext profile"><?php echo get_avatar( esc_attr($item['email']), 100, 'mystery' ); ?></td></tr>
    162 
    163 <tr><th class="option <?php echo $user_class ?>"><span><?php _e('User Type','simpleform-contact-form-submissions') ?></span></th><td class="plaintext <?php echo $user_class ?>"><?php echo $user_type ?></td></tr>
     173<tr><th class="option <?php // echo $user_class ?>"><span><?php _e('User','simpleform-contact-form-submissions') ?></span></th><td class="plaintext <?php // echo $user_class ?>"><?php echo $user_type ?></td></tr>
    164174
    165175<?php if ( $user_data == true ) { ?>
     
    171181<?php } ?>
    172182
    173 <?php if ( ! empty($name) ) { ?>
    174 
    175 <tr><th class="option <?php echo $name_class ?>"><span><?php _e('Name','simpleform-contact-form-submissions') ?></span></th><td class="plaintext <?php echo $name_class ?>"><?php echo $name ?></td></tr>
     183<?php if ( get_option( 'show_avatars' ) && is_email($item['email']) && $avatar ) { ?>
     184
     185<tr><th class="option"><span><?php _e('Profile Picture','simpleform-contact-form-submissions') ?></span></th><td class="plaintext profile"><?php echo get_avatar( esc_attr($item['email']), 'mystery' ); ?></td></tr>
     186
     187<?php } ?>
     188
     189<tr><th class="option <?php echo $name_class ?>"><span><?php _e('Name','simpleform-contact-form-submissions') ?></span></th><td class="plaintext <?php echo $name_class ?>"><?php echo $fullname ?></td></tr>
    176190         
    177 <?php } ?>
    178 
    179 <?php if ( ! empty($lastname) ) { ?>
    180      
    181 <tr><th class="option <?php echo $lastname_class ?>"><span><?php _e('Last Name','simpleform-contact-form-submissions') ?></span></th><td class="plaintext <?php echo $lastname_class ?>"><?php echo $lastname ?></td></tr>
    182      
    183 <?php } ?>
    184 
    185191<?php if ( ! empty($phone ) ) { ?>
    186192     
     
    188194             
    189195<?php } ?>
    190 
    191 <?php if ( ! empty($ip) ) { ?>
    192      
    193  <tr><th class="option <?php echo $ip_class ?>"><span><?php _e('IP','simpleform-contact-form-submissions') ?></span></th><td class="plaintext <?php echo $ip_class ?>"><?php echo $ip ?></td></tr>
    194          
    195 <?php } ?>
    196196         
    197197<?php if ( ! empty($email) ) { ?>
    198198     
    199 <tr><th class="option last"><span><?php _e('Email','simpleform-contact-form-submissions') ?></span></th><td class="plaintext email last"><?php echo $email ?></td></tr>
     199<tr><th class="option <?php echo $email_class ?>"><span><?php _e('Email','simpleform-contact-form-submissions') ?></span></th><td class="plaintext email <?php echo $email_class ?>"><?php echo $email ?></td></tr>
    200200         
    201201<?php } ?>
    202202
     203<?php if ( ! empty($ip) ) { ?>
     204     
     205 <tr><th class="option last"><span><?php _e('IP','simpleform-contact-form-submissions') ?></span></th><td class="plaintext last"><?php echo $ip ?></td></tr>
     206         
     207<?php } ?>
     208
    203209</tbody></table>
    204210
     
    208214
    209215<table class="entrie-table"><tbody>
    210 
    211 <tr id="submission-id" class="<?php echo $submission_id_class ?>"><th class="option first"><span><?php _e('Entry ID','simpleform-contact-form-submissions') ?></span></th><td class="plaintext first toggle"># <?php echo $id; ?><span id="toggle-info" data-title="<?php esc_attr_e('Show contact info','simpleform-contact-form-submissions') ?>" class="dashicons dashicons-arrow-right-alt2 contact-info right"></span></td></tr>
    212 
    213 <tr id="entry-form" class="<?php echo $submission_id_class; if ( $count_forms < 2 ) { echo ' unseen'; } ?>"><th class="option"><span><?php _e('Form','simpleform') ?></span></th><td class="plaintext"><span class="form-name"><?php echo $entry_form_name ?></span></td></tr>
    214 
    215 <tr class="<?php echo $date_class ?>"><th id="thdate" class="option <?php echo $date_class ?>"><span><?php _e('Date','simpleform-contact-form-submissions') ?></span></th><td id="tddate" class="plaintext <?php echo $date_class ?>"><?php echo $entry_date ?></td></tr>
     216   
     217<tr id="submission-id" class="first"><th id="thdate" class="option first"><span><?php _e('Date','simpleform-contact-form-submissions') ?></span></th><td id="tddate" class="plaintext first toggle"><?php echo $entry_date ?><span id="toggle-message" data-title="<?php esc_attr_e('Show contact info','simpleform-contact-form-submissions') ?>" class="dashicons dashicons-arrow-right-alt2 contact-info right <?php echo $toggle_message_class ?>"></span></td></tr>
    216218
    217219<?php if ( ! empty($subject) ) { ?>
     
    221223<?php } ?>
    222224
    223 <tr><th class="option"><span><?php _e('Message','simpleform-contact-form-submissions') ?></span></th><td class="plaintext"><?php echo esc_attr($item['object']) ?></td></tr>
     225<tr><th class="option request"><span><?php _e('Message','simpleform-contact-form-submissions') ?></span></th><td class="plaintext request"><?php echo stripslashes(wpautop(esc_attr($item['object']))) ?></td></tr>
     226
     227</tbody></table>
     228<h2 id="h2-editing" class="options-heading <?php echo $editing_class ?>"><span class="heading" section="editing"><?php _e( 'Editing', 'simpleform' ); ?><span class="toggle dashicons <?php echo $dashicons_arrow ?> editing"></span></span></h2>
     229
     230<div class="section editing <?php echo $editing ?>">
     231<table class="form-table editing"><tbody>
    224232
    225233<tr><th id="thstatus" class="option <?php echo $status_class ?>"><span><?php _e('Status','simpleform') ?></span></th><td id="tdstatus"  class="select <?php echo $status_class ?>"><select name="message-status" id="message-status" class="sform <?php echo $color ?>"><option value="" disabled><?php _e('Mark as', 'simpleform-contact-form-submissions' ) ?></option><option value="new"><?php _e('unread', 'simpleform-contact-form-submissions' ) ?></option><option value="read" <?php if ( $item['status'] == 'read' || $item['status'] == 'new' ) echo 'selected="selected"'; ?>><?php _e('read', 'simpleform-contact-form-submissions' ) ?></option><option value="answered" <?php selected( $item['status'], 'answered'); ?>><?php _e('answered', 'simpleform-contact-form-submissions' ) ?></option><option value="spam" <?php selected( $item['status'], 'spam'); ?>><?php _e('junk', 'simpleform-contact-form-submissions' ) ?></option><option value="trash" <?php selected( $item['status'], 'trash'); ?>><?php _e('trashed', 'simpleform-contact-form-submissions' ) ?></option></select><?php echo $mailtolink ?></td></tr>
     
    228236     
    229237<tr class="trmoving <?php if ( $count_forms < 2 || $item['status'] == 'trash' || $item['status'] == 'spam' || $movable != true ) { echo 'unseen'; } ?>"><th id="thmoveto" class="option last"><span><?php _e('Move To','simpleform') ?></span></th><td id="tdmoveto" class="select last"><select name="moveto" id="moveto" class="sform <?php echo $color ?>"><option value=""><?php _e('Select a form to move entry to', 'simpleform-contact-form-submissions' ) ?></option><?php echo $options ?></select></td></tr>
    230        
     238
    231239</tbody></table>
    232240
     
    238246<input type="submit" name="edit-entry" id="edit-entry" class="submit-button" value="<?php esc_attr_e( 'Save Changes', 'simpleform-contact-form-submissions' ) ?>"><?php  wp_nonce_field( 'ajax-verification-nonce', 'verification_nonce'); ?>
    239247</div>
    240 
    241 </div>
    242 
     248</div>
     249</div>
    243250</div>
    244251
     
    247254</div>
    248255
    249 <div class="sform-clear"></div> 
     256<div class="sform-clear"></div>
  • simpleform-contact-form-submissions/trunk/changelog.txt

    r2664815 r2701411  
    11== Changelog ==
     2
     3= 2.0.1 (29 March 2022) =
     4* Fixed: the line breaks are preserved in the message
     5* Fixed: backslashes removed in the message
     6* Fixed: incorrect display of the number of entries when entries have been moved
     7* Fixed: incorrect displaying of form status
     8* Fixed: deprecated jQuery functions warning
     9* Changed: restyling of entry data page
     10* Changed: last entries data are recovered upon the plugin activation
    211
    312= 2.0 (25 January 2022) =
  • simpleform-contact-form-submissions/trunk/includes/class-activator.php

    r2664815 r2701411  
    2424         switch_to_blog( $blog_id );
    2525         self::change_db();
     26         self::entries_data_recovery();
    2627         self::sform_submissions_settings();
    2728         restore_current_blog();
     
    2930      } else {
    3031         self::change_db();
     32         self::entries_data_recovery();
    3133         self::sform_submissions_settings();
    3234      }
    3335     } else {
    3436        self::change_db();
     37        self::entries_data_recovery();
    3538        self::sform_submissions_settings();
    3639     }
     
    104107        $prefix = $wpdb->prefix;
    105108        require_once(ABSPATH . 'wp-admin/includes/upgrade.php');
    106            
    107109          $submissions_table = $prefix . 'sform_submissions';
    108           $sql = "CREATE TABLE " . $submissions_table . " (
     110          $sql = "CREATE TABLE {$submissions_table} (
    109111            id int(11) NOT NULL AUTO_INCREMENT,
    110112            form int(7) NOT NULL DEFAULT '1',
     
    123125            previous_status varchar(32) NOT NULL default '',
    124126            trash_date datetime NULL,
    125             notes text NOT NULL,
     127            notes text NULL,
    126128            listable tinyint(1) NOT NULL DEFAULT 1,
    127129            hidden tinyint(1) NOT NULL DEFAULT '0',
     
    136138   
    137139    /**
     140     * Edit entries recovering data from last received messages.
     141     *
     142     * @since    1.0
     143     */
     144
     145    public static function entries_data_recovery() {
     146     
     147        global $wpdb;
     148        $submissions_table = $wpdb->prefix . 'sform_submissions';
     149        if ( $result = $wpdb->get_results("SHOW TABLES LIKE '{$wpdb->prefix}sform_submissions'") ) {
     150          $forms = $wpdb->get_col("SELECT DISTINCT form FROM {$wpdb->prefix}sform_submissions");
     151          if ( $forms ) {
     152            foreach ( $forms as $form ) {
     153              $last_entry = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM {$wpdb->prefix}sform_submissions WHERE form = %d ORDER BY date DESC LIMIT 1", $form) );
     154              $before_last_entry = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM {$wpdb->prefix}sform_submissions WHERE form = %d ORDER BY date DESC LIMIT 1 OFFSET 1", $form) );
     155              $last_message = get_option("sform_last_{$form}_message") != false ? explode('#', get_option("sform_last_{$form}_message") ) : '';
     156              $before_last_message = get_option("sform_before_last_{$form}_message") != false ? explode('#', get_option("sform_before_last_{$form}_message") ) : '';
     157              $forwarded_last_message = get_option("sform_forwarded_last_{$form}_message") != false ? explode('#', get_option("sform_forwarded_last_{$form}_message") ) : '';
     158              $forwarded_before_last_message = get_option("sform_forwarded_before_last_{$form}_message") != false ? explode('#', get_option("sform_forwarded_before_last_{$form}_message") ) : '';
     159              $direct_last_message = get_option("sform_direct_last_{$form}_message") != false ? explode('#', get_option("sform_direct_last_{$form}_message") ) : '';
     160              $direct_before_last_message = get_option("sform_direct_before_last_{$form}_message") != false ? explode('#', get_option("sform_direct_before_last_{$form}_message") ) : '';
     161              $moved_last_message = get_option("sform_moved_last_{$form}_message") != false ? explode('#', get_option("sform_moved_last_{$form}_message") ) : '';
     162              $moved_before_last_message = get_option("sform_moved_before_last_{$form}_message") != false ? explode('#', get_option("sform_moved_before_last_{$form}_message") ) : '';
     163              $last_message_timestamp = $last_message && is_numeric($last_message[0]) ? $last_message[0] : '';
     164              $before_last_message_timestamp = $before_last_message && is_numeric($before_last_message[0]) ? $before_last_message[0] : '';
     165              $forwarded_last_message_timestamp = $forwarded_last_message && is_numeric($forwarded_last_message[0]) ? $forwarded_last_message[0] : '';
     166              $forwarded_before_last_message_timestamp = $forwarded_before_last_message && is_numeric($forwarded_before_last_message[0]) ? $forwarded_before_last_message[0] : '';
     167              $direct_last_message_timestamp = $direct_last_message && is_numeric($direct_last_message[0]) ? $direct_last_message[0] : '';
     168              $direct_before_last_message_timestamp = $direct_before_last_message && is_numeric($direct_before_last_message[0]) ? $direct_before_last_message[0] : '';
     169              $moved_last_message_timestamp = $moved_last_message && is_numeric($moved_last_message[0]) ? $moved_last_message[0] : '';
     170              $moved_before_last_message_timestamp = $moved_before_last_message && is_numeric($moved_before_last_message[0]) ? $moved_before_last_message[0] : '';
     171              $dates = array();
     172              $dates[$last_message_timestamp] = $last_message_timestamp && isset($last_message[1]) ? $last_message[1] : '';
     173              $dates[$before_last_message_timestamp] = $before_last_message_timestamp && isset($before_last_message[1]) ? $before_last_message[1] : '';
     174              $dates[$forwarded_last_message_timestamp] = $forwarded_last_message_timestamp && isset($forwarded_last_message[1]) ? $forwarded_last_message[1] : '';
     175              $dates[$forwarded_before_last_message_timestamp] = $forwarded_before_last_message_timestamp && isset($forwarded_before_last_message[1]) ? $forwarded_before_last_message[1] : '';
     176              $dates[$direct_last_message_timestamp] = $direct_last_message_timestamp && isset($direct_last_message[1]) ? $direct_last_message[1] : '';
     177              $dates[$direct_before_last_message_timestamp] = $direct_before_last_message_timestamp && isset($direct_before_last_message[1]) ? $direct_before_last_message[1] : '';
     178              $dates[$moved_last_message_timestamp] = $moved_last_message_timestamp && isset($moved_last_message[1]) ? $moved_last_message[1] : '';
     179              $dates[$moved_before_last_message_timestamp] = $moved_before_last_message_timestamp && isset($moved_before_last_message[1]) ? $moved_before_last_message[1] : '';
     180              // Remove empty array elements
     181              $dates = array_filter($dates);
     182              if ( $last_entry && esc_attr($last_entry->object) == '' ) {
     183                $last_date = esc_attr($last_entry->date);
     184                $entry_id = esc_attr($last_entry->id);
     185                if ( array_key_exists(strtotime($last_date), $dates) ) {
     186                  $message = $dates[strtotime($last_date)];
     187                  $split_mail = explode('&nbsp;&nbsp;&lt;&nbsp;', $message);
     188                  $email = isset($split_mail[1]) ? explode('&nbsp;&gt;', $split_mail[1])[0] : '';
     189                  $name_separator =  strpos($message, ':</td><td>') !== false ? __('From', 'simpleform') . ':</td><td>' : __('From', 'simpleform') . ':</b>&nbsp;&nbsp;';
     190                  $separator =  strpos($message, ':</td><td>') !== false ? '</td>' : '<br>';
     191                  $split_name = explode($name_separator, $message);
     192                  $email_separator = ! empty($email) ? '&nbsp;&nbsp;&lt;&nbsp;' : $separator;                 
     193                  $name = isset($split_name[1]) ? explode($email_separator, $split_name[1])[0] : '';
     194                  $phone_separator =  strpos($message, ':</td><td>') !== false ? __('Phone', 'simpleform') . ':</td><td>' : __('Phone', 'simpleform') . ':</b>&nbsp;&nbsp;';
     195                  $split_phone = explode($phone_separator, $message);
     196                  $phone = isset($split_phone[1]) ? explode($separator, $split_phone[1])[0] : '';
     197                  $subject_separator =  strpos($message, ':</td><td>') !== false ? __('Subject', 'simpleform') . ':</td><td>' : __('Subject', 'simpleform') . ':</b>&nbsp;&nbsp;';
     198                  $split_subject = explode($subject_separator, $message);
     199                  $subject = isset($split_subject[1]) ? explode($separator, $split_subject[1])[0] : '';
     200                  $object_separator = strpos($message, ':</td><td>') !== false ? __('Message', 'simpleform') . ':</td><td>' : __('Message', 'simpleform') . ':</b>&nbsp;&nbsp;';
     201                  $split_object = explode($object_separator, $message);
     202                  $closing_separator =  strpos($message, ':</td><td>') !== false ? '</td>' : '</div>';
     203                  $object = isset($split_object[1]) ? explode($closing_separator, $split_object[1])[0] : '';
     204                  $wpdb->update( $wpdb->prefix . 'sform_submissions', array( 'name' => strip_tags($name), 'email' => strip_tags($email), 'phone' => $phone, 'subject' => $subject, 'object' => $object, 'status' => 'read' ), array('id' => $entry_id ) );
     205                }
     206              }
     207              if ( $before_last_entry && esc_attr($before_last_entry->object) == '' ) {
     208                $before_last_date = esc_attr($before_last_entry->date);
     209                $before_entry_id = esc_attr($before_last_entry->id);
     210                if ( array_key_exists(strtotime($before_last_date), $dates) ) {
     211                  $message = $dates[strtotime($before_last_date)];
     212                  $split_mail = explode('&nbsp;&nbsp;&lt;&nbsp;', $message);
     213                  $email = isset($split_mail[1]) ? explode('&nbsp;&gt;', $split_mail[1])[0] : '';
     214                  $name_separator = strpos($message, ':</td><td>') !== false ? __('From', 'simpleform') . ':</td><td>' : __('From', 'simpleform') . ':</b>&nbsp;&nbsp;';
     215                  $separator =  strpos($message, ':</td><td>') !== false ? '</td>' : '<br>';
     216                  $split_name = explode($name_separator, $message);
     217                  $email_separator = ! empty($email) ? '&nbsp;&nbsp;&lt;&nbsp;' : $separator;                 
     218                  $name = isset($split_name[1]) ? explode($email_separator, $split_name[1])[0] : '';
     219                  $phone_separator = strpos($message, ':</td><td>') !== false ? __('Phone', 'simpleform') . ':</td><td>' : __('Phone', 'simpleform') . ':</b>&nbsp;&nbsp;';
     220                  $split_phone = explode($phone_separator, $message);
     221                  $phone = isset($split_phone[1]) ? explode($separator, $split_phone[1])[0] : '';
     222                  $subject_separator = strpos($message, ':</td><td>') !== false ? __('Subject', 'simpleform') . ':</td><td>' : __('Subject', 'simpleform') . ':</b>&nbsp;&nbsp;';
     223                  $split_subject = explode($subject_separator, $message);
     224                  $subject = isset($split_subject[1]) ? explode($separator, $split_subject[1])[0] : '';
     225                  $object_separator = strpos($message, ':</td><td>') !== false ? __('Message', 'simpleform') . ':</td><td>' : __('Message', 'simpleform') . ':</b>&nbsp;&nbsp;';
     226                  $split_object = explode($object_separator, $message);
     227                  $closing_separator = strpos($message, ':</td><td>') !== false ? '</td>' : '</div>';
     228                  $object = isset($split_object[1]) ? explode($closing_separator, $split_object[1])[0] : '';
     229                  $wpdb->update( $wpdb->prefix . 'sform_submissions', array( 'name' => strip_tags($name), 'email' => strip_tags($email), 'phone' => $phone, 'subject' => $subject, 'object' => $object, 'status' => 'read' ), array('id' => $before_entry_id ) );
     230                }
     231              }
     232            }
     233          }
     234        }             
     235
     236    }
     237
     238
     239    /**
    138240     *  Create a table whenever a new blog is created in a WordPress Multisite installation.
    139241     *
     
    145247       if ( is_plugin_active_for_network( 'simpleform-submissions/simpleform-submissions.php' ) ) {
    146248       switch_to_blog( $params->blog_id );
     249       self::change_db();
     250       self::entries_data_recovery();
    147251       self::sform_submissions_settings();
    148        self::change_db();
    149252       restore_current_blog();
    150253       }
  • simpleform-contact-form-submissions/trunk/includes/class-core.php

    r2664815 r2701411  
    133133        // The class responsible for defining all actions that occur in the admin area.     
    134134        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-admin.php';
     135
     136        // The class responsible for defining utilities 
     137        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-utilities.php';
    135138
    136139        // The class responsible for defining all actions that occur in the public-facing side of the site.     
     
    195198           // Admin footer text
    196199           $this->loader->add_action( 'admin_footer_text', $plugin_admin, 'admin_footer', 1, 2 );
    197            // Register ajax callback for message status editing
    198            // $this->loader->add_action( 'wp_ajax_edit_message_status', $plugin_admin, 'edit_message_status');
    199200           // Register ajax callback for entry data editing
    200201           $this->loader->add_action('wp_ajax_edit_entry', $plugin_admin, 'edit_entry');
  • simpleform-contact-form-submissions/trunk/includes/class-deactivator.php

    r2664815 r2701411  
    2727      // Check if other forms have been activated
    2828      global $wpdb;
    29       $table = "{$wpdb->prefix}sform_shortcodes";
    30       if ( $result = $wpdb->get_results("SHOW TABLES LIKE '".$table."'") ) {
    31         $ids = $wpdb->get_col("SELECT id FROM `$table` WHERE id != '1'");   
     29      if ( $result = $wpdb->get_results("SHOW TABLES LIKE '{$wpdb->prefix}sform_shortcodes'") ) {
     30        $ids = $wpdb->get_col("SELECT id FROM {$wpdb->prefix}sform_shortcodes WHERE id != '1'");   
    3231        if ( $ids ) {
    3332        foreach($ids as $id) {
     
    4544         
    4645      if ( $messages > 0 ) {
    47         $forms = $wpdb->get_col( "SELECT id FROM $table" );
     46        $forms = $wpdb->get_col( "SELECT id FROM {$wpdb->prefix}sform_shortcodes" );
    4847        foreach($forms as $form) {
    4948          $count_entries = $wpdb->get_var("SELECT COUNT(id) FROM {$wpdb->prefix}sform_submissions WHERE form = '$form'");
    5049          $count_moved = $wpdb->get_var("SELECT COUNT(id) FROM {$wpdb->prefix}sform_submissions WHERE moved_from = '$form'");
    51           $form_status = $wpdb->get_var("SELECT status FROM {$wpdb->prefix}sform_shortcodes WHERE id = '$form'");
    52           // if ( $form_status != 'trash' ) { $status = $count_entries == '0' ? 'unused' : 'used'; }
    53           // else { $status = 'trash'; }
    54           // $update = $wpdb->update($table, array( 'status' => $status, 'entries' => $count_entries, 'moved_entries' => $count_moved, 'storing' => '1' ), array('id' => $form ) );
    55           $update = $wpdb->update($table, array( 'entries' => $count_entries, 'moved_entries' => $count_moved, 'storing' => '1' ), array('id' => $form ) );
     50          $update = $wpdb->update($wpdb->prefix . 'sform_shortcodes', array( 'entries' => $count_entries, 'moved_entries' => $count_moved, 'storing' => '1' ), array('id' => $form ) );
    5651        }
    5752        $entries = $wpdb->get_var("SELECT SUM(entries) as total_entries FROM {$wpdb->prefix}sform_shortcodes");
     
    6156      }
    6257      else  {
    63         $forms = $wpdb->get_col( "SELECT id FROM $table" );
     58        $forms = $wpdb->get_col( "SELECT id FROM {$wpdb->prefix}sform_shortcodes" );
    6459        foreach($forms as $form) {
    65           $update = $wpdb->update($table, array( 'storing' => '1' ), array('id' => $form ) );
     60          $update = $wpdb->update($wpdb->prefix . 'sform_shortcodes', array( 'storing' => '1' ), array('id' => $form ) );
    6661        }
    6762        delete_option( 'sform_entries_view' );
  • simpleform-contact-form-submissions/trunk/includes/class-list-table.php

    r2664815 r2701411  
    219219    function column_firstname($item) {
    220220        $sender = $item['name'] != '' ? esc_attr($item['name']) : __('Anonymous', 'simpleform-contact-form-submissions' );
    221         return $sender;
     221        return stripslashes($sender);
    222222    }
    223223
     
    230230    function column_family($item) {
    231231        $sender = $item['lastname'] != '' ? esc_attr($item['lastname']) : '-';
    232         return $sender;
     232        return stripslashes($sender);
    233233    }
    234234   
     
    241241    function column_from($item) {
    242242        $from = $item['name'] != '' || $item['lastname'] != '' ? trim(esc_attr($item['name']) . ' ' . esc_attr($item['lastname'])) : __('Anonymous', 'simpleform-contact-form-submissions' );
    243         return $from;
     243        return stripslashes($from);
    244244    }
    245245
     
    441441         );
    442442        }
    443         $subject = $item['subject'] != '' && $item['subject'] != 'not stored' ? esc_attr($item['subject']) : esc_attr__( 'No Subject', 'simpleform-contact-form-submissions' );
     443        $subject = $item['subject'] != '' && $item['subject'] != 'not stored' ? stripslashes(esc_attr($item['subject'])) : esc_attr__( 'No Subject', 'simpleform-contact-form-submissions' );
    444444        if ( $form_id == '' ) {
    445445        $settings = get_option('sform_settings');
     
    460460
    461461    function column_object($item) {
    462         return esc_attr($item['object']);
     462        return stripslashes(esc_attr($item['object']));
    463463    }
    464464
     
    535535     */
    536536       
    537     function process_bulk_action() { 
     537    function process_bulk_action() {
     538       
    538539       global $wpdb;
    539540       $msg = '';
    540        $form_id = isset($_REQUEST['form']) ? absint($_REQUEST['form']) : '';       
    541        $moveto = isset($_REQUEST['moveto']) ? absint($_REQUEST['moveto']) : $form_id;
    542541       
    543542       if ('delete' === $this->current_action()) {
     
    554553            }
    555554       }
     555       
    556556       if ('trash' === $this->current_action() ) {
    557557            $nonce = isset ( $_REQUEST['_wpnonce'] ) ? wp_unslash($_REQUEST['_wpnonce']) : '';
     
    568568            }
    569569       }
     570       
    570571       if ('spam' === $this->current_action() ) {
    571572            $nonce = isset ( $_REQUEST['_wpnonce'] ) ? wp_unslash($_REQUEST['_wpnonce']) : '';
     
    584585            }
    585586       }
     587       
    586588       if ('untrash' === $this->current_action()) {
    587589            $nonce = isset ( $_REQUEST['_wpnonce'] ) ? wp_unslash($_REQUEST['_wpnonce']) : '';
     
    597599            }
    598600       }
     601       
    599602       if ('unspam' === $this->current_action()) {
    600603            $nonce = isset ( $_REQUEST['_wpnonce'] ) ? wp_unslash($_REQUEST['_wpnonce']) : '';
     
    613616            }
    614617       }
     618       
    615619       if ( 'bulk-delete' === $this->current_action() || ( isset( $_REQUEST['action2'] ) && $_REQUEST['action2'] === 'bulk-delete' ) ) {
    616620                   
     
    638642            }
    639643       }
     644       
    640645       if ( 'bulk-trash' === $this->current_action() || ( isset( $_REQUEST['action2'] ) && $_REQUEST['action2'] === 'bulk-trash' ) ) {
    641646            $nonce = isset ( $_REQUEST['_wpnonce'] ) ? wp_unslash($_REQUEST['_wpnonce']) : '';
     
    658663            }
    659664       }
     665       
    660666       if ( 'bulk-spam' === $this->current_action() || ( isset( $_REQUEST['action2'] ) && $_REQUEST['action2'] === 'bulk-spam' ) ) {
    661667            $nonce = isset ( $_REQUEST['_wpnonce'] ) ? wp_unslash($_REQUEST['_wpnonce']) : '';
     
    680686            }
    681687       }       
     688       
    682689       if ( 'bulk-untrash' === $this->current_action() || ( isset( $_REQUEST['action2'] ) && $_REQUEST['action2'] === 'bulk-untrash' ) ) {
    683690            $nonce = isset ( $_REQUEST['_wpnonce'] ) ? wp_unslash($_REQUEST['_wpnonce']) : '';
     
    699706            }
    700707        }
     708       
    701709       if ( 'bulk-unspam' === $this->current_action() || ( isset( $_REQUEST['action2'] ) && $_REQUEST['action2'] === 'bulk-unspam' ) ) {
    702710            $nonce = isset ( $_REQUEST['_wpnonce'] ) ? wp_unslash($_REQUEST['_wpnonce']) : '';
     
    723731
    724732       if ( 'bulk-move' === $this->current_action() || ( isset( $_REQUEST['action2'] ) && $_REQUEST['action2'] === 'bulk-move' ) ) {
    725             $moveto = isset($_REQUEST['move2']) ? absint($_REQUEST['move2']) : '';
     733            $movefrom = isset($_REQUEST['form']) ? absint($_REQUEST['form']) : '';
     734            $moveto = isset($_REQUEST['move2']) ? absint($_REQUEST['move2']) : '';
    726735            $nonce = isset ( $_REQUEST['_wpnonce'] ) ? wp_unslash($_REQUEST['_wpnonce']) : '';
    727736            if ( ! wp_verify_nonce( $nonce, 'bulk-sform-entries' ) ) { $this->invalid_nonce_redirect(); }
    728             else {              
     737            else {   
    729738              $ids = isset($_REQUEST['id']) && is_array($_REQUEST['id']) ? $_REQUEST['id'] : array($_REQUEST['id']);
    730739              $ids = array_map('absint', $ids);
     
    735744                $form_name = $wpdb->get_var( "SELECT name FROM {$wpdb->prefix}sform_shortcodes WHERE id = '{$moveto}'");
    736745                $name = ! empty($form_name) ? $form_name : __( 'selected form', 'simpleform-contact-form-submissions' );
    737                 $success = $wpdb->query( $wpdb->prepare("UPDATE {$wpdb->prefix}sform_submissions SET form = '{$moveto}' WHERE id IN($placeholders)", $ids) );
    738                 if ( $success ):   
     746                $success = $wpdb->query( $wpdb->prepare("UPDATE {$wpdb->prefix}sform_submissions SET moved_from = form, form = '{$moveto}' WHERE id IN($placeholders)", $ids) );
     747                if ( $success ):
     748                $util = new SimpleForm_Submissions_Util();     
     749                $util->update_last_messages( $ids, $movefrom, $moveto );
    739750                $messages = implode(',', $ids);
    740751                $action_notice = '<div class="notice notice-success is-dismissible"><p>' . sprintf( _n( 'Submission with ID: %1$s successfully moved to %2$s', 'Submissions with ID: %1$s successfully moved to %2$s', $ids_count, 'simpleform-contact-form-submissions' ), $messages, $name ) .'</p></div>';
     
    870881   
    871882    /**
    872      * Edit bulk actions.
     883     * Append the selector to move entries in the bulk actions menu.
    873884     *
    874885     * @since 2.0
     
    876887   
    877888    function bulk_actions( $which = '' ) {
    878     if ( is_null( $this->_actions ) ) {
     889     
     890      $id = isset( $_REQUEST['form'] ) ? absint($_REQUEST['form']) : '';
     891      $moving_option = '';
     892     
     893      // Prevent duplicate queries in bottom bulk actions
     894      if ( !empty($id) && 'top' === $which ) {
     895        global $wpdb;
     896        $forms = $wpdb->get_results( "SELECT id, name FROM {$wpdb->prefix}sform_shortcodes WHERE id != '{$id}' ORDER BY name ASC", 'ARRAY_A' );
     897        if ( count($forms) > 1 ) {
     898          $moving_option .= '<select name="moveto" id="moveto" class="moveto unseen"><option value="">' . __( 'Select Form', 'simpleform-contact-form-submissions' ) . '</option>';
     899          foreach($forms as $form) { $moving_option .= '<option value="'.$form['id'].'">'. $form['name'].'</option>'; }
     900          $moving_option .= '</select>';
     901        }
     902      }
     903       
     904      if ( is_null( $this->_actions ) ) {
    879905        $this->_actions = $this->get_bulk_actions();
     906        $this->_actions = apply_filters( "bulk_actions-{$this->screen->id}", $this->_actions );
     907        $two = '';
     908      } else {
     909        $two = '2';
     910      }
    880911 
    881         /**
    882          * Filters the items in the bulk actions menu of the list table............
    883          *
    884          * @since 1.7
    885          */
    886         $this->_actions = apply_filters( "bulk_actions-{$this->screen->id}", $this->_actions ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
     912      if ( empty( $this->_actions ) ) {
     913        return;
     914      }
    887915 
    888         $two = '';
    889     } else {
    890         $two = '2';
    891     }
     916      echo '<label for="bulk-action-selector-' . esc_attr( $which ) . '" class="screen-reader-text">' . __( 'Select bulk action' ) . '</label>';
     917      echo '<select name="action' . $two . '" id="bulk-action-selector-' . esc_attr( $which ) . "\">\n";
     918      echo '<option value="-1">' . __( 'Bulk actions' ) . "</option>\n";
    892919 
    893     if ( empty( $this->_actions ) ) {
    894         return;
    895     }
    896  
    897     echo '<label for="bulk-action-selector-' . esc_attr( $which ) . '" class="screen-reader-text">' . __( 'Select bulk action' ) . '</label>';
    898     echo '<select name="action' . $two . '" id="bulk-action-selector-' . esc_attr( $which ) . "\">\n";
    899     echo '<option value="-1">' . __( 'Bulk actions' ) . "</option>\n";
    900  
    901     foreach ( $this->_actions as $key => $value ) {
     920      foreach ( $this->_actions as $key => $value ) {
    902921        if ( is_array( $value ) ) {
    903922            echo "\t" . '<optgroup label="' . esc_attr( $key ) . '">' . "\n";
     
    914933            echo "\t" . '<option value="' . esc_attr( $key ) . '"' . $class . '>' . $value . "</option>\n";
    915934        }
    916     }
     935      }
    917936 
    918     echo "</select>\n";
     937      echo "</select>\n";
     938     
     939      echo $moving_option;
     940     
     941      submit_button( __( 'Apply' ), 'action', '', false, array( 'id' => "doaction$two" ) );
     942      echo "\n";
    919943   
    920     $id = isset( $_REQUEST['form'] ) ? absint($_REQUEST['form']) : '';
    921     if ( !empty($id) ) {
    922       global $wpdb;
    923       $table_name = "{$wpdb->prefix}sform_shortcodes";
    924       $forms = $wpdb->get_results( "SELECT id, name FROM $table_name WHERE id != '{$id}' ORDER BY name ASC", 'ARRAY_A' );
    925       $forms_counter = count($forms);
    926       if ( $forms_counter > 1 ) {
    927         echo '<select name="moveto" id="moveto" class="unseen"><option value="">' . __( 'Select Form', 'simpleform-contact-form-submissions' ) . '</option>';
    928         foreach($forms as $form) { $form_id = $form['id']; $form_name = $form['name']; echo '<option value="'.$form_id.'">'.$form_name.'</option>'; }
    929         echo '</select>';
    930       }
    931     }
    932  
    933     submit_button( __( 'Apply' ), 'action', '', false, array( 'id' => "doaction$two" ) );
    934     echo "\n";
    935944    }   
    936 
     945       
    937946    /**
    938947     * Add a date filter.
     
    10491058        }
    10501059       
    1051         echo '<input type="hidden" id="move2" name="move2" value="XX">';
     1060               $form_id = isset($_REQUEST['form']) ? absint($_REQUEST['form']) : '';
     1061
     1062        echo '<input type="hidden" id="form" name="form" value="'.$form_id.'">';
     1063        echo '<input type="hidden" id="move2" name="move2" value="">';
    10521064        echo '<input id="my-post-query-submit" class="button" type="submit" value="'. __("Filter", "simpleform-contact-form-submissions") .'" name="" style="margin-right: 10px;">';
    10531065        }
  • simpleform-contact-form-submissions/trunk/public/class-public.php

    r2664815 r2701411  
    113113      }
    114114     
    115       $submitter = $requester_name != '' ? $requester_name : __( 'Anonymous', 'simpleform' );
     115      $submitter = $requester_name != '' ? $requester_name : __( 'Anonymous', 'simpleform-contact-form-submissions' );
    116116
    117117      if ( ! empty($email) ) { $requester_email = $email; }
     
    128128      $listable = $data_storing == 'true' ? '1' : '0';
    129129     
    130       // Add filter for moving
    131       // (listable refers to move to form NOT to move from form)
    132      
    133       // NEEDS TO FIX IF MOVING NEXT ENABLED
    134       // FORM FROM storing disabled and FORM TO storing enabled, or vice versa
    135       // Solution => show error message ad display option for save/unsave message data
     130      // NEEDS TO FIX IF MOVING ENABLED ?
    136131     
    137132      if ( $data_storing == 'true' ) {
  • simpleform-contact-form-submissions/trunk/simpleform-submissions.php

    r2664815 r2701411  
    55 * Plugin Name: SimpleForm Contact Form Submissions
    66 * Description: You are afraid of losing important messages? This addon for SimpleForm saves data into the WordPress database, and allows you to easily manage the messages from the dashboard.
    7  * Version: 2.0
     7 * Version: 2.0.1
    88 * Requires at least: 5.2
    99 * Requires PHP: 5.6
     
    2626 
    2727define( 'SIMPLEFORM_SUBMISSIONS_NAME', 'SimpleForm Contact Form Submissions' );
    28 define( 'SIMPLEFORM_SUBMISSIONS_VERSION', '2.0' );
    29 define( 'SIMPLEFORM_SUBMISSIONS_DB_VERSION', '2.0' );
     28define( 'SIMPLEFORM_SUBMISSIONS_VERSION', '2.0.1' );
     29define( 'SIMPLEFORM_SUBMISSIONS_DB_VERSION', '2.0.1' );
    3030define( 'SIMPLEFORM_SUBMISSIONS_BASENAME', plugin_basename( __FILE__ ) );
    3131define( 'SIMPLEFORM_SUBMISSIONS_PATH', plugin_dir_path( __FILE__ ) );
    32 define( 'SIMPLEFORM_VERSION_REQUIRED', '2.1.1' );
     32define( 'SIMPLEFORM_VERSION_REQUIRED', '2.1.5' );
    3333
    3434/**
  • simpleform-contact-form-submissions/trunk/uninstall.php

    r2664815 r2701411  
    2323    $prefix = $wpdb->prefix;
    2424    $submissions_table = $prefix . 'sform_submissions';
    25     $wpdb->query("ALTER TABLE $submissions_table DROP COLUMN name, DROP COLUMN lastname, DROP COLUMN email, DROP COLUMN phone, DROP COLUMN subject, DROP COLUMN object, DROP COLUMN ip, DROP COLUMN status, DROP COLUMN trash_date, DROP COLUMN listable");
     25    $wpdb->query("ALTER TABLE $submissions_table DROP COLUMN name, DROP COLUMN lastname, DROP COLUMN email, DROP COLUMN phone, DROP COLUMN subject, DROP COLUMN object, DROP COLUMN ip, DROP COLUMN listable, DROP COLUMN movable");
    2626   }
    2727   $addon_settings = array( 'data_storing' => $settings['data_storing'], 'ip_storing' => $settings['ip_storing'], 'data_columns' => $settings['data_columns'], 'counter' => $settings['counter'], 'deleting_messages' => $settings['deleting_messages'] );
     
    6868        $prefix = $wpdb->prefix;
    6969        $submissions_table = $prefix . 'sform_submissions';
    70         $wpdb->query("ALTER TABLE $submissions_table DROP COLUMN name, DROP COLUMN lastname, DROP COLUMN email, DROP COLUMN phone, DROP COLUMN subject, DROP COLUMN object, DROP COLUMN ip, DROP COLUMN status, DROP COLUMN trash_date, DROP COLUMN listable");
     70        $wpdb->query("ALTER TABLE $submissions_table DROP COLUMN name, DROP COLUMN lastname, DROP COLUMN email, DROP COLUMN phone, DROP COLUMN subject, DROP COLUMN object, DROP COLUMN ip, DROP COLUMN listable, DROP COLUMN movable");
    7171        }
    7272        $addon_settings = array( 'data_storing' => $settings['data_storing'], 'ip_storing' => $settings['ip_storing'], 'data_columns' => $settings['data_columns'], 'counter' => $settings['counter'], 'deleting_messages' => $settings['deleting_messages'] );
Note: See TracChangeset for help on using the changeset viewer.