Commit af44b9b6 authored by Rodrigo's avatar Rodrigo
Browse files

Add Form ID to the class Gen_Form_Parameters

parent db4887b0
......@@ -8,10 +8,6 @@
* @subpackage Gen_Registration_Tracker/includes
*/
/**
* Adds Form parameters class.
*/
require_once plugin_dir_path( __FILE__ ) . 'class-gen-form-parameters.php';
/**
* The Class that fetches data from Caldera Forms API and arrang it in the Model classes.
*
......@@ -128,8 +124,8 @@ class Gen_Caldera_Forms_Data_Collector {
/**
* Registration ID.
*/
if ( isset( $registration_array[ Gen_Form_Parameters::ID ] ) ) {
$registration_id = $registration_array[ Gen_Form_Parameters::ID ];
if ( isset( $registration_array[ Gen_Form_Parameters::REGISTRATION_ID ] ) ) {
$registration_id = $registration_array[ Gen_Form_Parameters::REGISTRATION_ID ];
} else {
$this->error_list->add( 'registration_id', 'Registration has no valid id.' );
}
......
......@@ -19,7 +19,8 @@
* @subpackage Gen_Registration_Tracker/includes
*/
abstract class Gen_Form_Parameters {
const ID = 'id';
const ID = 'CF5c1a2c5ed240f';
const REGISTRATION_ID = 'id';
const TRANSPORTATION = 'how_do_you_plan_to_travel_to_the_conference';
const GA_ACCOMMODATION = 'accommodation_during_the_general_assembly';
const CONFERENCE_ACCOMMODATION = 'accommodation_during_the_conference';
......
......@@ -93,6 +93,7 @@ class Gen_Registration_Tracker {
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';
// Register style sheet.
add_action( 'admin_enqueue_scripts', array( $this, 'register_styles' ) );
......@@ -164,7 +165,7 @@ class Gen_Registration_Tracker {
echo '<h1>GEN Registration Tracker</h1>';
$this->error_list = new WP_Error();
$data_source = Gen_Caldera_Forms_Data_Collector::get_instance( 'CF5c1a2c5ed240f' );
$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 );
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment