Esempio n. 1
0
/**
 * Delete a tag with the given ID.
 * @param integer Tag ID
 */
function tag_delete($p_tag_id)
{
    tag_ensure_exists($p_tag_id);
    access_ensure_global_level(config_get('tag_edit_threshold'));
    $t_bugs = tag_get_bugs_attached($p_tag_id);
    foreach ($t_bugs as $t_bug_id) {
        tag_bug_detach($p_tag_id, $t_bug_id);
    }
    $c_tag_id = db_prepare_int($p_tag_id);
    $t_tag_table = db_get_table('tag');
    $t_bug_tag_table = db_get_table('bug_tag');
    $query = "DELETE FROM {$t_tag_table}\n\t\t\t\t\tWHERE id=" . db_param();
    db_query_bound($query, array($c_tag_id));
    return true;
}
Esempio n. 2
0
/**
 * Delete a tag with the given ID.
 * @param integer $p_tag_id The tag ID to delete.
 * @return boolean
 */
function tag_delete($p_tag_id)
{
    tag_ensure_exists($p_tag_id);
    access_ensure_global_level(config_get('tag_edit_threshold'));
    $t_bugs = tag_get_bugs_attached($p_tag_id);
    foreach ($t_bugs as $t_bug_id) {
        tag_bug_detach($p_tag_id, $t_bug_id);
    }
    $t_query = 'DELETE FROM {tag} WHERE id=' . db_param();
    db_query($t_query, array($p_tag_id));
    return true;
}
Esempio n. 3
0
/**
 * Delete a tag with the given ID.
 * @param integer Tag ID
 */
function tag_delete($p_tag_id)
{
    tag_ensure_exists($p_tag_id);
    access_ensure_global_level(config_get('tag_edit_threshold'));
    $t_bugs = tag_get_bugs_attached($p_tag_id);
    foreach ($t_bugs as $t_bug_id) {
        tag_bug_detach($p_tag_id, $t_bug_id);
    }
    $c_tag_id = db_prepare_int($p_tag_id);
    $t_tag_table = config_get('mantis_tag_table');
    $t_bug_tag_table = config_get('mantis_bug_tag_table');
    $query = "DELETE FROM {$t_tag_table}\r\n\t\t\t\t\tWHERE id='{$c_tag_id}'";
    db_query($query);
    return true;
}
 */
require_once 'icon_api.php';
/**
 * requires columns_api
 */
require_once 'columns_api.php';
require_once "plugin_bug_api.php";
// Make sure that the user is porperly authenticated and to not access directly the page from the outside by-passing security gate
//auth_ensure_user_authenticated();
// Avoid indexing of the page, although it does not do much as Google and co do not have access behind the Eurocontrol gate
html_robots_noindex();
// $_POST['bugid'] = "ATR1685-V8B1";
if (!isset($_POST['bugid'])) {
    $_POST['bugid'] = "07 – Target V8B3-U1";
}
$tab_bug_ids = tag_get_bugs_attached(tag_get_by_name($_POST['bugid'])['id']);
print "[ ";
// print_r($tab_bug_ids);
for ($i = 0; $i < count($tab_bug_ids); $i++) {
    //print $tab_bug_ids[$i];
    //$t_bug_id = get_bug_id_from_artas_id( $tab_bug_ids[$i]);
    $t_bug = bug_get($tab_bug_ids[$i]);
    print " { \"summary\" : \"" . htmlentities($t_bug->summary) . "\", ";
    $query = "SELECT value FROM `mantis_custom_field_string_table` WHERE bug_id = " . $t_bug->id . " and field_id = 55";
    $result = db_query($query);
    $tab = db_fetch_array($result);
    if ($tab['value'] == "") {
        $query = "SELECT value FROM `mantis_custom_field_string_table` WHERE bug_id = " . $t_bug->id . " and field_id = 56";
        $result = db_query($query);
        $tab = db_fetch_array($result);
        $tab['value'] = "ACP" . $tab['value'] . "-" . $t_bug->version;