Code Duplication    Length = 15-15 lines in 9 locations

core/helpers/EEH_Activation.helper.php 9 locations

@@ 937-951 (lines=15) @@
934
                            'QST_deleted'       => 0,
935
                        );
936
                        break;
937
                    case 'lname':
938
                        $QST_values = array(
939
                            'QST_display_text'  => __('Last Name', 'event_espresso'),
940
                            'QST_admin_label'   => __('Last Name - System Question', 'event_espresso'),
941
                            'QST_system'        => 'lname',
942
                            'QST_type'          => 'TEXT',
943
                            'QST_required'      => 1,
944
                            'QST_required_text' => __('This field is required', 'event_espresso'),
945
                            'QST_order'         => 2,
946
                            'QST_admin_only'    => 0,
947
                            'QST_max'           => EEM_Question::instance()->absolute_max_for_system_question($QST_system),
948
                            'QST_wp_user'       => self::get_default_creator_id(),
949
                            'QST_deleted'       => 0,
950
                        );
951
                        break;
952
                    case 'email':
953
                        $QST_values = array(
954
                            'QST_display_text'  => __('Email Address', 'event_espresso'),
@@ 922-936 (lines=15) @@
919
            if (! in_array($QST_system, $questions)) {
920
                // add it
921
                switch ($QST_system) {
922
                    case 'fname':
923
                        $QST_values = array(
924
                            'QST_display_text'  => __('First Name', 'event_espresso'),
925
                            'QST_admin_label'   => __('First Name - System Question', 'event_espresso'),
926
                            'QST_system'        => 'fname',
927
                            'QST_type'          => 'TEXT',
928
                            'QST_required'      => 1,
929
                            'QST_required_text' => __('This field is required', 'event_espresso'),
930
                            'QST_order'         => 1,
931
                            'QST_admin_only'    => 0,
932
                            'QST_max'           => EEM_Question::instance()->absolute_max_for_system_question($QST_system),
933
                            'QST_wp_user'       => self::get_default_creator_id(),
934
                            'QST_deleted'       => 0,
935
                        );
936
                        break;
937
                    case 'lname':
938
                        $QST_values = array(
939
                            'QST_display_text'  => __('Last Name', 'event_espresso'),
@@ 952-966 (lines=15) @@
949
                            'QST_deleted'       => 0,
950
                        );
951
                        break;
952
                    case 'email':
953
                        $QST_values = array(
954
                            'QST_display_text'  => __('Email Address', 'event_espresso'),
955
                            'QST_admin_label'   => __('Email Address - System Question', 'event_espresso'),
956
                            'QST_system'        => 'email',
957
                            'QST_type'          => 'EMAIL',
958
                            'QST_required'      => 1,
959
                            'QST_required_text' => __('This field is required', 'event_espresso'),
960
                            'QST_order'         => 3,
961
                            'QST_admin_only'    => 0,
962
                            'QST_max'           => EEM_Question::instance()->absolute_max_for_system_question($QST_system),
963
                            'QST_wp_user'       => self::get_default_creator_id(),
964
                            'QST_deleted'       => 0,
965
                        );
966
                        break;
967
                    case 'email_confirm':
968
                        $QST_values = array(
969
                            'QST_display_text'  => __('Confirm Email Address', 'event_espresso'),
@@ 967-981 (lines=15) @@
964
                            'QST_deleted'       => 0,
965
                        );
966
                        break;
967
                    case 'email_confirm':
968
                        $QST_values = array(
969
                            'QST_display_text'  => __('Confirm Email Address', 'event_espresso'),
970
                            'QST_admin_label'   => __('Confirm Email Address - System Question', 'event_espresso'),
971
                            'QST_system'        => 'email_confirm',
972
                            'QST_type'          => 'EMAIL_CONFIRM',
973
                            'QST_required'      => 1,
974
                            'QST_required_text' => __('This field is required', 'event_espresso'),
975
                            'QST_order'         => 4,
976
                            'QST_admin_only'    => 0,
977
                            'QST_max'           => EEM_Question::instance()->absolute_max_for_system_question($QST_system),
978
                            'QST_wp_user'       => self::get_default_creator_id(),
979
                            'QST_deleted'       => 0,
980
                        );
981
                        break;
982
                    case 'address':
983
                        $QST_values = array(
984
                            'QST_display_text'  => __('Address', 'event_espresso'),
@@ 982-996 (lines=15) @@
979
                            'QST_deleted'       => 0,
980
                        );
981
                        break;
982
                    case 'address':
983
                        $QST_values = array(
984
                            'QST_display_text'  => __('Address', 'event_espresso'),
985
                            'QST_admin_label'   => __('Address - System Question', 'event_espresso'),
986
                            'QST_system'        => 'address',
987
                            'QST_type'          => 'TEXT',
988
                            'QST_required'      => 0,
989
                            'QST_required_text' => __('This field is required', 'event_espresso'),
990
                            'QST_order'         => 5,
991
                            'QST_admin_only'    => 0,
992
                            'QST_max'           => EEM_Question::instance()->absolute_max_for_system_question($QST_system),
993
                            'QST_wp_user'       => self::get_default_creator_id(),
994
                            'QST_deleted'       => 0,
995
                        );
996
                        break;
997
                    case 'address2':
998
                        $QST_values = array(
999
                            'QST_display_text'  => __('Address2', 'event_espresso'),
@@ 997-1011 (lines=15) @@
994
                            'QST_deleted'       => 0,
995
                        );
996
                        break;
997
                    case 'address2':
998
                        $QST_values = array(
999
                            'QST_display_text'  => __('Address2', 'event_espresso'),
1000
                            'QST_admin_label'   => __('Address2 - System Question', 'event_espresso'),
1001
                            'QST_system'        => 'address2',
1002
                            'QST_type'          => 'TEXT',
1003
                            'QST_required'      => 0,
1004
                            'QST_required_text' => __('This field is required', 'event_espresso'),
1005
                            'QST_order'         => 6,
1006
                            'QST_admin_only'    => 0,
1007
                            'QST_max'           => EEM_Question::instance()->absolute_max_for_system_question($QST_system),
1008
                            'QST_wp_user'       => self::get_default_creator_id(),
1009
                            'QST_deleted'       => 0,
1010
                        );
1011
                        break;
1012
                    case 'city':
1013
                        $QST_values = array(
1014
                            'QST_display_text'  => __('City', 'event_espresso'),
@@ 1012-1026 (lines=15) @@
1009
                            'QST_deleted'       => 0,
1010
                        );
1011
                        break;
1012
                    case 'city':
1013
                        $QST_values = array(
1014
                            'QST_display_text'  => __('City', 'event_espresso'),
1015
                            'QST_admin_label'   => __('City - System Question', 'event_espresso'),
1016
                            'QST_system'        => 'city',
1017
                            'QST_type'          => 'TEXT',
1018
                            'QST_required'      => 0,
1019
                            'QST_required_text' => __('This field is required', 'event_espresso'),
1020
                            'QST_order'         => 7,
1021
                            'QST_admin_only'    => 0,
1022
                            'QST_max'           => EEM_Question::instance()->absolute_max_for_system_question($QST_system),
1023
                            'QST_wp_user'       => self::get_default_creator_id(),
1024
                            'QST_deleted'       => 0,
1025
                        );
1026
                        break;
1027
                    case 'country':
1028
                        $QST_values = array(
1029
                            'QST_display_text'  => __('Country', 'event_espresso'),
@@ 1055-1069 (lines=15) @@
1052
                            'QST_deleted'       => 0,
1053
                        );
1054
                        break;
1055
                    case 'zip':
1056
                        $QST_values = array(
1057
                            'QST_display_text'  => __('Zip/Postal Code', 'event_espresso'),
1058
                            'QST_admin_label'   => __('Zip/Postal Code - System Question', 'event_espresso'),
1059
                            'QST_system'        => 'zip',
1060
                            'QST_type'          => 'TEXT',
1061
                            'QST_required'      => 0,
1062
                            'QST_required_text' => __('This field is required', 'event_espresso'),
1063
                            'QST_order'         => 10,
1064
                            'QST_admin_only'    => 0,
1065
                            'QST_max'           => EEM_Question::instance()->absolute_max_for_system_question($QST_system),
1066
                            'QST_wp_user'       => self::get_default_creator_id(),
1067
                            'QST_deleted'       => 0,
1068
                        );
1069
                        break;
1070
                    case 'phone':
1071
                        $QST_values = array(
1072
                            'QST_display_text'  => __('Phone Number', 'event_espresso'),
@@ 1070-1084 (lines=15) @@
1067
                            'QST_deleted'       => 0,
1068
                        );
1069
                        break;
1070
                    case 'phone':
1071
                        $QST_values = array(
1072
                            'QST_display_text'  => __('Phone Number', 'event_espresso'),
1073
                            'QST_admin_label'   => __('Phone Number - System Question', 'event_espresso'),
1074
                            'QST_system'        => 'phone',
1075
                            'QST_type'          => 'TEXT',
1076
                            'QST_required'      => 0,
1077
                            'QST_required_text' => __('This field is required', 'event_espresso'),
1078
                            'QST_order'         => 11,
1079
                            'QST_admin_only'    => 0,
1080
                            'QST_max'           => EEM_Question::instance()->absolute_max_for_system_question($QST_system),
1081
                            'QST_wp_user'       => self::get_default_creator_id(),
1082
                            'QST_deleted'       => 0,
1083
                        );
1084
                        break;
1085
                }
1086
                if (! empty($QST_values)) {
1087
                    // insert system question