Commit 937fe732 authored by lphuberdeau's avatar lphuberdeau

[ENH] Converting trklib

parent 497eeaeb
......@@ -11,7 +11,7 @@ if (strpos($_SERVER['SCRIPT_NAME'], basename(__FILE__)) !== false) {
exit;
}
include_once ('lib/trackers/trackerlib.php');
$trklib = TikiLib::lib('trk');
if (isset($_REQUEST['trkset'])) {
check_ticket('admin-inc-trackers');
......
......@@ -111,6 +111,7 @@
},
"classmap": [
"vendor_extra/pear/",
"lib/tikidate.php",
"lib/openpgp/",
"lib/language/",
"lib/TikiWebdav/",
......
......@@ -14,6 +14,9 @@
<service id="tiki.lib.comments" class="Comments">
<file>%kernel.root_dir%/lib/comments/commentslib.php</file>
</service>
<service id="tiki.lib.css" class="cssLib">
<file>%kernel.root_dir%/lib/csslib.php</file>
</service>
<service id="tiki.lib.filegal" class="FileGalLib">
<file>%kernel.root_dir%/lib/filegals/filegallib.php</file>
</service>
......@@ -29,6 +32,10 @@
<service id="tiki.lib.service" class="ServiceLib">
<file>%kernel.root_dir%/lib/servicelib.php</file>
</service>
<service id="tiki.lib.tikidate" class="TikiDate"/>
<service id="tiki.lib.trk" class="TrackerLib">
<file>%kernel.root_dir%/lib/trackers/trackerlib.php</file>
</service>
<service id="tiki.lib.user" class="UsersLib">
<file>%kernel.root_dir%/lib/userslib.php</file>
</service>
......
......@@ -941,8 +941,7 @@ if (
require_once 'lib/tikilib.php';
$tikilib = new TikiLib;
$userlib = TikiLib::lib('user');
require_once 'lib/tikidate.php';
$tikidate = new TikiDate();
$tikidate = TikiLib::lib('tikidate');
}
if (isset($_POST['update'])) {
......
......@@ -80,7 +80,7 @@ class CategLib extends ObjectLib
return $this->getOne("select `name` from `tiki_trackers` where `trackerId`=?", array((int) $trackerId));
}
if (preg_match('/^Tracker Item ([0-9]+)$/', $res['name'])) {
global $trklib;require_once('lib/trackers/trackerlib.php');
$trklib = TikiLib::lib('trk');
$itemId=preg_replace('/^Tracker Item ([0-9]+)$/', "$1", $res['name']);
return $trklib->get_isMain_value(-1, $itemId);
}
......@@ -523,7 +523,7 @@ class CategLib extends ObjectLib
foreach ( $result as $res ) {
if (!in_array($res['catObjectId'].'-'.$res['categId'], $objs)) { // same object and same category
if (preg_match('/trackeritem/', $res['type'])&&$res['description']=='') {
global $trklib; include_once('lib/trackers/trackerlib.php');
$trklib = TikiLib::lib('trk');
$trackerId=preg_replace('/^.*trackerId=([0-9]+).*$/', '$1', $res['href']);
$res['name']=$trklib->get_isMain_value($trackerId, $res['itemId']);
$filed=$trklib->get_field_id($trackerId, "description");
......
......@@ -76,9 +76,7 @@ class Tiki_Profile_InstallHandler_TrackerItem extends Tiki_Profile_InstallHandle
$data = array_merge($this->getDefaultValues(), $data);
global $trklib;
if ( ! $trklib )
require_once 'lib/trackers/trackerlib.php';
$trklib = TikiLib::lib('trk');
$fields = $trklib->list_tracker_fields($data['tracker']);
$providedfields = array();
......
......@@ -278,7 +278,7 @@ class Tracker_Definition
*/
function getItemUser($itemId)
{
global $trklib;
$trklib = TikiLib::lib('trk');
return $trklib->get_item_creator($this->trackerInfo['trackerId'], $itemId);
}
......
......@@ -761,7 +761,8 @@ class Tracker_Query
*/
function query()
{
global $tikilib, $trklib;
$trklib = TikiLib::lib('trk');
$tikilib = TikiLib::lib('tiki');
$params = array();
$fields_safe = "";
$status_safe = "";
......@@ -1021,7 +1022,7 @@ class Tracker_Query
*/
private function render_field_value($fieldDefinition, $value)
{
global $trklib;
$trklib = TikiLib::lib('trk');
$fieldDefinition['value'] = $value;
//if type is text, no need to render value
......@@ -1294,7 +1295,7 @@ class Tracker_Query
*/
public function delete($bulkMode = false)
{
global $trklib;
$trklib = TikiLib::lib('trk');
if ($this->canDelete()) {
$results = $this->query();
......
......@@ -199,4 +199,3 @@ class cssLib extends TikiLib
return $version;
}
}
$csslib = new cssLib;
......@@ -170,10 +170,8 @@ class GeoLib
*/
function setTrackerGeo($itemId, $geo)
{
global $prefs, $trklib;
if (!is_object($trklib)) {
include_once('lib/trackers/trackerlib.php');
}
global $prefs;
$trklib = TikiLib::lib('trk');
$item = $trklib->get_tracker_item($itemId);
$fields = $trklib->list_tracker_fields($item['trackerId']);
foreach ($fields["data"] as $f) {
......
......@@ -141,7 +141,7 @@ class ObjectLib extends TikiLib
break;
case 'tracker':
global $trklib; include_once('lib/trackers/trackerlib.php');
$trklib = TikiLib::lib('trk');
$info = $trklib->get_tracker($itemId);
$description = $info['description'];
......@@ -150,7 +150,7 @@ class ObjectLib extends TikiLib
break;
case 'trackeritem':
global $trklib; include_once('lib/trackers/trackerlib.php');
$trklib = TikiLib::lib('trk');
$info = $trklib->get_tracker_item($itemId);
$description = '';
......
......@@ -2086,7 +2086,7 @@ if ( \$('#$id') ) {
break;
}
case 'lastItemVersion':
global $trklib; include_once ('lib/trackers/trackerlib.php');
$trklib = TikiLib::lib('trk');
$auto_query_args = array('itemId');
if (!empty($_REQUEST['itemId'])) {
$item_info = $trklib->get_item_info($_REQUEST['itemId']);
......@@ -2113,7 +2113,7 @@ if ( \$('#$id') ) {
break;
}
case 'lastItemAuthor':
global $trklib; include_once ('lib/trackers/trackerlib.php');
$trklib = TikiLib::lib('trk');
$auto_query_args = array('itemId');
if (!empty($_REQUEST['itemId'])) {
$item_info = $trklib->get_item_info($_REQUEST['itemId']);
......@@ -2140,7 +2140,7 @@ if ( \$('#$id') ) {
break;
}
case 'lastItemModif':
global $trklib; include_once ('lib/trackers/trackerlib.php');
$trklib = TikiLib::lib('trk');
$auto_query_args = array('itemId');
if (!empty($_REQUEST['itemId'])) {
$item_info = $trklib->get_item_info($_REQUEST['itemId']);
......
......@@ -14,8 +14,7 @@ function payment_behavior_cart_exchange_product( $exchangeorderitemid = 0, $exch
return false;
}
global $trklib;
include_once ('lib/trackers/trackerlib.php');
$trklib = TikiLib::lib('trk');
$orderitemsTrackerId = $prefs['payment_cart_orderitems_tracker'];
......
......@@ -13,7 +13,7 @@ function payment_behavior_cart_gift_certificate_purchase(
$orderItemId = 0
)
{
global $trklib; require_once("lib/trackers/trackerlib.php");
$trklib = TikiLib::lib('trk');
global $prefs;
$params['trackerId'] = $prefs['payment_cart_giftcert_tracker'];
......
......@@ -502,8 +502,8 @@ class CartLib
function has_gift_certificate()
{
global $trklib, $prefs;
require_once('lib/trackers/trackerlib.php');
global $prefs;
$trklib = TikiLib::lib('trk');
return ($trklib->get_tracker_by_name($prefs['payment_cart_giftcert_tracker_name']) ? true : false );
}
......@@ -1103,8 +1103,7 @@ class CartLib
global $prefs;
$productTrackerId = $prefs['payment_cart_product_tracker'];
$inventoryTypeFieldId = $prefs['payment_cart_inventory_type_field'];
global $trklib;
require_once('lib/trackers/trackerlib.php');
$trklib = TikiLib::lib('trk');
return $trklib->get_item_value($productTrackerId, $productId, $inventoryTypeFieldId);
}
......@@ -1128,8 +1127,7 @@ class CartLib
} else {
$inventoryFieldId = $inventoryTotalFieldId;
}
global $trklib;
require_once('lib/trackers/trackerlib.php');
$trklib = TikiLib::lib('trk');
return $trklib->get_item_value($productTrackerId, $productId, $inventoryFieldId);
}
......@@ -1216,8 +1214,7 @@ class CartLib
private function modify_tracker_item( $trackerId, $itemId, $trackerFields )
{
global $trklib;
require_once('lib/trackers/trackerlib.php');
$trklib = TikiLib::lib('trk');
$tracker_fields_info = $trklib->list_tracker_fields($trackerId);
$fieldTypes = array();
foreach ($tracker_fields_info['data'] as $t) {
......@@ -1319,8 +1316,7 @@ class CartLib
function get_missing_user_information_fields( $product_class_id, $type = 'required' )
{
global $user, $prefs;
global $trklib;
require_once('lib/trackers/trackerlib.php');
$trklib = TikiLib::lib('trk');
if ($type == 'required') {
$fields_str = $this->get_tracker_value_custom($prefs['payment_cart_productclasses_tracker_name'], 'Required Field IDs', $product_class_id);
} else if ($type == 'postpurchase') {
......
......@@ -839,7 +839,7 @@ class SearchLib extends TikiLib
*/
function find_trackers($words = '', $offset = 0, $maxRecords = -1, $fulltext = false, $filter='', $boolean='n', $searchDate = 0, $categId = 0)
{
global $trklib; require_once('lib/trackers/trackerlib.php');
$trklib = TikiLib::lib('trk');
global $tiki_p_view_trackers_pending; global $tiki_p_view_trackers_closed;
static $search_trackers = array(
......
......@@ -65,15 +65,6 @@ class TikiLib extends TikiDb_Bridge
case 'tiki':
global $tikilib;
return self::$libraries[$name] = $tikilib;
case 'tikidate':
require_once('lib/tikidate.php');
return self::$libraries[$name] = new TikiDate;
case 'css':
global $csslib; include_once("lib/csslib.php");
return self::$libraries[$name] = $csslib;
case 'trk':
global $trklib; require_once('lib/trackers/trackerlib.php');
return self::$libraries[$name] = $trklib;
case 'wiki':
global $wikilib; include_once('lib/wiki/wikilib.php');
return self::$libraries[$name] = $wikilib;
......
......@@ -239,7 +239,7 @@ class TodoLib
function listObjectsTodo_tracker($todo, $except=null)
{
global $tikilib;
global $trklib; include_once('lib/trackers/trackerlib.php');
$trklib = TikiLib::lib('trk');
switch ($todo['event']) {
case 'creation':
......@@ -287,7 +287,7 @@ class TodoLib
*/
function applyTodo_tracker($todo, $objects)
{
global $trklib; include_once('lib/trackers/trackerlib.php');
$trklib = TikiLib::lib('trk');
$trklib->change_status($objects, $todo['to']['status']);
}
......@@ -298,7 +298,7 @@ class TodoLib
function notifyTodo_tracker($todo, $objects)
{
global $smarty, $tikilib, $prefs;
global $trklib; include_once('lib/trackers/trackerlib.php');
$trklib = TikiLib::lib('trk');
foreach ($objects as $object) {
// get the creator
$u = $object['field_values'][0]['value'];
......
......@@ -4965,5 +4965,3 @@ class TrackerLib extends TikiLib
}
}
global $trklib;
$trklib = new TrackerLib;
......@@ -6718,7 +6718,7 @@ class UsersLib extends TikiLib
if (!empty($chosenGroup)) {
$smarty->assign_by_ref('chosenGroup', $chosenGroup);
if ($prefs['userTracker'] == 'y') {
global $trklib; include_once('lib/trackers/trackerlib.php');
$trklib = TikiLib::lib('trk');
$re = $this->get_group_info(isset($chosenGroup)? $chosenGroup: 'Registered');
$fields = $trklib->list_tracker_fields(
$re['usersTrackerId'],
......
......@@ -7,9 +7,7 @@
function validator_distinct($input, $parameter = '', $message = '')
{
global $trklib;
include_once 'lib/trackers/trackerlib.php';
$trklib = TikiLib::lib('trk');
parse_str($parameter, $arr);
if (count($arr) < 2 || !isset($arr['trackerId']) || !isset($arr['fieldId'])) {
......
......@@ -39,7 +39,7 @@ class watershedLib
function getAllViewableChannels( $channelName = '', $brandId = '')
{
global $prefs;
global $trklib; include_once ('lib/trackers/trackerlib.php');
$trklib = TikiLib::lib('trk');
$channels = array();
if ($channelName && $brandId) {
......@@ -88,7 +88,7 @@ class watershedLib
function filterChannels( $channels, $mode = 'viewer' )
{
global $prefs, $tikilib;
global $trklib; include_once ('lib/trackers/trackerlib.php');
$trklib = TikiLib::lib('trk');
$tracker_info = $trklib->get_tracker($prefs['watershed_channel_trackerId']);
if ($t = $trklib->get_tracker_options($prefs['watershed_channel_trackerId'])) {
......@@ -121,7 +121,7 @@ class watershedLib
function checkArchiveViewable( $videoId, $channels )
{
global $prefs, $tikilib;
global $trklib; include_once ('lib/trackers/trackerlib.php');
$trklib = TikiLib::lib('trk');
$archive = $trklib->get_item($prefs['watershed_archive_trackerId'], $prefs['watershed_archive_fieldId'], $videoId);
$archiveChannelCode = $archive[$prefs['watershed_archive_channel_fieldId']];
......@@ -156,7 +156,7 @@ class watershedLib
function storeArchive( $recording )
{
global $prefs;
global $trklib; include_once ('lib/trackers/trackerlib.php');
$trklib = TikiLib::lib('trk');
$fields = array();
if (empty($prefs['watershed_archive_trackerId'])) {
return false;
......
......@@ -146,7 +146,7 @@ function wikiplugin_attach($data, $params)
// See if we're being called from a tracker page.
if ( $section == 'trackers' ) {
global $trklib; include_once('lib/trackers/trackerlib.php');
$trklib = TikiLib::lib('trk');
$atts_item_name = $_REQUEST["itemId"];
$tracker_info = $trklib->get_tracker($atts_item_name);
$tracker_info = array_merge($tracker_info, $trklib->get_tracker_options($atts_item_name));
......
......@@ -80,7 +80,7 @@ function wikiplugin_hasticket( $data, $params )
$data = substr($data, 0, strpos($data, '{ELSE}'));
}
// check code
global $trklib; require_once("lib/trackers/trackerlib.php");
$trklib = TikiLib::lib('trk');
$correctcode = $trklib->get_item_value($params['trackerId'], $params['itemId'], $params['fieldId']);
if ($_SESSION['wikiplugin_trackerpasscode'][$key] == $correctcode) {
return $data;
......
......@@ -38,7 +38,7 @@ function shuf(&$ar)
function wikiplugin_miniquiz($data, $params)
{
global $tikilib, $user, $group, $prefs, $smarty;
global $trklib; include_once('lib/trackers/trackerlib.php');
$trklib = TikiLib::lib('trk');
extract($params, EXTR_SKIP);
if ($prefs['feature_trackers'] != 'y' || !isset($trackerId) || !($tracker = $trklib->get_tracker($trackerId))) {
......
......@@ -47,7 +47,7 @@ function wikiplugin_trackercomments_info()
}
function wikiplugin_trackercomments($data, $params)
{
global $trklib; include_once('lib/trackers/trackerlib.php');
$trklib = TikiLib::lib('trk');
global $user;
extract($params, EXTR_SKIP);
$ret = '';
......
......@@ -145,8 +145,9 @@ function wikiplugin_trackerfilter_info()
function wikiplugin_trackerfilter($data, $params)
{
global $smarty, $prefs;
global $trklib; include_once('lib/trackers/trackerlib.php');
global $prefs;
$trklib = TikiLib::lib('trk');
$smarty = TikiLib::lib('smarty');
static $iTrackerFilter = 0;
if ($prefs['feature_trackers'] != 'y') {
return $smarty->fetch("wiki-plugins/error_tracker.tpl");
......@@ -376,7 +377,7 @@ function wikiplugin_trackerfilter($data, $params)
function wikiplugin_trackerfilter_build_trackerlist_filter($input, $formats, &$ffs, &$values, &$exactValues, Tracker_Definition $tracker_definition)
{
global $trklib;
$trklib = TikiLib::lib('trk');
foreach ($input as $key =>$val) {
if (substr($key, 0, 2) == 'f_' && !empty($val) && (!is_array($val) || !empty($val[0]))) {
......@@ -495,8 +496,10 @@ function wikiplugin_trackerFilter_split_filters($filters)
function wikiplugin_trackerFilter_get_filters($trackerId=0, $listfields='', &$formats, $status='opc')
{
global $tiki_p_admin_trackers, $smarty, $tikilib;
global $trklib; include_once('lib/trackers/trackerlib.php');
global $tiki_p_admin_trackers;
$trklib = TikiLib::lib('trk');
$tikilib = TikiLib::lib('tiki');
$smarty = TikiLib::lib('smarty');
$filters = array();
if (empty($trackerId) && !empty($listfields[0])) {
$field = $trklib->get_tracker_field($listfields[0]);
......
......@@ -6,7 +6,6 @@
// $Id$
require_once('lib/ldap/filter.php');
require_once('lib/trackers/trackerlib.php');
function wikiplugin_trackerif_info()
{
......@@ -35,7 +34,7 @@ function wikiplugin_trackerif_info()
function wikiplugin_trackerif ($data, $params)
{
global $trklib;
$trklib = TikiLib::lib('trk');
$test = null;
$values = array();
$dataelse = '';
......
......@@ -90,8 +90,8 @@ function wikiplugin_trackeritemcopy_info()
function wikiplugin_trackeritemcopy( $data, $params )
{
global $smarty;
$trklib = TikiLib::lib("trk");
$smarty = TikiLib::lib('smarty');
if (!isset($params["trackerId"]) || !isset($params["copyFieldIds"])) {
return tra('Missing mandatory parameters');
......@@ -113,9 +113,8 @@ function wikiplugin_trackeritemcopy( $data, $params )
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
function items_copy($trackerId, $updateFieldIds, $updateFieldValues, $copyFieldIds, $itemIds, $linkFieldId, $itemLinkId, $copies)
{
global $trklib, $_POST;
$items_copy = function ($trackerId, $updateFieldIds, $updateFieldValues, $copyFieldIds, $itemIds, $linkFieldId, $itemLinkId, $copies) {
$trklib = TikiLib::lib('trk');
if (is_array($itemIds) == false) $itemIds = array($itemIds);
......@@ -186,7 +185,7 @@ function wikiplugin_trackeritemcopy( $data, $params )
"data" => $newitemsdata,
"list" => $newitemslist
);
}
};
$return_array = array();
$itemIds = array();
......@@ -227,7 +226,7 @@ function wikiplugin_trackeritemcopy( $data, $params )
}
}
$return_array[] = items_copy(
$return_array[] = $items_copy(
$trackerId[$key],
$updateFieldIds[$key],
$updateFieldValues[$key],
......
......@@ -79,7 +79,7 @@ function wikiplugin_trackerpasscode( $data, $params )
$data = substr($data, 0, strpos($data, '{ELSE}'));
}
// check code
global $trklib; require_once("lib/trackers/trackerlib.php");
$trklib = TikiLib::lib('trk');
$correctcode = $trklib->get_item_value($params['trackerId'], $params['itemId'], $params['fieldId']);
if ($_SESSION['wikiplugin_trackerpasscode'][$key] == $correctcode) {
return $data;
......
......@@ -110,8 +110,10 @@ function wikiplugin_trackerstat_info()
function wikiplugin_trackerstat($data, $params)
{
global $smarty, $prefs, $tiki_p_admin_trackers, $trklib, $tikilib;
include_once('lib/trackers/trackerlib.php');
global $prefs, $tiki_p_admin_trackers;
$trklib = TikiLib::lib('trk');
$tikilib = TikiLib::lib('tiki');
$smarty = TikiLib::lib('smarty');
extract($params, EXTR_SKIP);
if ($prefs['feature_trackers'] != 'y' || !isset($trackerId) || !($tracker_info = $trklib->get_tracker($trackerId))) {
......
......@@ -170,8 +170,9 @@ function wikiplugin_trackertimeline_info()
function wikiplugin_trackertimeline( $data, $params )
{
global $trklib, $smarty, $tikilib;
require_once 'lib/trackers/trackerlib.php';
$trklib = TikiLib::lib('trk');
$tikilib = TikiLib::lib('tiki');
$smarty = TikiLib::lib('smarty');
static $instance = 0;
$instance++;
......
......@@ -139,8 +139,10 @@ function wikiplugin_vote_info()
function wikiplugin_vote($data, $params)
{
global $smarty, $tikilib, $user, $prefs, $tiki_p_admin_trackers, $tiki_p_view_trackers, $trklib;
include_once('lib/trackers/trackerlib.php');
global $user, $prefs, $tiki_p_admin_trackers, $tiki_p_view_trackers;
$trklib = TikiLib::lib('trk');
$tikilib = TikiLib::lib('tiki');
$smarty = TikiLib::lib('smarty');
extract($params, EXTR_SKIP);
if ($prefs['feature_trackers'] != 'y' || !isset($trackerId) || !($tracker = $trklib->get_tracker($trackerId))) {
......
......@@ -359,7 +359,7 @@ class SemanticLib
$f_links = $this->getLinksUsing('titlefieldid', array( 'fromPage' => $page ));
$ret = array();
if (count($t_links) && count($f_links) && ctype_digit($t_links[0]['toPage']) && ctype_digit($f_links[0]['toPage'])) {
global $trklib; include_once ('lib/trackers/trackerlib.php');
$trklib = TikiLib::lib('trk');
$items = $trklib->list_items($t_links[0]['toPage'], 0, -1, '', '', $f_links[0]['toPage'], '', '', '', $suffix);
foreach ($items["data"] as $i) {
$ret[] = $i["itemId"];
......
......@@ -408,7 +408,7 @@ class WikiLib extends TikiLib
$tikilib->set_preference('wikiHomePage', $newName);
}
if ($prefs['feature_trackers'] == 'y') {
global $trklib; include_once('lib/trackers/trackerlib.php');
$trklib = TikiLib::lib('trk');
$trklib->rename_page($oldName, $newName);
}
......
......@@ -80,7 +80,6 @@ class UserWizardPreferencesInfo extends Wizard
if ($prefs['userTracker'] == 'y') {
$re = $userlib->get_usertracker($userinfo["userId"]);
if (isset($re['usersTrackerId']) and $re['usersTrackerId']) {
include_once ('lib/trackers/trackerlib.php');
$trklib = TikiLib::lib('trk');
$info = $trklib->get_item_id($re['usersTrackerId'], $trklib->get_field_id($re['usersTrackerId'], 'Login'), $userwatch);
$usertrackerId = $re['usersTrackerId'];
......
......@@ -9,7 +9,7 @@
// $Id$
require_once('tiki-setup.php');
global $trklib; include_once('lib/trackers/trackerlib.php');
$trklib = TikiLib::lib('trk');
$err = false;
if ($prefs['feature_trackers'] !== 'y' || $prefs['feature_jquery'] !== 'y' || $prefs['feature_jquery_autocomplete'] !== 'y' ||
......
......@@ -50,8 +50,7 @@ function module_last_tracker_comments($mod_reference, $module_params)
$itemId = isset($module_params["itemId"]) ? $module_params["itemId"] : 0;
global $trklib;
require_once ('lib/trackers/trackerlib.php');
$trklib = TikiLib::lib('trk');
$ranking = $trklib->list_last_comments($trackerId, $itemId, 0, $mod_reference["rows"]);
$smarty->assign('modLastModifComments', isset($ranking['data']) ? $ranking["data"] : array());
......
......@@ -61,7 +61,7 @@ function module_last_tracker_items_info()
function module_last_tracker_items($mod_reference, $module_params)
{
global $prefs, $tikilib, $smarty, $user;
global $trklib; include_once('lib/trackers/trackerlib.php');
$trklib = TikiLib::lib('trk');
$smarty->assign('module_error', '');
if ($tikilib->user_has_perm_on_object($user, $module_params['trackerId'], 'tracker', 'tiki_p_view_trackers')) {
......
......@@ -45,7 +45,7 @@ function module_trackerhelp($mod_reference, &$module_params)
$default = array('height' => 4, 'cols' => 23);
$module_params = array_merge($default, $module_params);
if (!empty($_REQUEST['trackerhelp'])) {
global $trklib; include_once('lib/trackers/trackerlib.php');
$trklib = TikiLib::lib('trk');
$trackerId = $trklib->get_tracker_by_name($_REQUEST['trackerhelp_name']);
if (empty($trackerId)) {
$tracker_info = $trklib->get_tracker($_REQUEST['trackerhelp_name']);
......
......@@ -156,8 +156,8 @@ function module_webmail_inbox($mod_reference, $module_params)
function webmail_refresh() // called in ajax mode
{
global $webmaillib, $user, $smarty, $webmail_list_page, $webmail_account, $webmail_reload, $webmail_start, $module_params, $trklib, $contactlib;
include_once('lib/trackers/trackerlib.php');
global $webmaillib, $user, $smarty, $webmail_list_page, $webmail_account, $webmail_reload, $webmail_start, $module_params, $contactlib;
$trklib = TikiLib::lib('trk');
include_once ('lib/webmail/contactlib.php');
$accountid = isset($module_params['accountid']) ? $module_params['accountid'] : 0;
......
......@@ -437,7 +437,7 @@ if ($prefs['feature_search'] !== 'y' || $prefs['unified_add_to_categ_search'] !=
}
if ( $prefs['feature_trackers'] == 'y' ) {
include_once ('lib/trackers/trackerlib.php');
$trklib = TikiLib::lib('trk');
$trackers = $trklib->list_trackers($offset, -1, 'name_asc', $find_objects);
}
......
......@@ -127,8 +127,7 @@ $channels = $tikilib->list_watches($offset, $maxRecords, $sort_mode, $find);
$smarty->assign_by_ref('cant', $channels['cant']);
$smarty->assign_by_ref('channels', $channels["data"]);
if ($prefs['feature_trackers'] == 'y') {
global $trklib;
include_once ('lib/trackers/trackerlib.php');
$trklib = TikiLib::lib('trk');
$trackers = $trklib->get_trackers_options(0, 'outboundemail', $find, 'empty');
$smarty->assign_by_ref('trackers', $trackers);
}
......
......@@ -9,7 +9,7 @@
// $Id$
require_once ('tiki-setup.php');
include_once ('lib/trackers/trackerlib.php');
$trklib = TikiLib::lib('trk');
$access->check_feature('feature_trackers');
......
......@@ -232,7 +232,7 @@ if (!empty($_REQUEST["group"])) {
if (isset($re['prorateInterval'])) $prorateInterval = $re['prorateInterval'];
if ($prefs['userTracker'] == 'y') {
if (isset($re["usersTrackerId"]) and $re["usersTrackerId"]) {
include_once ('lib/trackers/trackerlib.php');
$trklib = TikiLib::lib('trk');
$userstrackerid = $re["usersTrackerId"];
$smarty->assign('userstrackerid', $userstrackerid);
$usersFields = $trklib->list_tracker_fields($userstrackerid, 0, -1, 'position_asc', '');
......@@ -247,7 +247,7 @@ if (!empty($_REQUEST["group"])) {
if ($prefs['groupTracker'] == 'y') {
$groupFields = array();
if (isset($re["groupTrackerId"]) and $re["groupTrackerId"]) {
include_once ('lib/trackers/trackerlib.php');
$trklib = TikiLib::lib('trk');
$grouptrackerid = $re["groupTrackerId"];
$smarty->assign('grouptrackerid', $grouptrackerid);
$groupFields = $trklib->list_tracker_fields($grouptrackerid, 0, -1, 'position_asc', '');
......
......@@ -714,7 +714,7 @@ if (isset($_REQUEST['user']) and $_REQUEST['user']) {