From: <sy...@us...> - 2007-01-30 14:25:48
|
Update of /cvsroot/tikiwiki/_mods/wiki-plugins/trackeritemfield/wiki-plugins In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv10846/wiki-plugins/trackeritemfield/wiki-plugins Modified Files: wikiplugin_trackeritemfield.php Log Message: some fixes + a smarty version Index: wikiplugin_trackeritemfield.php =================================================================== RCS file: /cvsroot/tikiwiki/_mods/wiki-plugins/trackeritemfield/wiki-plugins/wikiplugin_trackeritemfield.php,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- wikiplugin_trackeritemfield.php 23 Jan 2007 21:10:37 -0000 1.1 +++ wikiplugin_trackeritemfield.php 30 Jan 2007 14:25:43 -0000 1.2 @@ -13,31 +13,38 @@ if (empty($itemId) && $userTracker == 'y' && !empty($group) && ($utid = $userlib->get_usertrackerid($group)) && $utid['usersTrackerId']) { $trackerId = $utid['usersTrackerId']; $itemId = $trklib->get_item_id($trackerId, $utid['usersFieldId'], $user); + $is_user_tracker = true; } else if (empty($trackerId) && !empty($itemId)) { $item = $trklib->get_tracker_item($itemId); $trackerId = $item['trackerId']; } if (empty($itemId) || empty($trackerId) || empty($fieldId)) { - return ''; + return false; } - if ($tiki_p_admin_trackers != 'y' && !$userlib->user_has_perm_on_object($user, $trackerId, 'tracker','tiki_p_view_trackers')) { - return ''; + if ($tiki_p_admin_trackers != 'y' && !$userlib->user_has_perm_on_object($user, $trackerId, 'tracker','tiki_p_view_trackers') && empty($is_user_tracker)) { + return false; } if (!($field = $trklib->get_tracker_field($fieldId))) { - return ''; + return false; } - if ($tiki_p_admin_trackers != 'y' && $field['options']['isHidden'] != 'n') { - return ''; + if ($tiki_p_admin_trackers != 'y' && $field['isHidden'] != 'n') { + return false; } if (empty($test)) $test = false; - if (($val = $trklib->get_item_value($trackerId, $itemId, $fieldId)) !== false && !empty($val)) { - return ($test?$data: $val); + if (($val = $trklib->get_item_value($trackerId, $itemId, $fieldId)) !== false) { + if ($test && empty($val)) { + return false; + } elseif ($test) { + return $data; + } else { + return $val; + } } else { - return ''; + return false; } } ?> |