Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 9b8beb7

Browse files
marcodingsdregad
authored andcommittedFeb 21, 2013
Fix #15522: SOAP mc_project_get_issues now reports due_date
Signed-off-by: Damien Regad <damien.regad@merckgroup.com>
1 parent 3980754 commit 9b8beb7

File tree

1 file changed

+20
-18
lines changed

1 file changed

+20
-18
lines changed
 

‎api/soap/mc_issue_api.php

+20-18
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ function mc_issue_exists( $p_username, $p_password, $p_issue_id ) {
4545
* @return Array that represents an IssueData structure
4646
*/
4747
function mc_issue_get( $p_username, $p_password, $p_issue_id ) {
48-
48+
4949
$t_user_id = mci_check_login( $p_username, $p_password );
5050
if( $t_user_id === false ) {
5151
return mci_soap_fault_login_failed();
@@ -138,13 +138,13 @@ function mci_get_category( $p_category_id ) {
138138
* @return soapval the value to be encoded as the due date
139139
*/
140140
function mci_issue_get_due_date( $p_bug ) {
141-
141+
142142
$t_value = null;
143-
143+
144144
if ( access_has_bug_level( config_get( 'due_date_view_threshold' ), $p_bug->id ) && !date_is_null( $p_bug->due_date ) ) {
145145
$t_value = $p_bug->due_date;
146146
}
147-
147+
148148
return SoapObjectsFactory::newDateTimeVar( $t_value) ;
149149
}
150150

@@ -159,9 +159,9 @@ function mci_issue_set_custom_fields( $p_issue_id, &$p_custom_fields, $p_log_ins
159159
# set custom field values on the submitted issue
160160
if( isset( $p_custom_fields ) && is_array( $p_custom_fields ) ) {
161161
foreach( $p_custom_fields as $t_custom_field ) {
162-
162+
163163
$t_custom_field = SoapObjectsFactory::unwrapObject( $t_custom_field );
164-
164+
165165
# get custom field id from object ref
166166
$t_custom_field_id = mci_get_custom_field_id_from_objectref( $t_custom_field['field'] );
167167

@@ -358,7 +358,7 @@ function mci_issue_set_monitors( $p_issue_id , $p_requesting_user_id, $p_monitor
358358
# 2. build new monitors ids
359359
$t_new_monitor_ids = array();
360360
foreach ( $p_monitors as $t_monitor ) {
361-
$t_monitor = SoapObjectsFactory::unwrapObject( $t_monitor );
361+
$t_monitor = SoapObjectsFactory::unwrapObject( $t_monitor );
362362
$t_new_monitor_ids[] = $t_monitor['id'];
363363
}
364364

@@ -678,15 +678,15 @@ function mc_issue_add( $p_username, $p_password, $p_issue ) {
678678

679679
$t_set_custom_field_error = mci_issue_set_custom_fields( $t_issue_id, $p_issue['custom_fields'], false );
680680
if ( $t_set_custom_field_error != null ) return $t_set_custom_field_error;
681-
681+
682682
if ( isset ( $p_issue['monitors'] ) )
683683
mci_issue_set_monitors( $t_issue_id , $t_user_id, $p_issue['monitors'] );
684684

685685
if( isset( $t_notes ) && is_array( $t_notes ) ) {
686686
foreach( $t_notes as $t_note ) {
687-
687+
688688
$t_note = SoapObjectsFactory::unwrapObject( $t_note );
689-
689+
690690
if( isset( $t_note['view_state'] ) ) {
691691
$t_view_state = $t_note['view_state'];
692692
} else {
@@ -742,7 +742,7 @@ function mc_issue_update( $p_username, $p_password, $p_issue_id, $p_issue ) {
742742
}
743743

744744
$g_project_override = $t_project_id; // ensure that helper_get_current_project() calls resolve to this project id
745-
745+
746746
$p_issue = SoapObjectsFactory::unwrapObject( $p_issue );
747747

748748
$t_project_id = mci_get_project_id( $p_issue['project'] );
@@ -863,7 +863,7 @@ function mc_issue_update( $p_username, $p_password, $p_issue_id, $p_issue ) {
863863

864864
$t_set_custom_field_error = mci_issue_set_custom_fields( $p_issue_id, $p_issue['custom_fields'], true );
865865
if ( $t_set_custom_field_error != null ) return $t_set_custom_field_error;
866-
866+
867867
if ( isset ( $p_issue['monitors'] ) )
868868
mci_issue_set_monitors( $p_issue_id , $t_user_id, $p_issue['monitors'] );
869869

@@ -876,9 +876,9 @@ function mc_issue_update( $p_username, $p_password, $p_issue_id, $p_issue ) {
876876
}
877877

878878
foreach ( $p_issue['notes'] as $t_note ) {
879-
879+
880880
$t_note = SoapObjectsFactory::unwrapObject( $t_note );
881-
881+
882882
if ( isset( $t_note['view_state'] ) ) {
883883
$t_view_state = $t_note['view_state'];
884884
} else {
@@ -1011,7 +1011,7 @@ function mc_issue_note_add( $p_username, $p_password, $p_issue_id, $p_note ) {
10111011
if( !bug_exists( $p_issue_id ) ) {
10121012
return SoapObjectsFactory::newSoapFault( 'Client', "Issue '$p_issue_id' does not exist." );
10131013
}
1014-
1014+
10151015
$p_note = SoapObjectsFactory::unwrapObject( $p_note );
10161016

10171017
if ( !isset( $p_note['text'] ) || is_blank( $p_note['text'] ) ) {
@@ -1107,7 +1107,7 @@ function mc_issue_note_update( $p_username, $p_password, $p_note ) {
11071107
}
11081108

11091109
$p_note = SoapObjectsFactory::unwrapObject( $p_note );
1110-
1110+
11111111
if ( !isset( $p_note['id'] ) || is_blank( $p_note['id'] ) ) {
11121112
return SoapObjectsFactory::newSoapFault('Client', "Issue note id must not be blank." );
11131113
}
@@ -1173,9 +1173,9 @@ function mc_issue_note_update( $p_username, $p_password, $p_note ) {
11731173
*/
11741174
function mc_issue_relationship_add( $p_username, $p_password, $p_issue_id, $p_relationship ) {
11751175
$t_user_id = mci_check_login( $p_username, $p_password );
1176-
1176+
11771177
$p_relationship = SoapObjectsFactory::unwrapObject( $p_relationship );
1178-
1178+
11791179
$t_dest_issue_id = $p_relationship['target_id'];
11801180
$t_rel_type = SoapObjectsFactory::unwrapObject( $p_relationship['type'] );
11811181

@@ -1399,6 +1399,8 @@ function mci_issue_data_as_array( $p_issue_data, $p_user_id, $p_lang ) {
13991399
$t_additional_information = bug_get_text_field( $t_id, 'additional_information' );
14001400
$t_issue['additional_information'] = mci_null_if_empty( mci_sanitize_xml_string( $t_additional_information ) );
14011401

1402+
$t_issue['due_date'] = SoapObjectsFactory::newDateTimeVar( $p_issue_data->due_date );
1403+
14021404
$t_issue['attachments'] = mci_issue_get_attachments( $p_issue_data->id );
14031405
$t_issue['relationships'] = mci_issue_get_relationships( $p_issue_data->id, $p_user_id );
14041406
$t_issue['notes'] = mci_issue_get_notes( $p_issue_data->id );

0 commit comments

Comments
 (0)
Please sign in to comment.