Commit f04825cc by nilu

S42971637 # Matchd / Talentology - No Plan [Enhancement] #Expose the Customer…

S42971637 # Matchd / Talentology - No Plan [Enhancement] #Expose the Customer Name at the top of the Hiring Team page.
parent b9a3c3af
......@@ -2,14 +2,17 @@ package performa.orm;
import java.util.Set;
import oneit.logging.LoggingArea;
import oneit.objstore.FieldWriteability;
import oneit.objstore.rdbms.filters.EqualsFilter;
import oneit.objstore.rdbms.filters.IsNotNullFilter;
import oneit.security.SecUser;
import oneit.utils.BusinessException;
import oneit.utils.CollectionUtils;
import oneit.utils.StringUtils;
import oneit.utils.filter.Filter;
import oneit.utils.math.NullArith;
import performa.orm.types.JobStatus;
import performa.orm.types.RoleType;
import performa.orm.types.TimeZone;
import performa.utils.Utils;
......@@ -180,4 +183,23 @@ public class Company extends BaseCompany
{
return pipelineCompany().toHiringTeams().toTimeZone().val();
}
@Override
public FieldWriteability getObjectWriteability()
{
SecUser secUser = SecUser.getTXUser(getTransaction());
if(secUser != null && secUser.getExtension(CompanyUser.REFERENCE_CompanyUser) != null)
{
CompanyUser companyUser = secUser.getExtension(CompanyUser.REFERENCE_CompanyUser);
if(companyUser.getSelectedTeam() != null && companyUser.getRoleForHiringTeam(companyUser.getSelectedTeam()) == RoleType.STANDARD)
{
return FieldWriteability.NOT_IN_GUI;
}
}
return super.getObjectWriteability();
}
}
\ No newline at end of file
......@@ -11,9 +11,11 @@
HiringTeam hiringTeam = companyUser.getActiveHiringTeam();
Company company = hiringTeam.getCompany();
String nextPage = WebUtils.getArticleByShortCut(transaction, WebUtils.ADMIN_HOME).getLink(request);
boolean readOnly = hiringTeam.getObjectWriteability() == FieldWriteability.NOT_IN_GUI;
Debug.assertion(company != null , "Invalid company in admin portal my company");
boolean readOnly = company.getObjectWriteability() == FieldWriteability.NOT_IN_GUI;
%>
<div class="container-fluid">
<div class="row content">
......@@ -52,9 +54,10 @@
String hiringTeamTypeId = String.valueOf(company.getID().longID()) + "_hiringteamtype_" + hiringTeamType.getName();
String selected = isSelected ? "checked" : "";
String activeClass = isSelected ? "active" : "";
String disabled = isSelected ? "" : readOnly? "disabled" : "";
%>
<div class="radio radio-primary workplace-radio manage-company">
<input type="radio" name="<%= optionKey %>" id="<%= hiringTeamTypeId %>" class="element_rating_radio" value="<%= hiringTeamType.getName() %>" <%= selected %> >
<input type="radio" name="<%= optionKey %>" id="<%= hiringTeamTypeId %>" class="element_rating_radio" value="<%= hiringTeamType.getName() %>" <%= selected %> <%= disabled %>>
<label for="<%= hiringTeamTypeId %>">
<oneit:toString value="<%= hiringTeamType %>" mode="EscapeHTML"/>
</label>
......@@ -77,7 +80,7 @@
requestAttribs='<%= CollectionUtils.mapEntry ("nextPage", nextPage)
.mapEntry("cancelProcess", true)
.toMap() %>'/>
<oneit:button value="Save" name="save" cssClass="btn btn-primary largeBtn"
<oneit:button value="Save" name="save" cssClass="btn btn-primary largeBtn" disabled="<%= readOnly ? "true" : "false" %>"
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", nextPage)
.mapEntry(NotificationUtils.DISPLAY_NOTIFICATION_PARAM, false)
.mapEntry("Company", company)
......
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