From: <xa...@us...> - 2012-04-05 11:14:39
|
Revision: 40756 http://tikiwiki.svn.sourceforge.net/tikiwiki/?rev=40756&view=rev Author: xavidp Date: 2012-04-05 11:14:29 +0000 (Thu, 05 Apr 2012) Log Message: ----------- [bp/r40754][ENH] Make optional the selection of whether the period is after an item was created or modified, since both use cases seem frequent. In fact this could have been tagged as a [FIX] since wihtout it some use cases of trackerlist provide wrong results and way for the user to request tiki provide their expected results. Revision Links: -------------- http://tikiwiki.svn.sourceforge.net/tikiwiki/?rev=40754&view=rev Modified Paths: -------------- branches/proposals/6.x/lib/wiki-plugins/wikiplugin_trackerlist.php Modified: branches/proposals/6.x/lib/wiki-plugins/wikiplugin_trackerlist.php =================================================================== --- branches/proposals/6.x/lib/wiki-plugins/wikiplugin_trackerlist.php 2012-04-05 11:02:35 UTC (rev 40755) +++ branches/proposals/6.x/lib/wiki-plugins/wikiplugin_trackerlist.php 2012-04-05 11:14:29 UTC (rev 40756) @@ -620,6 +620,18 @@ ), 'default' => '', ), + 'periodType' => array( + 'required' => false, + 'name' => tr('Period type'), + 'description' => tr('Time period after creattion or after modification'), + 'filter' => 'word', + 'options' => array( + array('text' => '', 'value' => ''), + array('text' => tr('Creation'), 'value' => 'c'), + array('text' => tr('Modification'), 'value' => 'm'), + ), + 'default' => '', + ), ) ); } @@ -760,10 +772,17 @@ default: break; } - - if (is_int($periodUnit)) { + + if (!isset($periodType)) { + $periodType = 'c'; + } + + if (is_int($periodUnit) && ($periodType == 'm' ) ) { $filter['lastModifAfter'] = $tikilib->now - ($periodQuantity * $periodUnit); $filter['lastModifBefore'] = $tikilib->now; + } elseif (is_int($periodUnit)) { # case for periodType beig c or anything else (therefore, set as case for default) + $filter['createdAfter'] = $tikilib->now - ($periodQuantity * $periodUnit); + $filter['createdBefore'] = $tikilib->now; } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |