Plugin Directory

Changeset 3363642


Ignore:
Timestamp:
09/18/2025 05:25:18 AM (5 months ago)
Author:
myappy
Message:

Tagging version 1.2.5

Location:
crs-booker
Files:
3 edited
33 copied

Legend:

Unmodified
Added
Removed
  • crs-booker/tags/1.2.5/crs_booker.js

    r3359743 r3363642  
    55 * Author: My Appy
    66 * Author URI: http://www.myappy.it/
    7  * Version: 1.2.4
     7 * Version: 1.2.5
    88 * Text Domain: crs-booker
    99 * License: GPLv2 or later
     
    10811081                {
    10821082                    var available = bases[i].available && (!checkoutBase || checkoutBase.userIds.filter(value => bases[i].userIds.includes(value)).length > 0);
     1083
     1084                    if (params.checkout_base != i && available)
     1085                    {
     1086                        // Be sure one way is enabled.
     1087                        fromBaseIds = crsbkr_array_get(checkoutBase, 'bases', '').split(',').filter(n => ('' + n).length > 0);
     1088                        toBaseIds = crsbkr_array_get(bases[i], 'bases', '').split(',').filter(n => ('' + n).length > 0);
     1089
     1090                        var found = false;
     1091                        for (var ii = 0; ii < data.base_transfer_time.length; ii++)
     1092                        {
     1093                            if (crsbkr_array_get(data.base_transfer_time[ii], 'one_way', 0) != 0 && fromBaseIds.indexOf(data.base_transfer_time[ii].from_base_id) != -1 && toBaseIds.indexOf(data.base_transfer_time[ii].to_base_id) != -1)
     1094                            {
     1095                                found = true;
     1096                                break;
     1097                            }
     1098                        }
     1099
     1100                        if (!found)
     1101                        {
     1102                            available = false;
     1103                        }
     1104                    }
     1105
    10831106                    checkinBaseList.children[i].style.display = available ? 'block' : 'none';
    10841107
     
    19691992                        checkinBaseInput.parentNode.classList.remove('error');
    19701993                    }
     1994                }
     1995            }
     1996
     1997            if (checkinBaseInput && !checkoutBaseInput.parentNode.classList.contains('error') && !checkinBaseInput.parentNode.classList.contains('error') && checkoutBaseInput.base != checkinBaseInput.base && data.base_transfer_time)
     1998            {
     1999                // Be sure one way is enabled.
     2000                fromBaseIds = crsbkr_array_get(bases[checkoutBaseInput.base], 'bases', '').split(',').filter(n => ('' + n).length > 0);
     2001                toBaseIds = crsbkr_array_get(bases[checkinBaseInput.base], 'bases', '').split(',').filter(n => ('' + n).length > 0);
     2002
     2003                var found = false;
     2004                for (var i = 0; i < data.base_transfer_time.length; i++)
     2005                {
     2006                    if (crsbkr_array_get(data.base_transfer_time[i], 'one_way', 0) != 0 && fromBaseIds.indexOf(data.base_transfer_time[i].from_base_id) != -1 && toBaseIds.indexOf(data.base_transfer_time[i].to_base_id) != -1)
     2007                    {
     2008                        console.log(data.base_transfer_time);
     2009                        found = true;
     2010                        break;
     2011                    }
     2012                }
     2013
     2014                if (found)
     2015                {
     2016                    checkinBaseInput.parentNode.classList.remove('error');
     2017                }
     2018                else
     2019                {
     2020                    checkinBaseInput.parentNode.classList.add('error');
    19712021                }
    19722022            }
     
    21532203                    }
    21542204
    2155                     if (!open)
     2205                    if (dateObj < new Date())
     2206                    {
     2207                        error.innerHTML = CRSBKR_STRINGS['search.error.pastDate'];
     2208
     2209                        timeError.className = 'error';
     2210                        timeError.innerHTML = error.innerHTML;
     2211                    }
     2212                    else if (!open)
    21562213                    {
    21572214                        if (dayField.textContent.length > 0)
  • crs-booker/tags/1.2.5/crs_booker.php

    r3359743 r3363642  
    77 * Author: My Appy
    88 * Author URI: http://www.myappy.it/
    9  * Version: 1.2.4
     9 * Version: 1.2.5
    1010 * Text Domain: crs-booker
    1111 * License: GPLv2 or later
     
    4040if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
    4141
    42 define('CRSBKR_VERSION', '1.2.4');
     42define('CRSBKR_VERSION', '1.2.5');
    4343
    4444class CRSBKR_BOOKER
     
    350350            $debug = json_encode($debug, JSON_PRETTY_PRINT);
    351351
    352             $referer = isset($_SERVER['HTTP_REFERER']) ? sanitize_text_field(wp_unslash($_SERVER['HTTP_REFERER'])) : '###';
     352            $referer = sanitize_text_field(wp_unslash(isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : (isset($_SERVER['QUERY_STRING']) ? $_SERVER['QUERY_STRING'] : '###')));
    353353
    354354            $headers = [];
     
    536536        $this->add_scripts();
    537537
    538         $data = $this->curl('GET', 'controller_form/' . $attr['code'] . '?expand=acriss_code_web,base,base_opening_hours');
     538        $data = $this->curl('GET', 'controller_form/' . $attr['code'] . '?expand=acriss_code_web,base,base_opening_hours,base_transfer_time');
    539539        $form = '';
    540540
     
    582582        $this->add_scripts();
    583583
    584         $data = $this->curl('GET', 'controller_form/' . $f . '?expand=accessory,acriss_code_web,agent,base,base_opening_hours,broker,user');
     584        $data = $this->curl('GET', 'controller_form/' . $f . '?expand=accessory,acriss_code_web,agent,base,base_opening_hours,base_transfer_time,broker,user');
    585585        $input = json_decode(base64_decode($q), TRUE);
    586586        $rid = isset($_GET['rid']) ? sanitize_text_field(wp_unslash($_GET['rid'])) : NULL;
     
    594594        ];
    595595
     596        $content = '';
     597        if (!isset($input['checkout_time']) || !isset($input['checkin_time']) || $input['checkout_time'] <= (new DateTime('now', new DateTimeZone('UTC')))->format('Y-m-d H:i:s') || $input['checkin_time'] <= $input['checkout_time'])
     598        {
     599        }
     600        else
     601        {
     602            $content = '<div class="crsbkr" id="crsbkr_search_results"></div>';
     603        }
     604
    596605        wp_add_inline_script('crsbkr_script', wp_kses_post('jQuery(function( $ )
    597606            {
     
    602611
    603612                crsbkr_module(' . wp_json_encode(isset($data['result']) ? $data['result'] : NULL) . ');
    604                 crsbkr_search_results(' . wp_json_encode($params) . ');
     613                ' . ($content != '' ? 'crsbkr_search_results(' . wp_json_encode($params) . ');' : '') . '
    605614            });'));
    606615
    607         $form = '<div class="crsbkr" id="crsbkr_module"></div>' . '<div class="crsbkr" id="crsbkr_search_results"></div>';
     616        $form = '<div class="crsbkr" id="crsbkr_module"></div>' . $content;
    608617
    609618        return wp_kses_post($form);
     
    937946            'search.error.baseOutOfHours.checkout' => 'Potrebbero essere applicati dei costi aggiuntivi per il ritiro a quest\'ora.',
    938947            'search.error.checkinBeforeCheckout' => 'La data e ora della riconsegna non può precedere e non può essere uguale a quella del ritiro.',
     948            'search.error.pastDate' => 'La data/ora scelta è nel passato.',
    939949            'search.promo_code.select' => 'Ho un codice promo',
    940950            'search.promo_code.placeholder' => 'Inserisci codice promo…',
     
    13341344            'search.error.baseOutOfHours.checkout' => 'Pickups at this time might come with additional fees',
    13351345            'search.error.checkinBeforeCheckout' => 'The dropoff date and time has to be after the pickup.',
     1346            'search.error.pastDate' => 'The chosen date has already passed.',
    13361347            'search.promo_code.select' => 'I have a promo code',
    13371348            'search.promo_code.placeholder' => 'Insert promo code…',
  • crs-booker/tags/1.2.5/readme.txt

    r3359743 r3363642  
    33Requires at least: 5.8
    44Tested up to: 6.8
    5 Stable tag: 1.2.4
     5Stable tag: 1.2.5
    66License: GPLv2 or later
    77
     
    3636== Changelog ==
    3737
     38= 1.2.5 =
     39* Release Date - 18 September 2025
     40* Bugfixes
     41
    3842= 1.2.4 =
    3943* Release Date - 11 September 2025
  • crs-booker/trunk/crs_booker.js

    r3359743 r3363642  
    55 * Author: My Appy
    66 * Author URI: http://www.myappy.it/
    7  * Version: 1.2.4
     7 * Version: 1.2.5
    88 * Text Domain: crs-booker
    99 * License: GPLv2 or later
     
    10811081                {
    10821082                    var available = bases[i].available && (!checkoutBase || checkoutBase.userIds.filter(value => bases[i].userIds.includes(value)).length > 0);
     1083
     1084                    if (params.checkout_base != i && available)
     1085                    {
     1086                        // Be sure one way is enabled.
     1087                        fromBaseIds = crsbkr_array_get(checkoutBase, 'bases', '').split(',').filter(n => ('' + n).length > 0);
     1088                        toBaseIds = crsbkr_array_get(bases[i], 'bases', '').split(',').filter(n => ('' + n).length > 0);
     1089
     1090                        var found = false;
     1091                        for (var ii = 0; ii < data.base_transfer_time.length; ii++)
     1092                        {
     1093                            if (crsbkr_array_get(data.base_transfer_time[ii], 'one_way', 0) != 0 && fromBaseIds.indexOf(data.base_transfer_time[ii].from_base_id) != -1 && toBaseIds.indexOf(data.base_transfer_time[ii].to_base_id) != -1)
     1094                            {
     1095                                found = true;
     1096                                break;
     1097                            }
     1098                        }
     1099
     1100                        if (!found)
     1101                        {
     1102                            available = false;
     1103                        }
     1104                    }
     1105
    10831106                    checkinBaseList.children[i].style.display = available ? 'block' : 'none';
    10841107
     
    19691992                        checkinBaseInput.parentNode.classList.remove('error');
    19701993                    }
     1994                }
     1995            }
     1996
     1997            if (checkinBaseInput && !checkoutBaseInput.parentNode.classList.contains('error') && !checkinBaseInput.parentNode.classList.contains('error') && checkoutBaseInput.base != checkinBaseInput.base && data.base_transfer_time)
     1998            {
     1999                // Be sure one way is enabled.
     2000                fromBaseIds = crsbkr_array_get(bases[checkoutBaseInput.base], 'bases', '').split(',').filter(n => ('' + n).length > 0);
     2001                toBaseIds = crsbkr_array_get(bases[checkinBaseInput.base], 'bases', '').split(',').filter(n => ('' + n).length > 0);
     2002
     2003                var found = false;
     2004                for (var i = 0; i < data.base_transfer_time.length; i++)
     2005                {
     2006                    if (crsbkr_array_get(data.base_transfer_time[i], 'one_way', 0) != 0 && fromBaseIds.indexOf(data.base_transfer_time[i].from_base_id) != -1 && toBaseIds.indexOf(data.base_transfer_time[i].to_base_id) != -1)
     2007                    {
     2008                        console.log(data.base_transfer_time);
     2009                        found = true;
     2010                        break;
     2011                    }
     2012                }
     2013
     2014                if (found)
     2015                {
     2016                    checkinBaseInput.parentNode.classList.remove('error');
     2017                }
     2018                else
     2019                {
     2020                    checkinBaseInput.parentNode.classList.add('error');
    19712021                }
    19722022            }
     
    21532203                    }
    21542204
    2155                     if (!open)
     2205                    if (dateObj < new Date())
     2206                    {
     2207                        error.innerHTML = CRSBKR_STRINGS['search.error.pastDate'];
     2208
     2209                        timeError.className = 'error';
     2210                        timeError.innerHTML = error.innerHTML;
     2211                    }
     2212                    else if (!open)
    21562213                    {
    21572214                        if (dayField.textContent.length > 0)
  • crs-booker/trunk/crs_booker.php

    r3359743 r3363642  
    77 * Author: My Appy
    88 * Author URI: http://www.myappy.it/
    9  * Version: 1.2.4
     9 * Version: 1.2.5
    1010 * Text Domain: crs-booker
    1111 * License: GPLv2 or later
     
    4040if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
    4141
    42 define('CRSBKR_VERSION', '1.2.4');
     42define('CRSBKR_VERSION', '1.2.5');
    4343
    4444class CRSBKR_BOOKER
     
    350350            $debug = json_encode($debug, JSON_PRETTY_PRINT);
    351351
    352             $referer = isset($_SERVER['HTTP_REFERER']) ? sanitize_text_field(wp_unslash($_SERVER['HTTP_REFERER'])) : '###';
     352            $referer = sanitize_text_field(wp_unslash(isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : (isset($_SERVER['QUERY_STRING']) ? $_SERVER['QUERY_STRING'] : '###')));
    353353
    354354            $headers = [];
     
    536536        $this->add_scripts();
    537537
    538         $data = $this->curl('GET', 'controller_form/' . $attr['code'] . '?expand=acriss_code_web,base,base_opening_hours');
     538        $data = $this->curl('GET', 'controller_form/' . $attr['code'] . '?expand=acriss_code_web,base,base_opening_hours,base_transfer_time');
    539539        $form = '';
    540540
     
    582582        $this->add_scripts();
    583583
    584         $data = $this->curl('GET', 'controller_form/' . $f . '?expand=accessory,acriss_code_web,agent,base,base_opening_hours,broker,user');
     584        $data = $this->curl('GET', 'controller_form/' . $f . '?expand=accessory,acriss_code_web,agent,base,base_opening_hours,base_transfer_time,broker,user');
    585585        $input = json_decode(base64_decode($q), TRUE);
    586586        $rid = isset($_GET['rid']) ? sanitize_text_field(wp_unslash($_GET['rid'])) : NULL;
     
    594594        ];
    595595
     596        $content = '';
     597        if (!isset($input['checkout_time']) || !isset($input['checkin_time']) || $input['checkout_time'] <= (new DateTime('now', new DateTimeZone('UTC')))->format('Y-m-d H:i:s') || $input['checkin_time'] <= $input['checkout_time'])
     598        {
     599        }
     600        else
     601        {
     602            $content = '<div class="crsbkr" id="crsbkr_search_results"></div>';
     603        }
     604
    596605        wp_add_inline_script('crsbkr_script', wp_kses_post('jQuery(function( $ )
    597606            {
     
    602611
    603612                crsbkr_module(' . wp_json_encode(isset($data['result']) ? $data['result'] : NULL) . ');
    604                 crsbkr_search_results(' . wp_json_encode($params) . ');
     613                ' . ($content != '' ? 'crsbkr_search_results(' . wp_json_encode($params) . ');' : '') . '
    605614            });'));
    606615
    607         $form = '<div class="crsbkr" id="crsbkr_module"></div>' . '<div class="crsbkr" id="crsbkr_search_results"></div>';
     616        $form = '<div class="crsbkr" id="crsbkr_module"></div>' . $content;
    608617
    609618        return wp_kses_post($form);
     
    937946            'search.error.baseOutOfHours.checkout' => 'Potrebbero essere applicati dei costi aggiuntivi per il ritiro a quest\'ora.',
    938947            'search.error.checkinBeforeCheckout' => 'La data e ora della riconsegna non può precedere e non può essere uguale a quella del ritiro.',
     948            'search.error.pastDate' => 'La data/ora scelta è nel passato.',
    939949            'search.promo_code.select' => 'Ho un codice promo',
    940950            'search.promo_code.placeholder' => 'Inserisci codice promo…',
     
    13341344            'search.error.baseOutOfHours.checkout' => 'Pickups at this time might come with additional fees',
    13351345            'search.error.checkinBeforeCheckout' => 'The dropoff date and time has to be after the pickup.',
     1346            'search.error.pastDate' => 'The chosen date has already passed.',
    13361347            'search.promo_code.select' => 'I have a promo code',
    13371348            'search.promo_code.placeholder' => 'Insert promo code…',
  • crs-booker/trunk/readme.txt

    r3359743 r3363642  
    33Requires at least: 5.8
    44Tested up to: 6.8
    5 Stable tag: 1.2.4
     5Stable tag: 1.2.5
    66License: GPLv2 or later
    77
     
    3636== Changelog ==
    3737
     38= 1.2.5 =
     39* Release Date - 18 September 2025
     40* Bugfixes
     41
    3842= 1.2.4 =
    3943* Release Date - 11 September 2025
Note: See TracChangeset for help on using the changeset viewer.