Commit d4fccc50 authored by sylvieg's avatar sylvieg

[ENH]TRACKEFILTER: possibility to filter interactively on the status

parent 2c5bf6b1
......@@ -238,6 +238,8 @@ $(".trackerfilter form").submit( function () {
}
if (empty($params['max']))
$params['max'] = $prefs['maxRecords'];
if (!empty($_REQUEST['f_status']))
$params['status'] = $_REQUEST['f_status'];
wikiplugin_trackerFilter_save_session_filters($params);
$smarty->assign('urlquery', wikiplugin_trackerFilter_build_urlquery($params));
include_once('lib/wiki-plugins/wikiplugin_trackerlist.php');
......@@ -313,6 +315,8 @@ function wikiplugin_trackerfilter_build_trackerlist_filter($input, $formats, &$f
if (substr($key, 0, 2) == 'f_' && !empty($val) && (!is_array($val) || !empty($val[0]))) {
if (!is_array($val)) { $val = urldecode($val); }
$fieldId = substr($key, 2);
if ($fieldId == 'status')
continue;
if (preg_match('/([0-9]+)(Month|Day|Year|Hour|Minute|Second)/', $fieldId, $matches)) { // a date
if (!in_array($matches[1], $ffs)) {
$fieldId = $matches[1];
......@@ -418,9 +422,13 @@ function wikiplugin_trackerFilter_get_filters($trackerId=0, $listfields='', &$fo
$iField = 0;
foreach ($listfields as $fieldId) {
if ($fieldId == 'status' || $fieldId == 'Status') {
$filter = array('name' => $fieldId, 'fieldId' => 'status', 'format' => 'd', 'opts'=> array(array('id'=>'o', 'name'=>'open', 'selected'=>(!empty($_REQUEST['f_status'])&& $_REQUEST['f_status']=='o')?'y':'n'), array('id'=>'p', 'name'=>'pending', 'selected'=>(!empty($_REQUEST['f_status'])&& $_REQUEST['f_status']=='p')?'y':'n'), array('id'=>'c', 'name'=>'closed', 'selected'=>(!empty($_REQUEST['f_status'])&& $_REQUEST['f_status']=='c')?'y':'n')));
$filters[] = $filter;
continue; }
if (!is_numeric($fieldId)) { // composite field
$filter = array('name'=> 'Text', 'fieldId'=> $fieldId, 'format'=>'sqlsearch');
If (!empty($_REQUEST['f_'.$fieldId])) {
if (!empty($_REQUEST['f_'.$fieldId])) {
$filter['selected'] = $_REQUEST['f_'.$fieldId];
}
$filters[] = $filter;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment