/** * Returns html string to display * @return string */ public function html() { $t_string = $this->tag ? lang_get('timeline_issue_tagged') : lang_get('timeline_issue_untagged'); $t_tag_row = tag_get_by_name($this->tag_name); $t_html = $this->html_start(); $t_html .= '<div class="action">' . sprintf($t_string, user_get_name($this->user_id), string_get_bug_view_link($this->issue_id), $t_tag_row ? tag_get_link($t_tag_row) : $this->tag_name) . '</div>'; $t_html .= $this->html_end(); return $t_html; }
/** * Creates a tag * * @param string $p_username The user's username * @param string $p_password The user's password * @param array $p_tag The tag to create * @return soap_fault|integer */ function mc_tag_add($p_username, $p_password, $p_tag) { $t_user_id = mci_check_login($p_username, $p_password); if ($t_user_id === false) { return mci_soap_fault_login_failed(); } if (!access_has_global_level(config_get('tag_create_threshold'))) { return mci_soap_fault_access_denied($t_user_id); } $t_valid_matches = array(); $t_tag_name = $p_tag['name']; $t_tag_description = array_key_exists('description', $p_tag) ? $p_tag['description'] : ''; if (!tag_name_is_valid($t_tag_name, $t_valid_matches)) { return new soap_fault('client', '', 'Invalid tag name : "' . $t_tag_name . '"'); } $t_matching_by_name = tag_get_by_name($t_tag_name); if ($t_matching_by_name != false) { return new soap_fault('client', '', 'A tag with the same name already exists , id: ' . $t_matching_by_name['id']); } return tag_create($t_tag_name, $t_user_id, $t_tag_description); }
/** * Creates a tag * * @param string $p_username The user's username * @param string $p_password The user's password * @param array $p_tag The tag to create * @return soap_fault|integer */ function mc_tag_add($p_username, $p_password, $p_tag) { $t_user_id = mci_check_login($p_username, $p_password); if ($t_user_id === false) { return mci_soap_fault_login_failed(); } if (!access_has_global_level(config_get('tag_create_threshold'))) { return mci_soap_fault_access_denied($t_user_id); } $t_valid_matches = array(); $p_tag = SoapObjectsFactory::unwrapObject($p_tag); $t_tag_name = $p_tag['name']; $t_tag_description = array_key_exists('description', $p_tag) ? $p_tag['description'] : ''; if (!tag_name_is_valid($t_tag_name, $t_valid_matches)) { return SoapObjectsFactory::newSoapFault('Client', 'Invalid tag name : "' . $t_tag_name . '"'); } $t_matching_by_name = tag_get_by_name($t_tag_name); if ($t_matching_by_name != false) { return SoapObjectsFactory::newSoapFault('Client', 'A tag with the same name already exists , id: ' . $t_matching_by_name['id']); } log_event(LOG_WEBSERVICE, "creating tag '{$t_tag_name}' for user '{$t_user_id}'"); return tag_create($t_tag_name, $t_user_id, $t_tag_description); }
/** * Parse a filter string to extract existing and new tags. * When given a string, parses for tag names separated by configured separator, * then returns an array of tag rows for each tag. Existing tags get the full * row of information returned. If the tag does not exist, a row is returned with * id = -1 and the tag name, and if the name is invalid, a row is returned with * id = -2 and the tag name. The resulting array is then sorted by tag name. * @param string Filter string to parse * @return array Rows of tags parsed from filter string */ function tag_parse_filters($p_string) { $t_tags = array(); $t_prefix = '[+-]{0,1}'; $t_strings = explode(config_get('tag_separator'), $p_string); foreach ($t_strings as $t_name) { $t_name = trim($t_name); $t_matches = array(); if (!is_blank($t_name) && tag_name_is_valid($t_name, $t_matches, $t_prefix)) { $t_tag_row = tag_get_by_name($t_matches[1]); if ($t_tag_row !== false) { $t_filter = utf8_substr($t_name, 0, 1); if ('+' == $t_filter) { $t_tag_row['filter'] = 1; } else { if ('-' == $t_filter) { $t_tag_row['filter'] = -1; } else { $t_tag_row['filter'] = 0; } } $t_tags[] = $t_tag_row; } } else { continue; } } usort($t_tags, 'tag_cmp_name'); return $t_tags; }
*/ 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;