<?xml version="1.0" encoding="UTF-8"?>
<!--
   Copyright 2018 Anyware Services

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
   -->
<extension class="org.ametys.cms.search.ui.model.StaticSearchUIModel">
	<SearchModel>
	    <content-types>
	       <content-type id="org.ametys.plugins.job-offer.Content.jobApplication"/>
	    </content-types>
	    
	    <simple-search-criteria>
            <criteria field-ref="lastname">
                <test-operator>search</test-operator>
            </criteria>
            <criteria field-ref="lastname">
                <test-operator>like</test-operator>
                <widget>edition.hidden</widget>
            </criteria>
            <criteria field-ref="firstname">
                <test-operator>search</test-operator>
            </criteria>
            <criteria field-ref="firstname">
                <test-operator>like</test-operator>
                <widget>edition.hidden</widget>
            </criteria>
            <criteria field-ref="jobOffer">
                <widget>edition.hidden</widget>
            </criteria>
            <criteria system-ref="workflowStep">
                <workflow name="job-application"/>
            </criteria>
            <criteria system-ref="creationDate">
                <label i18n="true">plugin.job-offer:PLUGINS_JOB_OFFER_UITOOL_SEARCH_JOB_APPLICATIONS_CREATED_BEFORE</label>
                <test-operator>lt</test-operator>
            </criteria>
            <criteria system-ref="creationDate">
                <label i18n="true">plugin.job-offer:PLUGINS_JOB_OFFER_UITOOL_SEARCH_JOB_APPLICATIONS_CREATED_AFTER</label>
                <test-operator>gt</test-operator>
            </criteria>
            <criteria field-ref="jobOffer">
                <widget>edition.hidden</widget>
            </criteria>
	    </simple-search-criteria>
	    
	    <facets>
            <criteria system-ref="workflowStep">
                <workflow name="job-application"/>
            </criteria>
            <criteria field-ref="jobOffer"/>
        </facets>
	    
	    <columns>
	        <default>
	            <column metadata-ref="title">
	                <renderer>Ametys.plugins.cms.search.SearchGridHelper.renderTitle</renderer>
	            </column>
                <column metadata-ref="lastname">
                    <hidden>true</hidden>
                </column>
                <column metadata-ref="firstname">
                    <hidden>true</hidden>
                </column>
                <column metadata-ref="email"/>
                <column metadata-ref="jobOffer"/>
                <column metadata-ref="jobOffer/refId"/>
                <column metadata-ref="jobOffer/personInCharge">
                    <hidden>true</hidden>
                </column>
                <column system-ref="workflowStep"/>
	            <column system-ref="creationDate">
                    <label i18n="true">plugin.job-offer:PLUGINS_JOB_OFFER_UITOOL_SEARCH_JOB_APPLICATIONS_CREATION_DATE</label>
                </column>
                <column metadata-ref="cv"/>
                <column metadata-ref="coveringLetter"/>
                <column system-ref="contentLanguage">
                    <hidden>true</hidden>
                </column>
	        </default>
	    </columns>
	</SearchModel>
</extension>
