Commit fbb0ee82 by Nilu

By default, show only Jobs that are Open and owned by the current user. Include…

By default, show only Jobs that are Open and owned by the current user. Include checkbox (or Boolean slider) to show all Jobs for current Hiring Team that are Open. (See below about how Job Owner is specified)
parent 07d197a7
<?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.DefineTableOperation">
<tableName factory="String">it_does_not_matter</tableName>
<column name="object_id" type="Long" nullable="false" length="11"/>
<column name="object_last_updated_date" type="Date" nullable="false" length="22"/>
<column name="object_created_date" type="Date" nullable="false" length="22"/>
<column name="xxxx" type="Boolean" nullable="true"/>
<column name="xxxx" type="Long" length="11" nullable="true"/>
<column name="xxxx" type="Long" length="11" nullable="true"/>
</NODE>
</NODE></OBJECTS>
\ No newline at end of file
-- DROP TABLE it_does_not_matter;
CREATE TABLE it_does_not_matter (
object_id int NOT NULL ,
object_last_updated_date datetime DEFAULT getdate() NOT NULL ,
object_created_date datetime DEFAULT getdate() NOT NULL
,
xxxx char(1) NULL,
xxxx numeric(12) NULL,
xxxx numeric(12) NULL
);
ALTER TABLE it_does_not_matter ADD
CONSTRAINT PK_it_does_not_matter PRIMARY KEY
(
object_id
) ;
\ No newline at end of file
-- DROP TABLE it_does_not_matter;
CREATE TABLE it_does_not_matter (
object_id number(12) NOT NULL ,
object_last_updated_date date DEFAULT SYSDATE NOT NULL ,
object_created_date date DEFAULT SYSDATE NOT NULL
,
xxxx char(1) NULL,
xxxx number(12) NULL,
xxxx number(12) NULL
);
ALTER TABLE it_does_not_matter ADD
CONSTRAINT PK_it_does_not_matter PRIMARY KEY
(
object_id
) ;
\ No newline at end of file
-- @AutoRun
-- drop table it_does_not_matter;
CREATE TABLE it_does_not_matter (
object_id numeric(12) NOT NULL ,
object_last_updated_date timestamp DEFAULT NOW() NOT NULL ,
object_created_date timestamp DEFAULT NOW() NOT NULL
,
xxxx char(1) NULL,
xxxx numeric(12) NULL,
xxxx numeric(12) NULL
);
ALTER TABLE it_does_not_matter ADD
CONSTRAINT pk_it_does_not_matter PRIMARY KEY
(
object_id
) ;
\ No newline at end of file
package performa.search;
import oneit.objstore.BaseBusinessClass;
import oneit.objstore.rdbms.filters.EqualsFilter;
import performa.orm.BaseJob;
import performa.orm.Job;
import performa.orm.types.JobStatus;
public class SearchHome extends BaseSearchHome
{
private static final long serialVersionUID = 0L;
// This constructor should not be called
public SearchHome ()
{
// Do not add any code to this, always put it in initialiseNewObject
}
@Override
public BaseBusinessClass[] doSearch()
{
BaseJob.SearchAll search = Job.SearchByAll()
.andHiringTeam(new EqualsFilter<>(getHiringTeam()))
.andJobStatus(new EqualsFilter<>(JobStatus.OPEN));
if(!getShowAllJobs())
{
search = search.andCreatedBy(new EqualsFilter<>(getCompanyUser()));
}
return search.search(getTransaction());
}
}
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<ROOT xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:noNamespaceSchemaLocation='http://www.oneit.com.au/schemas/5.2/BusinessObject.xsd'>
<BUSINESSCLASS name="SearchHome" package="performa.search" superclass="SearchExecutor" >
<IMPORT value="oneit.servlets.orm.*"/>
<IMPORT value="performa.orm.*"/>
<TABLE name="it_does_not_matter" tablePrefix="object" polymorphic="FALSE" >
<ATTRIB name="ShowAllJobs" type="Boolean" dbcol="xxxx" defaultValue="Boolean.FALSE"/>
<SINGLEREFERENCE name="HiringTeam" type="HiringTeam" dbcol="xxxx" />
<SINGLEREFERENCE name="CompanyUser" type="CompanyUser" dbcol="xxxx" />
</TABLE>
</BUSINESSCLASS>
</ROOT>
\ No newline at end of file
......@@ -18,7 +18,7 @@
<script type="text/javascript">
$(document).ready(function()
{
recalcFunction = setupRecalc ($("editJob"), {'recalcOnError':true});
recalcFunction = setupRecalc ($("form#editJob"), {'recalcOnError':true});
$(".switch input[type='checkbox']").change(function() {
$("button[name$='changeAssessmentCriteria']").click();
......
......@@ -46,17 +46,23 @@
CompanyUser companyUser = secUser.getExtension(CompanyUser.REFERENCE_CompanyUser);
HiringTeam hiringTeam = companyUser.getSelectedTeam();
SearchHome searchHome = (SearchHome) RunSearchExecutorFP.setupExecutor(request, SearchHome.REFERENCE_SearchHome, true);
Job[] allJobs = (Job[])process.getAttribute("allJobs");
searchHome.setHiringTeam(hiringTeam);
searchHome.setCompanyUser(companyUser);
if(allJobs == null)
{
allJobs = (Job[]) searchHome.doSearch();
}
Job[] jobs = Job.SearchByAll().andJobStatus(new EqualsFilter<>(JobStatus.OPEN))
.andHiringTeam(new EqualsFilter<>(hiringTeam))
.search(transaction);
Job[] allJobs = Job.SearchByAll().andHiringTeam(new EqualsFilter<>(hiringTeam))
.search(transaction);
List<Job> recentJobs = ObjstoreUtils.sort(Arrays.asList(allJobs),
new ObjectTransform[]{ Job.pipesJob().toLastEdited() ,
Job.pipesJob().toObjectLastModified()},
new Comparator[]{ CollectionUtils.reverse(CollectionUtils.DEFAULT_COMPARATOR), CollectionUtils.reverse(CollectionUtils.DEFAULT_COMPARATOR), CollectionUtils.reverse(CollectionUtils.DEFAULT_COMPARATOR) });
......@@ -68,6 +74,18 @@
boolean firstTime = request.getParameter("firstTime") != null ? Boolean.parseBoolean(request.getParameter("firstTime")) : false;
boolean canCreateJob = Utils.allowJobCreation(hiringTeam);
%>
<script type="text/javascript">
$(document).ready(function()
{
recalcFunction = setupRecalc ($("form#editJob"), {'recalcOnError':true});
$(".switch input[type='checkbox']").change(function() {
$("button[name$='search']").click();
});
});
</script>
<oneit:form name="editJob" method="post" enctype="multipart/form-data">
<div class="dashboard-content-area">
<div class="dashboard-first-part">
......@@ -144,7 +162,19 @@
</div>
<div class="second-part">
<oneit:dynInclude page="/extensions/applicantportal/inc/multifieldtext.jsp" data="<%= CollectionUtils.EMPTY_MAP%>"/>
<div class="d-job-title">Recent Jobs</div>
<div class="d-job-title">Your Open Jobs</div>
<div class ="form-group">
<label>Show all open jobs for team</label>
<span class="pull-right">
<label class="switch">
<oneit:recalcClass htmlTag="span" classScript="searchHome.getShowAllJobs() ? 'checkbox checked': 'checkbox unchecked'" searchHome="<%= searchHome %>">
<oneit:ormInput obj="<%= searchHome %>" attributeName="ShowAllJobs" type="checkbox"/>
</oneit:recalcClass>
<div class="slider round"></div>
</label>
<oneit:button value="Search" name="search" cssClass="hide"/>
</span>
</div>
<%
if(recentJobs.isEmpty())
{
......
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