How can I make standard fields required
Moderators: Developer, Contributor
How can I make standard fields required
Hi
I have MantiBT 1.2.0rc2 and I want to make some fields as required. I was edited, bug_report_page.php and added <span class="required">*</span> but, it's just visual effect. What, I must do to make some existing fields as required?
Sorry, for my bad English :/
I have MantiBT 1.2.0rc2 and I want to make some fields as required. I was edited, bug_report_page.php and added <span class="required">*</span> but, it's just visual effect. What, I must do to make some existing fields as required?
Sorry, for my bad English :/
Re: How can I make standard fields required
I was edited this file but it's not working correctly :/ I write in 287 line.
The alert, about blank field is after every Send, even when the product version is chosen :/
In assign_to is the same :/
Code: Select all
# Make sure a category is set
if( 0 == $this->product_version ) {
error_parameters( lang_get( 'product_version' ) );
trigger_error( ERROR_EMPTY_FIELD, ERROR );
}The alert, about blank field is after every Send, even when the product version is chosen :/
In assign_to is the same :/
Re: How can I make standard fields required
This should work, I didn't try
product_version is not numeric
product_version is not numeric
Code: Select all
if( is_blank ($this->product_version) ) {
error_parameters( lang_get( 'product_version' ) );
trigger_error( ERROR_EMPTY_FIELD, ERROR );
}
Re: How can I make standard fields required
:/ It's not work
Always after click Send button it's a alert about blank field Product version, even is chosen.
Any idea, what can I do?
Any idea, what can I do?
Re: How can I make standard fields required
Thanks atrol 
now it's working
but what's about Assing to? I was trying:
andbut it isn't working 
now it's working
Code: Select all
if( is_blank ($this->version) ) {
error_parameters( lang_get( 'product_version' ) );
trigger_error( ERROR_EMPTY_FIELD, ERROR );
}Code: Select all
if( is_blank ($this->assign_to) ) {
error_parameters( lang_get( 'assign_to' ) );
trigger_error( ERROR_EMPTY_FIELD, ERROR );
}Code: Select all
if( is_blank ($this->handler_id) ) {
error_parameters( lang_get( 'assign_to' ) );
trigger_error( ERROR_EMPTY_FIELD, ERROR );
}Re: How can I make standard fields required
bump
Nobody know what's wrong

Nobody know what's wrong
Re: How can I make standard fields required
Maybe open source freeware is not the best solution for you.
You should be aware that there will not be all the time someone who has a look at your changes of sourcecode.
For long term you have two options when using MantisBT:
a) learn some more of PHP, databases, html, how MantisBT works and / or
b) buy some support
a further hint (which I did'nt try!)
0 == $this->handler_id
You should be aware that there will not be all the time someone who has a look at your changes of sourcecode.
For long term you have two options when using MantisBT:
a) learn some more of PHP, databases, html, how MantisBT works and / or
b) buy some support
a further hint (which I did'nt try!)
0 == $this->handler_id
Re: How can I make standard fields required
Hi, I put target_version as a required field ant its works. After lines referenced to summary and description and I add this:
if( $p_update_extended ) {
< # target_version field cannot be empty
< if( is_blank( $this->target_version ) ) {
< error_parameters( lang_get( 'target_version' ) );
< trigger_error( ERROR_EMPTY_FIELD, ERROR );
< }
< }
if( $p_update_extended ) {
< # target_version field cannot be empty
< if( is_blank( $this->target_version ) ) {
< error_parameters( lang_get( 'target_version' ) );
< trigger_error( ERROR_EMPTY_FIELD, ERROR );
< }
< }
-
phoenixcreation
- Posts: 7
- Joined: 20 Aug 2007, 12:51
Re: How can I make standard fields required
Ahhh, found this thread as well. I've been working on this as well, but focusing on the due_date field being required. I've tried mimicing the description and summary entries:
if( $p_update_extended ) {
# due_date field cannot be empty
if( is_blank( $this->due_date) ) {
error_parameters( lang_get( 'due_date' ) );
trigger_error( ERROR_EMPTY_FIELD, ERROR );
}
}
With no success. I have also gone a little further down into the file and tried to do the above within the create function:
# check due_date format
if( is_blank( $this->due_date ) ) {
$this_due_date = date_get_null();
}
Either way if I leave the due_date blank it lets the bug get added. Am I missing something in the above? Could it have to do with "1" being the default entry in the database when a due_date is blank?
if( $p_update_extended ) {
# due_date field cannot be empty
if( is_blank( $this->due_date) ) {
error_parameters( lang_get( 'due_date' ) );
trigger_error( ERROR_EMPTY_FIELD, ERROR );
}
}
With no success. I have also gone a little further down into the file and tried to do the above within the create function:
# check due_date format
if( is_blank( $this->due_date ) ) {
$this_due_date = date_get_null();
}
Either way if I leave the due_date blank it lets the bug get added. Am I missing something in the above? Could it have to do with "1" being the default entry in the database when a due_date is blank?