- Regarding the wrong fix that I applied for the filtering, please fix it in your patch.
- What do you think about specifying a date range in possible values fields? And getting rid of the config variable.
Regards,
Victor
http://www.futureware.biz
Date Custom Fields patch.
Moderators: Developer, Contributor
What is the syntax that you use now for possible values? What would be the syntax to use for the full date? I would like to be able to specify a full date range. This would mean that the contents of the month and day may be affected as well. It also means that the date custom field would have to be validated to fall within the specified range.
Regards,
Victor
http://www.futureware.biz
Regards,
Victor
http://www.futureware.biz
Code: Select all
function gpc_get_custom_field( $p_var_name, $p_custom_field_type, $p_default = null ) {
switch ($p_custom_field_type ) {
case CUSTOM_FIELD_TYPE_MULTILIST:
case CUSTOM_FIELD_TYPE_CHECKBOX:
$t_values = gpc_get_string_array( $p_var_name, $p_default );
if( null != $t_values && '' != $t_values ) {
return implode( '|', $t_values );
} else {
return '';
}
case CUSTOM_FIELD_TYPE_DATE:
$t_day = gpc_get_int( $p_var_name . "_day") ;
$t_month = gpc_get_int( $p_var_name . "_month") ;
$t_year = gpc_get_int( $p_var_name . "_year") ;
if (($t_year == 0) || ($t_month == 0) || ($t_day == 0)) {
if ($p_default == null) {
return '' ;
} else {
return $p_default ;
}
} else {
return strtotime($t_year . "-" . $t_month . "-" . $t_day) ;
}
break ;
default:
return gpc_get_string( $p_var_name, $p_default);
}
}
But I've made a custom fields not modifiable from reporter, only from developer. So in the new bug this field is not present and there are an error 200 (GPC Var not present).
I've modified the source:
Code: Select all
$t_day = gpc_get_int( $p_var_name . "_day",0) ;
$t_month = gpc_get_int( $p_var_name . "_month",0) ;
$t_year = gpc_get_int( $p_var_name . "_year",0) ;
Is this correct? THX
PS: sorry for my english. I hope you understand :)