diff --git a/api/soap/mantisconnect.wsdl b/api/soap/mantisconnect.wsdl index 1e3faac..7d5f2ce 100644 --- a/api/soap/mantisconnect.wsdl +++ b/api/soap/mantisconnect.wsdl @@ -164,6 +164,24 @@ + + + + + + + + + + + + + + + + + + @@ -435,6 +453,12 @@ + + + + + + @@ -843,6 +867,11 @@ + + Get the history of the issue with the specified id. + + + Get the latest submitted issue in the specified project. @@ -1171,6 +1200,11 @@ + + + + + diff --git a/api/soap/mc_issue_api.php b/api/soap/mc_issue_api.php index 410705a..a3e7693 100644 --- a/api/soap/mc_issue_api.php +++ b/api/soap/mc_issue_api.php @@ -45,7 +45,7 @@ * @return Array that represents an IssueData structure */ function mc_issue_get( $p_username, $p_password, $p_issue_id ) { - + $t_user_id = mci_check_login( $p_username, $p_password ); if( $t_user_id === false ) { return mci_soap_fault_login_failed(); @@ -120,6 +120,42 @@ } /** +* Get history details about an issue. +* +* @param string $p_username The name of the user trying to access the issue. +* @param string $p_password The password of the user. +* @param integer $p_issue_id The id of the issue to retrieve. +* @return Array that represents a HistoryDataArray structure +*/ +function mc_issue_get_history( $p_username, $p_password, $p_issue_id ) { + + $t_user_id = mci_check_login( $p_username, $p_password ); + if( $t_user_id === false ) { + return mci_soap_fault_login_failed(); + } + + $t_lang = mci_get_user_lang( $t_user_id ); + + if( !bug_exists( $p_issue_id ) ) { + return SoapObjectsFactory::newSoapFault('Client', 'Issue does not exist'); + } + + $t_project_id = bug_get_field( $p_issue_id, 'project_id' ); + if( !mci_has_readonly_access( $t_user_id, $t_project_id ) ) { + return mci_soap_fault_access_denied( $t_user_id ); + } + + if( !access_has_bug_level( VIEWER, $p_issue_id, $t_user_id ) ){ + return mci_soap_fault_access_denied( $t_user_id ); + } + + $t_bug_history = history_get_raw_events_array($p_issue_id, $t_user_id); + + return $t_bug_history; + +} + +/** * Returns the category name, possibly null if no category is assigned * * @param int $p_category_id