Commit 0e4a6161 authored by lphuberdeau's avatar lphuberdeau

[MOD] Moving all tracker functions to trackerlib

parent 7411c0fc
......@@ -61,7 +61,8 @@ function smarty_modifier_sefurl($source, $type='wiki', $with_next = '', $all_lan
case 'trackeritem':
$replacementpage = '';
if ($prefs["feature_sefurl_tracker_prefixalias"] == 'y') {
$replacementpage = $tikilib->get_trackeritem_pagealias($source);
$trklib = TikiLib::lib('trk');
$replacementpage = $trklib->get_trackeritem_pagealias($source);
}
if ($replacementpage) {
return $wikilib->sefurl($replacementpage, $with_next, $all_langs);
......
......@@ -868,90 +868,6 @@ class TikiLib extends TikiDb_Bridge
return(isset($this->online_users_cache[$whichuser]));
}
/*shared*/
function get_user_items($user) {
$items = array();
$query = "select ttf.`trackerId`, tti.`itemId` from `tiki_tracker_fields` ttf, `tiki_tracker_items` tti, `tiki_tracker_item_fields` ttif";
$query .= " where ttf.`fieldId`=ttif.`fieldId` and ttif.`itemId`=tti.`itemId` and `type`=? and tti.`status`=? and `value`=?";
$result = $this->fetchAll($query,array('u','o',$user));
$ret = array();
$trackers = $this->table('tiki_trackers');
$trackerFields = $this->table('tiki_tracker_fields');
$trackerItemFields = $this->table('tiki_tracker_item_fields');
//FIXME Perm:filter ?
foreach ( $result as $res ) {
if (!$this->user_has_perm_on_object($user, $res['trackerId'], 'tracker', 'tiki_p_view_trackers')) {
continue;
}
$itemId = $res["itemId"];
$trackerId = $res["trackerId"];
// Now get the isMain field for this tracker
$fieldId = $trackerFields->fetchOne('fieldId', array(
'isMain' => 'y',
'trackerId' => (int) $trackerId
));
// Now get the field value
$value = $trackerItemFields->fetchOne('value', array(
'fieldId' => (int) $fieldId,
'itemId' => (int) $itemId
));
$tracker = $trackers->fetchOne('name', array(
'trackerId' => (int) $trackerId,
));
$aux["trackerId"] = $trackerId;
$aux["itemId"] = $itemId;
$aux["value"] = $value;
$aux["name"] = $tracker;
if (!in_array($itemId, $items)) {
$ret[] = $aux;
$items[] = $itemId;
}
}
$groups = $this->get_user_groups($user);
foreach ($groups as $group) {
$query = "select ttf.`trackerId`, tti.`itemId` from `tiki_tracker_fields` ttf, `tiki_tracker_items` tti, `tiki_tracker_item_fields` ttif ";
$query .= " where ttf.`fieldId`=ttif.`fieldId` and ttif.`itemId`=tti.`itemId` and `type`=? and tti.`status`=? and `value`=?";
$result = $this->fetchAll($query,array('g','o',$group));
foreach ( $result as $res ) {
$itemId = $res["itemId"];
$trackerId = $res["trackerId"];
// Now get the isMain field for this tracker
$fieldId = $trackerFields->fetchOne('fieldId', array(
'isMain' => 'y',
'trackerId' => (int) $trackerId
));
// Now get the field value
$value = $trackerItemFields->fetchOne('value', array(
'fieldId' => (int) $fieldId,
'itemId' => (int) $itemId
));
$tracker = $trackers->fetchOne('name', array(
'trackerId' => (int) $trackerId,
));
$aux["trackerId"] = $trackerId;
$aux["itemId"] = $itemId;
$aux["value"] = $value;
$aux["name"] = $tracker;
if (!in_array($itemId, $items)) {
$ret[] = $aux;
$items[] = $itemId;
}
}
}
return $ret;
}
/*shared*/
function get_quiz($quizId) {
$query = "select * from `tiki_quizzes` where `quizId`=?";
......@@ -1061,46 +977,6 @@ class TikiLib extends TikiDb_Bridge
);
}
function get_tracker($trackerId) {
return $this->table('tiki_trackers')->fetchFullRow(array('trackerId' => (int) $trackerId));
}
/*shared*/
function list_trackers($offset=0, $maxRecords=-1, $sort_mode='name_asc', $find='') {
$categlib = TikiLib::lib('categ');
$join = '';
$where = '';
$bindvars = array();
if( $jail = $categlib->get_jail() ) {
$categlib->getSqlJoin($jail, 'tracker', '`tiki_trackers`.`trackerId`', $join, $where, $bindvars);
}
if ($find) {
$findesc = '%' . $find . '%';
$where .= ' and (`tiki_trackers`.`name` like ? or `tiki_trackers`.`description` like ?)';
$bindvars = array_merge($bindvars, array($findesc, $findesc));
}
$query = "select * from `tiki_trackers` $join where 1=1 $where order by `tiki_trackers`.".$this->convertSortMode($sort_mode);
$query_cant = "select count(*) from `tiki_trackers` $join where 1=1 $where";
$result = $this->fetchAll($query,$bindvars,$maxRecords,$offset);
$cant = $this->getOne($query_cant,$bindvars);
$ret = array();
$list = array();
//FIXME Perm:filter ?
foreach ( $result as $res ) {
global $user;
$add=$this->user_has_perm_on_object($user,$res['trackerId'],'tracker','tiki_p_view_trackers');
if ($add) {
$ret[] = $res;
$list[$res['trackerId']] = $res['name'];
}
}
$retval = array();
$retval["list"] = $list;
$retval["data"] = $ret;
$retval["cant"] = $cant;
return $retval;
}
function list_surveys($offset, $maxRecords, $sort_mode, $find) {
if ($find) {
$findesc = '%' . $find . '%';
......@@ -1142,115 +1018,6 @@ class TikiLib extends TikiDb_Bridge
return $retval;
}
/* experimental shared */
function get_item_id($trackerId,$fieldId,$value) {
$query = "select ttif.`itemId` from `tiki_tracker_items` tti, `tiki_tracker_fields` ttf, `tiki_tracker_item_fields` ttif ";
$query.= " where tti.`trackerId`=ttf.`trackerId` and ttif.`fieldId`=ttf.`fieldId` and ttf.`trackerId`=? and ttf.`fieldId`=? and ttif.`value`=?";
$itemId = $this->getOne($query,array((int) $trackerId,(int)$fieldId,$value));
return $itemId;
}
/*shared*/
function list_tracker_items($trackerId, $offset, $maxRecords, $sort_mode, $fields, $status = '', $initial = '') {
$filters = array();
if ($fields) {
$temp_max = count($fields["data"]);
for ($i = 0; $i < $temp_max; $i++) {
$fieldId = $fields["data"][$i]["fieldId"];
$filters[$fieldId] = $fields["data"][$i];
}
}
$csort_mode = '';
if (substr($sort_mode,0,2) == "f_") {
list($a,$csort_mode,$corder) = explode('_',$sort_mode, 3);
}
$trackerId = (int) $trackerId;
if ($trackerId == -1) {
$mid = " where 1=1 ";
$bindvars = array();
} else {
$mid = " where tti.`trackerId`=? ";
$bindvars = array($trackerId);
}
if ($status) {
$mid.= " and tti.`status`=? ";
$bindvars[] = $status;
}
if ($initial) {
$mid.= "and ttif.`value` like ?";
$bindvars[] = $initial.'%';
}
if (!$sort_mode) {
$temp_max = count($fields["data"]);
for ($i = 0; $i < $temp_max; $i++) {
if ($fields['data'][$i]['isMain'] == 'y') {
$csort_mode = $fields['data'][$i]['name'];
break;
}
}
}
if ($csort_mode) {
$sort_mode = $csort_mode."_desc";
$bindvars[] = $csort_mode;
$query = "select tti.*, ttif.`value` from `tiki_tracker_items` tti, `tiki_tracker_item_fields` ttif, `tiki_tracker_fields` ttf ";
$query.= " $mid and tti.`itemId`=ttif.`itemId` and ttf.`fieldId`=ttif.`fieldId` and ttf.`name`=? order by ttif.`value`";
$query_cant = "select count(*) from `tiki_tracker_items` tti, `tiki_tracker_item_fields` ttif, `tiki_tracker_fields` ttf ";
$query_cant.= " $mid and tti.`itemId`=ttif.`itemId` and ttf.`fieldId`=ttif.`fieldId` and ttf.`name`=? ";
} else {
if (!$sort_mode) {
$sort_mode = "lastModif_desc";
}
$query = "select * from `tiki_tracker_items` tti $mid order by ".$this->convertSortMode($sort_mode);
$query_cant = "select count(*) from `tiki_tracker_items` tti $mid ";
}
$result = $this->fetchAll($query,$bindvars,$maxRecords,$offset);
$cant = $this->getOne($query_cant,$bindvars);
$ret = array();
foreach ( $result as $res ) {
$fields = array();
$itid = $res["itemId"];
$query2 = "select ttif.`fieldId`,`name`,`value`,`type`,`isTblVisible`,`isMain`,`position`
from `tiki_tracker_item_fields` ttif, `tiki_tracker_fields` ttf
where ttif.`fieldId`=ttf.`fieldId` and `itemId`=? order by `position` asc";
$result2 = $this->fetchAll($query2,array((int) $res["itemId"]));
$pass = true;
$kx = "";
foreach ( $result2 as $res2 ) {
// Check if the field is visible!
$fieldId = $res2["fieldId"];
if (count($filters) > 0) {
if (isset($filters["$fieldId"]["value"]) and $filters["$fieldId"]["value"]) {
if ($filters["$fieldId"]["type"] == 'a' || $filters["$fieldId"]["type"] == 't') {
if (!stristr($res2["value"], $filters["$fieldId"]["value"]))
$pass = false;
} else {
if (strtolower($res2["value"]) != strtolower($filters["$fieldId"]["value"])) {
$pass = false;
}
}
}
if (preg_replace("/[^a-zA-Z0-9]/","",$res2["name"]) == $csort_mode) {
$kx = $res2["value"].$itid;
}
}
$fields[] = $res2;
}
$res["field_values"] = $fields;
$res["comments"] = $this->table('tiki_tracker_item_comments')->fetchCount(array('itemId' => (int) $itid));
if ($pass) {
$kl = $kx.$itid;
$ret["$kl"] = $res;
}
}
ksort($ret);
//$ret=$this->sort_items_by_condition($ret,$sort_mode);
$retval = array();
$retval["data"] = array_values($ret);
$retval["cant"] = $cant;
return $retval;
}
/*
* Score methods begin
*/
......@@ -8336,29 +8103,6 @@ JS;
$menulib = TikiLib::lib('menu');
$menulib->rename_wiki_page($old, $new);
}
// This function gets the prefix alias page name e.g. Org:230 for the pretty tracker
// wiki page corresponding to a tracker item (230 in the example) using prefix aliases
// Returns false if no such page is found.
function get_trackeritem_pagealias($itemId) {
$trackerId = $this->table('tiki_tracker_items')->fetchOne('trackerId', array('itemId' => $itemId));
$semanticlib = TikiLib::lib('semantic');
$t_links = $semanticlib->getLinksUsing('trackerid', array( 'toPage' => $trackerId ) );
if (count($t_links)) {
$p_links = $semanticlib->getLinksUsing('prefixalias', array( 'fromPage' => $t_links[0]['fromPage'] ) );
if (count($p_links)) {
$ret = $p_links[0]['toPage'] . $itemId;
return $ret;
} else {
return false;
}
} else {
return false;
}
}
}
// end of class ------------------------------------------------------
......
......@@ -506,6 +506,199 @@ class TrackerLib extends TikiLib
return $ret;
}
/*shared*/
function list_tracker_items($trackerId, $offset, $maxRecords, $sort_mode, $fields, $status = '', $initial = '') {
$filters = array();
if ($fields) {
$temp_max = count($fields["data"]);
for ($i = 0; $i < $temp_max; $i++) {
$fieldId = $fields["data"][$i]["fieldId"];
$filters[$fieldId] = $fields["data"][$i];
}
}
$csort_mode = '';
if (substr($sort_mode,0,2) == "f_") {
list($a,$csort_mode,$corder) = explode('_',$sort_mode, 3);
}
$trackerId = (int) $trackerId;
if ($trackerId == -1) {
$mid = " where 1=1 ";
$bindvars = array();
} else {
$mid = " where tti.`trackerId`=? ";
$bindvars = array($trackerId);
}
if ($status) {
$mid.= " and tti.`status`=? ";
$bindvars[] = $status;
}
if ($initial) {
$mid.= "and ttif.`value` like ?";
$bindvars[] = $initial.'%';
}
if (!$sort_mode) {
$temp_max = count($fields["data"]);
for ($i = 0; $i < $temp_max; $i++) {
if ($fields['data'][$i]['isMain'] == 'y') {
$csort_mode = $fields['data'][$i]['name'];
break;
}
}
}
if ($csort_mode) {
$sort_mode = $csort_mode."_desc";
$bindvars[] = $csort_mode;
$query = "select tti.*, ttif.`value` from `tiki_tracker_items` tti, `tiki_tracker_item_fields` ttif, `tiki_tracker_fields` ttf ";
$query.= " $mid and tti.`itemId`=ttif.`itemId` and ttf.`fieldId`=ttif.`fieldId` and ttf.`name`=? order by ttif.`value`";
$query_cant = "select count(*) from `tiki_tracker_items` tti, `tiki_tracker_item_fields` ttif, `tiki_tracker_fields` ttf ";
$query_cant.= " $mid and tti.`itemId`=ttif.`itemId` and ttf.`fieldId`=ttif.`fieldId` and ttf.`name`=? ";
} else {
if (!$sort_mode) {
$sort_mode = "lastModif_desc";
}
$query = "select * from `tiki_tracker_items` tti $mid order by ".$this->convertSortMode($sort_mode);
$query_cant = "select count(*) from `tiki_tracker_items` tti $mid ";
}
$result = $this->fetchAll($query,$bindvars,$maxRecords,$offset);
$cant = $this->getOne($query_cant,$bindvars);
$ret = array();
foreach ( $result as $res ) {
$fields = array();
$itid = $res["itemId"];
$query2 = "select ttif.`fieldId`,`name`,`value`,`type`,`isTblVisible`,`isMain`,`position`
from `tiki_tracker_item_fields` ttif, `tiki_tracker_fields` ttf
where ttif.`fieldId`=ttf.`fieldId` and `itemId`=? order by `position` asc";
$result2 = $this->fetchAll($query2,array((int) $res["itemId"]));
$pass = true;
$kx = "";
foreach ( $result2 as $res2 ) {
// Check if the field is visible!
$fieldId = $res2["fieldId"];
if (count($filters) > 0) {
if (isset($filters["$fieldId"]["value"]) and $filters["$fieldId"]["value"]) {
if ($filters["$fieldId"]["type"] == 'a' || $filters["$fieldId"]["type"] == 't') {
if (!stristr($res2["value"], $filters["$fieldId"]["value"]))
$pass = false;
} else {
if (strtolower($res2["value"]) != strtolower($filters["$fieldId"]["value"])) {
$pass = false;
}
}
}
if (preg_replace("/[^a-zA-Z0-9]/","",$res2["name"]) == $csort_mode) {
$kx = $res2["value"].$itid;
}
}
$fields[] = $res2;
}
$res["field_values"] = $fields;
$res["comments"] = $this->table('tiki_tracker_item_comments')->fetchCount(array('itemId' => (int) $itid));
if ($pass) {
$kl = $kx.$itid;
$ret["$kl"] = $res;
}
}
ksort($ret);
//$ret=$this->sort_items_by_condition($ret,$sort_mode);
$retval = array();
$retval["data"] = array_values($ret);
$retval["cant"] = $cant;
return $retval;
}
/* experimental shared */
function get_item_id($trackerId,$fieldId,$value) {
$query = "select ttif.`itemId` from `tiki_tracker_items` tti, `tiki_tracker_fields` ttf, `tiki_tracker_item_fields` ttif ";
$query.= " where tti.`trackerId`=ttf.`trackerId` and ttif.`fieldId`=ttf.`fieldId` and ttf.`trackerId`=? and ttf.`fieldId`=? and ttif.`value`=?";
$itemId = $this->getOne($query,array((int) $trackerId,(int)$fieldId,$value));
return $itemId;
}
/*shared*/
function get_user_items($user) {
$items = array();
$query = "select ttf.`trackerId`, tti.`itemId` from `tiki_tracker_fields` ttf, `tiki_tracker_items` tti, `tiki_tracker_item_fields` ttif";
$query .= " where ttf.`fieldId`=ttif.`fieldId` and ttif.`itemId`=tti.`itemId` and `type`=? and tti.`status`=? and `value`=?";
$result = $this->fetchAll($query,array('u','o',$user));
$ret = array();
$trackers = $this->table('tiki_trackers');
$trackerFields = $this->table('tiki_tracker_fields');
$trackerItemFields = $this->table('tiki_tracker_item_fields');
//FIXME Perm:filter ?
foreach ( $result as $res ) {
if (!$this->user_has_perm_on_object($user, $res['trackerId'], 'tracker', 'tiki_p_view_trackers')) {
continue;
}
$itemId = $res["itemId"];
$trackerId = $res["trackerId"];
// Now get the isMain field for this tracker
$fieldId = $trackerFields->fetchOne('fieldId', array(
'isMain' => 'y',
'trackerId' => (int) $trackerId
));
// Now get the field value
$value = $trackerItemFields->fetchOne('value', array(
'fieldId' => (int) $fieldId,
'itemId' => (int) $itemId
));
$tracker = $trackers->fetchOne('name', array(
'trackerId' => (int) $trackerId,
));
$aux["trackerId"] = $trackerId;
$aux["itemId"] = $itemId;
$aux["value"] = $value;
$aux["name"] = $tracker;
if (!in_array($itemId, $items)) {
$ret[] = $aux;
$items[] = $itemId;
}
}
$groups = $this->get_user_groups($user);
foreach ($groups as $group) {
$query = "select ttf.`trackerId`, tti.`itemId` from `tiki_tracker_fields` ttf, `tiki_tracker_items` tti, `tiki_tracker_item_fields` ttif ";
$query .= " where ttf.`fieldId`=ttif.`fieldId` and ttif.`itemId`=tti.`itemId` and `type`=? and tti.`status`=? and `value`=?";
$result = $this->fetchAll($query,array('g','o',$group));
foreach ( $result as $res ) {
$itemId = $res["itemId"];
$trackerId = $res["trackerId"];
// Now get the isMain field for this tracker
$fieldId = $trackerFields->fetchOne('fieldId', array(
'isMain' => 'y',
'trackerId' => (int) $trackerId
));
// Now get the field value
$value = $trackerItemFields->fetchOne('value', array(
'fieldId' => (int) $fieldId,
'itemId' => (int) $itemId
));
$tracker = $trackers->fetchOne('name', array(
'trackerId' => (int) $trackerId,
));
$aux["trackerId"] = $trackerId;
$aux["itemId"] = $itemId;
$aux["value"] = $value;
$aux["name"] = $tracker;
if (!in_array($itemId, $items)) {
$ret[] = $aux;
$items[] = $itemId;
}
}
}
return $ret;
}
/* experimental shared */
function get_items_list($trackerId, $fieldId, $value, $status='o') {
$query = "select distinct tti.`itemId`, tti.`itemId` from `tiki_tracker_items` tti, `tiki_tracker_item_fields` ttif ";
......@@ -518,6 +711,67 @@ class TrackerLib extends TikiLib
return array_values($this->fetchMap($query, $bindVars));
}
function get_tracker($trackerId) {
return $this->table('tiki_trackers')->fetchFullRow(array('trackerId' => (int) $trackerId));
}
function list_trackers($offset=0, $maxRecords=-1, $sort_mode='name_asc', $find='') {
$categlib = TikiLib::lib('categ');
$join = '';
$where = '';
$bindvars = array();
if( $jail = $categlib->get_jail() ) {
$categlib->getSqlJoin($jail, 'tracker', '`tiki_trackers`.`trackerId`', $join, $where, $bindvars);
}
if ($find) {
$findesc = '%' . $find . '%';
$where .= ' and (`tiki_trackers`.`name` like ? or `tiki_trackers`.`description` like ?)';
$bindvars = array_merge($bindvars, array($findesc, $findesc));
}
$query = "select * from `tiki_trackers` $join where 1=1 $where order by `tiki_trackers`.".$this->convertSortMode($sort_mode);
$query_cant = "select count(*) from `tiki_trackers` $join where 1=1 $where";
$result = $this->fetchAll($query,$bindvars,$maxRecords,$offset);
$cant = $this->getOne($query_cant,$bindvars);
$ret = array();
$list = array();
//FIXME Perm:filter ?
foreach ( $result as $res ) {
global $user;
$add=$this->user_has_perm_on_object($user,$res['trackerId'],'tracker','tiki_p_view_trackers');
if ($add) {
$ret[] = $res;
$list[$res['trackerId']] = $res['name'];
}
}
$retval = array();
$retval["list"] = $list;
$retval["data"] = $ret;
$retval["cant"] = $cant;
return $retval;
}
// This function gets the prefix alias page name e.g. Org:230 for the pretty tracker
// wiki page corresponding to a tracker item (230 in the example) using prefix aliases
// Returns false if no such page is found.
function get_trackeritem_pagealias($itemId) {
$trackerId = $this->table('tiki_tracker_items')->fetchOne('trackerId', array('itemId' => $itemId));
$semanticlib = TikiLib::lib('semantic');
$t_links = $semanticlib->getLinksUsing('trackerid', array( 'toPage' => $trackerId ) );
if (count($t_links)) {
$p_links = $semanticlib->getLinksUsing('prefixalias', array( 'fromPage' => $t_links[0]['fromPage'] ) );
if (count($p_links)) {
$ret = $p_links[0]['toPage'] . $itemId;
return $ret;
} else {
return false;
}
} else {
return false;
}
}
function concat_item_from_fieldslist($trackerId,$itemId,$fieldsId,$status='o',$separator=' ') {
$res='';
$sts = preg_split('/\|/', $fieldsId, -1, PREG_SPLIT_NO_EMPTY);
......
......@@ -1868,22 +1868,22 @@ class UsersLib extends TikiLib
$groupTracker = $this->get_tracker_usergroup( $user );
if( $groupTracker && $groupTracker['usersTrackerId'] ) {
global $trklib;
if( ! $trklib ) require_once 'lib/trackers/trackerlib.php';
$trklib = TikiLib::lib('trk');
$itemId = $trklib->get_item_id( $groupTracker['usersTrackerId'], $groupTracker['usersFieldId'], $user );
if( $itemId )
if( $itemId ) {
$trklib->remove_tracker_item( $itemId );
}
}
$tracker = $this->get_usertracker( $userId );
if( $tracker && $tracker['usersTrackerId'] ) {
global $trklib;
if( ! $trklib ) require_once 'lib/trackers/trackerlib.php';
$trklib = TikiLib::lib('trk');
$itemId = $trklib->get_item_id( $tracker['usersTrackerId'], $tracker['usersFieldId'], $user );
if( $itemId )
if( $itemId ) {
$trklib->remove_tracker_item( $itemId );
}
}
$query = "delete from `users_users` where binary `login` = ?";
......@@ -3802,11 +3802,8 @@ class UsersLib extends TikiLib
$userid = $this->get_user_id($user);
$tracker = $this->get_usertracker($userid);
if( $tracker && $tracker['usersTrackerId'] ) {
global $trklib;
if( ! $trklib ) {
require_once 'lib/trackers/trackerlib.php';
}
global $categlib; include_once('lib/categories/categlib.php');
$trklib = TikiLib::lib('trk');
$categlib = TikiLib::lib('categ');
$itemid = $trklib->get_item_id( $tracker['usersTrackerId'], $tracker['usersFieldId'], $user );
$cat = $categlib->get_object_categories('trackeritem', $itemid);
$categId = $this->getOne("select `categId` from `tiki_categories` where `name` = ?", array($group));
......@@ -3821,11 +3818,8 @@ class UsersLib extends TikiLib
$userid = $this->get_user_id($user);
$tracker = $this->get_usertracker($userid);
if( $tracker && $tracker['usersTrackerId'] ) {
global $trklib;
if( ! $trklib ) {
require_once 'lib/trackers/trackerlib.php';
}
global $categlib; include_once('lib/categories/categlib.php');
$trklib = TikiLib::lib('trk');
$categlib = TikiLib::lib('categ');
$itemid = $trklib->get_item_id( $tracker['usersTrackerId'], $tracker['usersFieldId'], $user );
$cat = $categlib->get_object_categories('trackeritem', $itemid);
$categId = $this->getOne("select `categId` from `tiki_categories` where `name` = ?", array($group));
......
......@@ -60,7 +60,7 @@ function wikiplugin_miniquiz($data, $params) {
return $smarty->fetch("wiki-plugins/error_tracker.tpl");
}
$items = $tikilib->list_tracker_items($trackerId,0,-1,'lastModif_desc','','o');
$items = $trklib->list_tracker_items($trackerId,0,-1,'lastModif_desc','','o');
foreach ($items['data'] as $it) {
$id = $it['itemId'];
foreach ($it['field_values'] as $val) {
......
......@@ -1466,7 +1466,7 @@ function wikiplugin_trackerlist($data, $params) {
$smarty->assign('trackerlistmapview', false);
}
$tracker = $tikilib->get_tracker($trackerId,0,-1);
$tracker = $trklib->get_tracker($trackerId,0,-1);
/*foreach ($query_array as $k=>$v) {
if (!is_array($v)) { //only to avoid an error: eliminate the params that are not simple (ex: if you have in the same page a tracker list plugin and a tracker plugin, filling the tracker plugin interfers with the tracker list. In any case this is buggy if two tracker list plugins in the same page and if one needs the query value....
$quarray[] = urlencode($k) ."=". urlencode($v);
......
......@@ -413,7 +413,7 @@ $info['autoCreateGroup'] = '';
$info['autoCreateGroupInc'] = 0;
$info['autoAssignGroupItem'] = '';
if ($_REQUEST["trackerId"]) {
$info = array_merge($info, $tikilib->get_tracker($_REQUEST["trackerId"]));
$info = array_merge($info, $trklib->get_tracker($_REQUEST["trackerId"]));
$info = array_merge($info, $trklib->get_tracker_options($_REQUEST["trackerId"]));
require_once 'lib/todolib.php';
$info['todos'] = $todolib->listTodoObject('tracker', $_REQUEST['trackerId']);
......
......@@ -14,7 +14,8 @@ $auto_query_args = array('group');
if (!isset($cookietab)) { $cookietab = '1'; }