Plugin Directory

Changeset 2989860


Ignore:
Timestamp:
11/06/2023 12:22:16 PM (2 years ago)
Author:
mnchga
Message:

Committing changes for 4.1.0

Location:
eduadmin-booking/trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • eduadmin-booking/trunk/CHANGELOG.md

    r2976806 r2989860  
    22
    33All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
     4
     5## [4.1.0](https://github.com/MultinetInteractive/EduAdmin-WordPress/compare/v4.0.0...v4.1.0) (2023-11-06)
     6
     7
     8### Features
     9
     10* Added shortcode [eduadmin-programmeinfo] with limited attributes ([b51a1b1](https://github.com/MultinetInteractive/EduAdmin-WordPress/commit/b51a1b102282dd7a23cd96aa9e459f4b116f3af0)), closes [#506](https://github.com/MultinetInteractive/EduAdmin-WordPress/issues/506)
     11
     12
     13### Documentation
     14
     15* **Shortcodes:** Added info about the new shortcode ([4fe4b80](https://github.com/MultinetInteractive/EduAdmin-WordPress/commit/4fe4b8015c095841a75cfd5348ece89bfb90944a)), closes [#506](https://github.com/MultinetInteractive/EduAdmin-WordPress/issues/506)
    416
    517## [4.0.0](https://github.com/MultinetInteractive/EduAdmin-WordPress/compare/v3.11.1...v4.0.0) (2023-10-10)
  • eduadmin-booking/trunk/PLUGIN-CHECKSUM

    r2976806 r2989860  
    1 f225964c4ebc0fdc2db8e51049e166ae
     16e9d70ce9d2e8ae3adcc8c9e163fd75f
  • eduadmin-booking/trunk/eduadmin.php

    r2976806 r2989860  
    1010 * Description: EduAdmin plugin to allow visitors to book courses at your website
    1111 * Tags:    booking, participants, courses, events, eduadmin, lega online
    12  * Version: 4.0.0
     12 * Version: 4.1.0
    1313 * GitHub Plugin URI: multinetinteractive/eduadmin-wordpress
    1414 * GitHub Plugin URI: https://github.com/multinetinteractive/eduadmin-wordpress
  • eduadmin-booking/trunk/includes/edu-shortcodes.php

    r2976806 r2989860  
    206206
    207207    return $str;
     208}
     209
     210function eduadmin_get_programmeinfo( $attributes ) {
     211    $t = EDU()->start_timer( __METHOD__ );
     212    global $wp_query;
     213    $attributes = shortcode_atts(
     214        array(
     215            'programmeid'               => null,
     216            'programmename'             => null,
     217            'programmepublicname'       => null,
     218            'programmeimage'            => null,
     219            'programmeimagetext'        => null,
     220            'courseprice'               => null,
     221            'eventprice'                => null,
     222            'programmedescriptionshort' => null,
     223            'programmedescription'      => null,
     224            'programmegoal'             => null,
     225            'programmetarget'           => null,
     226            'programmeprerequisites'    => null,
     227            'courseafter'               => null,
     228            'programmequote'            => null,
     229            'courseeventlist'           => null,
     230            'showmore'                  => null,
     231            'courseattributeid'         => null,
     232            'courseattributehasvalue'   => null,
     233            'courseeventlistfiltercity' => null,
     234            'pagetitlejs'               => null,
     235            'bookurl'                   => null,
     236            'courseinquiryurl'          => null,
     237            'order'                     => null,
     238            'orderby'                   => null,
     239            'ondemand'                  => false,
     240            'allcourses'                => false,
     241        ),
     242        normalize_empty_atts( $attributes ),
     243        'eduadmin-programmeinfo'
     244    );
     245    $api_key    = EDU()->get_option( 'eduadmin-api-key' );
     246
     247    $ret_str = '';
     248
     249    if ( empty( $api_key ) ) {
     250        EDU()->stop_timer( $t );
     251
     252        return 'Please complete the configuration: <a href="' . admin_url() . 'admin.php?page=eduadmin-settings">EduAdmin - Api Authentication</a>';
     253    }
     254
     255    if ( empty( $attributes['programmeid'] ) || str_replace( array(
     256                                                                 '&#8221;',
     257                                                                 '&#8243;',
     258                                                             ), '', $attributes['programmeid'] ) <= 0 ) {
     259        if ( isset( $wp_query->query_vars['edu_programme'] ) ) {
     260            $exploded_id  = explode( '_', $wp_query->query_vars['edu_programme'] )[1];
     261            $programme_id = $exploded_id;
     262        } else {
     263            EDU()->stop_timer( $t );
     264
     265            return 'Missing programmeid in attributes';
     266        }
     267    } else {
     268        $programme_id = str_replace(
     269            array(
     270                '&#8221;',
     271                '&#8243;',
     272            ),
     273            '',
     274            $attributes['programmeid']
     275        );
     276    }
     277
     278    if ( ! empty( $programme_id ) ) {
     279        $programme = EDUAPI()->OData->Programmes->GetItem(
     280            $programme_id,
     281            null,
     282            'ProgrammeStarts(' .
     283            '$filter=' .
     284            'HasPublicPriceName' .
     285            ' and StatusId eq 1' .
     286            ' and (ApplicationOpenDate le ' . date_i18n( 'c' ) . ' or ApplicationOpenDate eq null)' .
     287            ' and StartDate ge ' . date_i18n( 'c' ) .
     288            ';' .
     289            '$orderby=' .
     290            'StartDate' .
     291            ';' .
     292            '$expand=' .
     293            'Courses($orderby=ProgrammeCourseSortIndex),Events($expand=EventDates($orderby=StartDate;$select=StartDate,EndDate;);$orderby=ProgrammeCourseSortIndex),PriceNames' .
     294            '),PriceNames'
     295        );
     296
     297        if ( isset( $programme["@error"] ) ) {
     298            EDU()->stop_timer( $t );
     299
     300            return $programme["@error"];
     301        }
     302
     303        if ( isset( $attributes['programmename'] ) ) {
     304            $ret_str .= $programme['InternaProgrammeName'];
     305        }
     306
     307        if ( isset( $attributes['programmepublicname'] ) ) {
     308            $ret_str .= $programme['ProgrammeName'];
     309        }
     310
     311        if ( isset( $attributes['programmeimage'] ) ) {
     312            $ret_str .= $programme['ImageUrl'];
     313        }
     314
     315        if ( isset( $attributes['programmeimagetext'] ) ) {
     316            $ret_str .= $programme['ImageText'];
     317        }
     318
     319        if ( isset( $attributes['programmedescriptionshort'] ) ) {
     320            $ret_str .= $programme['DescriptionShort'];
     321        }
     322
     323        if ( isset( $attributes['programmedescription'] ) ) {
     324            $ret_str .= $programme['Description'];
     325        }
     326
     327        if ( isset( $attributes['programmequote'] ) ) {
     328            $ret_str .= $programme['Quote'];
     329        }
     330
     331        if ( isset( $attributes['programmegoal'] ) ) {
     332            $ret_str .= $programme['CourseGoal'];
     333        }
     334
     335        if ( isset( $attributes['programmetarget'] ) ) {
     336            $ret_str .= $programme['TargetGroup'];
     337        }
     338
     339        if ( isset( $attributes['programmeprerequisites'] ) ) {
     340            $ret_str .= $programme['Prerequisites'];
     341        }
     342
     343        if ( isset( $attributes['courseafter'] ) ) {
     344            $ret_str .= $programme['CourseAfter'];
     345        }
     346
     347        $ret_str .= print_r( $programme, true );
     348    }
     349
     350    EDU()->stop_timer( $t );
     351
     352    return $ret_str;
    208353}
    209354
     
    820965    add_shortcode( 'eduadmin-programme-detail', 'eduadmin_get_programme_details' );
    821966    add_shortcode( 'eduadmin-programme-book', 'eduadmin_get_programme_booking' );
    822 }
     967    add_shortcode( 'eduadmin-programmeinfo', 'eduadmin_get_programmeinfo' );
     968}
  • eduadmin-booking/trunk/readme.txt

    r2976806 r2989860  
    44Requires at least: 5.8
    55Tested up to: 6.4
    6 Stable tag: 4.0.0
     6Stable tag: 4.1.0
    77Requires PHP: 7.0
    88License: GPL3
     
    4646The full changelog available on [GitHub](https://github.com/MultinetInteractive/EduAdmin-WordPress/blob/production/CHANGELOG.md)
    4747
     48### [4.1.0](https://github.com/MultinetInteractive/EduAdmin-WordPress/compare/v4.0.0...v4.1.0) (2023-11-06)
     49
     50
     51#### Features
     52
     53* Added shortcode [eduadmin-programmeinfo] with limited attributes ([b51a1b1](https://github.com/MultinetInteractive/EduAdmin-WordPress/commit/b51a1b102282dd7a23cd96aa9e459f4b116f3af0)), closes [#506](https://github.com/MultinetInteractive/EduAdmin-WordPress/issues/506)
     54
     55
     56#### Documentation
     57
     58* **Shortcodes:** Added info about the new shortcode ([4fe4b80](https://github.com/MultinetInteractive/EduAdmin-WordPress/commit/4fe4b8015c095841a75cfd5348ece89bfb90944a)), closes [#506](https://github.com/MultinetInteractive/EduAdmin-WordPress/issues/506)
     59
    4860### [4.0.0](https://github.com/MultinetInteractive/EduAdmin-WordPress/compare/v3.11.1...v4.0.0) (2023-10-10)
    4961
     
    7486* List number of free spots on programme list ([38529a8](https://github.com/MultinetInteractive/EduAdmin-WordPress/commit/38529a86da27169961bb53597a0f6069c4721d1c))
    7587
    76 ### [3.10.0](https://github.com/MultinetInteractive/EduAdmin-WordPress/compare/v3.9.2...v3.10.0) (2023-09-29)
    7788
    7889
    79 #### Features
    80 
    81 * Programme starts now show number of spots left (according to settings) ([0117df4](https://github.com/MultinetInteractive/EduAdmin-WordPress/commit/0117df408a557998bd04d467720e51cef331612a)), closes [#498](https://github.com/MultinetInteractive/EduAdmin-WordPress/issues/498)
    82 
    83 
    84 
Note: See TracChangeset for help on using the changeset viewer.