Changeset 2804103
- Timestamp:
- 10/25/2022 07:31:13 PM (3 years ago)
- Location:
- registerone-event-forms/trunk
- Files:
-
- 4 edited
-
admin/classes/RegisteroneShortcodes.php (modified) (23 diffs)
-
front-end/assets/css/form-custom.css (modified) (1 diff)
-
readme.txt (modified) (2 diffs)
-
registerone-wordpress-client.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
registerone-event-forms/trunk/admin/classes/RegisteroneShortcodes.php
r2801401 r2804103 1817 1817 break; 1818 1818 1819 case "terms_confirm": 1820 1821 // call signature function to process 1822 $data['dwc_screen_name'] = 'signature'; 1823 $responses = json_decode($this->_execute_terms_confirm_submission($data), true); 1824 1825 $redirect_url = $root; 1826 1827 if($responses['code'] == 202 || 1828 $responses['code'] == 201 || 1829 $responses['code'] == 200) { 1830 1831 // set to terms for navigation redirect 1832 $data['dwc_screen_name'] = 'terms'; 1833 1834 $next_step_a = $responses['next_step'][0]; 1835 $key_pos = (int)array_search($data['dwc_screen_name'], $next_step_a); 1836 $key_pos++; 1837 1838 $redirect_url = $root; 1839 $redirect_url .= "?".$next_step_a[$key_pos]; 1840 } 1841 1842 if(!empty($responses['profile_key'])){ 1843 $redirect_url .= "&pk=" . $responses['profile_key']; 1844 1845 }elseif($_SESSION['pk']){ 1846 $redirect_url .= "&pk=" . $_SESSION['pk']; 1847 1848 }elseif($_SESSION['temp_pk']){ 1849 $redirect_url .= "&pk=" . $_SESSION['temp_pk'].".temp_pk"; 1850 } 1851 1852 $mt = str_replace('.', '', microtime(true)); 1853 $redirect_url .= "&v=".$mt; 1854 1855 wp_redirect($redirect_url); 1856 exit(); 1857 break; 1858 1819 1859 case "payment": 1820 1860 … … 1873 1913 $headers = $this->_set_request_header(['Accept' => "application/json, text/javascript, */*; q=0.01", 'Authorization' => 'Basic ' . $this->plugin_api_auth_key]); 1874 1914 1875 $signatureData = [' svg_xml' => $data['svg_xml'], 'svg' => $data['svg'], 'terms_scope' => $data['terms_scope']];1915 $signatureData = ['confirm_ip' => $_SERVER['REMOTE_ADDR'], 'svg_xml' => $data['svg_xml'], 'svg' => $data['svg'], 'terms_scope' => $data['terms_scope']]; 1876 1916 $request_args = $this->_get_request_args([ 1877 1917 'method' => 'POST', … … 1887 1927 echo $responses; 1888 1928 die(); 1929 } 1930 1931 /** 1932 * @param $data 1933 */ 1934 private function _execute_terms_confirm_submission($data) { 1935 1936 $headers = $this->_set_request_header(['Accept' => "application/json, text/javascript, */*; q=0.01", 'Authorization' => 'Basic ' . $this->plugin_api_auth_key]); 1937 1938 $confirmData = ['confirm_ip' => $_SERVER['REMOTE_ADDR'], 'terms_scope' => 3]; 1939 $request_args = $this->_get_request_args([ 1940 'method' => 'POST', 1941 'headers' => $headers, 1942 'body' => $confirmData 1943 ] 1944 ); 1945 1946 $request_url = $this->base_request_url . $data['form_code'] . "/" . $data['dwc_screen_name'] . "/" . $data['profile_key']; 1947 1948 $responses = wp_remote_retrieve_body(wp_remote_request($request_url, $request_args)); 1949 1950 return $responses; 1889 1951 } 1890 1952 … … 2547 2609 2548 2610 }elseif(isset( $_GET['amenities'])) { 2611 2549 2612 if(isset( $_GET['map']) && $_GET['map'] != '') { 2550 2613 return "map"; … … 2557 2620 2558 2621 }elseif(isset( $_GET['terms'])) { 2622 2559 2623 if(isset( $_GET['signature']) && $_GET['signature'] != '') { 2560 2624 return "signature"; … … 2629 2693 * @return string 2630 2694 */ 2631 private function _signature_screen($formData)2695 private function _signature_screen($formData) 2632 2696 { 2633 2697 $form = ""; 2698 2699 // process terms checkbox submission 2700 if(isset( $_GET['signature']) && $_GET['signature'] == 3) { 2701 2702 $event_attributes = json_decode($this->event_attributes, true); 2703 $data['form_code'] = $event_attributes['event_a']['form_code']; 2704 $data['profile_key'] = "{$event_attributes['applicant_a']['profile_key']}.{$_SESSION['api_token']}"; // => GZNFFuJDmmiFpM2NTldI 2705 $data['dwc_screen_name'] = 'terms_confirm'; 2706 2707 $this->_execute_form_submission($data, $this->_get_form_root_path(wp_get_referer())); 2708 } 2634 2709 2635 2710 $form = $this->_create_signature_screen_fields($formData, $form); … … 3899 3974 $status_approved = $event_attributes['applicant_a']['approval_status'] == 1 ? true : false; 3900 3975 3976 // print_r($formData); die; 3977 3978 // checkbox signed 3979 // $formData['terms_scope'] => 3 3980 3981 3901 3982 /* 3902 3983 * $event_a['c_cfg2'] … … 3916 3997 } 3917 3998 3999 // print_r($applicant_signature); die; 4000 3918 4001 if(isset($applicant_signature['signature'])) { 3919 4002 foreach($applicant_signature['signature'] AS $signature){ … … 3922 4005 $terms_sign_date = $signature['sign_date']; 3923 4006 $terms_sign_svg = $signature['svg']; 4007 $terms_ip_address = $signature['ip_address']; 3924 4008 } 3925 4009 if($signature['terms_scope'] == 2){ … … 3927 4011 $contract_sign_date = $signature['sign_date']; 3928 4012 $contract_sign_svg = $signature['svg']; 4013 $contract_ip_address = $signature['ip_address']; 4014 } 4015 // checkbox signed 4016 if($signature['terms_scope'] == 3){ 4017 $terms_signed = true; 4018 $terms_sign_date = $signature['sign_date']; 4019 $terms_ip_address = $signature['ip_address']; 3929 4020 } 3930 4021 } … … 3950 4041 <?php endif; ?> 3951 4042 3952 <?php //// TERMS ///// ?>4043 <?php //// TERMS SIGNATURE ///// ?> 3953 4044 3954 4045 <?php if($formData['terms_scope'] == 1) : ?> … … 3964 4055 </div> 3965 4056 3966 <div style="width: 100%; margin-bottom:20px; ">4057 <div style="width: 100%; margin-bottom:20px; margin-top:10px;"> 3967 4058 <div class="sig_block_inner"> 3968 4059 <img src="<?php echo $terms_sign_svg; ?>" alt="" style="width: 80%;" height="auto"> 3969 4060 <hr> 3970 Signature4061 <div style="margin-top: -8px;">Signature</div> 3971 4062 </div> 3972 4063 <div class="sig_block_inner"> 3973 4064 <h4><?php echo $terms_sign_date; ?></h4> 3974 4065 <hr> 3975 Date4066 <div style="margin-top: -8px;">Date</div> 3976 4067 </div> 3977 4068 </div> … … 3997 4088 </div> 3998 4089 4090 <?php if($event_attributes['event_a']['terms_proc'] == 1): ?> 4091 <div class="center" style="margin-top:10px;"> 4092 <button type="submit" id="terms-agree-button" class="btn"> 4093 <i class="fa fa-pencil" aria-hidden="true"></i> <?= $this->_button_label_swap('sign_here') ?> 4094 </button> 4095 </div> 4096 <?php else: ?> 4097 <div class="center" style="margin-top:10px;"> 4098 <button type="submit" id="terms-agree-submit" class="btn"> 4099 Continue <i style="margin-left:0px;" class="fa fa-chevron-right" aria-hidden="true"></i> 4100 </button> 4101 </div> 4102 <?php endif; ?> 4103 <?php else: ?> 4104 <?php $display_continue = true; ?> 4105 <?php endif; ?> 4106 4107 <script type="text/javascript"> 4108 $(document).ready(function () { 4109 // initialize jQuery stuff after page load 4110 $(function(){ 4111 $('#terms-agree-button').click(function () { 4112 document.location.href = "<?php echo $this->_get_skip_url(['terms' => '', 'signature' => $formData['terms_scope'], 'pk' => sanitize_text_field($_GET['pk'])]); ?>"; 4113 }); 4114 $('#terms-agree-submit').click(function () { 4115 document.location.href = "<?php echo $this->_get_skip_url(['terms' => '', 'signature' => 3, 'pk' => sanitize_text_field($_GET['pk'])]); ?>"; 4116 }); 4117 $("#terms-checkbox").on("click", function() { 4118 var chk = $("#terms-checkbox").is(":checked"); 4119 $('#terms-agree-button').prop("disabled", !chk).toggleClass("btn-success",chk); // possibly add .button('refresh'); for JQM 4120 $('#terms-agree-submit').prop("disabled", !chk).toggleClass("btn-success",chk); // possibly add .button('refresh'); for JQM 4121 }); 4122 }); 4123 $('#terms-agree-button').prop("disabled", "disabled"); 4124 $('#terms-agree-submit').prop("disabled", "disabled"); 4125 }); 4126 </script> 4127 4128 <?php $hide_continue = true; ?> 4129 <?php endif; ?> 4130 4131 <?php endif; ?> 4132 4133 <?php //// CONTRACTS ///// ?> 4134 4135 <?php if($formData['terms_scope'] == 2) : ?> 4136 4137 <?php if($contract_signed) : ?> 4138 4139 <div class="col-lg-offset-2"> 4140 <h4><?php echo $formData['contract']['title']; ?></h4> 4141 </div> 4142 4143 <div id="summernote"> 4144 <?php echo $formData['contract']['body']; ?> 4145 </div> 4146 4147 <div style="width: 100%; margin-bottom:20px; margin-top:10px;"> 4148 <div class="sig_block_inner"> 4149 <img src="<?php echo $contract_sign_svg; ?>" alt="" style="width: 80%;" height="auto"> 4150 <hr> 4151 Signature 4152 </div> 4153 <div class="sig_block_inner"> 4154 <h4><?php echo $contract_sign_date; ?></h4> 4155 <hr> 4156 Date 4157 </div> 4158 </div> 4159 <?php $display_continue = true; ?> 4160 <?php $mini_block = true; ?> 4161 4162 <?php else: ?> 4163 4164 <div class="col-lg-offset-2"> 4165 <h4><?php echo $formData['contract']['title']; ?></h4> 4166 </div> 4167 4168 <div id="summernote"> 4169 <?php echo $formData['contract']['body']; ?> 4170 </div> 4171 4172 <?php if($formData['audit'] == 0): ?> 4173 <div style="width:80%; margin:20px auto; text-align:center;"> 4174 <form class="terms-checkbox"> 4175 <input id="terms-checkbox" type="checkbox"/><label class="fa" for="terms-checkbox"></label> 4176 <?php echo $formData['contract']['note']; ?> 4177 </form> 4178 </div> 4179 3999 4180 <div class="center" style="margin-top:10px;"> 4000 4181 <button type="submit" id="terms-agree-button" class="btn"> … … 4002 4183 </button> 4003 4184 </div> 4185 4004 4186 <?php else: ?> 4005 4187 <?php $display_continue = true; ?> … … 4021 4203 }); 4022 4204 </script> 4023 4024 <?php $hide_continue = true; ?>4025 4205 <?php endif; ?> 4026 4206 4027 4207 <?php endif; ?> 4028 4208 4029 <?php //// CONTRACTS ///// ?> 4030 4031 <?php if($formData['terms_scope'] == 2) : ?> 4032 4033 <?php if($contract_signed) : ?> 4209 4210 <?php //// TERMS CHECKBOX ///// ?> 4211 4212 <?php if($formData['terms_scope'] == 3) : ?> 4213 4214 <?php if($terms_signed) : ?> 4034 4215 4035 4216 <div class="col-lg-offset-2"> 4036 <h4><?php echo $formData[' contract']['title']; ?></h4>4217 <h4><?php echo $formData['terms']['title']; ?></h4> 4037 4218 </div> 4038 4219 4039 4220 <div id="summernote"> 4040 <?php echo $formData[' contract']['body']; ?>4221 <?php echo $formData['terms']['body']; ?> 4041 4222 </div> 4042 4223 4043 <div style="width: 100%; margin-bottom:20px; ">4224 <div style="width: 100%; margin-bottom:20px; margin-top:10px;"> 4044 4225 <div class="sig_block_inner"> 4045 < img src="<?php echo $contract_sign_svg; ?>" alt="" style="width: 80%;" height="auto">4226 <h4><?php echo $terms_sign_date; ?></h4> 4046 4227 <hr> 4047 Signature4228 <div style="margin-top: -8px;">Signed on Date</div> 4048 4229 </div> 4049 4230 <div class="sig_block_inner"> 4050 <h4><?php echo $ contract_sign_date; ?></h4>4231 <h4><?php echo $terms_ip_address; ?></h4> 4051 4232 <hr> 4052 Date4233 <div style="margin-top: -8px;">IP Address</div> 4053 4234 </div> 4054 4235 </div> … … 4059 4240 4060 4241 <div class="col-lg-offset-2"> 4061 <h4><?php echo $formData[' contract']['title']; ?></h4>4242 <h4><?php echo $formData['terms']['title']; ?></h4> 4062 4243 </div> 4063 4244 4064 4245 <div id="summernote"> 4065 <?php echo $formData[' contract']['body']; ?>4246 <?php echo $formData['terms']['body']; ?> 4066 4247 </div> 4067 4248 … … 4070 4251 <form class="terms-checkbox"> 4071 4252 <input id="terms-checkbox" type="checkbox"/><label class="fa" for="terms-checkbox"></label> 4072 <?php echo $formData[' contract']['note']; ?>4253 <?php echo $formData['terms']['note']; ?> 4073 4254 </form> 4074 4255 </div> 4075 4256 4076 <div class="center" style="margin-top:10px;"> 4077 <button type="submit" id="terms-agree-button" class="btn"> 4078 <i class="fa fa-pencil" aria-hidden="true"></i> <?= $this->_button_label_swap('sign_here') ?> 4079 </button> 4080 </div> 4257 <?php if($event_attributes['event_a']['terms_proc'] == 1): ?> 4258 <div class="center" style="margin-top:10px;"> 4259 <button type="submit" id="terms-agree-button" class="btn"> 4260 <i class="fa fa-pencil" aria-hidden="true"></i> <?= $this->_button_label_swap('sign_here') ?> 4261 </button> 4262 </div> 4263 <?php else: ?> 4264 <div class="center" style="margin-top:10px;"> 4265 <button type="submit" id="terms-agree-submit" class="btn"> 4266 Continue <i style="margin-left:0px;" class="fa fa-chevron-right" aria-hidden="true"></i> 4267 </button> 4268 </div> 4269 <?php endif; ?> 4081 4270 <?php else: ?> 4082 4271 <?php $display_continue = true; ?> … … 4090 4279 document.location.href = "<?php echo $this->_get_skip_url(['terms' => '', 'signature' => $formData['terms_scope'], 'pk' => sanitize_text_field($_GET['pk'])]); ?>"; 4091 4280 }); 4281 $('#terms-agree-submit').click(function () { 4282 document.location.href = "<?php echo $this->_get_skip_url(['terms' => '', 'signature' => 3, 'pk' => sanitize_text_field($_GET['pk'])]); ?>"; 4283 }); 4092 4284 $("#terms-checkbox").on("click", function() { 4093 4285 var chk = $("#terms-checkbox").is(":checked"); 4094 4286 $('#terms-agree-button').prop("disabled", !chk).toggleClass("btn-success",chk); // possibly add .button('refresh'); for JQM 4287 $('#terms-agree-submit').prop("disabled", !chk).toggleClass("btn-success",chk); // possibly add .button('refresh'); for JQM 4095 4288 }); 4096 4289 }); 4097 4290 $('#terms-agree-button').prop("disabled", "disabled"); 4291 $('#terms-agree-submit').prop("disabled", "disabled"); 4098 4292 }); 4099 4293 </script> 4294 4295 <?php $hide_continue = true; ?> 4100 4296 <?php endif; ?> 4101 4297 … … 5276 5472 'amenity_id': api_url_info["amenity_id"] 5277 5473 }; 5278 console.log(post_data);5474 /* console.log(post_data); */ 5279 5475 $.post(ajax_url, post_data, function(data){ 5280 console.log(data);5476 /* console.log(data); */ 5281 5477 var json = JSON.parse(data); 5282 5478 resolve(json); … … 8741 8937 return $base_url . "/"; 8742 8938 } 8939 8743 8940 /** 8744 8941 * @param $fields … … 8746 8943 * @return string 8747 8944 */ 8748 8749 8945 private function _generate_privacysign_screen_field($fields, $client_a, $event_a, $pre_launch_count = 0) 8750 8946 { … … 9767 9963 ]; 9768 9964 9769 // $button_custom_labels = json_decode($attributes['event_a']['button_labels'], true);9770 9965 $button_custom_labels = $attributes['event_a']['button_labels']; 9771 9966 … … 9882 10077 } 9883 10078 ?> 9884 v3.6. 210079 v3.6.3 9885 10080 : <a href="https://app.registerone.com/privacy-policy" target="_blank">Privacy Policy</a> 9886 10081 <?php -
registerone-event-forms/trunk/front-end/assets/css/form-custom.css
r2796267 r2804103 348 348 /* signature block */ 349 349 .sig_block_inner { 350 outline: 0px; 350 outline: 0; 351 padding-right: 20px; 351 352 width: 100%; 352 353 display: table-cell; -
registerone-event-forms/trunk/readme.txt
r2801401 r2804103 7 7 Requires at least: 5 8 8 Tested up to: 6.0 9 Version 3.6. 210 Stable tag: 3.6. 29 Version 3.6.3 10 Stable tag: 3.6.3 11 11 Requires PHP: 5.6 12 12 License: GPLv2 or later … … 138 138 == Changelog == 139 139 140 = 3.6.3 = 141 * UPDATE: Added support for checkbox T&C agreement 142 140 143 = 3.6.2 = 141 144 * FIX: warnings for PHP::unset() calls -
registerone-event-forms/trunk/registerone-wordpress-client.php
r2801401 r2804103 4 4 Plugin URI: https://www.registerone.com 5 5 Description: RegisterONE – Exhibitor & Speaker Registration, Advanced Booth Mapping, Ticketing 6 Version: 3.6. 26 Version: 3.6.3 7 7 Author: RegisterONE 8 8 Author URI: http://www.registerone.com … … 318 318 global $post; 319 319 320 $script_rev = '2022 06071830';320 $script_rev = '202210251530'; 321 321 322 322 if( is_a( $post, 'WP_Post' ) && has_shortcode( $post->post_content, $this->short_code)){
Note: See TracChangeset
for help on using the changeset viewer.