Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Krishna Vemulavada
/
vera_2.1_app
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
46685956
authored
Apr 16, 2018
by
Kunj Gupta
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Added some hard code sys_id for HRCase, Fixed app is crashing.
parent
feac4b31
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
38 additions
and
4 deletions
app/src/main/java/com/vsoft/servicenow/adapters/HRCaseCategoryAdapter.java
app/src/main/java/com/vsoft/servicenow/db/managers/HRCaseVariableManager.java
app/src/main/java/com/vsoft/servicenow/ui/HRCaseVariableScreen.java
app/src/vportal/res/values/arrays.xml
app/src/main/java/com/vsoft/servicenow/adapters/HRCaseCategoryAdapter.java
View file @
46685956
...
...
@@ -21,16 +21,35 @@ import java.util.List;
*/
public
class
HRCaseCategoryAdapter
extends
BaseAdapter
{
private
final
List
<
HRCase
>
mHRCaseList
=
new
ArrayList
<>(
0
);
private
String
[]
hardCodedHRCase
=
new
String
[
3
];
private
LayoutInflater
mInflater
;
private
Context
mContext
;
public
HRCaseCategoryAdapter
(
Context
context
)
{
mContext
=
context
;
mInflater
=
(
LayoutInflater
)
context
.
getSystemService
(
Context
.
LAYOUT_INFLATER_SERVICE
);
hardCodedHRCase
=
context
.
getResources
().
getStringArray
(
R
.
array
.
hard_code_hr_case_sys_id
);
}
public
void
setHRCaseList
(
List
<
HRCase
>
hrCaseList
)
{
mHRCaseList
.
clear
();
for
(
int
i
=
0
;
i
<
hrCaseList
.
size
();
i
++)
{
String
sysId
=
hrCaseList
.
get
(
i
).
getSysId
();
boolean
isDelete
=
false
;
for
(
int
j
=
0
;
j
<
hardCodedHRCase
.
length
;
j
++)
{
String
hardCodeSysId
=
hardCodedHRCase
[
j
];
if
(
hardCodeSysId
==
null
||
hardCodeSysId
.
equals
(
sysId
))
{
isDelete
=
false
;
break
;
}
else
{
isDelete
=
true
;
}
}
if
(
isDelete
)
{
hrCaseList
.
remove
(
i
);
}
}
if
(
hrCaseList
!=
null
)
mHRCaseList
.
addAll
(
hrCaseList
);
notifyDataSetChanged
();
...
...
@@ -73,7 +92,7 @@ public class HRCaseCategoryAdapter extends BaseAdapter {
HRCase
hrCase
=
mHRCaseList
.
get
(
position
);
holder
.
titleTextView
.
setText
(
hrCase
.
getTitle
());
if
(
hrCase
.
getDescription
()
!=
null
&&
!
hrCase
.
getDescription
().
isEmpty
())
{
if
(
hrCase
.
getDescription
()
!=
null
&&
!
hrCase
.
getDescription
().
isEmpty
())
{
holder
.
desTextView
.
setVisibility
(
View
.
VISIBLE
);
holder
.
desTextView
.
setText
(
hrCase
.
getDescription
());
}
else
{
...
...
@@ -81,7 +100,7 @@ public class HRCaseCategoryAdapter extends BaseAdapter {
holder
.
desTextView
.
setText
(
hrCase
.
getDescription
());
}
if
(
hrCase
.
getIcon
()
!=
null
&&
!
hrCase
.
getIcon
().
isEmpty
())
{
if
(
hrCase
.
getIcon
()
!=
null
&&
!
hrCase
.
getIcon
().
isEmpty
())
{
holder
.
image
.
setVisibility
(
View
.
VISIBLE
);
StringBuilder
builder
=
new
StringBuilder
();
builder
.
append
(
Constants
.
DOMAIN
);
...
...
@@ -92,7 +111,6 @@ public class HRCaseCategoryAdapter extends BaseAdapter {
holder
.
image
.
setVisibility
(
View
.
INVISIBLE
);
}
return
convertView
;
}
...
...
app/src/main/java/com/vsoft/servicenow/db/managers/HRCaseVariableManager.java
View file @
46685956
...
...
@@ -112,7 +112,9 @@ public class HRCaseVariableManager implements DBConstants {
continue
;
}
if
(!
localCatalogueVariable
.
getQuestionText
().
equals
(
serverCatalogueVariable
.
getQuestionText
()))
{
if
(
localCatalogueVariable
.
getQuestionText
()
!=
null
&&
serverCatalogueVariable
.
getQuestionText
()
!=
null
&&
!
localCatalogueVariable
.
getQuestionText
().
equals
(
serverCatalogueVariable
.
getQuestionText
()))
{
hasChanged
=
true
;
continue
;
}
...
...
app/src/main/java/com/vsoft/servicenow/ui/HRCaseVariableScreen.java
View file @
46685956
...
...
@@ -1225,6 +1225,7 @@ public class HRCaseVariableScreen extends HandleNotificationActivity {
if
(
container
.
getErrorView
()==
null
)
{
TextView
errorView
=
Util
.
getErrorView
(
HRCaseVariableScreen
.
this
);
container
.
setErrorView
(
errorView
);
if
(
container
.
getContainerView
()
!=
null
)
container
.
getContainerView
().
addView
(
errorView
);
}
variable
.
setMandatory
(
true
);
...
...
@@ -1232,15 +1233,19 @@ public class HRCaseVariableScreen extends HandleNotificationActivity {
}
if
(
action
.
getVisible
().
equals
(
Boolean
.
toString
(
true
)))
{
if
(
container
.
getContainerView
()
!=
null
)
container
.
getContainerView
().
setVisibility
(
View
.
GONE
);
}
else
if
(
action
.
getVisible
().
equals
(
Boolean
.
toString
(
false
)))
{
if
(
container
.
getContainerView
()
!=
null
)
container
.
getContainerView
().
setVisibility
(
View
.
VISIBLE
);
runUIPolicyActions
(
variable
.
getSysId
());
}
if
(
action
.
getDisabled
().
equals
(
Boolean
.
toString
(
true
)))
{
if
(
container
.
getContainerView
()
!=
null
)
container
.
getContainerView
().
setEnabled
(
false
);
}
else
if
(
action
.
getDisabled
().
equals
(
Boolean
.
toString
(
false
)))
{
if
(
container
.
getContainerView
()
!=
null
)
container
.
getContainerView
().
setEnabled
(
true
);
}
}
...
...
app/src/vportal/res/values/arrays.xml
0 → 100644
View file @
46685956
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string-array
name=
"hard_code_hr_case_sys_id"
>
<item>
0b724f4e4fcd3200412a60001310c71c
</item>
<item>
2d4bb88e4f4a020020280ea28110c7f9
</item>
<item>
2d6b51924f8286005e1a3d728110c74a
</item>
</string-array>
</resources>
\ No newline at end of file
Write
Preview
Markdown
is supported
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