Commit 66018d26 authored by Rodrigo's avatar Rodrigo
Browse files

Rename files and classes

parent 50fb6912
......@@ -5,7 +5,7 @@
* Version: 1.0.1
* Author: Rodrigo Espirito Santo Braga
*
* @package Gen_Registration_Tracker
* @package GEN_EU_Registration_Tracker
**/
// If this file is called directly, abort.
......@@ -13,19 +13,19 @@ if ( ! defined( 'WPINC' ) ) {
die;
}
define( 'GEN_REGISTRATION_TRACKER_VERSION', '1.0.1' );
define( 'GEN_EU_REGISTRATION_DASHBOARD_VERSION', '1.0.1' );
/**
* The core plugin class that is used to define internationalization,
* admin-specific hooks, and public-facing site hooks.
*/
require plugin_dir_path( __FILE__ ) . 'includes/class-gen-registration-tracker.php';
require plugin_dir_path( __FILE__ ) . 'includes/class-gen-eu-registration-dashboard.php';
/**
* Begins execution of the plugin.
*
* @since 1.0.0
*/
function run_gen_registration_tracker() {
$plugin = new Gen_Registration_Tracker();
function run_gen_eu_registration_dashboard() {
$plugin = new GEN_EU_Registration_Dashboard();
}
run_gen_registration_tracker();
run_gen_eu_registration_dashboard();
......@@ -4,26 +4,28 @@
*
* @since 1.0.0
*
* @package Gen_Registration_Tracker
* @subpackage Gen_Registration_Tracker/includes
* @package GEN_EU_Registration_Dashboard
* @subpackage GEN_EU_Registration_Dashboard/includes
*/
use GEN_EU\Registration\Dashboard\GEN_EU_Form_Parameters;
/**
* The Class that fetches data from Caldera Forms API and arrang it in the Model classes.
*
* This class implements useful static methods.
*
* @since 1.0.0
* @package Gen_Registration_Tracker
* @subpackage Gen_Registration_Tracker/includes
* @package GEN_EU_Registration_Dashboard
* @subpackage GEN_EU_Registration_Dashboard/includes
*/
class Gen_Caldera_Forms_Data_Collector {
class GEN_EU_Caldera_Forms_Data_Collector {
/**
* Class Instance.
*
* @since 1.0.0
* @access private
* @var Gen_Caldera_Forms_Data_Collector $instance A instance of the class.
* @var GEN_EU_Caldera_Forms_Data_Collector $instance A instance of the class.
*/
private static $instance = null;
......@@ -35,10 +37,10 @@ class Gen_Caldera_Forms_Data_Collector {
*/
private $form_id;
/**
* Contains 3 arrays ['Attendees'], ['Delegates'] and ['Children'] with objects of type Gen_Registrant.
* Contains 3 arrays ['Attendees'], ['Delegates'] and ['Children'] with objects of type GEN_EU_Registrant.
*
* @since 1.0.0
* @var array $all_registrations Contains 3 arrays ['Attendees'], ['Delegates'] and ['Children'] with objects of type Gen_Registrant.
* @var array $all_registrations Contains 3 arrays ['Attendees'], ['Delegates'] and ['Children'] with objects of type GEN_EU_Registrant.
*/
private $all_registrations = [];
/**
......@@ -60,11 +62,11 @@ class Gen_Caldera_Forms_Data_Collector {
* Retrieves the class instance.
*
* @param array $form_id Caldera Forms form id.
* @return Gen_Caldera_Forms_Data_Collector $instance A instance of the class.
* @return GEN_EU_Caldera_Forms_Data_Collector $instance A instance of the class.
*/
public static function get_instance( $form_id ) {
if ( ! self::$instance ) {
self::$instance = new Gen_Caldera_Forms_Data_Collector( $form_id );
self::$instance = new GEN_EU_Caldera_Forms_Data_Collector( $form_id );
}
return self::$instance;
......@@ -109,12 +111,12 @@ class Gen_Caldera_Forms_Data_Collector {
}
}
if ( ! empty( $this->error_list->get_error_code() ) ) {
Gen_Utility::print_errors( $this->error_list );
GEN_EU_Utility::print_errors( $this->error_list );
}
return $all_registrations;
}
/** Function that iterates through the data of a registration entry and return arrays of objects from Gen_Registrant class.
/** Function that iterates through the data of a registration entry and return arrays of objects from GEN_EU_Registrant class.
*
* @param array $registration_array array of data from a registration.
* @since 1.0.0
......@@ -124,16 +126,16 @@ class Gen_Caldera_Forms_Data_Collector {
/**
* Registration ID.
*/
if ( isset( $registration_array[ Gen_Form_Parameters::REGISTRATION_ID ] ) ) {
$registration_id = $registration_array[ Gen_Form_Parameters::REGISTRATION_ID ];
if ( isset( $registration_array[ GEN_EU_Form_Parameters::REGISTRATION_ID ] ) ) {
$registration_id = $registration_array[ GEN_EU_Form_Parameters::REGISTRATION_ID ];
} else {
$this->error_list->add( 'registration_id', 'Registration has no valid id.' );
}
/**
* Accommodation Price
*/
if ( isset( $registration_array[ Gen_Form_Parameters::ACCOMMODATION_PRICE ] ) ) {
$accommodation_price = $registration_array[ Gen_Form_Parameters::ACCOMMODATION_PRICE ];
if ( isset( $registration_array[ GEN_EU_Form_Parameters::ACCOMMODATION_PRICE ] ) ) {
$accommodation_price = $registration_array[ GEN_EU_Form_Parameters::ACCOMMODATION_PRICE ];
} else {
$this->error_list->add(
'accommodation_price',
......@@ -143,8 +145,8 @@ class Gen_Caldera_Forms_Data_Collector {
/**
* Meals Price
*/
if ( isset( $registration_array[ Gen_Form_Parameters::MEALS_PRICE ] ) ) {
$meals_price = $registration_array[ Gen_Form_Parameters::MEALS_PRICE ];
if ( isset( $registration_array[ GEN_EU_Form_Parameters::MEALS_PRICE ] ) ) {
$meals_price = $registration_array[ GEN_EU_Form_Parameters::MEALS_PRICE ];
} else {
$this->error_list->add(
'meals_price',
......@@ -154,8 +156,8 @@ class Gen_Caldera_Forms_Data_Collector {
/**
* Event Price
*/
if ( isset( $registration_array[ Gen_Form_Parameters::EVENT_PRICE ] ) ) {
$event_price = $registration_array[ Gen_Form_Parameters::EVENT_PRICE ];
if ( isset( $registration_array[ GEN_EU_Form_Parameters::EVENT_PRICE ] ) ) {
$event_price = $registration_array[ GEN_EU_Form_Parameters::EVENT_PRICE ];
} else {
$this->error_list->add(
'event_price',
......@@ -165,8 +167,8 @@ class Gen_Caldera_Forms_Data_Collector {
/**
* Fee
*/
if ( isset( $registration_array[ Gen_Form_Parameters::FEE ] ) ) {
$fee = $registration_array[ Gen_Form_Parameters::FEE ];
if ( isset( $registration_array[ GEN_EU_Form_Parameters::FEE ] ) ) {
$fee = $registration_array[ GEN_EU_Form_Parameters::FEE ];
} else {
$this->error_list->add(
'fee',
......@@ -176,24 +178,24 @@ class Gen_Caldera_Forms_Data_Collector {
/**
* Discount
*/
if ( isset( $registration_array[ Gen_Form_Parameters::DISCOUNT ] ) ) {
$group_discount = $registration_array[ Gen_Form_Parameters::DISCOUNT ];
if ( isset( $registration_array[ GEN_EU_Form_Parameters::DISCOUNT ] ) ) {
$group_discount = $registration_array[ GEN_EU_Form_Parameters::DISCOUNT ];
} else {
$group_discount = 0;
}
/**
* Donation
*/
if ( isset( $registration_array[ Gen_Form_Parameters::DONATION ] ) ) {
$donation = $registration_array[ Gen_Form_Parameters::DONATION ];
if ( isset( $registration_array[ GEN_EU_Form_Parameters::DONATION ] ) ) {
$donation = $registration_array[ GEN_EU_Form_Parameters::DONATION ];
} else {
$donation = 0;
}
/**
* Total Price
*/
if ( isset( $registration_array[ Gen_Form_Parameters::TOTAL_PRICE ] ) ) {
$total_price = $registration_array[ Gen_Form_Parameters::TOTAL_PRICE ];
if ( isset( $registration_array[ GEN_EU_Form_Parameters::TOTAL_PRICE ] ) ) {
$total_price = $registration_array[ GEN_EU_Form_Parameters::TOTAL_PRICE ];
} else {
$this->error_list->add(
'total_price',
......@@ -201,8 +203,8 @@ class Gen_Caldera_Forms_Data_Collector {
);
}
if ( isset( $registration_array[ Gen_Form_Parameters::NUMBER_OF_PEOPLE ] ) ) {
$number_of_registrants = $registration_array[ Gen_Form_Parameters::NUMBER_OF_PEOPLE ];
if ( isset( $registration_array[ GEN_EU_Form_Parameters::NUMBER_OF_PEOPLE ] ) ) {
$number_of_registrants = $registration_array[ GEN_EU_Form_Parameters::NUMBER_OF_PEOPLE ];
} else {
$this->error_list->add(
'number_of_registrants',
......@@ -215,44 +217,44 @@ class Gen_Caldera_Forms_Data_Collector {
// This block identifies fields that has different values for each registrant inside a registration entry.
switch ( $registrant_number ) {
case 1:
$registrant_name_index = Gen_Form_Parameters::NAME_FIRST;
$registrant_age_index = Gen_Form_Parameters::AGE_FIRST;
$registrant_diet_index = Gen_Form_Parameters::DIET_FIRST;
$registration_type_index = Gen_Form_Parameters::REGISTRATION_TYPE_FIRST;
$delegate_price_index = Gen_Form_Parameters::DELEGATE_REGISTRATION_PRICE_FIRST;
$attendee_price_index = Gen_Form_Parameters::ATTENDEE_REGISTRATION_PRICE_FIRST;
$registrant_name_index = GEN_EU_Form_Parameters::NAME_FIRST;
$registrant_age_index = GEN_EU_Form_Parameters::AGE_FIRST;
$registrant_diet_index = GEN_EU_Form_Parameters::DIET_FIRST;
$registration_type_index = GEN_EU_Form_Parameters::REGISTRATION_TYPE_FIRST;
$delegate_price_index = GEN_EU_Form_Parameters::DELEGATE_REGISTRATION_PRICE_FIRST;
$attendee_price_index = GEN_EU_Form_Parameters::ATTENDEE_REGISTRATION_PRICE_FIRST;
break;
case 2:
$registrant_name_index = Gen_Form_Parameters::NAME_SECOND;
$registrant_age_index = Gen_Form_Parameters::AGE_SECOND;
$registrant_diet_index = Gen_Form_Parameters::DIET_SECOND;
$registration_type_index = Gen_Form_Parameters::REGISTRATION_TYPE_SECOND;
$delegate_price_index = Gen_Form_Parameters::DELEGATE_REGISTRATION_PRICE_SECOND;
$attendee_price_index = Gen_Form_Parameters::ATTENDEE_REGISTRATION_PRICE_SECOND;
$registrant_name_index = GEN_EU_Form_Parameters::NAME_SECOND;
$registrant_age_index = GEN_EU_Form_Parameters::AGE_SECOND;
$registrant_diet_index = GEN_EU_Form_Parameters::DIET_SECOND;
$registration_type_index = GEN_EU_Form_Parameters::REGISTRATION_TYPE_SECOND;
$delegate_price_index = GEN_EU_Form_Parameters::DELEGATE_REGISTRATION_PRICE_SECOND;
$attendee_price_index = GEN_EU_Form_Parameters::ATTENDEE_REGISTRATION_PRICE_SECOND;
break;
case 3:
$registrant_name_index = Gen_Form_Parameters::NAME_THIRD;
$registrant_age_index = Gen_Form_Parameters::AGE_THIRD;
$registrant_diet_index = Gen_Form_Parameters::DIET_THIRD;
$registration_type_index = Gen_Form_Parameters::REGISTRATION_TYPE_THIRD;
$delegate_price_index = Gen_Form_Parameters::DELEGATE_REGISTRATION_PRICE_THIRD;
$attendee_price_index = Gen_Form_Parameters::ATTENDEE_REGISTRATION_PRICE_THIRD;
$registrant_name_index = GEN_EU_Form_Parameters::NAME_THIRD;
$registrant_age_index = GEN_EU_Form_Parameters::AGE_THIRD;
$registrant_diet_index = GEN_EU_Form_Parameters::DIET_THIRD;
$registration_type_index = GEN_EU_Form_Parameters::REGISTRATION_TYPE_THIRD;
$delegate_price_index = GEN_EU_Form_Parameters::DELEGATE_REGISTRATION_PRICE_THIRD;
$attendee_price_index = GEN_EU_Form_Parameters::ATTENDEE_REGISTRATION_PRICE_THIRD;
break;
case 4:
$registrant_name_index = Gen_Form_Parameters::NAME_FOURTH;
$registrant_age_index = Gen_Form_Parameters::AGE_FOURTH;
$registrant_diet_index = Gen_Form_Parameters::DIET_FOURTH;
$registration_type_index = Gen_Form_Parameters::REGISTRATION_TYPE_FOURTH;
$delegate_price_index = Gen_Form_Parameters::DELEGATE_REGISTRATION_PRICE_FOURTH;
$attendee_price_index = Gen_Form_Parameters::ATTENDEE_REGISTRATION_PRICE_FOURTH;
$registrant_name_index = GEN_EU_Form_Parameters::NAME_FOURTH;
$registrant_age_index = GEN_EU_Form_Parameters::AGE_FOURTH;
$registrant_diet_index = GEN_EU_Form_Parameters::DIET_FOURTH;
$registration_type_index = GEN_EU_Form_Parameters::REGISTRATION_TYPE_FOURTH;
$delegate_price_index = GEN_EU_Form_Parameters::DELEGATE_REGISTRATION_PRICE_FOURTH;
$attendee_price_index = GEN_EU_Form_Parameters::ATTENDEE_REGISTRATION_PRICE_FOURTH;
break;
case 5:
$registrant_name_index = Gen_Form_Parameters::NAME_FIFTH;
$registrant_age_index = Gen_Form_Parameters::AGE_FIFTH;
$registrant_diet_index = Gen_Form_Parameters::DIET_FIFTH;
$registration_type_index = Gen_Form_Parameters::REGISTRATION_TYPE_FIFTH;
$delegate_price_index = Gen_Form_Parameters::DELEGATE_REGISTRATION_PRICE_FIFTH;
$attendee_price_index = Gen_Form_Parameters::ATTENDEE_REGISTRATION_PRICE_FIFTH;
$registrant_name_index = GEN_EU_Form_Parameters::NAME_FIFTH;
$registrant_age_index = GEN_EU_Form_Parameters::AGE_FIFTH;
$registrant_diet_index = GEN_EU_Form_Parameters::DIET_FIFTH;
$registration_type_index = GEN_EU_Form_Parameters::REGISTRATION_TYPE_FIFTH;
$delegate_price_index = GEN_EU_Form_Parameters::DELEGATE_REGISTRATION_PRICE_FIFTH;
$attendee_price_index = GEN_EU_Form_Parameters::ATTENDEE_REGISTRATION_PRICE_FIFTH;
break;
default:
$this->error_list->add(
......@@ -307,19 +309,19 @@ class Gen_Caldera_Forms_Data_Collector {
/**
* Registration Type
*/
if ( $registrant_age < Gen_Enum::MIN_YOUTHS_AGE ) {
$registration_type = Gen_Kid::REGISTRATION_TYPE;
$registrant_event_price = Gen_Enum::KIDS_REGISTRATION_PRICE;
if ( $registrant_age < GEN_EU_Enum::MIN_YOUTHS_AGE ) {
$registration_type = GEN_EU_Kid::REGISTRATION_TYPE;
$registrant_event_price = GEN_EU_Enum::KIDS_REGISTRATION_PRICE;
} elseif ( isset( $registration_array[ $registration_type_index ] ) ) {
$registration_type = $registration_array[ $registration_type_index ];
if ( strpos( $registration_type, Gen_Delegate::REGISTRATION_TYPE ) !== false ) {
if ( strpos( $registration_type, GEN_EU_Delegate::REGISTRATION_TYPE ) !== false ) {
/**
* Delegate organisation
*/
if ( ! isset( $registration_array[ Gen_Form_Parameters::ORGANISATION ] ) ) {
if ( ! isset( $registration_array[ GEN_EU_Form_Parameters::ORGANISATION ] ) ) {
$organization = 'Organization not specified';
} else {
$organization = $registration_array[ Gen_Form_Parameters::ORGANISATION ];
$organization = $registration_array[ GEN_EU_Form_Parameters::ORGANISATION ];
}
/**
* Delegate registration Price
......@@ -352,8 +354,8 @@ class Gen_Caldera_Forms_Data_Collector {
/**
* Transportation
*/
if ( isset( $registration_array[ Gen_Form_Parameters::TRANSPORTATION ] ) ) {
$transportation = $registration_array[ Gen_Form_Parameters::TRANSPORTATION ];
if ( isset( $registration_array[ GEN_EU_Form_Parameters::TRANSPORTATION ] ) ) {
$transportation = $registration_array[ GEN_EU_Form_Parameters::TRANSPORTATION ];
}
/**
* Registrant accommodation Price
......@@ -373,25 +375,25 @@ class Gen_Caldera_Forms_Data_Collector {
* Accommodation Type
*/
$accommodation = [];
if ( isset( $registration_array[ Gen_Form_Parameters::GA_ACCOMMODATION ] ) ) {
$accommodation['General Assembly'] = $registration_array[ Gen_Form_Parameters::GA_ACCOMMODATION ];
if ( isset( $registration_array[ GEN_EU_Form_Parameters::GA_ACCOMMODATION ] ) ) {
$accommodation['General Assembly'] = $registration_array[ GEN_EU_Form_Parameters::GA_ACCOMMODATION ];
}
if ( isset( $registration_array[ Gen_Form_Parameters::CONFERENCE_ACCOMMODATION ] ) ) {
$accommodation['Conference'] = $registration_array[ Gen_Form_Parameters::CONFERENCE_ACCOMMODATION ];
if ( isset( $registration_array[ GEN_EU_Form_Parameters::CONFERENCE_ACCOMMODATION ] ) ) {
$accommodation['Conference'] = $registration_array[ GEN_EU_Form_Parameters::CONFERENCE_ACCOMMODATION ];
}
if ( isset( $registration_array[ Gen_Form_Parameters::ADDITIONAL_ACCOMMODATION ] ) ) {
$accommodation['National Gathering'] = $registration_array[ Gen_Form_Parameters::ADDITIONAL_ACCOMMODATION ];
if ( isset( $registration_array[ GEN_EU_Form_Parameters::ADDITIONAL_ACCOMMODATION ] ) ) {
$accommodation['National Gathering'] = $registration_array[ GEN_EU_Form_Parameters::ADDITIONAL_ACCOMMODATION ];
}
/**
* Dates
*/
$arrival = DateTime::createFromFormat( 'd/m/Y', $registration_array[ Gen_Form_Parameters::ARRIVAL_DATE ] );
$departure = DateTime::createFromFormat( 'd/m/Y', $registration_array[ Gen_Form_Parameters::DEPARTURE_DATE ] );
$arrival = DateTime::createFromFormat( 'd/m/Y', $registration_array[ GEN_EU_Form_Parameters::ARRIVAL_DATE ] );
$departure = DateTime::createFromFormat( 'd/m/Y', $registration_array[ GEN_EU_Form_Parameters::DEPARTURE_DATE ] );
/**
* Country
*/
if ( isset( $registration_array[ Gen_Form_Parameters::COUNTRY ] ) ) {
$country = $registration_array[ Gen_Form_Parameters::COUNTRY ];
if ( isset( $registration_array[ GEN_EU_Form_Parameters::COUNTRY ] ) ) {
$country = $registration_array[ GEN_EU_Form_Parameters::COUNTRY ];
} else {
$this->error_list->add(
'registrant_country',
......@@ -407,7 +409,7 @@ class Gen_Caldera_Forms_Data_Collector {
case 'Attendee':
array_push(
$registrants,
new Gen_Attendee(
new GEN_EU_Attendee(
$registration_id,
$registrant_age,
$transportation,
......@@ -427,7 +429,7 @@ class Gen_Caldera_Forms_Data_Collector {
case 'Delegate':
array_push(
$registrants,
new Gen_Delegate(
new GEN_EU_Delegate(
$registration_id,
$registrant_age,
$organization,
......@@ -448,7 +450,7 @@ class Gen_Caldera_Forms_Data_Collector {
case 'Kid':
array_push(
$registrants,
new Gen_Kid(
new GEN_EU_Kid(
$registration_id,
$registrant_age,
$transportation,
......@@ -473,7 +475,7 @@ class Gen_Caldera_Forms_Data_Collector {
}
}
return new Gen_Registration(
return new GEN_EU_Registration(
$registration_id,
$event_price,
$accommodation_price,
......
......@@ -4,8 +4,8 @@
*
* @since 1.0.1
*
* @package Gen_Registration_Tracker
* @subpackage Gen_Registration_Tracker/includes
* @package GEN_EU_Registration_Dashboard
* @subpackage GEN_EU_Registration_Dashboard/includes
*/
/**
......@@ -14,10 +14,10 @@
* This class implements useful constant values to be used in the plugin.
*
* @since 1.0.1
* @package Gen_Registration_Tracker
* @subpackage Gen_Registration_Tracker/includes
* @package GEN_EU_Registration_Dashboard
* @subpackage GEN_EU_Registration_Dashboard/includes
*/
abstract class Gen_Enum {
abstract class GEN_EU_Enum {
/**
* Maximun age for a person to be considered a youth.
*
......
......@@ -4,19 +4,21 @@
*
* @since 1.0.1
*
* @package Gen_Registration_Tracker
* @subpackage Gen_Registration_Tracker/includes
* @package GEN_EU_Registration_Dashboard
* @subpackage GEN_EU_Registration_Dashboard/includes
*/
namespace GEN_EU\Registration\Dashboard;
/**
* This class implements parameters to be associated with form slugs.
* The main customization to make this plugin able to work with different events form should be made here.
*
* @since 1.0.1
* @package Gen_Registration_Tracker
* @subpackage Gen_Registration_Tracker/includes
* @package GEN_EU_Registration_Dashboard
* @subpackage GEN_EU_Registration_Dashboard/includes
*/
abstract class Gen_Form_Parameters {
abstract class GEN_EU_Form_Parameters {
const ID = 'CF5c1a2c5ed240f';
const REGISTRATION_ID = 'id';
const TRANSPORTATION = 'how_do_you_plan_to_travel_to_the_conference';
......
......@@ -7,10 +7,12 @@
*
* @since 1.0.0
*
* @package Gen_Registration_Tracker
* @subpackage Gen_Registration_Tracker/includes
* @package GEN_EU_Registration_Dashboard
* @subpackage GEN_EU_Registration_Dashboard/includes
*/
use GEN_EU\Registration\Dashboard\GEN_EU_Form_Parameters;
/**
* The core plugin class.
*
......@@ -21,11 +23,11 @@
* version of the plugin.
*
* @since 1.0.0
* @package Gen_Registration_Tracker
* @subpackage Gen_Registration_Tracker/includes
* @package GEN_EU_Registration_Dashboard
* @subpackage GEN_EU_Registration_Dashboard/includes
* @author Rodrigo Espirito Santo Braga <rodrigo@gen-europe.prg>
*/
class Gen_Registration_Tracker {
class GEN_EU_Registration_Dashboard {
/**
* The unique identifier of this plugin.
*
......@@ -59,12 +61,12 @@ class Gen_Registration_Tracker {
* @since 1.0.0
*/
public function __construct() {
if ( defined( 'GEN_REGISTRATION_TRACKER_VERSION' ) ) {
$this->version = GEN_REGISTRATION_TRACKER_VERSION;
if ( defined( 'GEN_EU_REGISTRATION_DASHBOARD_VERSION' ) ) {
$this->version = GEN_EU_REGISTRATION_DASHBOARD_VERSION;
} else {
$this->version = '1.0.0';
}
$this->plugin_name = 'gen-registration-tracker';
$this->plugin_name = 'gen-eu-registration-dashboard';
$this->load_dependencies();
}
/**
......@@ -72,7 +74,7 @@ class Gen_Registration_Tracker {
*
* Include the following files that make up the plugin:
*
* - Gen_Registrant. Model to process data from each registrant.
* - GEN_EU_Registrant. Model to process data from each registrant.
*
* Rregister the hooks with WordPress.
*
......@@ -83,17 +85,17 @@ class Gen_Registration_Tracker {
/**
* The Registrant Class used to handle information about each registrant.
*/
require_once plugin_dir_path( __FILE__ ) . 'registrant/class-gen-registrant.php';
require_once plugin_dir_path( __FILE__ ) . 'registrant/class-gen-attendee.php';
require_once plugin_dir_path( __FILE__ ) . 'registrant/class-gen-kid.php';
require_once plugin_dir_path( __FILE__ ) . 'registrant/class-gen-delegate.php';
require_once plugin_dir_path( __FILE__ ) . 'class-gen-utility.php';
require_once plugin_dir_path( __FILE__ ) . 'class-gen-caldera-forms-data-collector.php';
require_once plugin_dir_path( __FILE__ ) . 'dashboard/class-gen-dashboard-loader.php';
require_once plugin_dir_path( __FILE__ ) . 'dashboard/class-gen-dashboard-viewer.php';
require_once plugin_dir_path( __FILE__ ) . 'class-gen-enum.php';
require_once plugin_dir_path( __FILE__ ) . 'class-gen-registration.php';
require_once plugin_dir_path( __FILE__ ) . 'class-gen-form-parameters.php';
require_once plugin_dir_path( __FILE__ ) . 'registrant/class-gen-eu-registrant.php';
require_once plugin_dir_path( __FILE__ ) . 'registrant/class-gen-eu-attendee.php';
require_once plugin_dir_path( __FILE__ ) . 'registrant/class-gen-eu-kid.php';
require_once plugin_dir_path( __FILE__ ) . 'registrant/class-gen-eu-delegate.php';
require_once plugin_dir_path( __FILE__ ) . 'class-gen-eu-utility.php';
require_once plugin_dir_path( __FILE__ ) . 'class-gen-eu-caldera-forms-data-collector.php';
require_once plugin_dir_path( __FILE__ ) . 'dashboard/class-gen-eu-dashboard-loader.php';
require_once plugin_dir_path( __FILE__ ) . 'dashboard/class-gen-eu-dashboard-viewer.php';
require_once plugin_dir_path( __FILE__ ) . 'class-gen-eu-enum.php';
require_once plugin_dir_path( __FILE__ ) . 'class-gen-eu-registration.php';
require_once plugin_dir_path( __FILE__ ) . 'class-gen-eu-form-parameters.php';
// Register style sheet.
add_action( 'admin_enqueue_scripts', array( $this, 'register_styles' ) );
......@@ -105,7 +107,7 @@ class Gen_Registration_Tracker {
* Include CSS file for the plugin.
*/
public function register_styles() {
wp_register_style( $this->plugin_name, plugins_url( 'gen-registration-tracker/assets/gen-registration-tracker-styles.css' ), null, $this->version );
wp_register_style( $this->plugin_name, plugins_url( 'gen-eu-registration-dashboard/assets/gen-eu-registration-dashboard-styles.css' ), null, $this->version );
wp_enqueue_style( $this->plugin_name );
}
......@@ -114,8 +116,8 @@ class Gen_Registration_Tracker {
if ( current_user_can( 'manage_options' ) ) {
add_submenu_page(
'caldera-forms',
'GEN Registration Tracker',
'<span class="caldera-forms-menu-dashicon"><span class="dashicons dashicons-analytics"></span>GEN Registration Tracker',
'GEN EU Registration Dashboard',
'<span class="caldera-forms-menu-dashicon"><span class="dashicons dashicons-analytics"></span>GEN EU Registration Dashboard',
'edit_pages',
$this->plugin_name,
array( $this, 'create_admin_page' )
......@@ -162,11 +164,11 @@ class Gen_Registration_Tracker {
wp_die( esc_html__( 'You do not have sufficient permissions to access this page.' ) );
}
echo '<h1>GEN Registration Tracker</h1>';
echo '<h1>GEN EU Registration Dashboard</h1>';
$this->error_list = new WP_Error();
$data_source = Gen_Caldera_Forms_Data_Collector::get_instance( Gen_Form_Parameters::ID );
$dashboard = Gen_Dashboard_Loader::get_instance( $data_source ); // get instance of a singleton.
Gen_Dashboard_Viewer::display_dashboard( $dashboard );
$data_source = GEN_EU_Caldera_Forms_Data_Collector::get_instance( GEN_EU_Form_Parameters::ID );
$dashboard = GEN_EU_Dashboard_Loader::get_instance( $data_source ); // get instance of a singleton.
GEN_EU_Dashboard_Viewer::display_dashboard( $dashboard );
}
}
......@@ -4,18 +4,18 @@
*
* @since 1.0.1
*
* @package Gen_Registration_Tracker
* @subpackage Gen_Registration_Tracker/includes
* @package GEN_EU_Registration_Dashboard
* @subpackage GEN_EU_Registration_Dashboard/includes
*/
/**
* The class that describes the registration.
*
* @since 1.0.1
* @package Gen_Registration_Tracker
* @subpackage Gen_Registration_Tracker/includes
* @package GEN_EU_Registration_Dashboard
* @subpackage GEN_EU_Registration_Dashboard/includes
*/
class Gen_Registration {
class GEN_EU_Registration {
/**
* Id of the registration.
*
......@@ -29,7 +29,7 @@ class Gen_Registration {
*
* @since 1.0.1
* @access private
* @var array $registrants Array of objects from Gen_Registrant class.
* @var array $registrants Array of objects from GEN_EU_Registrant class.
*/
private $registrants;
/**
......
......@@ -4,8 +4,8 @@
*
* @since 1.0.0
*
* @package Gen_Registration_Tracker
* @subpackage Gen_Registration_Tracker/includes
* @package GEN_EU_Registration_Dashboard