Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
PERFORMA_REPLICA
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Muhammad Usman
PERFORMA_REPLICA
Commits
2f68fcfe
Commit
2f68fcfe
authored
Oct 03, 2018
by
Nilu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
modification to HT012 - enable, disable functionality
parent
552b896d
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
122 additions
and
10 deletions
+122
-10
CompanyUser.xml
cmsWebApp/sql/CompanyUser.xml
+1
-0
CompanyUser.sql
cmsWebApp/sql/ms/CompanyUser.sql
+1
-0
CompanyUser.sql
cmsWebApp/sql/oracle/CompanyUser.sql
+1
-0
CompanyUser.sql
cmsWebApp/sql/postgres/CompanyUser.sql
+1
-0
SaveCompanyUserFP.java
cmsWebApp/src/performa/form/SaveCompanyUserFP.java
+35
-0
BaseCompanyUser.java
cmsWebApp/src/performa/orm/BaseCompanyUser.java
+0
-0
CompanyUser.java
cmsWebApp/src/performa/orm/CompanyUser.java
+6
-0
CompanyUser.xml
cmsWebApp/src/performa/orm/CompanyUser.xml
+1
-0
CompanyUserPersistenceMgr.java
cmsWebApp/src/performa/orm/CompanyUserPersistenceMgr.java
+0
-0
CustomServlets_adminPortal.xml
...oot/extensions/adminportal/CustomServlets_adminPortal.xml
+1
-0
manage_users.jsp
cmsWebApp/webroot/extensions/adminportal/manage_users.jsp
+59
-10
20181002_Alter_CompanyUser.xml
...tensions/performa/upgrades/20181002_Alter_CompanyUser.xml
+14
-0
20181002_Alter_CompanyUser_Disabled.sql
...performa/upgrades/20181002_Alter_CompanyUser_Disabled.sql
+2
-0
No files found.
cmsWebApp/sql/CompanyUser.xml
View file @
2f68fcfe
...
@@ -18,6 +18,7 @@
...
@@ -18,6 +18,7 @@
<column
name=
"verification_key"
type=
"String"
nullable=
"true"
length=
"10"
/>
<column
name=
"verification_key"
type=
"String"
nullable=
"true"
length=
"10"
/>
<column
name=
"is_account_verified"
type=
"Boolean"
nullable=
"true"
/>
<column
name=
"is_account_verified"
type=
"Boolean"
nullable=
"true"
/>
<column
name=
"is_email_changed"
type=
"Boolean"
nullable=
"true"
/>
<column
name=
"is_email_changed"
type=
"Boolean"
nullable=
"true"
/>
<column
name=
"is_disabled"
type=
"Boolean"
nullable=
"true"
/>
<column
name=
"user_id"
type=
"Long"
length=
"11"
nullable=
"true"
/>
<column
name=
"user_id"
type=
"Long"
length=
"11"
nullable=
"true"
/>
<column
name=
"company_id"
type=
"Long"
length=
"11"
nullable=
"true"
/>
<column
name=
"company_id"
type=
"Long"
length=
"11"
nullable=
"true"
/>
<column
name=
"default_hiring_team_id"
type=
"Long"
length=
"11"
nullable=
"true"
/>
<column
name=
"default_hiring_team_id"
type=
"Long"
length=
"11"
nullable=
"true"
/>
...
...
cmsWebApp/sql/ms/CompanyUser.sql
View file @
2f68fcfe
...
@@ -17,6 +17,7 @@ CREATE TABLE oneit_sec_user_extension (
...
@@ -17,6 +17,7 @@ CREATE TABLE oneit_sec_user_extension (
verification_key
varchar
(
10
)
NULL
,
verification_key
varchar
(
10
)
NULL
,
is_account_verified
char
(
1
)
NULL
,
is_account_verified
char
(
1
)
NULL
,
is_email_changed
char
(
1
)
NULL
,
is_email_changed
char
(
1
)
NULL
,
is_disabled
char
(
1
)
NULL
,
user_id
numeric
(
12
)
NULL
,
user_id
numeric
(
12
)
NULL
,
company_id
numeric
(
12
)
NULL
,
company_id
numeric
(
12
)
NULL
,
default_hiring_team_id
numeric
(
12
)
NULL
default_hiring_team_id
numeric
(
12
)
NULL
...
...
cmsWebApp/sql/oracle/CompanyUser.sql
View file @
2f68fcfe
...
@@ -18,6 +18,7 @@ CREATE TABLE oneit_sec_user_extension (
...
@@ -18,6 +18,7 @@ CREATE TABLE oneit_sec_user_extension (
verification_key
varchar2
(
10
)
NULL
,
verification_key
varchar2
(
10
)
NULL
,
is_account_verified
char
(
1
)
NULL
,
is_account_verified
char
(
1
)
NULL
,
is_email_changed
char
(
1
)
NULL
,
is_email_changed
char
(
1
)
NULL
,
is_disabled
char
(
1
)
NULL
,
user_id
number
(
12
)
NULL
,
user_id
number
(
12
)
NULL
,
company_id
number
(
12
)
NULL
,
company_id
number
(
12
)
NULL
,
default_hiring_team_id
number
(
12
)
NULL
default_hiring_team_id
number
(
12
)
NULL
...
...
cmsWebApp/sql/postgres/CompanyUser.sql
View file @
2f68fcfe
...
@@ -18,6 +18,7 @@ CREATE TABLE oneit_sec_user_extension (
...
@@ -18,6 +18,7 @@ CREATE TABLE oneit_sec_user_extension (
verification_key
varchar
(
10
)
NULL
,
verification_key
varchar
(
10
)
NULL
,
is_account_verified
char
(
1
)
NULL
,
is_account_verified
char
(
1
)
NULL
,
is_email_changed
char
(
1
)
NULL
,
is_email_changed
char
(
1
)
NULL
,
is_disabled
char
(
1
)
NULL
,
user_id
numeric
(
12
)
NULL
,
user_id
numeric
(
12
)
NULL
,
company_id
numeric
(
12
)
NULL
,
company_id
numeric
(
12
)
NULL
,
default_hiring_team_id
numeric
(
12
)
NULL
default_hiring_team_id
numeric
(
12
)
NULL
...
...
cmsWebApp/src/performa/form/SaveCompanyUserFP.java
0 → 100644
View file @
2f68fcfe
package
performa
.
form
;
import
java.util.Map
;
import
oneit.logging.LogLevel
;
import
oneit.logging.LogMgr
;
import
oneit.objstore.StorageException
;
import
oneit.servlets.forms.SubmissionDetails
;
import
oneit.servlets.forms.SuccessfulResult
;
import
oneit.servlets.process.ORMProcessState
;
import
oneit.servlets.process.SaveFP
;
import
oneit.utils.BusinessException
;
import
performa.orm.Company
;
import
performa.orm.CompanyUser
;
import
javax.servlet.http.HttpServletRequest
;
public
class
SaveCompanyUserFP
extends
SaveFP
{
@Override
public
SuccessfulResult
processForm
(
ORMProcessState
process
,
SubmissionDetails
submission
,
Map
params
)
throws
BusinessException
,
StorageException
{
HttpServletRequest
request
=
submission
.
getRequest
();
CompanyUser
companyUser
=
(
CompanyUser
)
request
.
getAttribute
(
"CompanyUser"
);
Boolean
disabled
=
(
Boolean
)
request
.
getAttribute
(
"disabled"
);
LogMgr
.
log
(
Company
.
LOG
,
LogLevel
.
PROCESSING1
,
"In SaveCompanyUserFP saving company user : "
,
companyUser
);
companyUser
.
setIsDisabled
(
disabled
);
LogMgr
.
log
(
Company
.
LOG
,
LogLevel
.
PROCESSING1
,
"In SaveCompanyUserFP setting is disabled : "
,
disabled
,
" for company user : "
,
companyUser
);
return
super
.
processForm
(
process
,
submission
,
params
);
}
}
\ No newline at end of file
cmsWebApp/src/performa/orm/BaseCompanyUser.java
View file @
2f68fcfe
This diff is collapsed.
Click to expand it.
cmsWebApp/src/performa/orm/CompanyUser.java
View file @
2f68fcfe
...
@@ -180,4 +180,9 @@ public class CompanyUser extends BaseCompanyUser
...
@@ -180,4 +180,9 @@ public class CompanyUser extends BaseCompanyUser
{
{
return
getRoles
()
!=
null
&&
getRoles
().
contains
(
role
);
return
getRoles
()
!=
null
&&
getRoles
().
contains
(
role
);
}
}
public
boolean
isOwner
()
{
return
CollectionUtils
.
equals
(
getCompany
().
getAddedByUser
(),
this
);
}
}
}
\ No newline at end of file
cmsWebApp/src/performa/orm/CompanyUser.xml
View file @
2f68fcfe
...
@@ -24,6 +24,7 @@
...
@@ -24,6 +24,7 @@
<ATTRIB
name=
"VerificationKey"
type=
"String"
dbcol=
"verification_key"
length=
"10"
/>
<ATTRIB
name=
"VerificationKey"
type=
"String"
dbcol=
"verification_key"
length=
"10"
/>
<ATTRIB
name=
"IsAccountVerified"
type=
"Boolean"
dbcol=
"is_account_verified"
defaultValue=
"Boolean.FALSE"
/>
<ATTRIB
name=
"IsAccountVerified"
type=
"Boolean"
dbcol=
"is_account_verified"
defaultValue=
"Boolean.FALSE"
/>
<ATTRIB
name=
"IsEmailChanged"
type=
"Boolean"
dbcol=
"is_email_changed"
defaultValue=
"Boolean.FALSE"
/>
<ATTRIB
name=
"IsEmailChanged"
type=
"Boolean"
dbcol=
"is_email_changed"
defaultValue=
"Boolean.FALSE"
/>
<ATTRIB
name=
"IsDisabled"
type=
"Boolean"
dbcol=
"is_disabled"
defaultValue=
"Boolean.FALSE"
/>
<SINGLEREFERENCE
name=
"User"
type=
"SecUser"
dbcol=
"user_id"
backreferenceName=
"Extensions"
inSuper=
'TRUE'
/>
<SINGLEREFERENCE
name=
"User"
type=
"SecUser"
dbcol=
"user_id"
backreferenceName=
"Extensions"
inSuper=
'TRUE'
/>
<SINGLEREFERENCE
name=
"Company"
type=
"Company"
dbcol=
"company_id"
backreferenceName=
"Users"
/>
<SINGLEREFERENCE
name=
"Company"
type=
"Company"
dbcol=
"company_id"
backreferenceName=
"Users"
/>
...
...
cmsWebApp/src/performa/orm/CompanyUserPersistenceMgr.java
View file @
2f68fcfe
This diff is collapsed.
Click to expand it.
cmsWebApp/webroot/extensions/adminportal/CustomServlets_adminPortal.xml
View file @
2f68fcfe
...
@@ -58,6 +58,7 @@
...
@@ -58,6 +58,7 @@
<FORM
name=
"*.updateCard"
factory=
"Participant"
class=
"performa.form.UpdateCardFP"
/>
<FORM
name=
"*.updateCard"
factory=
"Participant"
class=
"performa.form.UpdateCardFP"
/>
<FORM
name=
"*.replaceCard"
factory=
"Participant"
class=
"performa.form.ReplaceCardFP"
/>
<FORM
name=
"*.replaceCard"
factory=
"Participant"
class=
"performa.form.ReplaceCardFP"
/>
<FORM
name=
"*.addHiringTeam"
factory=
"Participant"
class=
"performa.form.AddHiringTeamFP"
/>
<FORM
name=
"*.addHiringTeam"
factory=
"Participant"
class=
"performa.form.AddHiringTeamFP"
/>
<FORM
name=
"*.saveCompanyUser"
factory=
"Participant"
class=
"performa.form.SaveCompanyUserFP"
/>
</NODE>
</NODE>
<NODE
name=
"job_assessment_criteria_add_jsp"
factory=
"Participant"
>
<NODE
name=
"job_assessment_criteria_add_jsp"
factory=
"Participant"
>
...
...
cmsWebApp/webroot/extensions/adminportal/manage_users.jsp
View file @
2f68fcfe
...
@@ -17,20 +17,23 @@
...
@@ -17,20 +17,23 @@
UserSortOption userSortOpt = (UserSortOption) process.getAttribute("UserSortOption");
UserSortOption userSortOpt = (UserSortOption) process.getAttribute("UserSortOption");
Collection companyUsers = (Collection<CompanyUser>) process.getAttribute("CompanyUsers");
Collection companyUsers = (Collection<CompanyUser>) process.getAttribute("CompanyUsers");
Collection pendingUsers = (Collection<CompanyUser>) process.getAttribute("PendingUsers");
Collection pendingUsers = (Collection<CompanyUser>) process.getAttribute("PendingUsers");
Collection disabledUsers = (Collection<CompanyUser>) process.getAttribute("DisabledUsers");
if(company
==
null)
if(company
==
null)
{
{
company = comUser.getCompany();
company = comUser.getCompany();
process.setAttribute("Company", company);
process.setAttribute("Company", company);
}
}
if(companyUsers == null || pendingUsers == null)
if(companyUsers == null || pendingUsers == null
|| disabledUsers == null
)
{
{
companyUsers = CollectionFilter.filter(company.getUsersSet(), CompanyUser.SearchByAll().andIsAccountVerified(new EqualsFilter<>(Boolean.TRUE)));
companyUsers = CollectionFilter.filter(company.getUsersSet(), CompanyUser.SearchByAll().andIsAccountVerified(new EqualsFilter<>(Boolean.TRUE))
.andIsDisabled(new EqualsFilter<>(Boolean.FALSE))
);
pendingUsers = CollectionFilter.filter(company.getUsersSet(), CompanyUser.SearchByAll().andIsAccountVerified(new NotEqualsFilter<>(Boolean.TRUE)));
pendingUsers = CollectionFilter.filter(company.getUsersSet(), CompanyUser.SearchByAll().andIsAccountVerified(new NotEqualsFilter<>(Boolean.TRUE)));
disabledUsers = CollectionFilter.filter(company.getUsersSet(), CompanyUser.SearchByAll().andIsAccountVerified(new EqualsFilter<>(Boolean.TRUE)).andIsDisabled(new EqualsFilter<>(Boolean.TRUE)));
process.setAttribute("CompanyUsers", companyUsers);
process.setAttribute("CompanyUsers", companyUsers);
process.setAttribute("PendingUsers", pendingUsers);
process.setAttribute("PendingUsers", pendingUsers);
process.setAttribute("DisabledUsers", disabledUsers);
}
}
if( request.getParameter("UserSortOption") != null)
if( request.getParameter("UserSortOption") != null)
...
@@ -47,6 +50,7 @@
...
@@ -47,6 +50,7 @@
Collection<CompanyUser> sortedCompanyUsers = Utils.getUsersSorted(companyUsers, userSortOpt);
Collection<CompanyUser> sortedCompanyUsers = Utils.getUsersSorted(companyUsers, userSortOpt);
Collection<CompanyUser> sortedPendingUsers = Utils.getUsersSorted(pendingUsers, userSortOpt);
Collection<CompanyUser> sortedPendingUsers = Utils.getUsersSorted(pendingUsers, userSortOpt);
Collection<CompanyUser> sortedDisabledUsers = Utils.getUsersSorted(disabledUsers, userSortOpt);
company.setRoleType(RoleType.STANDARD);
company.setRoleType(RoleType.STANDARD);
%>
%>
...
@@ -147,13 +151,19 @@
...
@@ -147,13 +151,19 @@
</div>
</div>
</div>
</div>
</div>
</div>
<div class="m-user-right-padlock">
<oneit:recalcClass htmlTag="div" classScript="companyUser.isOwner() ? 'hide': 'show'" companyUser="<%= companyUser %>">
<div class="arrow_box disble" >DISABLE</div>
<div class="m-user-right-padlock">
<div class="arrow_box enable" >ENABLE</div>
<div class="arrow_box disble" >DISABLE</div>
<span class="m-user-right-padlockicon">
<div class="arrow_box enable" >ENABLE</div>
<span class="padlock"></span>
<oneit:button value=" " name="saveCompanyUser" skin="link"
</span>
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", currentPage)
</div>
.mapEntry("disabled", Boolean.TRUE)
.mapEntry("CompanyUser", companyUser)
.toMap() %>">
<span class="m-user-right-padlockicon"><span class="padlock"></span></span>
</oneit:button>
</div>
</oneit:recalcClass>
<div class="m-user-right">
<div class="m-user-right">
<oneit:ormEnum obj="<%= companyUser %>" attributeName="Role" cssClass="form-control user-role" enums="<%= Arrays.asList(new RoleType[]{RoleType.ADMIN, RoleType.STANDARD}) %>"/>
<oneit:ormEnum obj="<%= companyUser %>" attributeName="Role" cssClass="form-control user-role" enums="<%= Arrays.asList(new RoleType[]{RoleType.ADMIN, RoleType.STANDARD}) %>"/>
</div>
</div>
...
@@ -212,6 +222,45 @@
...
@@ -212,6 +222,45 @@
</div>
</div>
<%
<%
}
}
for(CompanyUser companyUser : sortedDisabledUsers)
{
SecUser user = companyUser.getUser();
%>
<div class="user-list-row disabled" id="<%= companyUser.getID() %>">
<div class="m-user-left">
<div class="remove-icon">_</div>
<div class="m-user-icon"><img src="images/user-list-icon.png"></div>
<div class="m-user-info">
<div class="m-user-name">
<oneit:toString value="<%= SecUserToNameTransform.INSTANCE.transform(user) %>" mode="EscapeHTML" />
</div>
<div class="m-user-email">
<oneit:toString value="<%= user.getEmail() %>" mode="EscapeHTML" />
</div>
</div>
</div>
<div class="m-user-right-padlock">
<div class="arrow_box disble" >DISABLE</div>
<div class="arrow_box enable" >ENABLE</div>
<oneit:button value=" " name="saveCompanyUser" skin="link"
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", currentPage)
.mapEntry("disabled", Boolean.FALSE)
.mapEntry("CompanyUser", companyUser)
.toMap() %>">
<span class="m-user-right-padlockicon"><span class="padlock"></span></span>
</oneit:button>
</div>
<div class="m-user-right">
<oneit:ormEnum obj="<%= companyUser %>" attributeName="Role" cssClass="form-control user-role" enums="<%= Arrays.asList(new RoleType[]{RoleType.ADMIN, RoleType.STANDARD}) %>"/>
</div>
<oneit:button name="save" value="Save" cssClass="<%= "save-user" + companyUser.getID().toString() + " hidden"%>"
requestAttribs="<%= CollectionUtils.mapEntry("CompanyUser", companyUser).mapEntry("nextPage", usersPage + "&UserSortOption=" + userSortOpt).toMap() %>" />
</div>
<%
}
%>
%>
</div>
</div>
</div>
</div>
...
...
cmsWebApp/webroot/extensions/performa/upgrades/20181002_Alter_CompanyUser.xml
0 → 100644
View file @
2f68fcfe
<?xml version="1.0" encoding="UTF-8"?>
<!-- @AutoRun -->
<OBJECTS
name=
""
xmlns:oneit=
"http://www.1iT.com.au"
>
<NODE
name=
"Script"
factory=
"Vector"
>
<NODE
name=
"DDL"
factory=
"Participant"
class=
"oneit.sql.transfer.RedefineTableOperation"
>
<tableName
factory=
"String"
>
oneit_sec_user_extension
</tableName>
<column
name=
"is_disabled"
type=
"Boolean"
nullable=
"true"
/>
</NODE>
</NODE>
</OBJECTS>
\ No newline at end of file
cmsWebApp/webroot/extensions/performa/upgrades/20181002_Alter_CompanyUser_Disabled.sql
0 → 100644
View file @
2f68fcfe
update
oneit_sec_user_extension
set
is_disabled
=
'N'
;
\ 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