Plugin Directory

Changeset 3070756


Ignore:
Timestamp:
04/15/2024 12:34:09 PM (2 years ago)
Author:
fedata
Message:

Version 2.2.1

Location:
fast-events
Files:
1 deleted
42 edited
34 copied

Legend:

Unmodified
Added
Removed
  • fast-events/tags/2.2.1/changelog.txt

    r3054284 r3070756  
    11== Changelog ==
     2
     3= 2.2.1 =
     4* Fix: Public Ordering API could not be used.
     5* Fix: An event cannot refer to itself as a linked-event.
    26
    37= 2.2.0 =
  • fast-events/tags/2.2.1/fast-events.php

    r3054284 r3070756  
    44 * Plugin URI: https://fast-events.eu/
    55 * Description: Sell online etickets wit a variety of payment options, mobile scanning, admin app, seating plans, online tracking for sports events and much more.
    6  * Version: 2.2.0
     6 * Version: 2.2.1
    77 * Requires at least: 6.0
    88 * Requires PHP: 8.0
  • fast-events/tags/2.2.1/includes/class-fast-events-helper.php

    r3052205 r3070756  
    893893            case 3:
    894894                // If the 'HTTP header' string doesn't contain the separator ':' -> exit.
    895                 if ( ! str_contains($choice->user_group->rest_header, ':') ) {
     895                if ( ! str_contains( $choice->user_group->rest_header, ':' ) ) {
    896896                    return 0;
    897897                }
     
    14811481     * @param string   $event_id The unique id of the event.
    14821482     * @param string   $email    The email address of the orderer.
    1483      * @param bool     $update   Do we need to update the values: true=yes, false=no (default).
     1483     * @param bool     $update   Do we need to update the values (true=yes, false=no -> default).
    14841484     *
    14851485     *  Example $json:
     
    15111511     * "events": [9],
    15121512     * "orders": [39]
    1513      * }
     1513     * }.
    15141514     *
    15151515     * @return WP_Error|float
  • fast-events/tags/2.2.1/includes/class-fast-events-shortcode.php

    r3052205 r3070756  
    282282        // Is the url-parameter 'redirect_uid' or 'ticket_ids' present or did.
    283283        if ( ( ! isset( $wp_query->query_vars[ self::FE_REDIRECT_UID ] ) && ! isset( $wp_query->query_vars[ self::FE_TICKETS_IDS ] ) ) ||
    284              ( isset( $wp_query->query_vars[ self::FE_TICKETS_IDS ] ) && ! isset( $wp_query->query_vars['hash'] ) ) ) {
     284            ( isset( $wp_query->query_vars[ self::FE_TICKETS_IDS ] ) && ! isset( $wp_query->query_vars['hash'] ) ) ) {
    285285            return '';
    286286        }
  • fast-events/tags/2.2.1/includes/class-fast-events.php

    r3054284 r3070756  
    1515 */
    1616class Fast_Events {
    17     public const FAST_EVENTS_VERSION = '2.2.0';
     17    public const FAST_EVENTS_VERSION = '2.2.1';
    1818    public const FE_ADMIN_VERSION    = 'v4.2';
    1919
  • fast-events/tags/2.2.1/includes/classes/class-fast-events-account.php

    r3022958 r3070756  
    8181
    8282    /**
    83      * Is the user and all sub-account blocked for REST calls.
     83     * Is the user and all sub-accounts blocked for REST calls.
    8484     *
    8585     * @since 2.0
     
    113113
    114114    /**
    115      * How many sub-account can this user create. This is baically the number of additional application passwords.
     115     * How many sub-accounts can this user create. This is baically the number of additional application passwords.
    116116     *
    117117     * @since 2.0
  • fast-events/tags/2.2.1/includes/classes/class-fast-events-pdf.php

    r3052205 r3070756  
    1111defined( 'ABSPATH' ) || exit;
    1212
    13 use setasign\Fpdi\PdfParser\CrossReference\CrossReferenceException;
    14 use setasign\Fpdi\PdfParser\Filter\FilterException;
    15 use setasign\Fpdi\PdfParser\PdfParserException;
    16 use setasign\Fpdi\PdfParser\Type\PdfTypeException;
    17 use setasign\Fpdi\PdfReader\PdfReaderException;
    1813use setasign\Fpdi\Tcpdf\Fpdi;
    1914
  • fast-events/tags/2.2.1/includes/classes/class-fast-events-sub-account.php

    r3015747 r3070756  
    2525
    2626    /**
    27      * Is sub-account blocked.
     27     * Is the sub-account blocked.
    2828     *
    2929     * @since 2.0
  • fast-events/tags/2.2.1/includes/classes/class-fast-events-tickets.php

    r3036391 r3070756  
    9090     * - Email      The emailaddress of the person who ordered the tickets
    9191     * - [order]    Any input field name on order level
    92      * - [ticket]   Any input put that has been personalised
     92     * - [ticket]   Any input field that has been personalised
    9393     *
    9494     * @since 2.1.0
    9595     * @var array
    9696     */
    97     private array $layout = array();
     97    private array $layout;
    9898
    9999    /**
  • fast-events/tags/2.2.1/includes/rest-api/class-fast-events-admin.php

    r3052205 r3070756  
    928928     *
    929929     * @since 1.0
    930      * @since 1.4 Event authorization restriction
    931      * @since 1.5 ROLLBACK after update error
    932      * @since 1.10 Added 'stock_link'
     930     * @since 1.4   Event authorization restriction
     931     * @since 1.5   ROLLBACK after update error
     932     * @since 1.10  Added 'stock_link'
     933     * @since 2.2.1 An event cannot refer to itself as a linked-event
    933934     *
    934935     * @param WP_REST_Request $data Request instance.
     
    948949        $wpdb->query( 'START TRANSACTION' );
    949950
    950         // Lookup the order.
     951        // Lookup the event.
    951952        $event_table = $wpdb->prefix . 'fe_events';
    952953        $event       = $wpdb->get_row( $wpdb->prepare( "SELECT sold, input_fields FROM $event_table WHERE id = %d FOR UPDATE", $data['id'] ) );
     
    954955            $wpdb->query( 'ROLLBACK' );
    955956            return new WP_Error( 'not_found', __( 'Event not found', 'fast-events' ), array( 'status' => 404 ) );
     957        }
     958
     959        // Check stock_link.
     960        if ( 0 !== $data['stock_link'] ) {
     961            $cnt = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(*) FROM $event_table WHERE id = %d", $data['stock_link'] ) );
     962            if ( 0 === (int) $cnt ) {
     963                return new WP_Error( 'not_found', __( 'Event for stock_link parameter not found', 'fast-events' ), array( 'status' => 404 ) );
     964            }
     965            if ( $data['stock_link'] === $data['id'] ) {
     966                return new WP_Error( 'invalid_event', __( 'An event cannot refer to itself as a linked-event', 'fast-events' ), array( 'status' => 400 ) );
     967            }
    956968        }
    957969
  • fast-events/tags/2.2.1/includes/rest-api/class-fast-events-events.php

    r3036904 r3070756  
    1515 */
    1616class Fast_Events_Events {
    17     private const NAMESPACE     = 'fast-events/v1';
    18     private const EVENTS_ROUTE  = '/admin/events/';
     17    private const NAMESPACE    = 'fast-events/v1';
     18    private const EVENTS_ROUTE = '/admin/events/';
    1919
    2020    /**
  • fast-events/tags/2.2.1/includes/rest-api/class-fast-events-ordering.php

    r3036391 r3070756  
    170170}
    171171
    172 return new Fast_Events_Personalise();
     172return new Fast_Events_Ordering();
  • fast-events/tags/2.2.1/includes/rest-api/class-fast-events-saas.php

    r3022022 r3070756  
    3030     * Current user object
    3131     *
    32      * @since 1.0
     32     * @since 1.4
    3333     * @var ?WP_User
    3434     */
  • fast-events/tags/2.2.1/includes/rest-api/public-api/class-fast-events-admin-accounts.php

    r3015747 r3070756  
    11<?php
    22/**
    3  * FE Admin Event Accounts controller.
     3 * FE Admin Accounts controller.
    44 *
    55 * @package Fast-Events/Rest-API/Admin/Accounts
     
    1313
    1414/**
    15  * FE Admin Events Accounts class.
     15 * FE Admin Accounts class.
    1616 */
    1717class Fast_Events_Admin_Accounts extends WP_REST_Controller {
    1818
    1919    /**
    20      * Admin Event Ticket Types constructor.
    21      *
    22      * @since 1.0
     20     * Admin Accounts constructor.
     21     *
     22     * @since 2.0
    2323     */
    2424    public function __construct() {
  • fast-events/tags/2.2.1/includes/rest-api/public-api/class-fast-events-admin-bulk-emails.php

    r3052205 r3070756  
    2020     * The maximum size of the request buffer with order_ids.
    2121     *
    22      * @since 1.0
     22     * @since 2.0
    2323     * @var int
    2424     */
     
    2828     * Admin Bulk Emails constructor.
    2929     *
    30      * @since 1.0
     30     * @since 2.0
    3131     */
    3232    public function __construct() {
  • fast-events/tags/2.2.1/includes/rest-api/public-api/class-fast-events-admin-bulk-order-emails.php

    r3036391 r3070756  
    2020     * The maximum size of the request buffer with order_ids.
    2121     *
    22      * @since 1.0
     22     * @since 2.0
    2323     * @var int
    2424     */
     
    2828     * Admin Bulk Order Emails constructor.
    2929     *
    30      * @since 1.0
     30     * @since 2.0
    3131     */
    3232    public function __construct() {
  • fast-events/tags/2.2.1/includes/rest-api/public-api/class-fast-events-admin-bulk-refunds.php

    r3036391 r3070756  
    2222     * The maximum size of the request buffer with order_ids.
    2323     *
    24      * @since 1.0
     24     * @since 2.0
    2525     * @var int
    2626     */
     
    3030     * Admin Bulk Refunds constructor.
    3131     *
    32      * @since 1.0
     32     * @since 2.0
    3333     */
    3434    public function __construct() {
  • fast-events/tags/2.2.1/includes/rest-api/public-api/class-fast-events-admin-events.php

    r3052205 r3070756  
    518518     *
    519519     * @since 1.0
    520      * @since 1.4 Added saas_fee, saas_user_id, sender_name and sender_email to query
     520     * @since 1.4.0 Added saas_fee, saas_user_id, sender_name and sender_email to query
     521     * @since 2.2.1 An event cannot refer to itself as a linked-event
    521522     *
    522523     * @param WP_REST_Request $request        Full details about the request.
     
    534535            $params = $request->get_params(); // This returns all params (JSON and defaults).
    535536        } else {
    536             $params = $request->get_json_params();
     537            $params       = $request->get_json_params();
     538            $params['id'] = $request['id'];
    537539        }
    538540        if ( null === $params ) {
     
    571573        }
    572574
    573         if ( isset( $params['stock_link'] ) && 0 !== $params['stock_link'] ) {
    574             $cnt = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(*) FROM $event_table WHERE id = %d", (int) $params['stock_link'] ) );
    575             if ( 0 === (int) $cnt ) {
    576                 return new WP_Error( 'not_found', __( 'Event for stock_link parameter not found', 'fast-events' ), array( 'status' => 404 ) );
    577             }
    578             $changed_event['stock_link'] = $params['stock_link'];
     575        if ( isset( $params['stock_link'] ) ) {
     576            if ( 0 !== $params['stock_link'] ) {
     577                $cnt = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(*) FROM $event_table WHERE id = %d", (int) $params['stock_link'] ) );
     578                if ( 0 === (int) $cnt ) {
     579                    return new WP_Error( 'not_found', __( 'Event for stock_link parameter not found', 'fast-events' ), array( 'status' => 404 ) );
     580                }
     581                if ( self::UPDATE === $method && (int) $params['stock_link'] === (int) $params['id'] ) {
     582                    return new WP_Error( 'invalid_event', __( 'An event cannot refer to itself as a linked-event', 'fast-events' ), array( 'status' => 400 ) );
     583                }
     584                $changed_event['stock_link'] = $params['stock_link'];
     585            } else {
     586                $changed_event['stock_link'] = 0;
     587            }
    579588        }
    580589
  • fast-events/tags/2.2.1/includes/rest-api/public-api/class-fast-events-admin-input-fields.php

    r3036391 r3070756  
    33 * FE Admin Event Input Fields controller.
    44 *
    5  * @package Fast-Events/Rest-API/Admin/Input-fields
     5 * @package Fast-Events/Rest-API/Admin/Input-Fields
    66 * @since 1.4 Event authorization restriction
    77 */
  • fast-events/tags/2.2.1/includes/rest-api/public-api/class-fast-events-admin-logs.php

    r3022958 r3070756  
    11<?php
    22/**
    3  * FE Admin Event Logs controller.
     3 * FE Admin Logs controller.
    44 *
    55 * @package Fast-Events/Rest-API/Admin/Logs
  • fast-events/tags/2.2.1/includes/rest-api/public-api/class-fast-events-admin-mail-lists.php

    r3052205 r3070756  
    122122        global $wpdb;
    123123
    124         $auth_query  = fast_events_auth_func()->get_restricted_events( fast_events_auth_func()::FAST_EVENTS_AUTH_QUERY_ORDER_LOOKUP );
     124        $auth_query = fast_events_auth_func()->get_restricted_events( fast_events_auth_func()::FAST_EVENTS_AUTH_QUERY_ORDER_LOOKUP );
    125125
    126126        // The 'WHERE event_id > 0' is needed for a possible limit in available events for the user
     
    165165        global $wpdb;
    166166
    167         $auth_query  = fast_events_auth_func()->get_restricted_events( fast_events_auth_func()::FAST_EVENTS_AUTH_QUERY_ORDER_LOOKUP );
     167        $auth_query = fast_events_auth_func()->get_restricted_events( fast_events_auth_func()::FAST_EVENTS_AUTH_QUERY_ORDER_LOOKUP );
    168168
    169169        $result = $wpdb->get_row(
  • fast-events/tags/2.2.1/includes/rest-api/public-api/class-fast-events-admin-new-order.php

    r3052205 r3070756  
    1414
    1515/**
    16  * FE Admin Events New Order class.
     16 * FE Admin New Order class.
    1717 */
    1818class Fast_Events_Admin_New_Order extends WP_REST_Controller {
    1919
    2020    /**
    21      * Admin Event New Order constructor.
     21     * Admin New Order constructor.
    2222     *
    2323     * @since 1.0
  • fast-events/tags/2.2.1/includes/rest-api/public-api/class-fast-events-admin-pdf-templates.php

    r3015747 r3070756  
    1313
    1414/**
    15  * FE Admin Events Input Fields class.
     15 * FE Admin Pdf Template class.
    1616 */
    1717class Fast_Events_Admin_Pdf_Templates extends WP_REST_Controller {
     
    300300     * Delete a single PDF template.
    301301     *
    302      * @since 1.0
     302     * @since 2.0
    303303     *
    304304     * @param WP_REST_Request $request Full details about the request.
  • fast-events/tags/2.2.1/includes/rest-api/public-api/class-fast-events-admin-scan-keys.php

    r3036391 r3070756  
    1414
    1515/**
    16  * FE Admin Events Scan Keys class.
     16 * FE Admin Scan Keys class.
    1717 */
    1818class Fast_Events_Admin_Scan_Keys extends WP_REST_Controller {
     
    4646
    4747    /**
    48      * Admin Event Scan Keys constructor.
     48     * Admin Scan Keys constructor.
    4949     *
    5050     * @since 1.0
  • fast-events/tags/2.2.1/includes/rest-api/public-api/class-fast-events-admin-sub-accounts.php

    r3015747 r3070756  
    11<?php
    22/**
    3  * FE Admin Event Sub Accounts controller.
     3 * FE Admin Sub Accounts controller.
    44 *
    55 * @package Fast-Events/Rest-API/Admin/Sub-Accounts
     
    1313
    1414/**
    15  * FE Admin Events Accounts class.
     15 * FE Admin Sub Accounts class.
    1616 */
    1717class Fast_Events_Admin_Sub_Accounts extends WP_REST_Controller {
     
    4242
    4343    /**
    44      * Admin Event Ticket Types constructor.
    45      *
    46      * @since 1.0
     44     * Admin Sub Accounts constructor.
     45     *
     46     * @since 2.0
    4747     */
    4848    public function __construct() {
     
    157157
    158158    /**
    159      * Only 'fe_account' user with USER_APW_ADD are allowed.
     159     * Only 'fe_account' users with USER_APW_ADD are allowed.
    160160     *
    161161     * @since 2.0
     
    178178
    179179    /**
    180      * Get all 'fe_account' sub_account.
     180     * Get all 'fe_account' sub_accounts.
    181181     *
    182182     * @since 2.0
  • fast-events/tags/2.2.1/includes/rest-api/public-api/class-fast-events-admin-ticket-types.php

    r3054284 r3070756  
    11<?php
    22/**
    3  * FE Admin Event Ticket Types controller.
     3 * FE Admin Ticket Types controller.
    44 *
    55 * @package Fast-Events/Rest-API/Admin/Ticket-types
     
    1414
    1515/**
    16  * FE Admin Events Ticket Types class.
     16 * FE Admin Ticket Types class.
    1717 */
    1818class Fast_Events_Admin_Ticket_Types extends WP_REST_Controller {
     
    204204
    205205    /**
    206      * Get the authorization for the Events Ticket Types endpoints.
     206     * Get the authorization for the Ticket Types endpoints.
    207207     *
    208208     * @since 1.0
     
    324324
    325325    /**
    326      * Retrieve a single input_field.
     326     * Retrieve a single ticket type.
    327327     *
    328328     * @since 1.0
  • fast-events/tags/2.2.1/includes/rest-api/public-api/class-fast-events-admin-webhooks.php

    r3052205 r3070756  
    2222     * Admin Webhooks constructor.
    2323     *
    24      * @since 1.0
     24     * @since 2.0
    2525     */
    2626    public function __construct() {
  • fast-events/tags/2.2.1/readme.txt

    r3054284 r3070756  
    11=== Fast Events ===
    22* Contributors: fedata
    3 * Tags: events, tickets, personalisation, sell online, qrcode
     3* Tags: events, etickets, qrcode, sell online, tickets
    44* Requires at least: 6.0
    55* Requires PHP: 8.0
    66* Tested up to: 6.5
    7 * Stable tag: 2.2.0
     7* Stable tag: 2.2.1
    88* Donate link: https://docs.fast-events.eu/en/latest/misc/donate.html
    99* License: GPLv3 or later
     
    188188== Changelog ==
    189189
    190 = 2.2.0 =
    191 
    192 * Added flexible discount codes. Optionally linked to events, tickets types, user email, min/max number of tickets and min/max amount. Possible usage limit per user.
    193 * Added volume pricing per ticket type. Eg. 1 ticket for 10.00, from 4 tickets for 9.00, from 10 tickets for 8.50, ...
    194 * Two new filters: 'fast_events_order_mail' and 'fast_events_order_name' for filtering the emailaddress and name.
     190= 2.2.1 =
     191
     192* Fix: Public Ordering API could not be used.
     193* Fix: An event cannot refer to itself as a linked-event.
    195194
    196195
  • fast-events/trunk/changelog.txt

    r3054284 r3070756  
    11== Changelog ==
     2
     3= 2.2.1 =
     4* Fix: Public Ordering API could not be used.
     5* Fix: An event cannot refer to itself as a linked-event.
    26
    37= 2.2.0 =
  • fast-events/trunk/fast-events.php

    r3054284 r3070756  
    44 * Plugin URI: https://fast-events.eu/
    55 * Description: Sell online etickets wit a variety of payment options, mobile scanning, admin app, seating plans, online tracking for sports events and much more.
    6  * Version: 2.2.0
     6 * Version: 2.2.1
    77 * Requires at least: 6.0
    88 * Requires PHP: 8.0
  • fast-events/trunk/includes/class-fast-events-helper.php

    r3052205 r3070756  
    893893            case 3:
    894894                // If the 'HTTP header' string doesn't contain the separator ':' -> exit.
    895                 if ( ! str_contains($choice->user_group->rest_header, ':') ) {
     895                if ( ! str_contains( $choice->user_group->rest_header, ':' ) ) {
    896896                    return 0;
    897897                }
     
    14811481     * @param string   $event_id The unique id of the event.
    14821482     * @param string   $email    The email address of the orderer.
    1483      * @param bool     $update   Do we need to update the values: true=yes, false=no (default).
     1483     * @param bool     $update   Do we need to update the values (true=yes, false=no -> default).
    14841484     *
    14851485     *  Example $json:
     
    15111511     * "events": [9],
    15121512     * "orders": [39]
    1513      * }
     1513     * }.
    15141514     *
    15151515     * @return WP_Error|float
  • fast-events/trunk/includes/class-fast-events-shortcode.php

    r3052205 r3070756  
    282282        // Is the url-parameter 'redirect_uid' or 'ticket_ids' present or did.
    283283        if ( ( ! isset( $wp_query->query_vars[ self::FE_REDIRECT_UID ] ) && ! isset( $wp_query->query_vars[ self::FE_TICKETS_IDS ] ) ) ||
    284              ( isset( $wp_query->query_vars[ self::FE_TICKETS_IDS ] ) && ! isset( $wp_query->query_vars['hash'] ) ) ) {
     284            ( isset( $wp_query->query_vars[ self::FE_TICKETS_IDS ] ) && ! isset( $wp_query->query_vars['hash'] ) ) ) {
    285285            return '';
    286286        }
  • fast-events/trunk/includes/class-fast-events.php

    r3054284 r3070756  
    1515 */
    1616class Fast_Events {
    17     public const FAST_EVENTS_VERSION = '2.2.0';
     17    public const FAST_EVENTS_VERSION = '2.2.1';
    1818    public const FE_ADMIN_VERSION    = 'v4.2';
    1919
  • fast-events/trunk/includes/classes/class-fast-events-account.php

    r3022958 r3070756  
    8181
    8282    /**
    83      * Is the user and all sub-account blocked for REST calls.
     83     * Is the user and all sub-accounts blocked for REST calls.
    8484     *
    8585     * @since 2.0
     
    113113
    114114    /**
    115      * How many sub-account can this user create. This is baically the number of additional application passwords.
     115     * How many sub-accounts can this user create. This is baically the number of additional application passwords.
    116116     *
    117117     * @since 2.0
  • fast-events/trunk/includes/classes/class-fast-events-pdf.php

    r3052205 r3070756  
    1111defined( 'ABSPATH' ) || exit;
    1212
    13 use setasign\Fpdi\PdfParser\CrossReference\CrossReferenceException;
    14 use setasign\Fpdi\PdfParser\Filter\FilterException;
    15 use setasign\Fpdi\PdfParser\PdfParserException;
    16 use setasign\Fpdi\PdfParser\Type\PdfTypeException;
    17 use setasign\Fpdi\PdfReader\PdfReaderException;
    1813use setasign\Fpdi\Tcpdf\Fpdi;
    1914
  • fast-events/trunk/includes/classes/class-fast-events-sub-account.php

    r3015747 r3070756  
    2525
    2626    /**
    27      * Is sub-account blocked.
     27     * Is the sub-account blocked.
    2828     *
    2929     * @since 2.0
  • fast-events/trunk/includes/classes/class-fast-events-tickets.php

    r3036391 r3070756  
    9090     * - Email      The emailaddress of the person who ordered the tickets
    9191     * - [order]    Any input field name on order level
    92      * - [ticket]   Any input put that has been personalised
     92     * - [ticket]   Any input field that has been personalised
    9393     *
    9494     * @since 2.1.0
    9595     * @var array
    9696     */
    97     private array $layout = array();
     97    private array $layout;
    9898
    9999    /**
  • fast-events/trunk/includes/rest-api/class-fast-events-admin.php

    r3052205 r3070756  
    928928     *
    929929     * @since 1.0
    930      * @since 1.4 Event authorization restriction
    931      * @since 1.5 ROLLBACK after update error
    932      * @since 1.10 Added 'stock_link'
     930     * @since 1.4   Event authorization restriction
     931     * @since 1.5   ROLLBACK after update error
     932     * @since 1.10  Added 'stock_link'
     933     * @since 2.2.1 An event cannot refer to itself as a linked-event
    933934     *
    934935     * @param WP_REST_Request $data Request instance.
     
    948949        $wpdb->query( 'START TRANSACTION' );
    949950
    950         // Lookup the order.
     951        // Lookup the event.
    951952        $event_table = $wpdb->prefix . 'fe_events';
    952953        $event       = $wpdb->get_row( $wpdb->prepare( "SELECT sold, input_fields FROM $event_table WHERE id = %d FOR UPDATE", $data['id'] ) );
     
    954955            $wpdb->query( 'ROLLBACK' );
    955956            return new WP_Error( 'not_found', __( 'Event not found', 'fast-events' ), array( 'status' => 404 ) );
     957        }
     958
     959        // Check stock_link.
     960        if ( 0 !== $data['stock_link'] ) {
     961            $cnt = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(*) FROM $event_table WHERE id = %d", $data['stock_link'] ) );
     962            if ( 0 === (int) $cnt ) {
     963                return new WP_Error( 'not_found', __( 'Event for stock_link parameter not found', 'fast-events' ), array( 'status' => 404 ) );
     964            }
     965            if ( $data['stock_link'] === $data['id'] ) {
     966                return new WP_Error( 'invalid_event', __( 'An event cannot refer to itself as a linked-event', 'fast-events' ), array( 'status' => 400 ) );
     967            }
    956968        }
    957969
  • fast-events/trunk/includes/rest-api/class-fast-events-events.php

    r3036904 r3070756  
    1515 */
    1616class Fast_Events_Events {
    17     private const NAMESPACE     = 'fast-events/v1';
    18     private const EVENTS_ROUTE  = '/admin/events/';
     17    private const NAMESPACE    = 'fast-events/v1';
     18    private const EVENTS_ROUTE = '/admin/events/';
    1919
    2020    /**
  • fast-events/trunk/includes/rest-api/class-fast-events-ordering.php

    r3036391 r3070756  
    170170}
    171171
    172 return new Fast_Events_Personalise();
     172return new Fast_Events_Ordering();
  • fast-events/trunk/includes/rest-api/class-fast-events-saas.php

    r3022022 r3070756  
    3030     * Current user object
    3131     *
    32      * @since 1.0
     32     * @since 1.4
    3333     * @var ?WP_User
    3434     */
  • fast-events/trunk/includes/rest-api/public-api/class-fast-events-admin-accounts.php

    r3015747 r3070756  
    11<?php
    22/**
    3  * FE Admin Event Accounts controller.
     3 * FE Admin Accounts controller.
    44 *
    55 * @package Fast-Events/Rest-API/Admin/Accounts
     
    1313
    1414/**
    15  * FE Admin Events Accounts class.
     15 * FE Admin Accounts class.
    1616 */
    1717class Fast_Events_Admin_Accounts extends WP_REST_Controller {
    1818
    1919    /**
    20      * Admin Event Ticket Types constructor.
    21      *
    22      * @since 1.0
     20     * Admin Accounts constructor.
     21     *
     22     * @since 2.0
    2323     */
    2424    public function __construct() {
  • fast-events/trunk/includes/rest-api/public-api/class-fast-events-admin-bulk-emails.php

    r3052205 r3070756  
    2020     * The maximum size of the request buffer with order_ids.
    2121     *
    22      * @since 1.0
     22     * @since 2.0
    2323     * @var int
    2424     */
     
    2828     * Admin Bulk Emails constructor.
    2929     *
    30      * @since 1.0
     30     * @since 2.0
    3131     */
    3232    public function __construct() {
  • fast-events/trunk/includes/rest-api/public-api/class-fast-events-admin-bulk-order-emails.php

    r3036391 r3070756  
    2020     * The maximum size of the request buffer with order_ids.
    2121     *
    22      * @since 1.0
     22     * @since 2.0
    2323     * @var int
    2424     */
     
    2828     * Admin Bulk Order Emails constructor.
    2929     *
    30      * @since 1.0
     30     * @since 2.0
    3131     */
    3232    public function __construct() {
  • fast-events/trunk/includes/rest-api/public-api/class-fast-events-admin-bulk-refunds.php

    r3036391 r3070756  
    2222     * The maximum size of the request buffer with order_ids.
    2323     *
    24      * @since 1.0
     24     * @since 2.0
    2525     * @var int
    2626     */
     
    3030     * Admin Bulk Refunds constructor.
    3131     *
    32      * @since 1.0
     32     * @since 2.0
    3333     */
    3434    public function __construct() {
  • fast-events/trunk/includes/rest-api/public-api/class-fast-events-admin-events.php

    r3052205 r3070756  
    518518     *
    519519     * @since 1.0
    520      * @since 1.4 Added saas_fee, saas_user_id, sender_name and sender_email to query
     520     * @since 1.4.0 Added saas_fee, saas_user_id, sender_name and sender_email to query
     521     * @since 2.2.1 An event cannot refer to itself as a linked-event
    521522     *
    522523     * @param WP_REST_Request $request        Full details about the request.
     
    534535            $params = $request->get_params(); // This returns all params (JSON and defaults).
    535536        } else {
    536             $params = $request->get_json_params();
     537            $params       = $request->get_json_params();
     538            $params['id'] = $request['id'];
    537539        }
    538540        if ( null === $params ) {
     
    571573        }
    572574
    573         if ( isset( $params['stock_link'] ) && 0 !== $params['stock_link'] ) {
    574             $cnt = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(*) FROM $event_table WHERE id = %d", (int) $params['stock_link'] ) );
    575             if ( 0 === (int) $cnt ) {
    576                 return new WP_Error( 'not_found', __( 'Event for stock_link parameter not found', 'fast-events' ), array( 'status' => 404 ) );
    577             }
    578             $changed_event['stock_link'] = $params['stock_link'];
     575        if ( isset( $params['stock_link'] ) ) {
     576            if ( 0 !== $params['stock_link'] ) {
     577                $cnt = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(*) FROM $event_table WHERE id = %d", (int) $params['stock_link'] ) );
     578                if ( 0 === (int) $cnt ) {
     579                    return new WP_Error( 'not_found', __( 'Event for stock_link parameter not found', 'fast-events' ), array( 'status' => 404 ) );
     580                }
     581                if ( self::UPDATE === $method && (int) $params['stock_link'] === (int) $params['id'] ) {
     582                    return new WP_Error( 'invalid_event', __( 'An event cannot refer to itself as a linked-event', 'fast-events' ), array( 'status' => 400 ) );
     583                }
     584                $changed_event['stock_link'] = $params['stock_link'];
     585            } else {
     586                $changed_event['stock_link'] = 0;
     587            }
    579588        }
    580589
  • fast-events/trunk/includes/rest-api/public-api/class-fast-events-admin-input-fields.php

    r3036391 r3070756  
    33 * FE Admin Event Input Fields controller.
    44 *
    5  * @package Fast-Events/Rest-API/Admin/Input-fields
     5 * @package Fast-Events/Rest-API/Admin/Input-Fields
    66 * @since 1.4 Event authorization restriction
    77 */
  • fast-events/trunk/includes/rest-api/public-api/class-fast-events-admin-logs.php

    r3022958 r3070756  
    11<?php
    22/**
    3  * FE Admin Event Logs controller.
     3 * FE Admin Logs controller.
    44 *
    55 * @package Fast-Events/Rest-API/Admin/Logs
  • fast-events/trunk/includes/rest-api/public-api/class-fast-events-admin-mail-lists.php

    r3052205 r3070756  
    122122        global $wpdb;
    123123
    124         $auth_query  = fast_events_auth_func()->get_restricted_events( fast_events_auth_func()::FAST_EVENTS_AUTH_QUERY_ORDER_LOOKUP );
     124        $auth_query = fast_events_auth_func()->get_restricted_events( fast_events_auth_func()::FAST_EVENTS_AUTH_QUERY_ORDER_LOOKUP );
    125125
    126126        // The 'WHERE event_id > 0' is needed for a possible limit in available events for the user
     
    165165        global $wpdb;
    166166
    167         $auth_query  = fast_events_auth_func()->get_restricted_events( fast_events_auth_func()::FAST_EVENTS_AUTH_QUERY_ORDER_LOOKUP );
     167        $auth_query = fast_events_auth_func()->get_restricted_events( fast_events_auth_func()::FAST_EVENTS_AUTH_QUERY_ORDER_LOOKUP );
    168168
    169169        $result = $wpdb->get_row(
  • fast-events/trunk/includes/rest-api/public-api/class-fast-events-admin-new-order.php

    r3052205 r3070756  
    1414
    1515/**
    16  * FE Admin Events New Order class.
     16 * FE Admin New Order class.
    1717 */
    1818class Fast_Events_Admin_New_Order extends WP_REST_Controller {
    1919
    2020    /**
    21      * Admin Event New Order constructor.
     21     * Admin New Order constructor.
    2222     *
    2323     * @since 1.0
  • fast-events/trunk/includes/rest-api/public-api/class-fast-events-admin-pdf-templates.php

    r3015747 r3070756  
    1313
    1414/**
    15  * FE Admin Events Input Fields class.
     15 * FE Admin Pdf Template class.
    1616 */
    1717class Fast_Events_Admin_Pdf_Templates extends WP_REST_Controller {
     
    300300     * Delete a single PDF template.
    301301     *
    302      * @since 1.0
     302     * @since 2.0
    303303     *
    304304     * @param WP_REST_Request $request Full details about the request.
  • fast-events/trunk/includes/rest-api/public-api/class-fast-events-admin-scan-keys.php

    r3036391 r3070756  
    1414
    1515/**
    16  * FE Admin Events Scan Keys class.
     16 * FE Admin Scan Keys class.
    1717 */
    1818class Fast_Events_Admin_Scan_Keys extends WP_REST_Controller {
     
    4646
    4747    /**
    48      * Admin Event Scan Keys constructor.
     48     * Admin Scan Keys constructor.
    4949     *
    5050     * @since 1.0
  • fast-events/trunk/includes/rest-api/public-api/class-fast-events-admin-sub-accounts.php

    r3015747 r3070756  
    11<?php
    22/**
    3  * FE Admin Event Sub Accounts controller.
     3 * FE Admin Sub Accounts controller.
    44 *
    55 * @package Fast-Events/Rest-API/Admin/Sub-Accounts
     
    1313
    1414/**
    15  * FE Admin Events Accounts class.
     15 * FE Admin Sub Accounts class.
    1616 */
    1717class Fast_Events_Admin_Sub_Accounts extends WP_REST_Controller {
     
    4242
    4343    /**
    44      * Admin Event Ticket Types constructor.
    45      *
    46      * @since 1.0
     44     * Admin Sub Accounts constructor.
     45     *
     46     * @since 2.0
    4747     */
    4848    public function __construct() {
     
    157157
    158158    /**
    159      * Only 'fe_account' user with USER_APW_ADD are allowed.
     159     * Only 'fe_account' users with USER_APW_ADD are allowed.
    160160     *
    161161     * @since 2.0
     
    178178
    179179    /**
    180      * Get all 'fe_account' sub_account.
     180     * Get all 'fe_account' sub_accounts.
    181181     *
    182182     * @since 2.0
  • fast-events/trunk/includes/rest-api/public-api/class-fast-events-admin-ticket-types.php

    r3054284 r3070756  
    11<?php
    22/**
    3  * FE Admin Event Ticket Types controller.
     3 * FE Admin Ticket Types controller.
    44 *
    55 * @package Fast-Events/Rest-API/Admin/Ticket-types
     
    1414
    1515/**
    16  * FE Admin Events Ticket Types class.
     16 * FE Admin Ticket Types class.
    1717 */
    1818class Fast_Events_Admin_Ticket_Types extends WP_REST_Controller {
     
    204204
    205205    /**
    206      * Get the authorization for the Events Ticket Types endpoints.
     206     * Get the authorization for the Ticket Types endpoints.
    207207     *
    208208     * @since 1.0
     
    324324
    325325    /**
    326      * Retrieve a single input_field.
     326     * Retrieve a single ticket type.
    327327     *
    328328     * @since 1.0
  • fast-events/trunk/includes/rest-api/public-api/class-fast-events-admin-webhooks.php

    r3052205 r3070756  
    2222     * Admin Webhooks constructor.
    2323     *
    24      * @since 1.0
     24     * @since 2.0
    2525     */
    2626    public function __construct() {
  • fast-events/trunk/readme.txt

    r3054284 r3070756  
    11=== Fast Events ===
    22* Contributors: fedata
    3 * Tags: events, tickets, personalisation, sell online, qrcode
     3* Tags: events, etickets, qrcode, sell online, tickets
    44* Requires at least: 6.0
    55* Requires PHP: 8.0
    66* Tested up to: 6.5
    7 * Stable tag: 2.2.0
     7* Stable tag: 2.2.1
    88* Donate link: https://docs.fast-events.eu/en/latest/misc/donate.html
    99* License: GPLv3 or later
     
    188188== Changelog ==
    189189
    190 = 2.2.0 =
    191 
    192 * Added flexible discount codes. Optionally linked to events, tickets types, user email, min/max number of tickets and min/max amount. Possible usage limit per user.
    193 * Added volume pricing per ticket type. Eg. 1 ticket for 10.00, from 4 tickets for 9.00, from 10 tickets for 8.50, ...
    194 * Two new filters: 'fast_events_order_mail' and 'fast_events_order_name' for filtering the emailaddress and name.
     190= 2.2.1 =
     191
     192* Fix: Public Ordering API could not be used.
     193* Fix: An event cannot refer to itself as a linked-event.
    195194
    196195
Note: See TracChangeset for help on using the changeset viewer.