Exemplo n.º 1
0
function elggadmin_pagesetup()
{
    // first login?
    global $CFG;
    if (user_flag_get('admin', $_SESSION['userid']) && !isset($CFG->elggadmin_installed)) {
        $CFG->elggadmin_installed = true;
        set_config('elggadmin_installed', true);
        header_redirect(get_url(null, 'elggadmin::config'), __gettext('Welcome to the Elgg configuration manager!'));
    }
    if (context() == 'admin') {
        if (!plugin_is_loaded('pages')) {
            elgg_messages_add(__gettext('Error: <code>elggadmin</code> plugin needs <code>pages</code> plugin to run'));
        } else {
            pages_submenu_add('elggadmin', __gettext('Site administration'), get_url(null, 'elggadmin::'), 10);
        }
    } elseif (context() == 'elggadmin') {
        if (!plugin_is_loaded('pages')) {
            elgg_messages_add(__gettext('Error: <code>elggadmin</code> plugin needs <code>pages</code> plugin to run'));
            header_redirect(get_url(null, 'admin::'));
        }
        // submenu options
        pages_submenu_add('elggadmin', __gettext('Configuration manager'), get_url(null, 'elggadmin::'));
        pages_submenu_add('elggadmin:theme', __gettext('Default theme editor'), get_url(null, 'elggadmin::theme'));
        pages_submenu_add('elggadmin:frontpage', __gettext('Frontpage template editor'), get_url(null, 'elggadmin::frontpage'));
        pages_submenu_add('elggadmin:logs', __gettext('Error log'), get_url(null, 'elggadmin::logs'));
        sidebar_add(50, 'sidebar-' . elggadmin_currentpage(), elggadmin_sidebar());
        // clear sidebar
        $clear_sidebar[] = 'sidebar-profile';
        $clear_sidebar[] = 'sidebar-' . elggadmin_currentpage();
        sidebar_remove($clear_sidebar, true);
        if (elggadmin_is_404()) {
            header('HTTP/1.0 404 Not Found');
        }
    }
}
Exemplo n.º 2
0
/**
 * Determine if the Product Matrix integration is enabled, and trigger
 * an error if integration is enabled but the plugin is not running.
 * @param boolean Trigger error
 * @return boolean Integration enabled
 */
function Source_PVM($p_trigger_error = true)
{
    if (config_get('plugin_Source_enable_product_matrix')) {
        if (plugin_is_loaded('ProductMatrix') || !$p_trigger_error) {
            return true;
        } else {
            trigger_error(ERROR_GENERIC, ERROR);
        }
    } else {
        return false;
    }
}
					value="<?php 
        echo $row['storyPoints'];
        ?>
"></td>
				<td><a href="view.php?id=<?php 
        echo $row['id'];
        ?>
"><?php 
        echo $row['id'];
        ?>
</a>
				</td>
				<td width="20">
				<?php 
        $functionName = 'loadUserstoryNoExpert';
        if (plugin_is_loaded('agileMantisExpert')) {
            $functionName = 'loadUserstoryExpert';
        }
        ?>
				<img src="<?php 
        echo AGILEMANTIS_PLUGIN_URL;
        ?>
images/info-icon.png"
					alt="<?php 
        echo plugin_lang_get('product_backlog_show_info');
        ?>
"
					onclick="<?php 
        echo $functionName;
        ?>
(<?php 
Exemplo n.º 4
0
            if (plugin_config_get('gadiv_tracker_planned_costs') != $f_gadiv_tracker_planned_costs) {
                plugin_config_set('gadiv_tracker_planned_costs', $f_gadiv_tracker_planned_costs);
            }
            $agilemantis_team->changeCustomFieldFilter("PlannedWork", plugin_config_get('gadiv_tracker_planned_costs'));
            $backlogProjects = $agilemantis_project->getProjectsInBacklogs();
            if (!empty($backlogProjects)) {
                foreach ($backlogProjects as $num => $row) {
                    $agilemantis_project->addAdditionalProjectFields($row['project_id']);
                }
            }
        }
    }
} else {
    $throw_error_7 = true;
}
if (plugin_is_loaded('agileMantisExpert') && $_FILES['license']['tmp_name'] != "") {
    if ($_FILES['license']['name'] == 'license.txt') {
        $uploadfile = config_get_global('plugin_path') . 'agileMantisExpert' . DIRECTORY_SEPARATOR . 'license' . DIRECTORY_SEPARATOR . basename($_FILES['license']['name']);
        if (!move_uploaded_file($_FILES['license']['tmp_name'], $uploadfile)) {
            $throw_error_5 = true;
            $file_upload = true;
        }
    } else {
        $throw_error_5 = true;
    }
}
# change task unit action
if ($_POST['changeUnit'] == 'deleteUnit') {
    function getTasksWithWrontUnit($task_list, $sprint_name = "")
    {
        global $agilemantis_userstory;
Exemplo n.º 5
0
$bug_ids = array();
while ($row = db_fetch_array($result))
{
	$bug_ids[] = $row["id"];
}

bug_cache_array_rows($bug_ids);
$bugs = array();
$status = array();
$columns = plugin_config_get("board_columns");
$sevcolors = plugin_config_get("board_severity_colors");
$rescolors = plugin_config_get("board_resolution_colors");
$sprint_length = plugin_config_get("sprint_length");

$use_source = plugin_is_loaded("Source");
$resolved_count = 0;

foreach ($bug_ids as $bug_id)
{
	$bug = bug_get($bug_id);
	$bugs[$bug->status][] = $bug;

	$source_count[$bug_id] = $use_source ? count(SourceChangeset::load_by_bug($bug_id)) : "";
	if ($bug->status >= $resolved_threshold)
	{
		$resolved_count++;
	}
}

$bug_count = count($bug_ids);
Exemplo n.º 6
0
 */
require_once 'core.php';
require_api('config_api.php');
require_api('constant_inc.php');
require_api('gpc_api.php');
require_api('plugin_api.php');
$t_plugin_path = config_get('plugin_path');
$f_page = gpc_get_string('page');
if (!preg_match('/^([a-zA-Z0-9_-]+)\\/([a-zA-Z0-9_-]+[\\/a-zA-Z0-9_-]*)/', $f_page, $t_matches)) {
    error_parameters($f_page);
    trigger_error(ERROR_PLUGIN_INVALID_PAGE, ERROR);
}
$t_basename = $t_matches[1];
$t_action = $t_matches[2];
$t_plugin = plugin_get($t_basename);
if (plugin_needs_upgrade($t_plugin)) {
    error_parameters($t_basename);
    trigger_error(ERROR_PLUGIN_UPGRADE_NEEDED, ERROR);
}
# Plugin can be registered but fail to load e.g. due to unmet dependencies
if (!plugin_is_loaded($t_basename)) {
    error_parameters($t_basename);
    trigger_error(ERROR_PLUGIN_NOT_LOADED, ERROR);
}
$t_page = $t_plugin_path . $t_basename . '/pages/' . $t_action . '.php';
if (!is_file($t_page)) {
    error_parameters($t_basename, $t_action);
    trigger_error(ERROR_PLUGIN_PAGE_NOT_FOUND, ERROR);
}
plugin_push_current($t_basename);
include $t_page;
Exemplo n.º 7
0
<?php

# Copyright (c) 2012 John Reese
# Licensed under the MIT license
access_ensure_global_level(plugin_config_get('view_threshold'));
require_once config_get('plugin_path') . 'Source' . DIRECTORY_SEPARATOR . 'Source.FilterAPI.php';
list($t_filter, $t_permalink) = Source_Generate_Filter();
$t_date_start = is_null($t_filter->filters['date_start']->value) ? 'start' : $t_filter->filters['date_start']->value;
$t_date_end = is_null($t_filter->filters['date_end']->value) ? 'now' : $t_filter->filters['date_end']->value;
html_page_top1(plugin_lang_get('title'));
html_page_top2();
?>

<?php 
if (plugin_is_loaded('jQuery')) {
    ?>
<script src="<?php 
    echo plugin_file('search.js');
    ?>
"></script>
<?php 
}
?>

<br/>
<form action="<?php 
echo helper_mantis_url('plugin.php');
?>
" method="get">
<input type="hidden" name="page" value="Source/search"/>
<table class="width75 SourceFilters" align="center" cellspacing="1">
Exemplo n.º 8
0
    $query .= " AND target_version=" . db_param();
    $params[] = $target_version;
}
if ($category_name) {
    $query .= " AND category_id IN (" . join(', ', $category_ids) . ")";
}
$query .= ' ORDER BY status ASC, priority DESC, id DESC';
$result = db_query_bound($query, $params);
$bug_ids = array();
while ($row = db_fetch_array($result)) {
    $bug_ids[] = $row['id'];
}
bug_cache_array_rows($bug_ids);
$bugs = array();
$status = array();
$use_source = plugin_is_loaded('Source');
$resolved_count = 0;
foreach ($bug_ids as $bug_id) {
    $bug = bug_get($bug_id);
    $bugs[$bug->status][] = $bug;
    $source_count[$bug_id] = $use_source ? count(SourceChangeset::load_by_bug($bug_id)) : '';
    if ($bug->status >= $resolved_threshold) {
        $resolved_count++;
    }
}
$bug_count = count($bug_ids);
if ($bug_count > 0) {
    $resolved_percent = floor(100 * $resolved_count / $bug_count);
    $bug_percentage_by_column = array();
    foreach ($columns as $column => $statuses) {
        $bug_count_for_column = 0;