Skip to content

Commit

Permalink
PRODUCT and TARGET are mandatory
Browse files Browse the repository at this point in the history
  • Loading branch information
Robbi Nespu committed Mar 19, 2023
1 parent eb57c01 commit b39531c
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 4 deletions.
8 changes: 4 additions & 4 deletions bug_report_page.php
Original file line number Diff line number Diff line change
Expand Up @@ -455,10 +455,10 @@
?>
<tr>
<th class="category">
<label for="product_version"><?php echo lang_get( 'product_version' ) ?></label>
<span class="required">*</span><label for="product_version"><?php echo lang_get( 'product_version' ) ?></label>
</th>
<td>
<select <?php echo helper_get_tab_index() ?> id="product_version" name="product_version" class="input-sm">
<select <?php echo helper_get_tab_index() ?> id="product_version" name="product_version" class="input-sm" required>
<?php print_version_option_list( $f_product_version, $t_project_id, $t_product_version_released_mask ) ?>
</select>
</td>
Expand Down Expand Up @@ -548,10 +548,10 @@
if( $t_show_target_version ) { ?>
<tr>
<th class="category">
<label for="target_version"><?php echo lang_get( 'target_version' ) ?></label>
<span class="required">*</span><label for="target_version"><?php echo lang_get( 'target_version' ) ?></label>
</th>
<td>
<select <?php echo helper_get_tab_index() ?> id="target_version" name="target_version" class="input-sm">
<select <?php echo helper_get_tab_index() ?> id="target_version" name="target_version" class="input-sm" required>
<?php print_version_option_list( '', null, VERSION_FUTURE ) ?>
</select>
</td>
Expand Down
15 changes: 15 additions & 0 deletions core/custom_function_api.php
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,21 @@ function custom_function_default_issue_update_notify( $p_issue_id ) {
* @return void
*/
function custom_function_default_issue_create_validate( BugData $p_new_issue_data ) {
// print "<pre>"; print_r($p_new_issue_data); print "</pre>";

$f_target_version = $p_new_issue_data->target_version;
$f_product_version = $p_new_issue_data->version;
$f_description = $p_new_issue_data->description;

if(is_blank( $f_product_version) ) {
error_parameters( 'product_version' );
trigger_error( ERROR_EMPTY_FIELD, ERROR );
}

if(is_blank( $f_product_version) ) {
error_parameters( 'target_version' );
trigger_error( ERROR_EMPTY_FIELD, ERROR );
}
}

/**
Expand Down

0 comments on commit b39531c

Please sign in to comment.