Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Datovka projects
mobile Datovka
Commits
ee4bdc6e
Commit
ee4bdc6e
authored
Sep 20, 2018
by
Karel Slaný
Committed by
Martin Straka
Sep 25, 2018
Browse files
Added Service::containsMandatoryUserFields().
parent
61fa9c20
Changes
4
Hide whitespace changes
Inline
Side-by-side
src/datovka_shared/gov_services/service/gov_service.cpp
View file @
ee4bdc6e
...
...
@@ -84,6 +84,30 @@ bool Gov::Service::haveAllMandatoryFields(void) const
return
true
;
}
bool
Gov
::
Service
::
containsMandatoryUserFields
(
void
)
const
{
foreach
(
const
FormField
&
ff
,
m_formFields
)
{
const
FormFieldType
::
Properties
props
=
ff
.
properties
();
if
((
props
&
FormFieldType
::
PROP_MANDATORY
)
&&
(
props
&
FormFieldType
::
PROP_USER_INPUT
))
{
return
true
;
}
}
return
false
;
}
bool
Gov
::
Service
::
containsBoxOwnerDataFields
(
void
)
const
{
foreach
(
const
FormField
&
ff
,
m_formFields
)
{
if
(
ff
.
properties
()
&
FormFieldType
::
PROP_BOX_INPUT
)
{
return
true
;
}
}
return
false
;
}
Isds
::
Message
Gov
::
Service
::
dataMessage
(
void
)
const
{
Isds
::
Message
message
;
...
...
src/datovka_shared/gov_services/service/gov_service.h
View file @
ee4bdc6e
...
...
@@ -182,6 +182,24 @@ namespace Gov {
virtual
bool
haveAllMandatoryFields
(
void
)
const
;
/*!
* @brief Return true if service requires mandatory data that
* must be provided by the user.
*
* @return True if at least one such field exists.
*/
virtual
bool
containsMandatoryUserFields
(
void
)
const
;
/*!
* @brief Return true if service requires data that must be
* acquired from the data box.
*
* @return true if at least on such field is in the model.
*/
virtual
bool
containsBoxOwnerDataFields
(
void
)
const
;
/*!
* @brief Create ISDS message containing the request.
*
...
...
src/gov_services/models/gov_form_list_model.cpp
View file @
ee4bdc6e
...
...
@@ -196,29 +196,19 @@ bool GovFormListModel::haveAllMandatory(void) const
bool
GovFormListModel
::
containsMandatoryUser
(
void
)
const
{
if
(
m_service
!=
Q_NULLPTR
)
{
foreach
(
const
Gov
::
FormField
&
ff
,
m_service
->
fields
())
{
const
Gov
::
FormFieldType
::
Properties
props
=
ff
.
properties
();
if
((
props
&
Gov
::
FormFieldType
::
PROP_MANDATORY
)
&&
(
props
&
Gov
::
FormFieldType
::
PROP_USER_INPUT
))
{
return
true
;
}
}
return
m_service
->
containsMandatoryUserFields
();
}
else
{
return
false
;
}
return
false
;
}
bool
GovFormListModel
::
containsBoxOwnerData
(
void
)
const
{
if
(
m_service
!=
Q_NULLPTR
)
{
foreach
(
const
Gov
::
FormField
&
ff
,
m_service
->
fields
())
{
if
(
ff
.
properties
()
&
Gov
::
FormFieldType
::
PROP_BOX_INPUT
)
{
return
true
;
}
}
return
m_service
->
containsBoxOwnerDataFields
();
}
else
{
return
false
;
}
return
false
;
}
GovFormListModel
*
GovFormListModel
::
fromVariant
(
const
QVariant
&
modelVariant
)
...
...
src/gov_services/models/gov_form_list_model.h
View file @
ee4bdc6e
...
...
@@ -169,7 +169,7 @@ public:
/*!
* @brief Return true if model contains data that have been acquired
* from the data box.
*
from the data box.
*
* @return true if at least on such field is in the model.
*/
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment