search_results.html

 1   <#macro getParentSubject subject breadcrumb>
 2   	<#if subject?has_content>
 3   		<#if breadcrumb == "">
 4   			<#assign breadcrumbCopy = '<a href="jsp/admin/plugins/helpdesk/QuestionAnswerList.jsp?faq_id=${faq_id}&subject_id=${subject.id}">' + subject.text + '</a>' + " &nbsp; " />
 5   		<#else>
 6   			<#assign breadcrumbCopy = '<a href="jsp/admin/plugins/helpdesk/QuestionAnswerList.jsp?faq_id=${faq_id}&subject_id=${subject.id}">' + subject.text + '</a>' + " &gt; " + breadcrumb />
 7   		</#if>
 8   		<#if subject.getParent(plugin)?has_content && subject.idParent != 0>
 9   			<@getParentSubject subject=subject.getParent(plugin) breadcrumb=breadcrumbCopy />
 10   		<#else>			
 11   			${breadcrumbCopy}
 12   		</#if>
 13   	</#if>
 14   </#macro>
 15   <#macro subjectsListSelect items default_value exclude_value depth>
 16   	<#if items?has_content>
 17   	<#list items as subject>
 18   		<#if exclude_value="${subject.id}">
 19   		<#else>
 20   			<option <#if default_value="${subject.id}">selected="selected"</#if> value="${subject.id}">
 21   			<#if depth &gt; 0><#list 1..depth as i>&nbsp;&nbsp;</#list></#if>${subject.text}</option>
 22   	        <#assign child_subjects_list = subject.getChilds(plugin) />
 23   	        <#if child_subjects_list?has_content>
 24   				<@subjectsListSelect items=child_subjects_list default_value=default_value exclude_value=exclude_value depth=depth+1 />
 25   	        </#if>
 26           </#if>
 27   	</#list>
 28   	</#if>
 29   </#macro>
 30   <@pageContainer>
 31       <@pageColumn>
 32   		<@row>
 33   			<@columns xl=3>
 34   				<@box color='primary' >
 35   					<@boxHeader title='${faq_name} - #i18n{helpdesk.search_results.labelSearch}' />
 36   					<@boxBody>
 37   						<@tform name='fullTextSearch' action='jsp/admin/plugins/helpdesk/HelpdeskSearch.jsp'>
 38   						<@input type='hidden' value=faq_id name='faq_id' />                     
 39   						<@input type='hidden' name='page' value='search' />
 40   						<@formGroup labelFor='query' labelKey='#i18n{helpdesk.search_results.labelSearch}' rows=2>
 41   							<@input name='query' value='${query!}' />
 42   						</@formGroup>
 43   						<#--
 44   						<@formGroup labelFor='date_start' labelKey='#i18n{helpdesk.search_results.date_start}' rows=2 >
 45   							<@inputGroup>
 46   								<@input type='daterange' dateRangeEndId='date_end' name='date_start' id='date_start' value='${date_start_query!}' />
 47   								<@inputGroupItem><@icon style='calendar' /></@inputGroupItem>
 48   							</@inputGroup>
 49   						</@formGroup>
 50   						<@formGroup labelFor='date_end' labelKey='#i18n{helpdesk.search_results.date_end}' rows=2>
 51   							<@inputGroup>
 52   								<@input name='date_end' id='date_end' value='${date_end_query!}' />
 53   								<@inputGroupItem><@icon style='calendar' /></@inputGroupItem>
 54   							</@inputGroup>
 55   						</@formGroup>
 56   						-->
 57   						<@formGroup labelFor='form_search_subject_id' labelKey='#i18n{helpdesk.subjects.title.questions}' rows=2>
 58   							<@select id='form_search_subject_id' name='form_search_subject_id' >
 59   								<@option value='' label='' />
 60   								<@subjectsListSelect items=helpdesk_subject_list default_value="${filter_subject_id}" exclude_value="" depth=0 />
 61   							</@select>
 62   						</@formGroup>
 63   						<@formGroup labelFor='form_search_subject_id' rows=2>
 64   							<@checkBox name='form_search_sub_subjects' id='form_search_sub_subjects' labelKey='#i18n{helpdesk.subject_list.labelSearchSubSubjects}' orientation='vertical' value=filter_search_sub_subject?c />
 65   						</@formGroup>
 66   						<@formGroup labelFor='form_search_subject_id' labelKey='#i18n{helpdesk.search_results.labelNbDocsPerPage}' rows=2>
 67   							<#-- Number of documents per page selector -->
 68   							<@NbItemsPerPageSelectorCombo nb_items_per_page />
 69   						</@formGroup>
 70   						<@formGroup rows=2 >
 71   							<@button buttonIcon='search' title='#i18n{helpdesk.search_results.buttonSearch}' type='submit' />
 72   						</@formGroup>
 73   						</@tform>
 74   					</@boxBody>
 75   				</@box> 
 76   			</@columns>
 77   			<@columns xl=9>
 78   				<@box color='primary' >
 79   					<@boxHeader title='#i18n{helpdesk.question_answer_list.adminTitleRight}' boxTools=true >
 80   						<@tform action="jsp/admin/plugins/helpdesk/CreateQuestionAnswer.jsp">
 81   						<@input type='hidden' value=faq_id name='faq_id' />
 82   						<#if subject?has_content><@input type='hidden' value=subject.id name='subject_id' /></#if>
 83   						<@button buttonIcon='plus' title='#i18n{helpdesk.question_answer_list.buttonLabelCreate}' type='submit' />
 84   						</@tform>
 85   					</@boxHeader>
 86   					<@boxBody>
 87   						<#if error??>
 88   							<@alert class='alert-error' color='danger' title='#i18n{helpdesk.search_results.error}' >	  	
 89   								<@p class="text-muted font-weight-bold ml-3 ms-3 mb-1">${error}</@p>	  
 90   							</@alert>
 91   						<#else>
 92   							<#if results_list?size gt 0>
 93   								<h2>#i18n{helpdesk.question_answer_list.LabelQuestion}</h2>
 94   								<@table>
 95   									<@tr>
 96   										<@th>Sujet</@th>                    
 97   										<@th>Question</@th>                    
 98   									</@tr>
 99   								<@tableHeadBodySeparator />
 100   								<#list results_list as result>
 101   									<@tr>
 102   										<@td><@getParentSubject subject=result.getSubject(plugin) breadcrumb="" /></@td>                   
 103   										<@td>
 104   											<@aButton href='jsp/admin/plugins/helpdesk/ModifyQuestionAnswer.jsp?faq_id=${faq_id}&question_id=${result.idQuestionAnswer}' buttonIcon='edit' size='sm' />
 105   										</@td>
 106   									</@tr>            
 107   								</#list>
 108   								</@table>
 109   								<@p>#i18n{helpdesk.search_results.labelResultsCount} : <strong>${paginator.itemsCount}</strong>            #i18n{helpdesk.search_results.labelResultsRange} : <strong>${paginator.rangeMin} - ${paginator.rangeMax}</strong></@p>
 110   								<@pagination paginator=paginator />
 111   								<#if (paginator.itemsCount> 0)>
 112   									<@tform type='inline' name='export' action='jsp/admin/plugins/helpdesk/DoExportCSV.jsp'>
 113   										<@button buttonIcon='download' type='submit' title='#i18n{helpdesk.search_results.exportCSV}' />
 114   									</@tform>
 115   								</#if>
 116   							<#else>
 117   								<@empty title='#i18n{helpdesk.helpdesk.message.search_nok}' subtitle='' />
 118   							</#if>
 119   						</#if>
 120   					</@boxBody> 
 121   				</@box> 
 122   			</@columns>
 123   		</@row>
 124   	</@pageColumn>
 125   </@pageContainer>
 126   </##if> 
 127   <#-- Freemarker macros -->
 128   <#-- Number of items per page selector - Combo Box implementation -->
 129   <#macro NbItemsPerPageSelectorCombo nb_items_per_page>
 130   <@select id='items_per_page' name='items_per_page'>
 131       <#list [ "10" , "20" , "50" , "100" ] as nb>
 132           <#if nb_items_per_page = nb>
 133               <@option selected=true value=nb label=nb />
 134           <#else>
 135               <@option value=nb label=nb />
 136           </#if>
 137       </#list>
 138   </@select>
 139   </#macro>