From: <sy...@us...> - 2010-02-03 23:18:04
|
Revision: 24826 http://tikiwiki.svn.sourceforge.net/tikiwiki/?rev=24826&view=rev Author: sylvieg Date: 2010-02-03 23:17:57 +0000 (Wed, 03 Feb 2010) Log Message: ----------- [FIX]TRACKERITEMFIELD: be able to handle case as TRACKERITEMFIELD(itemId={{itemId}}, fieldId=1) when there is no itemId in the url Modified Paths: -------------- trunk/lib/wiki-plugins/wikiplugin_trackeritemfield.php Modified: trunk/lib/wiki-plugins/wikiplugin_trackeritemfield.php =================================================================== --- trunk/lib/wiki-plugins/wikiplugin_trackeritemfield.php 2010-02-03 22:39:17 UTC (rev 24825) +++ trunk/lib/wiki-plugins/wikiplugin_trackeritemfield.php 2010-02-03 23:17:57 UTC (rev 24826) @@ -98,16 +98,16 @@ if (empty($itemId) && empty($test) && empty($status)) {// need an item return tra('Incorrect param').': itemId'; } - if (empty($trackerId)) { - return tra('Incorrect param').': trackerId'; - } if (!empty($status) && !$trklib->valid_status($status)) { return tra('Incorrect param').': status'; } $info = $trklib->get_item_info($itemId); - if (!$memoUserTracker) { + if (!empty($info) && empty($trackerId)) { + $trackerId = $info['trackerId']; + } + if (!empty($info) && !$memoUserTracker) { $perm = ($info['status'] == 'c')? 'view_trackers_closed':(($info['status'] == 'p')?'view_trackers_pending':'view_trackers'); $perms = Perms::get(array('type'=>'tracker', 'object'=>$trackerId)); if (!$perms->$perm) { @@ -144,7 +144,11 @@ return $dataelse; } } - if (isset($fields)) { + if (empty($itemId) && !empty($test)) { + return $dataelse; + } elseif (empty($itemId)) { + return tra('Incorrect param').': itemId'; + } elseif (isset($fields)) { $all_fields = $trklib->list_tracker_fields($trackerId, 0, -1); $all_fields = $all_fields['data']; if (!empty($fields)) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |