Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
project
forena
Commits
e1f39866
Commit
e1f39866
authored
Apr 25, 2013
by
metzlerd
Browse files
Fixed date defaulting.
parent
452364d4
Changes
2
Hide whitespace changes
Inline
Side-by-side
FrxReport.inc
View file @
e1f39866
...
...
@@ -559,17 +559,38 @@ class FrxReport {
$missing_parms
=
FALSE
;
foreach
(
$this
->
parameters
as
$key
=>
$parm
)
{
if
((
@
$parms
[
$key
]
===
''
||
@
$parms
[
$key
]
===
array
()
||
@
$parms
[
$key
]
===
NULL
)
&&
@
$parm
[
'value'
])
{
$value
=
(
string
)
$parm
[
'value'
];
if
(
strpos
(
$value
,
'|'
)
!==
FALSE
)
{
$value
=
explode
(
'|'
,
$value
);
$value
=
$parm
[
'value'
];
$options
=
array
();
if
(
@
$parm
[
'options'
])
{
parse_str
(
$parm
[
'options'
],
$options
);
}
switch
((
string
)
@
$parm
[
'type'
])
{
case
'date_text'
:
case
'date_popup'
:
case
'date_select'
:
if
(
$value
){
$datetime
=
@
strtotime
(
$value
);
if
(
$datetime
)
{
$value
=
date
(
$options
[
'date_format'
],
$datetime
);
}
}
break
;
default
:
if
(
strpos
(
$value
,
'|'
)
!==
FALSE
)
{
$value
=
explode
(
'|'
,
$value
);
}
}
$parms
[
$key
]
=
$value
;
$reload_params
=
TRUE
;
}
//do not show report if a required parameter does not have a value
//force the user to input a parameter
if
((
@!
$parms
[
$key
])
&&
(
@
strcmp
(
$parm
[
'require'
],
"1"
)
==
0
)
&&
(
!
$parm
[
'value'
]))
{
if
((
@!
$parms
[
$key
])
&&
(
@
strcmp
(
$parm
[
'require'
],
"1"
)
==
0
))
{
$missing_parms
=
TRUE
;
}
}
...
...
forena.module
View file @
e1f39866
...
...
@@ -557,6 +557,14 @@ function forena_parameter_form($formid, &$form_state, $parameters, $attributes=
case
'date_popup'
:
if
(
@
$options
[
'date_format'
])
{
$ctl_attrs
[
'#date_format'
]
=
$options
[
'date_format'
];
if
(
$value
){
$datetime
=
@
strtotime
(
$value
);
if
(
$datetime
)
{
$value
=
date
(
$options
[
'date_format'
],
$datetime
);
}
}
}
if
(
@
$options
[
'date_year_range'
])
{
$ctl_attrs
[
'#date_year_range'
]
=
$options
[
'date_year_range'
];
...
...
@@ -564,6 +572,7 @@ function forena_parameter_form($formid, &$form_state, $parameters, $attributes=
if
(
@
$options
[
'date_label_position'
])
{
$ctl_attrs
[
'#date_label_position'
]
=
$options
[
'date_label_position'
];
}
$list
=
''
;
break
;
case
'checkbox'
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment