Plugin Directory

Changeset 2804103


Ignore:
Timestamp:
10/25/2022 07:31:13 PM (3 years ago)
Author:
registerone
Message:

v3.6.3

Location:
registerone-event-forms/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • registerone-event-forms/trunk/admin/classes/RegisteroneShortcodes.php

    r2801401 r2804103  
    18171817                break;
    18181818
     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
    18191859            case "payment":
    18201860
     
    18731913        $headers = $this->_set_request_header(['Accept' => "application/json, text/javascript, */*; q=0.01", 'Authorization' => 'Basic ' . $this->plugin_api_auth_key]);
    18741914
    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']];
    18761916        $request_args = $this->_get_request_args([
    18771917                'method'  => 'POST',
     
    18871927        echo $responses;
    18881928        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;
    18891951    }
    18901952
     
    25472609
    25482610        }elseif(isset( $_GET['amenities'])) {
     2611
    25492612            if(isset( $_GET['map']) && $_GET['map'] != '') {
    25502613                return "map";
     
    25572620
    25582621        }elseif(isset( $_GET['terms'])) {
     2622
    25592623            if(isset( $_GET['signature']) && $_GET['signature'] != '') {
    25602624                return "signature";
     
    26292693     * @return string
    26302694     */
    2631     private  function _signature_screen($formData)
     2695    private function _signature_screen($formData)
    26322696    {
    26332697        $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        }
    26342709
    26352710        $form = $this->_create_signature_screen_fields($formData, $form);
     
    38993974        $status_approved = $event_attributes['applicant_a']['approval_status'] == 1 ? true : false;
    39003975
     3976        // print_r($formData); die;
     3977
     3978        // checkbox signed
     3979        // $formData['terms_scope'] => 3
     3980
     3981
    39013982        /*
    39023983         * $event_a['c_cfg2']
     
    39163997        }
    39173998
     3999        // print_r($applicant_signature); die;
     4000
    39184001        if(isset($applicant_signature['signature'])) {
    39194002            foreach($applicant_signature['signature'] AS $signature){
     
    39224005                    $terms_sign_date = $signature['sign_date'];
    39234006                    $terms_sign_svg = $signature['svg'];
     4007                    $terms_ip_address = $signature['ip_address'];
    39244008                }
    39254009                if($signature['terms_scope'] == 2){
     
    39274011                    $contract_sign_date = $signature['sign_date'];
    39284012                    $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'];
    39294020                }
    39304021            }
     
    39504041        <?php endif; ?>
    39514042
    3952         <?php //// TERMS ///// ?>
     4043        <?php //// TERMS SIGNATURE ///// ?>
    39534044
    39544045        <?php if($formData['terms_scope'] == 1) : ?>
     
    39644055                </div>
    39654056
    3966                 <div style="width: 100%; margin-bottom:20px;">
     4057                <div style="width: 100%; margin-bottom:20px; margin-top:10px;">
    39674058                    <div class="sig_block_inner">
    39684059                        <img src="<?php echo $terms_sign_svg; ?>" alt="" style="width: 80%;" height="auto">
    39694060                        <hr>
    3970                         Signature
     4061                        <div style="margin-top: -8px;">Signature</div>
    39714062                    </div>
    39724063                    <div class="sig_block_inner">
    39734064                        <h4><?php echo $terms_sign_date; ?></h4>
    39744065                        <hr>
    3975                         Date
     4066                        <div style="margin-top: -8px;">Date</div>
    39764067                    </div>
    39774068                </div>
     
    39974088                    </div>
    39984089
     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
    39994180                    <div class="center" style="margin-top:10px;">
    40004181                        <button type="submit" id="terms-agree-button" class="btn">
     
    40024183                        </button>
    40034184                    </div>
     4185
    40044186                <?php else: ?>
    40054187                    <?php $display_continue = true; ?>
     
    40214203                    });
    40224204                </script>
    4023 
    4024                 <?php $hide_continue = true; ?>
    40254205            <?php endif; ?>
    40264206
    40274207        <?php endif; ?>
    40284208
    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) : ?>
    40344215
    40354216                <div class="col-lg-offset-2">
    4036                     <h4><?php echo $formData['contract']['title']; ?></h4>
     4217                    <h4><?php echo $formData['terms']['title']; ?></h4>
    40374218                </div>
    40384219
    40394220                <div id="summernote">
    4040                     <?php echo $formData['contract']['body']; ?>
     4221                    <?php echo $formData['terms']['body']; ?>
    40414222                </div>
    40424223
    4043                 <div style="width: 100%; margin-bottom:20px;">
     4224                <div style="width: 100%; margin-bottom:20px; margin-top:10px;">
    40444225                    <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>
    40464227                        <hr>
    4047                         Signature
     4228                        <div style="margin-top: -8px;">Signed on Date</div>
    40484229                    </div>
    40494230                    <div class="sig_block_inner">
    4050                         <h4><?php echo $contract_sign_date; ?></h4>
     4231                        <h4><?php echo $terms_ip_address; ?></h4>
    40514232                        <hr>
    4052                         Date
     4233                        <div style="margin-top: -8px;">IP Address</div>
    40534234                    </div>
    40544235                </div>
     
    40594240
    40604241                <div class="col-lg-offset-2">
    4061                     <h4><?php echo $formData['contract']['title']; ?></h4>
     4242                    <h4><?php echo $formData['terms']['title']; ?></h4>
    40624243                </div>
    40634244
    40644245                <div id="summernote">
    4065                     <?php echo $formData['contract']['body']; ?>
     4246                    <?php echo $formData['terms']['body']; ?>
    40664247                </div>
    40674248
     
    40704251                        <form class="terms-checkbox">
    40714252                            <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']; ?>
    40734254                        </form>
    40744255                    </div>
    40754256
    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; ?>
    40814270                <?php else: ?>
    40824271                    <?php $display_continue = true; ?>
     
    40904279                                document.location.href = "<?php echo $this->_get_skip_url(['terms' => '', 'signature' => $formData['terms_scope'], 'pk' => sanitize_text_field($_GET['pk'])]); ?>";
    40914280                            });
     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                            });
    40924284                            $("#terms-checkbox").on("click", function() {
    40934285                                var chk = $("#terms-checkbox").is(":checked");
    40944286                                $('#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
    40954288                            });
    40964289                        });
    40974290                        $('#terms-agree-button').prop("disabled", "disabled");
     4291                        $('#terms-agree-submit').prop("disabled", "disabled");
    40984292                    });
    40994293                </script>
     4294
     4295                <?php $hide_continue = true; ?>
    41004296            <?php endif; ?>
    41014297
     
    52765472                        'amenity_id': api_url_info["amenity_id"]
    52775473                    };
    5278                     console.log(post_data);
     5474                    /* console.log(post_data); */
    52795475                    $.post(ajax_url, post_data, function(data){
    5280                         console.log(data);
     5476                        /* console.log(data); */
    52815477                        var json = JSON.parse(data);
    52825478                        resolve(json);
     
    87418937            return $base_url . "/";
    87428938        }
     8939
    87438940        /**
    87448941         * @param $fields
     
    87468943         * @return string
    87478944         */
    8748 
    87498945        private function _generate_privacysign_screen_field($fields, $client_a, $event_a, $pre_launch_count = 0)
    87508946        {
     
    97679963            ];
    97689964
    9769             // $button_custom_labels = json_decode($attributes['event_a']['button_labels'], true);
    97709965            $button_custom_labels = $attributes['event_a']['button_labels'];
    97719966
     
    988210077                    }
    988310078                    ?>
    9884                     v3.6.2
     10079                    v3.6.3
    988510080                    : <a href="https://app.registerone.com/privacy-policy" target="_blank">Privacy Policy</a>
    988610081                    <?php
  • registerone-event-forms/trunk/front-end/assets/css/form-custom.css

    r2796267 r2804103  
    348348/* signature block */
    349349.sig_block_inner {
    350     outline: 0px;
     350    outline: 0;
     351    padding-right: 20px;
    351352    width: 100%;
    352353    display: table-cell;
  • registerone-event-forms/trunk/readme.txt

    r2801401 r2804103  
    77Requires at least: 5
    88Tested up to: 6.0
    9 Version 3.6.2
    10 Stable tag: 3.6.2
     9Version 3.6.3
     10Stable tag: 3.6.3
    1111Requires PHP: 5.6
    1212License: GPLv2 or later
     
    138138== Changelog ==
    139139
     140= 3.6.3 =
     141* UPDATE: Added support for checkbox T&C agreement
     142
    140143= 3.6.2 =
    141144* FIX: warnings for PHP::unset() calls
  • registerone-event-forms/trunk/registerone-wordpress-client.php

    r2801401 r2804103  
    44Plugin URI: https://www.registerone.com
    55Description: RegisterONE – Exhibitor & Speaker Registration, Advanced Booth Mapping, Ticketing
    6 Version: 3.6.2
     6Version: 3.6.3
    77Author: RegisterONE
    88Author URI: http://www.registerone.com
     
    318318            global $post;
    319319
    320             $script_rev = '202206071830';
     320            $script_rev = '202210251530';
    321321
    322322            if( is_a( $post, 'WP_Post' ) && has_shortcode( $post->post_content, $this->short_code)){
Note: See TracChangeset for help on using the changeset viewer.