Commit 8a78c475 authored by sylvieg's avatar sylvieg

[FIX]tracker: the user selector field can have a second option

parent fa513db3
<?php
// CVS: $Id: trackerlib.php,v 1.226 2007-10-09 13:02:23 sylvieg Exp $
// CVS: $Id: trackerlib.php,v 1.227 2007-10-09 14:48:16 sylvieg Exp $
//this script may only be included - so its better to die if called directly.
if (strpos($_SERVER["SCRIPT_NAME"],basename(__FILE__)) !== false) {
header("location: index.php");
......@@ -1765,7 +1765,11 @@ class TrackerLib extends TikiLib {
$mid = ' `trackerId`=? and `type`=? ';
$bindvars = array((int)$trackerId, $type);
if (!empty($option)) {
$mid .= ' and `options`=? ';
if (strstr($options, '%')) {
$mid .= ' and `options`=? ';
} else {
$mid .= ' and `options` like ? ';
}
$bindvars[] = $option;
}
return $this->getOne("select `fieldId` from `tiki_tracker_fields` where $mid",$bindvars);
......@@ -2011,7 +2015,7 @@ class TrackerLib extends TikiLib {
$userreal=$userparam!=null?$userparam:$user;
if (!empty($userreal)) {
if ($fieldId = $this->get_field_id_from_type($trackerId, 'u', '1')) { // user creator field
if ($fieldId = $this->get_field_id_from_type($trackerId, 'u', '1%')) { // user creator field
$value = $userreal;
$items = $this->get_items_list($trackerId, $fieldId, $value);
if ($items)
......@@ -2027,7 +2031,7 @@ class TrackerLib extends TikiLib {
}
}
function get_item_creator($trackerId, $itemId) {
if ($fieldId = $this->get_field_id_from_type($trackerId, 'u', '1')) { // user creator field
if ($fieldId = $this->get_field_id_from_type($trackerId, 'u', '1%')) { // user creator field
return $this->get_item_value($trackerId, $itemId, $fieldId);
} else {
return null;
......
<?php
// $Header: /cvsroot/tikiwiki/tiki/tiki-user_information.php,v 1.43 2007-08-10 13:33:20 tombombadilom Exp $
// $Header: /cvsroot/tikiwiki/tiki/tiki-user_information.php,v 1.44 2007-10-09 14:48:17 sylvieg Exp $
// Copyright (c) 2002-2007, Luis Argerich, Garland Foster, Eduardo Polidor, et. al.
// All Rights Reserved. See copyright.txt for details and a complete list of authors.
......@@ -155,7 +155,7 @@ if ( $user_tracker_infos ) {
foreach ($fields['data'] as $field) {
$lll[$field['fieldId']] = $field;
}
$items = $trklib->list_items($userTrackerId, 0, 1, '', $lll, $trklib->get_field_id_from_type($userTrackerId, 'u', '1'), $userwatch);
$items = $trklib->list_items($userTrackerId, 0, 1, '', $lll, $trklib->get_field_id_from_type($userTrackerId, 'u', '1%'), $userwatch);
$smarty->assign_by_ref('userItem',$items['data'][0]);
}
......
<?php
// $Header: /cvsroot/tikiwiki/tiki/tiki-view_tracker_item.php,v 1.136 2007-10-03 17:24:48 sylvieg Exp $
// $Header: /cvsroot/tikiwiki/tiki/tiki-view_tracker_item.php,v 1.137 2007-10-09 14:48:17 sylvieg Exp $
// Copyright (c) 2002-2007, Luis Argerich, Garland Foster, Eduardo Polidor, et. al.
// All Rights Reserved. See copyright.txt for details and a complete list of authors.
......@@ -32,7 +32,7 @@ if (!isset($_REQUEST['trackerId']) && $userTracker == 'y') {
$addit['data'][0]['type'] = 'u';
$addit['data'][0]['value'] = $user;
$i = 1;
if ($f = $trklib->get_field_id_from_type($_REQUEST['trackerId'], "u", 1)) {
if ($f = $trklib->get_field_id_from_type($_REQUEST['trackerId'], "u", '1%')) {
if ($f != $utid['usersFieldId']) {
$addit['data'][1]['fieldId'] = $f;
$addit['data'][1]['type'] = 'u';
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment