function getMantisBugByProjectName($project_name, $status = "") { $project_id = project_get_id_by_name($project_name); if ($project_id == 0) { return 0; } return getMantisBugByProjectId($project_id, $status); }
function ensure_project_exists($p_name, $p_description) { $t_project_id = project_get_id_by_name($p_name); if ($t_project_id !== false) { return $t_project_id; } return project_create('MantisBT', 'Mantis Bug Tracker', 50); }
function mci_get_project_id($p_project) { if ((int) $p_project['id'] != 0) { $t_project_id = (int) $p_project['id']; } else { $t_project_id = project_get_id_by_name($p_project['name']); } return $t_project_id; }
function mci_get_project_id($p_project) { if (isset($p_project['id']) && (int) $p_project['id'] != 0) { $t_project_id = (int) $p_project['id']; } else { if (isset($p_project['name']) && !is_blank($p_project['name'])) { $t_project_id = project_get_id_by_name($p_project['name']); } else { $t_project_id = ALL_PROJECTS; } } return $t_project_id; }
public function getProject($proj) { if (MANTIS_LOCAL) { $ret = new StdClass(); $ret->id = project_get_id_by_name($proj); } else { $projects = $this->client->mc_projects_get_user_accessible(MANTIS_USER, MANTIS_PWD); foreach ($projects as $p) { if ($p->name == $proj) { $ret = $p; } } } return $ret; }
/** * Print header for the specified project * @param string $p_project_name project name to display * @return null */ function print_project_header_changelog($p_project_name) { echo '<br /><span class="pagetitle">', string_display_line($p_project_name), ' - ', lang_get('changelog'), '</span><br />'; echo '<tt>'; } $t_user_id = auth_get_current_user_id(); $f_project = gpc_get_string('project', ''); if (is_blank($f_project)) { $f_project_id = gpc_get_int('project_id', -1); } else { $f_project_id = project_get_id_by_name($f_project); if ($f_project_id === 0) { trigger_error(ERROR_PROJECT_NOT_FOUND, ERROR); } } $f_version = gpc_get_string('version', ''); if (is_blank($f_version)) { $f_version_id = gpc_get_int('version_id', -1); # If both version_id and project_id parameters are supplied, then version_id take precedence. if ($f_version_id == -1) { if ($f_project_id == -1) { $t_project_id = helper_get_current_project(); } else { $t_project_id = $f_project_id; } } else {
/** * Get the id of a project via the project's name. * * @param string $p_username The name of the user trying to access the versions. * @param string $p_password The password of the user. * @param string $p_project_name The name of the project to retrieve. * @return int The id of the project with the given name, 0 if there is no such project. */ function mc_project_get_id_from_name($p_username, $p_password, $p_project_name) { $t_user_id = mci_check_login($p_username, $p_password); if ($t_user_id === false) { return mci_soap_fault_login_failed(); } return project_get_id_by_name($p_project_name); }