diff --git a/inc/helper.class.php b/inc/helper.class.php index 6746239..1c70854 100644 --- a/inc/helper.class.php +++ b/inc/helper.class.php @@ -322,6 +322,24 @@ static function manageCriterias($params) { $crit['crit']['status'] = $status; } } + if (in_array("begin", $criterias)) { + if (isset($params['opt']['begin']) + && $params['opt']["begin"] > 0) { + $opt["begin"] = $params['opt']['begin']; + $crit['crit']['begin'] = $params['opt']['begin']; + } else { + $opt["begin"] = date("Y-m-d"); + } + } + if (in_array("end", $criterias)) { + if (isset($params['opt']['end']) + && $params['opt']["end"] > 0) { + $opt["end"] = $params['opt']['end']; + $crit['crit']['end'] = $params['opt']['end']; + } else { + $opt["end"] = date("Y-m-d"); + } + } $crit['opt'] = $opt; return $crit; @@ -505,6 +523,24 @@ static function getForm($widgetId, $onsubmit = false, $opt, $criterias) { $form .= "

"; } } + if (in_array("begin", $criterias)) { + $form .= __('Start'); + $form .= " "; + $form .= Html::showDateField("begin", array('value' => $opt['begin'], 'maybeempty' => false, 'display' => false)); + $form .= " "; + if ($count > 1) { + $form .= "

"; + } + } + if (in_array("end", $criterias)) { + $form .= __('End'); + $form .= " "; + $form .= Html::showDateField("end", array('value' => $opt['end'], 'maybeempty' => false, 'display' => false)); + $form .= " "; + if ($count > 1) { + $form .= "

"; + } + } $form .= self::getFormFooter(); return $form;