Changeset 3410172
- Timestamp:
- 12/03/2025 09:57:36 PM (4 months ago)
- Location:
- whistleblowing-system/trunk
- Files:
-
- 7 edited
-
admin/Controller.php (modified) (1 diff)
-
admin/assets/js/edit.js (modified) (1 diff)
-
config.php (modified) (1 diff)
-
frontend/Controller.php (modified) (1 diff)
-
library.php (modified) (1 diff)
-
readme.txt (modified) (2 diffs)
-
whistleblowing.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
whistleblowing-system/trunk/admin/Controller.php
r3404400 r3410172 69 69 $email_options = array(); 70 70 if ( isset($_POST['email_options']) && is_array($_POST['email_options']) ) { 71 $email_options = map_deep(wp_unslash($_POST['email_options']), 'sanitize_text_field'); 71 $email_options = map_deep(wp_unslash($_POST['email_options']), function($value) { 72 return wp_kses($value, WBLSLibrary::$wp_kses_default); 73 }); 72 74 } 73 75 -
whistleblowing-system/trunk/admin/assets/js/edit.js
r3404400 r3410172 976 976 stop() { 977 977 self.columns_refresh(); 978 self.update_fields_order(); 978 979 } 979 980 }).disableSelection(); 980 981 } 982 983 /** 984 * Goes through all .wblsform-row elements in the DOM (in visual order) 985 * and updates fields_options[fieldId].order = index (0, 1, 2, ...) 986 */ 987 update_fields_order() { 988 let orderIndex = 0; 989 const self = this; 990 991 jQuery(".wblsform-row").each(function() { 992 993 // Get the field ID from data-field-id 994 const idAttr = jQuery(this).attr("data-field-id"); 995 996 if (typeof idAttr === "undefined") { 997 // If no ID, skip this element 998 return; 999 } 1000 1001 // Convert ID to string (fields_options keys may be strings) 1002 const fieldId = String(idAttr); 1003 1004 // Update the order in fields_options if the field exists 1005 if (self.fields_options && typeof self.fields_options[fieldId] !== "undefined") { 1006 1007 self.fields_options[fieldId].order = orderIndex; 1008 1009 } else { 1010 // If fields_options is using numeric keys, try numeric conversion 1011 const numericId = parseInt(fieldId, 10); 1012 1013 if ( 1014 !isNaN(numericId) && 1015 Array.isArray(self.fields_options) && 1016 typeof self.fields_options[numericId] !== "undefined" 1017 ) { 1018 self.fields_options[numericId].order = orderIndex; 1019 } else { 1020 // Field not found in fields_options (optional debug) 1021 // console.warn('Field not found in fields_options:', fieldId); 1022 } 1023 } 1024 1025 // Optional: update DOM attribute for debugging 1026 jQuery(this).attr('data-field-order', orderIndex); 1027 1028 orderIndex++; 1029 }); 1030 1031 // Optionally sort fields_options by order here 1032 // Or trigger a save (AJAX) call if needed 1033 } 1034 981 1035 982 1036 columns_refresh() { -
whistleblowing-system/trunk/config.php
r3404400 r3410172 5 5 6 6 if (!defined('WBLS_VERSION')) { 7 define('WBLS_VERSION', '1.4. 4');7 define('WBLS_VERSION', '1.4.5'); 8 8 } 9 9 if (!defined('WBLS_PREFIX')) { -
whistleblowing-system/trunk/frontend/Controller.php
r3404400 r3410172 541 541 } 542 542 543 // Reorder form fields as in html view using order setting in the field data 544 if (!empty($this->form_data)) { 545 // Sort array by 'order' value ascending 546 usort($this->form_data, function($a, $b) { 547 // If 'order' is missing, treat as 0 548 $orderA = isset($a['order']) ? (int)$a['order'] : 0; 549 $orderB = isset($b['order']) ? (int)$b['order'] : 0; 550 551 return $orderA <=> $orderB; 552 }); 553 } 554 543 555 544 556 foreach ($this->form_data as $data ) { -
whistleblowing-system/trunk/library.php
r3398357 r3410172 123 123 'style' => array(), 124 124 ), 125 125 'br' => array(), 126 'hr' => array( 127 'class' => array(), 128 'id' => array(), 129 'style' => array(), 130 ), 126 131 ); 127 132 -
whistleblowing-system/trunk/readme.txt
r3404400 r3410172 5 5 Tested up to: 6.8 6 6 Requires PHP: 7.4 7 Stable tag: 1.4. 47 Stable tag: 1.4.5 8 8 License: GPLv3 9 9 License URI: https://www.gnu.org/licenses/gpl-3.0.html … … 140 140 141 141 == Changelog == 142 = 1.4.5 = 143 Fixed: Form fields ordering in the email 144 142 145 = 1.4.4 = 143 146 Added: Status changed in logs -
whistleblowing-system/trunk/whistleblowing.php
r3404400 r3410172 4 4 * Plugin URI: https://whistleblowing-form.de 5 5 * Description: Whistleblowing system form is the ultimate solution for effortlessly creating and managing contact and whistleblowing forms. 6 * Version: 1.4. 46 * Version: 1.4.5 7 7 * Author: Whistleblowing System Team 8 8 * Author URI: https://whistleblowing-form.de
Note: See TracChangeset
for help on using the changeset viewer.