Plugin Directory

Changeset 2472099


Ignore:
Timestamp:
02/10/2021 03:01:46 AM (5 years ago)
Author:
janorkar
Message:

Committing Version 3.0.1

Location:
ebecas
Files:
1 added
6 edited

Legend:

Unmodified
Added
Removed
  • ebecas/trunk/admin/Eit_Ebecas_Settings.php

    r2469343 r2472099  
    102102                    'type'    => 'text',
    103103                    'placeholder'    => '',
     104                    'default' => '',
    104105                ),
    105106                array(
     
    109110                    'type'    => 'text',
    110111                    'placeholder'    => '',
     112                    'default' => '',
    111113                ),
    112114                array(
     
    116118                    'type'    => 'text',
    117119                    'placeholder'    => '',
     120                    'default' => '',
    118121                ),
    119122                array(
     
    123126                    'type'    => 'text',
    124127                    'placeholder'    => '',
     128                    'default' => '',
    125129                ),
    126130                array(
     
    138142                    'type'    => 'text',
    139143                    'placeholder'    => '',
     144                    'default' => '',
    140145                ),
    141146                array(
     
    145150                    'type'    => 'text',
    146151                    'placeholder'    => '',
     152                    'default' => '',
    147153                ),
    148154                array(
     
    156162                    ),
    157163                    'default' => 'up',
     164                ),
     165                array(
     166                    'uid'     => EIT_EBECAS_OPTION_PREFIX . 'application_type',
     167                    'label'   => 'Application Type',
     168                    'section' => 'eit_ebecas_other_setting_section',
     169                    'type'    => 'radio',
     170                    'options' => array(
     171                        'personal' => 'Personal Details - Only collect student\'s personal details.',
     172                        'complete' => 'Complete Application - Personal details with all available products (course, insurance, accommodation, etc.).',
     173                    ),
     174                    'default' => 'complete',
    158175                ),
    159176                array(
     
    181198        public function eit_ebecas_field_callback( $arguments ) {
    182199            $value = get_option( $arguments['uid'] ); // Get the current value, if there is one
     200            if ( ! $value ) {
     201                $value = $arguments['default']; // If no value exists, Set to our default
     202            }
    183203
    184204            switch ( $arguments['type'] ) {
  • ebecas/trunk/eit-ebecas.php

    r2469375 r2472099  
    55Plugin URI: https://ebecas.com.au/wordpress-plugin
    66Description: Using this plugin students can submit online application directly from school/college website. Submitted application with student details along with course and other products will be recorded in eBecas for further processing.
    7 Version: 3.0.0
     7Version: 3.0.1
    88Requires at least: 5.3
    99Requires PHP: 7.0
     
    3535define( 'EIT_EBECAS_PLUGIN', __FILE__ );
    3636
    37 define( 'EIT_EBECAS_VERSION', '3.0.0' );
     37define( 'EIT_EBECAS_VERSION', '3.0.1' );
    3838
    3939define( 'EIT_EBECAS_REQUIRED_WP_VERSION', '5.3' );
     
    8080require_once EIT_EBECAS_PLUGIN_INCLUDES_DIR . '/Eit_Ebecas_Email_Verification.php';
    8181
     82// ebecas app general class
     83require_once EIT_EBECAS_PLUGIN_INCLUDES_DIR . '/Eit_Ebecas_App.php';
     84
    8285// admin option settings
    8386require_once EIT_EBECAS_PLUGIN_ADMIN_DIR . '/Eit_Ebecas_Settings.php';
  • ebecas/trunk/includes/Eit_Ebecas_Controller.php

    r2467608 r2472099  
    141141            '<p>Below are your application details for future reference.<br/></p>' .
    142142            '<p>Student ID: ' . $offer['StudentId'] . '<br/>' .
    143             'Application Number: ' . $offer['OfferId'] . '</p>' .
    144             '<table border="1" class = "eit_ebecas_th_des"><thead><tr>' .
     143            'Application Number: ' . $offer['OfferId'] . '</p>';
     144
     145    $table = '<table border="1" class = "eit_ebecas_th_des"><thead><tr>' .
    145146            '<th>Description</th>' .
    146147            '<th>Amount</th>' .
     
    151152        $tax    += $item['Tax'];
    152153
    153         $html .= '<tr>' .
     154        $table .= '<tr>' .
    154155                 '<td>' . $item['Description'] . '<br/><small><i>' . $item['ValidationMessage'] . '</i></small></td>' .
    155156                 '<td>$' . $item['Amount'] . '</td>' .
     
    158159
    159160    $tax_description = $tax ? '(Includes $' . $tax . ' Tax)' : '';
    160     $html .= '<tr>' .
     161    $table .= '<tr>' .
    161162             '<td>Application Total ' . $tax_description . '</td>' .
    162163             '<td>$' . $amount . '</td>' .
    163164             '</tr>' .
    164165             '</tbody></table>';
     166
     167    if ($amount) {
     168        $html .= $table;
     169    }
    165170
    166171    return $html;
     
    203208    $dob        = sanitize_text_field( $_POST["eit_ebecas_dob"] );
    204209    $mobile     = sanitize_text_field( $_POST["eit_ebecas_mobile"] );
    205     $course     = (int) filter_var( $_POST["eit_ebecas_course"], FILTER_SANITIZE_NUMBER_INT );
    206 
    207     if ( empty( $first_name ) || empty( $last_name ) || empty( $email ) || empty($dob) || empty($mobile) || empty( $course ) ) {
     210
     211    if ( empty( $first_name ) || empty( $last_name ) || empty( $email ) || empty($dob) || empty($mobile) ) {
    208212        $reg_errors->add( 'field', 'Required form fields are missing.' );
    209213    }
  • ebecas/trunk/public/Eit_Ebecas_Student_Portal.php

    r2467512 r2472099  
    99    class Eit_Ebecas_Student_Portal {
    1010        private $eit_ebecas_api = null;
    11         const APPLICATION_STATUS_UP = 'up';
    12         const APPLICATION_STATUS_DOWN = 'down';
     11        public $type = null;
    1312
    1413        public function __construct() {
     
    2221            //get the attribute_escape
    2322            $atts = shortcode_atts(
    24                 array(),
     23                array( 'type' => Eit_Ebecas_App::application_type() ),
    2524                $atts,
    2625                EIT_EBECAS_SHORTCODE
    2726            );
     27
     28            // personal or complete
     29            $this->type = $atts['type'];
    2830
    2931            ob_start();
     
    3739            // 'up' - Allowing students to submit application.
    3840            // 'down' - Unavailable
    39             if ( get_option( EIT_EBECAS_OPTION_PREFIX . 'application_status' ) == self::APPLICATION_STATUS_UP ) {
     41            if ( Eit_Ebecas_App::is_application_status_up() ) {
    4042                $courses_exist = $this->check_courses();
    4143                $api_status    = $this->eit_ebecas_api->is_api_up();
    42                 if ( ! $courses_exist && $api_status ) {
    43                     echo $message;
    44                 }
    4544
    4645                if ( ! $api_status ) {
     
    5049                         "Please check back soon." .
    5150                         "</p>";
     51
     52                    return ob_get_clean();
    5253                }
    5354
    54                 if ( $courses_exist && $api_status ) {
    55                     $this->get_form_html();
     55                // if it's a complete application then we need published courses
     56                if ( $this->type == Eit_Ebecas_App::APPLICATION_TYPE_COMPLETE && ! $courses_exist ) {
     57                    echo $message;
     58
     59                    return ob_get_clean();
    5660                }
    57             } else {
    58                 echo $message;
    59             }
     61
     62                // get the html application form
     63                $this->get_form_html();
     64
     65                return ob_get_clean();
     66            }
     67
     68            echo $message;
    6069
    6170            return ob_get_clean();
     
    156165
    157166        protected function get_form_html() {
    158             $locationSelect = $this->get_locations_select();
    159167            $countrySelect = $this->get_country_select();
    160168            $languageSelect = $this->get_language_select();
     
    213221                                . '<p id="eit_ebecas_country">' . $countrySelect . '</p>'
    214222                               
    215                                 . '<p id="eit_ebecas_language">' . $languageSelect . '</p>'
    216                                
    217                                 . '<p id="eit-location-select">' . $locationSelect . '</p>'
    218                            
    219                                 . '<p id="eit_ebecas_course"></p>'
    220                                
    221                                 . '<p id="eit_ebecas_insurance"></p>'
    222                                
    223                                 . '<p id="eit_ebecas_accommodation"></p>'
    224                                
    225                                 . '<p id="eit_ebecas_arrangement"></p>'
    226                        
    227                                 . '<p id="eit_ebecas_airport_pickup"></p>'
    228                            
    229                                 . '<p id="eit_ebecas_airport_dropoff"></p>'
    230                                
    231                                 . '<p id="eit_ebecas_others"></p>'
    232                                
    233                                 .'<div class = "wrap-eit-ebecas-input bg1">'
    234                                     . '<label for="eit_ebecas_application_details">Additional Application Details</label>'
     223                                . '<p id="eit_ebecas_language">' . $languageSelect . '</p>';
     224
     225                                if ( $this->type == Eit_Ebecas_App::APPLICATION_TYPE_COMPLETE ) {
     226                                    $form .= '<p id="eit-location-select">' . $this->get_locations_select() . '</p>'
     227
     228                                             . '<p id="eit_ebecas_course"></p>'
     229
     230                                             . '<p id="eit_ebecas_insurance"></p>'
     231
     232                                             . '<p id="eit_ebecas_accommodation"></p>'
     233
     234                                             . '<p id="eit_ebecas_arrangement"></p>'
     235
     236                                             . '<p id="eit_ebecas_airport_pickup"></p>'
     237
     238                                             . '<p id="eit_ebecas_airport_dropoff"></p>'
     239
     240                                             . '<p id="eit_ebecas_others"></p>';
     241                                }
     242
     243                                $form .= '<div class = "wrap-eit-ebecas-input bg1">'
     244                                    . '<label for="eit_ebecas_application_details">Additional Details</label>'
    235245                                    . '<textarea name="eit_ebecas_application_details" rows="5"></textarea>'
    236246                                .'</div>'
  • ebecas/trunk/readme.txt

    r2469375 r2472099  
    55Requires at least: 5.3
    66Tested up to: 5.6
    7 Stable tag: 3.0.0
     7Stable tag: 3.0.1
    88Requires PHP: 7.0
    99License: GPLv2 or later
     
    34341. Register a new site by clicking on the "+" sign in the Admin Console.
    35351. Fill the form, select "reCAPTCHA v3" as reCAPTCHA Type and add your website in the Domains Section, then click on Submit button.
    36 1. Copy "Site Key" and "Secret Key" in the eBecas plugin integration page "reCAPTCHA Settings" section.
     361. Copy "Site Key" and "Secret Key" in "reCAPTCHA Settings" section in eBECAS plugin integration page
    3737
    3838= How to temporary stop accepting online application? =
     
    4141
    4242When you are ready to start accepting online application you can set the "Application Status" flag to "Up - Allowing students to submit application".
     43
     44= Personal Details or Complete Application type selection? =
     45
     46In the eBecas integration page you can set the "Application Type" flag to
     471. "Personal Details - Only collect student's personal details." or
     481. "Complete Application - Personal details with all available products (course, insurance, accommodation, etc.)"
    4349
    4450= Can i share my eBecas API Key and API Secret with others? =
     
    7177== Installation ==
    7278
    73 1. Upload the entire `eit-ebecas` folder to the `/wp-content/plugins/` directory.
     791. Upload the entire `ebecas` folder to the `/wp-content/plugins/` directory.
    74801. Activate the plugin through the **Plugins** screen (**Plugins > Installed Plugins**).
    7581
     
    113119
    114120== Changelog ==
     121= 3.0.1 =
     122* Added option to choose between 'Personal Details only' or 'Complete Application' type
    115123
    116124= 3.0.0 =
Note: See TracChangeset for help on using the changeset viewer.