<?php
// (c) Copyright 2002-2012 by authors of the Tiki Wiki CMS Groupware Project
// 
// All Rights Reserved. See copyright.txt for details and a complete list of authors.
// Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details.
// $Id: tiki-admin_metrics.php 41017 2012-04-21 15:22:34Z robertplummer $

require_once ('tiki-setup.php');

$access->check_permission('tiki_p_admin');
$access->check_feature('feature_metrics_dashboard');

require_once 'lib/admin/adminlib.php';
require_once("lib/metrics/metricslib.php");
$metricslib = new MetricsLib($dbTiki);
$metric_range_all = $metricslib->getMetricsRangeAll();
$smarty->assign('metric_range_all', $metric_range_all);
$metric_datatype_all = $metricslib->getMetricsDatatypeAll();
$smarty->assign('metric_datatype_all', $metric_datatype_all);
$headerlib->add_cssfile("css/metrics.css");

$dsn_list = $adminlib->list_dsn(0, -1, 'name_asc', '');
$smarty->assign('dsn_list', $dsn_list['data']);

/* Edit or delete a metric */
if (isset($_REQUEST["metric_submit"])) {
	if (empty($_REQUEST["metric_name"])) {
	    $smarty->assign('msg', tra("Cannot create or update metric: You need to specify a name for the metric."));
	    $smarty->display("error.tpl");
	    die;
	}
Example #2
0
 * use your version of this file under the terms of the MPL, indicate your
 * decision by deleting the provisions above and replace them with the notice
 * and other provisions required by the GPL or the LGPL. If you do not delete
 * the provisions above, a recipient may use your version of this file under
 * the terms of any one of the MPL, the GPL or the LGPL.
 *
 * ***** END LICENSE BLOCK ***** */

// Initialization
require_once('tiki-setup.php');
require_once("lib/metrics/metricslib.php");
require_once("lib/metrics/input-validation.php");

$access->check_feature('feature_metrics_dashboard');

$metricslib = new MetricsLib($dbTiki);

$tabs = $metricslib->getAllTabs();

$range = isset( $_REQUEST['range'] ) ? $_REQUEST['range'] : null;
$date_from = isset( $_REQUEST['date_from'] ) ? $_REQUEST['date_from'] : null;
$date_to = isset( $_REQUEST['date_to'] ) ? $_REQUEST['date_to'] : null;
$converted_range = convert_date_range($range, $date_from, $date_to);
if (!empty($converted_range['msg'])) {
	$smarty->assign('msg', $converted_range['msg']);
	$smarty->display('error.tpl');
	die;
}
$metrics_range = $converted_range['date_from'] . tra(' to ') . $converted_range['date_to'];
$smarty->assign('date_from', $converted_range['date_from']);
$smarty->assign('date_to', $converted_range['date_to']);
Example #3
0
 * and other provisions required by the GPL or the LGPL. If you do not delete
 * the provisions above, a recipient may use your version of this file under
 * the terms of any one of the MPL, the GPL or the LGPL.
 *
 * ***** END LICENSE BLOCK ***** */

// Initialization
define('COLUMN_MAXLEN', 64);

require_once('tiki-setup.php');

$access->check_feature('feature_metrics_dashboard');

require_once("lib/metrics/metricslib.php");
require_once("lib/metrics/input-validation.php");
$metricslib = new MetricsLib;

$tab_id = $_REQUEST['tab_id'];
$range = $_REQUEST['range'];
$date_from = $_REQUEST['date_from'];
$date_to = $_REQUEST['date_to'];
$date_field = $_REQUEST['date_field'];

require_once 'lib/cache/pagecache.php';
$pageCache = Tiki_PageCache::create()
	->requiresPreference('metrics_cache_output')
	->addKeys($_REQUEST, array( 'tab_id', 'range', 'date_from', 'date_to', 'date_field' ))
	->applyCache();

$metrics_notify = '';
if (empty($date_field)) {