Author: nathangray
New Revision: 55867
URL: http://svn.stylite.de/viewvc/egroupware?rev=55867&view=rev
Log:
Add custom date range filtering to tracker
- Added closed column to tracker list
- Date ranges filters in tracker will apply to the currently selected date column (opened, start, due, closed)
Modified:
trunk/tracker/inc/class.tracker_bo.inc.php
trunk/tracker/inc/class.tracker_ui.inc.php
trunk/tracker/js/app.js
trunk/tracker/templates/default/index.xet
— trunk/tracker/inc/class.tracker_bo.inc.php (original)
+++ trunk/tracker/inc/class.tracker_bo.inc.php Tue Apr 26 21:51:42 2016
@@ -1460,7 +1460,7 @@
{
if($query[‘filter’])
{
-
$query['col_filter'][] = $this->date_filter($query['filter'],$query['startdate'],$query['enddate'],$query['order']);
}
return parent::get_rows($query,$rows,$readonlys,$join,$need_full_no_count);
}
@@ -2114,13 +2114,26 @@
/**
- return SQL implementing filtering by date
-
-
- If the currently sorted column is a date, we filter by that date, otherwise
-
-
-
-
@param string $name
-
@param int &$start
-
@param int &$end
-
-
@param string &$column
-
@return string
*/
- function date_filter($name,&$start,&$end)
- {
- function date_filter($name,&$start,&$end, $column = ‘tr_created’)
- {
-
if(!$column ||
-
// Just these columns
-
!in_array($column, array('tr_created','tr_startdate','tr_duedate','tr_closed'))
-
// Any date column
-
//!in_array($column, tracker_egw_record::$types['date-time']))
-
)
-
{
-
$column = 'tr_created';
-
}
switch(strtolower($name))
{
case 'overdue':
@@ -2143,7 +2156,7 @@
case ‘upcoming’:
return “(tr_startdate IS NOT NULL and tr_startdate > {$this->now} )”;
}
-
return egw_time::sql_filter($name, $start, $end, 'tr_created', $this->date_filters);
-
return egw_time::sql_filter($name, $start, $end, $column, $this->date_filters);
}
/**
— trunk/tracker/inc/class.tracker_ui.inc.php (original)
+++ trunk/tracker/inc/class.tracker_ui.inc.php Tue Apr 26 21:51:42 2016
@@ -1284,11 +1284,13 @@
{
$date_filters[$name] = lang($name);
}
-
$date_filters['custom'] = 'custom';
$content['nm'] = array(
'get_rows' => 'tracker.tracker_ui.get_rows',
'cat_is_select' => 'no_lang',
'filter' => 0, // all
'options-filter' => $date_filters,
-
'filter_onchange' => "app.tracker.filter_change();",
//'filter_label' => lang('Date filter'),
'filter_no_lang'=> true,
'filter2' => 0, // all
— trunk/tracker/js/app.js (original)
+++ trunk/tracker/js/app.js Tue Apr 26 21:51:42 2016
@@ -69,6 +69,7 @@
break;
case 'tracker.index':
@@ -112,6 +113,25 @@
},
/**
-
- Tracker list filter change, used to toggle date fields
- */
- filter_change: function()
- {
-
var filter = this.et2.getWidgetById('filter');
-
var dates = this.et2.getWidgetById('tracker.index.dates');
-
-
if (filter && dates)
-
{
-
dates.set_disabled(filter.value !== "custom");
-
if (filter.value == "custom")
-
{
-
jQuery(this.et2.getWidgetById('startdate').getDOMNode()).find('input').focus();
-
}
-
}
-
return true;
- },
-
- /**
- Used in escalations on buttons to change filters from a single select to a multi-select
-
-
@param {object} _event
— trunk/tracker/templates/default/index.xet (original)
+++ trunk/tracker/templates/default/index.xet Tue Apr 26 21:51:42 2016
@@ -13,6 +13,7 @@
@@ -46,6 +47,7 @@
@@ -97,6 +99,7 @@
@@ -127,6 +130,14 @@
-
-
-
<hbox>
-
<description value="Start"/>
-
<date id="startdate" onchange="widget.getParent().getWidgetById('enddate').set_min(widget.getValue());return true;"/>
-
<description value="End"/>
-
<date id="enddate" onchange="widget.getParent().getWidgetById('startdate').set_max(widget.getValue());return true;"/>
-
</hbox>
@@ -139,7 +150,7 @@
-
<nextmatch id="nm" template="tracker.index.rows" span="all" header_left="tracker.index.add" header_row="tracker.index.queue" header_right="tracker.index.dates"/>
</row>
<row disabled="!@nm[selectcols]=/legacy_actions/">
<button label="Add" id="add" onclick="window.open(egw::link('/index.php','menuaction=tracker.tracker_ui.edit&tracker={$cont[nm][col_filter][tr_tracker]}'),'_blank','dependent=yes,width=700,height=480,scrollbars=yes,status=yes'); return false;"/>
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
eGroupWare-cvs mailing list
eGroupWare-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/egroupware-cvs