From: <sy...@us...> - 2009-05-01 16:18:42
|
Revision: 18345 http://tikiwiki.svn.sourceforge.net/tikiwiki/?rev=18345&view=rev Author: sylvieg Date: 2009-05-01 16:18:41 +0000 (Fri, 01 May 2009) Log Message: ----------- [FIX]tracker: a computed field can use some fields that are not in th REQUEST - so prefill the computed array on what exists in the database Modified Paths: -------------- branches/3.0/lib/trackers/trackerlib.php Modified: branches/3.0/lib/trackers/trackerlib.php =================================================================== --- branches/3.0/lib/trackers/trackerlib.php 2009-05-01 15:14:52 UTC (rev 18344) +++ branches/3.0/lib/trackers/trackerlib.php 2009-05-01 16:18:41 UTC (rev 18345) @@ -785,12 +785,12 @@ else $ret[$kx] = $res; } - $retval = array(); $retval['data'] = array_values($ret); $retval['cant'] = $cant; return $retval; } + /* listfields fieldId=>ooptions */ function get_item_fields($trackerId, $itemId, $listfields, &$itemUser) { global $prefs, $user, $tiki_p_admin_trackers; $fields = array(); @@ -969,6 +969,13 @@ include_once('lib/categories/categlib.php'); include_once('lib/notifications/notificationlib.php'); $fil = array(); + if (!empty($itemId)) { // prefill with current value - in case a computed use some other fields + $query = 'select `value`, `fieldId` from `tiki_tracker_item_fields` where `itemId`=?'; + $result = $this->query($query, array($itemId)); + while ($res = $result->fetchRow()) { + $fil[$res['fieldId']] = $res['value']; + } + } if (empty($tracker_info)) { $tracker_info = $this->get_tracker($trackerId); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |