| 1 |
<?php |
| 2 |
|
| 3 |
/** |
| 4 |
* Blank form template |
| 5 |
*/ |
| 6 |
class WeForms_Template_Bug_Report extends WeForms_Form_Template { |
| 7 |
|
| 8 |
public function __construct() { |
| 9 |
parent::__construct(); |
| 10 |
|
| 11 |
$this->enabled = true; |
| 12 |
$this->title = __( 'Report a bug', 'weforms' ); |
| 13 |
$this->description = __( 'Here\'s a great way to make a form for use with reporting issues, feedback, suggestions, and questions or bugtracking', 'weforms' ); |
| 14 |
$this->image = WEFORMS_ASSET_URI . '/images/form-template/bug_report.png'; |
| 15 |
$this->category = 'feedback'; |
| 16 |
|
| 17 |
} |
| 18 |
|
| 19 |
/** |
| 20 |
* Get the form fields |
| 21 |
* |
| 22 |
* @return array |
| 23 |
*/ |
| 24 |
public function get_form_fields() { |
| 25 |
$all_fields = $this->get_available_fields(); |
| 26 |
|
| 27 |
$form_fields = array( |
| 28 |
array_merge( $all_fields['section_break']->get_field_props(), array( |
| 29 |
'label' => __( 'Report a bug', 'weforms' ), |
| 30 |
'description' => ' ', |
| 31 |
) ), |
| 32 |
|
| 33 |
array_merge( $all_fields['step_start']->get_field_props(), array( |
| 34 |
'label' => __( 'First Step', 'weforms' ), |
| 35 |
'name' => 'report_bug_step', |
| 36 |
'step_start' => array( |
| 37 |
'prev_button_text' => __( 'Previous', 'weforms' ), |
| 38 |
'next_button_text' => __( 'Next', 'weforms' ) |
| 39 |
), |
| 40 |
) ), |
| 41 |
|
| 42 |
array_merge( $all_fields['text_field']->get_field_props(), array( |
| 43 |
'required' => 'yes', |
| 44 |
'label' => __( 'Full Name', 'weforms' ), |
| 45 |
'name' => 'full_name', |
| 46 |
) ), |
| 47 |
|
| 48 |
array_merge( $all_fields['email_address']->get_field_props(), array( |
| 49 |
'required' => 'yes', |
| 50 |
'label' => __( 'Email Address', 'weforms' ), |
| 51 |
'name' => 'email_address', |
| 52 |
) ), |
| 53 |
|
| 54 |
array_merge( $all_fields['text_field']->get_field_props(), array( |
| 55 |
'required' => 'yes', |
| 56 |
'label' => __( 'Problem Title', 'weforms' ), |
| 57 |
'name' => 'email_address', |
| 58 |
) ), |
| 59 |
|
| 60 |
array_merge( $all_fields['dropdown_field']->get_field_props(), array( |
| 61 |
'label' => __( 'Problem Status', 'weforms' ), |
| 62 |
'name' => 'problem_status', |
| 63 |
'options' => array( |
| 64 |
'open' => __('Open', 'weforms'), |
| 65 |
'fixed' => __('Fixed', 'weforms'), |
| 66 |
'verified' => __('Veried', 'weforms'), |
| 67 |
'closed' => __('Closed', 'weforms'), |
| 68 |
'invalid' => __('Invalid', 'weforms'), |
| 69 |
), |
| 70 |
'first' => ' ', |
| 71 |
) ), |
| 72 |
|
| 73 |
array_merge( $all_fields['textarea_field']->get_field_props(), array( |
| 74 |
'required' => 'yes', |
| 75 |
'label' => __( 'Summary Information', 'weforms' ), |
| 76 |
'name' => 'summary_information', |
| 77 |
) ), |
| 78 |
|
| 79 |
array_merge( $all_fields['step_start']->get_field_props(), array( |
| 80 |
'label' => __( 'Second Step', 'weforms' ), |
| 81 |
'name' => 'report_bug_step_two', |
| 82 |
'step_start' => array( |
| 83 |
'prev_button_text' => __( 'Previous', 'weforms' ), |
| 84 |
'next_button_text' => __( 'Next', 'weforms' ) |
| 85 |
), |
| 86 |
) ), |
| 87 |
|
| 88 |
array_merge( $all_fields['textarea_field']->get_field_props(), array( |
| 89 |
'required' => 'yes', |
| 90 |
'label' => __( 'Steps to Reproduce', 'weforms' ), |
| 91 |
'name' => 'report_bug_two', |
| 92 |
'help_text' => __( 'Include any setup or preparation work and the steps we can take to reproduce the problem', 'weforms' ), |
| 93 |
) ), |
| 94 |
|
| 95 |
array_merge( $all_fields['textarea_field']->get_field_props(), array( |
| 96 |
'required' => 'yes', |
| 97 |
'label' => __( 'Results', 'weforms' ), |
| 98 |
'name' => 'result', |
| 99 |
'help_text' => __( 'Describe your results and how they differed from what you expected.', 'weforms' ), |
| 100 |
) ), |
| 101 |
|
| 102 |
array_merge( $all_fields['textarea_field']->get_field_props(), array( |
| 103 |
'label' => __( 'Regression', 'weforms' ), |
| 104 |
'name' => 'regression', |
| 105 |
'help_text' => __( 'Provide information on steps taken to isolate the problem. Under what conditions or circumstances does the problem occur or not occur.', 'weforms' ), |
| 106 |
) ), |
| 107 |
|
| 108 |
array_merge( $all_fields['checkbox_field']->get_field_props(), array( |
| 109 |
'label' => __( 'Is there a Workaround?', 'weforms' ), |
| 110 |
'name' => 'workaround', |
| 111 |
'options' => array( |
| 112 |
'yes' => __('yes', 'weforms'), |
| 113 |
'no' => __('No', 'weforms'), |
| 114 |
), |
| 115 |
) ), |
| 116 |
|
| 117 |
array_merge( $all_fields['textarea_field']->get_field_props(), array( |
| 118 |
'label' => __( 'Documentation & Notes', 'weforms' ), |
| 119 |
'name' => 'documentation_notes', |
| 120 |
'help_text' => __( 'Document any additional information that might be useful in resolving the problem.', 'weforms' ), |
| 121 |
) ), |
| 122 |
|
| 123 |
array_merge( $all_fields['dropdown_field']->get_field_props(), array( |
| 124 |
'required' => 'yes', |
| 125 |
'label' => __( 'Reproducibility', 'weforms' ), |
| 126 |
'name' => 'reproducibility', |
| 127 |
'options' => array( |
| 128 |
'try' => __('I didn\'t try', 'weforms'), |
| 129 |
'rare' => __('Rarely', 'weforms'), |
| 130 |
'sometimes' => __('Sometimes', 'weforms'), |
| 131 |
'always' => __('Always', 'weforms'), |
| 132 |
), |
| 133 |
|
| 134 |
'first' => ' ', |
| 135 |
|
| 136 |
) ), |
| 137 |
|
| 138 |
array_merge( $all_fields['dropdown_field']->get_field_props(), array( |
| 139 |
'required' => 'yes', |
| 140 |
'label' => __( 'Classification', 'weforms' ), |
| 141 |
'name' => 'classification', |
| 142 |
'options' => array( |
| 143 |
'security' => __('Security', 'weforms'), |
| 144 |
'crash' => __('Crash/Hang/Data loss', 'weforms'), |
| 145 |
'performance' => __('Performance/UI-Usability', 'weforms'), |
| 146 |
'serious_bug' => __('Serious Bug', 'weforms'), |
| 147 |
'other_bug' => __('Other Bug', 'weforms'), |
| 148 |
'feature' => __('Feature (New)', 'weforms'), |
| 149 |
'enhancement' => __('Enhancement', 'weforms'), |
| 150 |
), |
| 151 |
|
| 152 |
'first' => ' ', |
| 153 |
|
| 154 |
) ), |
| 155 |
|
| 156 |
array_merge( $all_fields['dropdown_field']->get_field_props(), array( |
| 157 |
'required' => 'yes', |
| 158 |
'label' => __( 'Severity', 'weforms' ), |
| 159 |
'name' => 'severity', |
| 160 |
'options' => array( |
| 161 |
'trivial' => __('Trivial', 'weforms'), |
| 162 |
'normal' => __('Normal', 'weforms'), |
| 163 |
'major' => __('Major', 'weforms'), |
| 164 |
'critical' => __('Critical', 'weforms'), |
| 165 |
), |
| 166 |
|
| 167 |
'first' => ' ', |
| 168 |
|
| 169 |
) ), |
| 170 |
); |
| 171 |
|
| 172 |
return $form_fields; |
| 173 |
} |
| 174 |
|
| 175 |
|
| 176 |
/** |
| 177 |
* Get the form settings |
| 178 |
* |
| 179 |
* @return array |
| 180 |
*/ |
| 181 |
public function get_form_settings() { |
| 182 |
$defaults = $this->get_default_settings(); |
| 183 |
|
| 184 |
return array_merge( $defaults, array( |
| 185 |
'submit_text' => __( 'Submit', 'weforms' ), |
| 186 |
'label_position' => 'above', |
| 187 |
'enable_multistep' => true, |
| 188 |
'multistep_progressbar_type' => 'step_by_step', |
| 189 |
) ); |
| 190 |
} |
| 191 |
|
| 192 |
} |
| 193 |
|