Commit 082b9d67 by Nilu

S13004655 # Client - Incoming Issues (raised by Client) #Only Owner can create new HT

parent 15408ba1
...@@ -182,9 +182,9 @@ public class CompanyUser extends BaseCompanyUser ...@@ -182,9 +182,9 @@ public class CompanyUser extends BaseCompanyUser
return getRoles() != null && getRoles().contains(role); return getRoles() != null && getRoles().contains(role);
} }
public boolean isOwner(HiringTeam hiringTeam) public boolean isOwner()
{ {
return CollectionUtils.equals(hiringTeam.getAddedByUser(), this); return pipelineCompanyUser().toHiringTeams().toRole().uniqueVals().contains(RoleType.OWNER);
} }
......
package performa.orm; package performa.orm;
import java.util.Arrays;
import java.util.List;
import oneit.objstore.FieldWriteability; import oneit.objstore.FieldWriteability;
import performa.orm.types.RoleType; import performa.orm.types.RoleType;
......
...@@ -15,7 +15,8 @@ ...@@ -15,7 +15,8 @@
CompanyUser comUser = secUser.getExtension(CompanyUser.REFERENCE_CompanyUser); CompanyUser comUser = secUser.getExtension(CompanyUser.REFERENCE_CompanyUser);
UserSortOption userSortOpt = (UserSortOption) process.getAttribute("UserSortOption"); UserSortOption userSortOpt = (UserSortOption) process.getAttribute("UserSortOption");
Collection<CompanyUser> companyUsers = (Collection<CompanyUser>) process.getAttribute("CompanyUsers"); Collection<CompanyUser> companyUsers = (Collection<CompanyUser>) process.getAttribute("CompanyUsers");
boolean readOnly = !comUser.isOwner();
if(company == null) if(company == null)
{ {
company = comUser.getCompany(); company = comUser.getCompany();
...@@ -118,19 +119,19 @@ ...@@ -118,19 +119,19 @@
</div> </div>
<div class="form-group"> <div class="form-group">
<label><oneit:label GUIName="Hiring Team Name" /></label> <label><oneit:label GUIName="Hiring Team Name" /></label>
<oneit:ormInput obj="<%= company %>" type="text" attributeName="HiringTeamName" cssClass="form-control" /> <oneit:ormInput obj="<%= company %>" type="text" attributeName="HiringTeamName" cssClass="form-control" readonly="<%= readOnly%>"/>
</div> </div>
<div class="form-group"> <div class="form-group">
<label><oneit:label GUIName="Team Owner/Admin" /></label> <label><oneit:label GUIName="Team Owner/Admin" /></label>
<div class="wider-select"> <div class="wider-select">
<tagfile:ormsingleasso_select obj="<%= company %>" assocName="Owner" options="<%= companyUsers.toArray(new CompanyUser[0]) %>"/> <tagfile:ormsingleasso_select obj="<%= company %>" assocName="Owner" options="<%= !readOnly ? companyUsers.toArray(new CompanyUser[0]) : new CompanyUser[0] %>" />
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label><oneit:label GUIName="Billing" /></label> <label><oneit:label GUIName="Billing" /></label>
<div class="styled_checkboxes"> <div class="styled_checkboxes">
<div class="checkbox checkbox-primary"> <div class="checkbox checkbox-primary">
<oneit:ormInput obj="<%= company %>" id="manage-own-billing" attributeName="ManageOwnBilling" type="checkbox"/> <oneit:ormInput obj="<%= company %>" id="manage-own-billing" attributeName="ManageOwnBilling" type="checkbox" readonly="<%= readOnly%>"/>
<oneit:recalcClass htmlTag="span" classScript="company.showTeamManagesOwnBilling() ? 'checked': 'unchecked'" company="<%= company %>"> <oneit:recalcClass htmlTag="span" classScript="company.showTeamManagesOwnBilling() ? 'checked': 'unchecked'" company="<%= company %>">
<label for="manage-own-billing"> <label for="manage-own-billing">
<oneit:ormlabel obj="<%= company %>" field="ManageOwnBilling" /> <oneit:ormlabel obj="<%= company %>" field="ManageOwnBilling" />
...@@ -143,15 +144,18 @@ ...@@ -143,15 +144,18 @@
<oneit:recalcClass htmlTag="div" classScript="company.showTeamManagesOwnBilling() ? 'hide': 'show'" company="<%= company %>"> <oneit:recalcClass htmlTag="div" classScript="company.showTeamManagesOwnBilling() ? 'hide': 'show'" company="<%= company %>">
<label><oneit:label GUIName="Select Billing Team" /></label> <label><oneit:label GUIName="Select Billing Team" /></label>
<div class="wider-select"> <div class="wider-select">
<tagfile:ormsingleasso_select obj="<%= company %>" assocName="BillingTeam" options="<%= company.getHiringTeamsSet().toArray(new HiringTeam[0]) %>"/> <tagfile:ormsingleasso_select obj="<%= company %>" assocName="BillingTeam" options="<%= !readOnly ? company.getHiringTeamsSet().toArray(new HiringTeam[0]) : new HiringTeam[0] %>"/>
</div> </div>
</oneit:recalcClass> </oneit:recalcClass>
</div> </div>
<oneit:button value="Add Team" name="addHiringTeam" cssClass="btn btn-invite"
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", currentPage) <oneit:recalcClass htmlTag="div" classScript="readOnly ? 'hide': 'show'" readOnly="<%= readOnly%>">
.mapEntry ("restartProcess", Boolean.TRUE) <oneit:button value="Add Team" name="addHiringTeam" cssClass="btn btn-invite"
.mapEntry ("attribNamesToRestore", Collections.singleton("HiringTeam")) requestAttribs="<%= CollectionUtils.mapEntry("nextPage", currentPage)
.toMap() %>" /> .mapEntry ("restartProcess", Boolean.TRUE)
.mapEntry ("attribNamesToRestore", Collections.singleton("HiringTeam"))
.toMap() %>" />
</oneit:recalcClass>
</div> </div>
</div> </div>
</div> </div>
......
...@@ -160,7 +160,7 @@ ...@@ -160,7 +160,7 @@
@page @page
{ {
size: 1340px 1896px;; size: 1340px 1896px;;
margin : 0; margin : 0;
@top-left { content: element(header);} @top-left { content: element(header);}
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment