コード例 #1
0
                }
            }
            $ret["items"]["trackers"]["count"] = $count;
        }
        if ($prefs['feature_calendar'] == 'y') {
            $ret["items"]["calendar"]["label"] = tra("new calendar events");
            $ret["items"]["calendar"]["cname"] = "slvn_calendar_menu";
            $query = "select `calitemId`, `calendarId`, `created`, `lastmodif`, `name` from `tiki_calendar_items` where `lastmodif`>? order by `lastmodif` desc";
            $result = $tikilib->query($query, array((int) $last));
            $count = 0;
            while ($res = $result->fetchRow()) {
                if ($userlib->user_has_perm_on_object($user, $res['calendarId'], 'calendar', 'tiki_p_view_calendar')) {
                    $ret["items"]["calendar"]["list"][$count]["href"] = 'tiki-calendar_edit_item.php?viewcalitemId=' . $res['calitemId'];
                    $ret["items"]["calendar"]["list"][$count]["title"] = $tikilib->get_short_datetime($res["lastmodif"]);
                    $ret["items"]["calendar"]["list"][$count]["label"] = $res['name'];
                    $count++;
                }
            }
            $ret["items"]["calendar"]["count"] = $count;
        }
        //get the total of items
        $ret["cant"] = 0;
        foreach ($ret["items"] as $item) {
            $ret["cant"] += $item["count"];
        }
        return $ret;
    }
}
$slvn_info = since_last_visit_new($user, $module_params);
$smarty->assign('slvn_info', $slvn_info);
$smarty->assign('nonums', isset($module_params["nonums"]) ? $module_params["nonums"] : 'n');
コード例 #2
0
            $query = "select `itemId`, `trackerId`, `created`, `lastModif`  from `tiki_tracker_items` where `lastModif`>? order by `lastModif` desc";
            $result = $tikilib->query($query, array((int) $last));
            $count = 0;
            global $cachelib;
            require_once 'lib/cache/cachelib.php';
            while ($res = $result->fetchRow()) {
                if ($userlib->user_has_perm_on_object($user, $res['trackerId'], 'trackers', 'tiki_p_view_trackers')) {
                    $ret["items"]["trackers"]["list"][$count]["href"] = "tiki-view_tracker_item.php?itemId=" . $res["itemId"];
                    $ret["items"]["trackers"]["list"][$count]["title"] = $tikilib->get_short_datetime($res["lastModif"]);
                    //routine to verify field in tracker that should appear as label
                    $cacheKey = 'trackerItemLabel' . $res['itemId'];
                    if (!$cachelib->isCached($cacheKey)) {
                        $query = "select `fieldId` from `tiki_tracker_fields` where `isMain` = ? and `trackerId` = ? order by `position`";
                        $fieldId = $tikilib->getOne($query, array('y', $res['trackerId']));
                        $query = "select `value` from `tiki_tracker_item_fields` where `fieldId` = ? and `itemId` = ?";
                        $label = $tikilib->getOne($query, array($fieldId, $res['itemId']));
                        $cachelib->cacheItem($cacheKey, $label);
                    } else {
                        $label = $cachelib->getCached($cacheKey);
                    }
                    $ret["items"]["trackers"]["list"][$count]["label"] = $label;
                    $count++;
                }
            }
            $ret["items"]["trackers"]["count"] = $count;
        }
        return $ret;
    }
}
$slvn_info = since_last_visit_new($user);
$smarty->assign('slvn_info', $slvn_info);