public function FrxReport::processParameters in Forena Reports 7.3
Same name and namespace in other branches
- 7.4 FrxReport.inc \FrxReport::processParameters()
Default the parameters ba
Parameters
$parms Array of parameters.:
Return value
boolean indicating whether the required parameters are present.
File
- ./
FrxReport.inc, line 667 - Basic report provider. Controls the rendering of the report.
Class
Code
public function processParameters() {
$parms = $this->parms;
$missing_parms = FALSE;
foreach ($this->parameters as $key => $parm) {
if ((@$parms[$key] === '' || @$parms[$key] === array() || @$parms[$key] === NULL) && @$parm['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) {
$date_format = @$options['date_format'] ? $options['date_format'] : 'Y-m-d';
$datetime = @strtotime($value);
if ($datetime) {
$value = date($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) {
$missing_parms = TRUE;
}
}
$this->parms = $parms;
$this->missing_parms = $missing_parms;
return $missing_parms;
}