Skip to content

Commit b41b528

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 3833d57 commit b41b528

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

@@ -677,15 +677,15 @@ function mc_issue_add( $p_username, $p_password, $p_issue ) {
677677

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

684684
if( isset( $t_notes ) && is_array( $t_notes ) ) {
685685
foreach( $t_notes as $t_note ) {
686-
686+
687687
$t_note = SoapObjectsFactory::unwrapObject( $t_note );
688-
688+
689689
if( isset( $t_note['view_state'] ) ) {
690690
$t_view_state = $t_note['view_state'];
691691
} else {
@@ -741,7 +741,7 @@ function mc_issue_update( $p_username, $p_password, $p_issue_id, $p_issue ) {
741741
}
742742

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

747747
$t_project_id = mci_get_project_id( $p_issue['project'] );
@@ -862,7 +862,7 @@ function mc_issue_update( $p_username, $p_password, $p_issue_id, $p_issue ) {
862862

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

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

877877
foreach ( $p_issue['notes'] as $t_note ) {
878-
878+
879879
$t_note = SoapObjectsFactory::unwrapObject( $t_note );
880-
880+
881881
if ( isset( $t_note['view_state'] ) ) {
882882
$t_view_state = $t_note['view_state'];
883883
} 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'] ) ) {
@@ -1111,7 +1111,7 @@ function mc_issue_note_update( $p_username, $p_password, $p_note ) {
11111111
}
11121112

11131113
$p_note = SoapObjectsFactory::unwrapObject( $p_note );
1114-
1114+
11151115
if ( !isset( $p_note['id'] ) || is_blank( $p_note['id'] ) ) {
11161116
return SoapObjectsFactory::newSoapFault('Client', "Issue note id must not be blank." );
11171117
}
@@ -1177,9 +1177,9 @@ function mc_issue_note_update( $p_username, $p_password, $p_note ) {
11771177
*/
11781178
function mc_issue_relationship_add( $p_username, $p_password, $p_issue_id, $p_relationship ) {
11791179
$t_user_id = mci_check_login( $p_username, $p_password );
1180-
1180+
11811181
$p_relationship = SoapObjectsFactory::unwrapObject( $p_relationship );
1182-
1182+
11831183
$t_dest_issue_id = $p_relationship['target_id'];
11841184
$t_rel_type = SoapObjectsFactory::unwrapObject( $p_relationship['type'] );
11851185

@@ -1373,6 +1373,8 @@ function mci_issue_data_as_array( $p_issue_data, $p_user_id, $p_lang ) {
13731373
$t_additional_information = bug_get_text_field( $t_id, 'additional_information' );
13741374
$t_issue['additional_information'] = mci_null_if_empty( mci_sanitize_xml_string( $t_additional_information ) );
13751375

1376+
$t_issue['due_date'] = SoapObjectsFactory::newDateTimeVar( $p_issue_data->due_date );
1377+
13761378
$t_issue['attachments'] = mci_issue_get_attachments( $p_issue_data->id );
13771379
$t_issue['relationships'] = mci_issue_get_relationships( $p_issue_data->id, $p_user_id );
13781380
$t_issue['notes'] = mci_issue_get_notes( $p_issue_data->id );

0 commit comments

Comments
 (0)
Please sign in to comment.