Skip to content

Commit

Permalink
Add filter for the “last updated“ date in the soap api
Browse files Browse the repository at this point in the history
Currently the soap method `mc_filter_search_issues` allows to filter
the result set by the “sumbitted” date of the issue. But not with the
“last updated” date.

For a task, we need to get the latest updated issues, to execute some
business logic. Therefore expand the soap api, with this additional
filter, so that's now also posssible to filter the result-set of the
search with the last “updated date”.

- Add this new filter to the `mc_filter_api`, simular like the
  “submitted date”.
- Add it also the the wsdl, so that this new api is documented for
  other programms.

Fixes #24717
  • Loading branch information
raimu authored and vboctor committed Sep 4, 2018
1 parent bbd8f79 commit 7bbd833
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
6 changes: 6 additions & 0 deletions api/soap/mantisconnect.wsdl
Expand Up @@ -296,6 +296,12 @@
<xsd:element name="end_day" type="xsd:integer" minOccurs="0"/>
<xsd:element name="end_month" type="xsd:integer" minOccurs="0"/>
<xsd:element name="end_year" type="xsd:integer" minOccurs="0"/>
<xsd:element name="last_update_start_day" type="xsd:integer" minOccurs="0"/>
<xsd:element name="last_update_start_month" type="xsd:integer" minOccurs="0"/>
<xsd:element name="last_update_start_year" type="xsd:integer" minOccurs="0"/>
<xsd:element name="last_update_end_day" type="xsd:integer" minOccurs="0"/>
<xsd:element name="last_update_end_month" type="xsd:integer" minOccurs="0"/>
<xsd:element name="last_update_end_year" type="xsd:integer" minOccurs="0"/>
<xsd:element name="tag_string" type="tns:StringArray" minOccurs="0"/>
<xsd:element name="tag_select" type="tns:IntegerArray" minOccurs="0"/>
<xsd:element name="custom_fields" type="tns:FilterCustomFieldArray" minOccurs="0"/>
Expand Down
14 changes: 14 additions & 0 deletions api/soap/mc_filter_api.php
Expand Up @@ -61,6 +61,12 @@
'end_day' => FILTER_PROPERTY_DATE_SUBMITTED_END_DAY,
'end_month' => FILTER_PROPERTY_DATE_SUBMITTED_END_MONTH,
'end_year' => FILTER_PROPERTY_DATE_SUBMITTED_END_YEAR,
'last_update_start_day' => FILTER_PROPERTY_LAST_UPDATED_START_DAY,
'last_update_start_month' => FILTER_PROPERTY_LAST_UPDATED_START_MONTH,
'last_update_start_year' => FILTER_PROPERTY_LAST_UPDATED_START_YEAR,
'last_update_end_day' => FILTER_PROPERTY_LAST_UPDATED_END_DAY,
'last_update_end_month' => FILTER_PROPERTY_LAST_UPDATED_END_MONTH,
'last_update_end_year' => FILTER_PROPERTY_LAST_UPDATED_END_YEAR,
'tag_string' => FILTER_PROPERTY_TAG_STRING,
'tag_select' => FILTER_PROPERTY_TAG_SELECT,
);
Expand Down Expand Up @@ -350,6 +356,14 @@ function mci_filter_search_get_rows( $p_user_id, $p_filter_search, $p_page_numbe
|| isset ( $t_filter[FILTER_PROPERTY_DATE_SUBMITTED_END_YEAR] ) ) {
$t_filter[FILTER_PROPERTY_FILTER_BY_DATE_SUBMITTED] = 'on';
}
if( isset ( $t_filter[FILTER_PROPERTY_LAST_UPDATED_START_DAY] )
|| isset ( $t_filter[FILTER_PROPERTY_LAST_UPDATED_START_MONTH] )
|| isset ( $t_filter[FILTER_PROPERTY_LAST_UPDATED_START_YEAR] )
|| isset ( $t_filter[FILTER_PROPERTY_LAST_UPDATED_END_DAY] )
|| isset ( $t_filter[FILTER_PROPERTY_LAST_UPDATED_END_MONTH] )
|| isset ( $t_filter[FILTER_PROPERTY_LAST_UPDATED_END_YEAR] ) ) {
$t_filter[FILTER_PROPERTY_FILTER_BY_LAST_UPDATED_DATE] = 'on';
}

$t_filter = filter_ensure_valid_filter( $t_filter );

Expand Down

0 comments on commit 7bbd833

Please sign in to comment.