-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPeople.html
342 lines (301 loc) · 11.7 KB
/
People.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
<!DOCTYPE html>
<html>
<head>
<title>All Content</title>
<meta about="Search all content at once."/>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
<meta name="viewport"
content="width=device-width, height=device-height, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
<script src="js/CoveoJsSearch.WithDependencies.js"></script>
<script src="js/CoveoResultRelatedResults.js"></script>
<script src="js/d3.js"></script>
<script src="//code.jquery.com/ui/1.11.3/jquery-ui.js"></script>
<link rel="stylesheet" href="//code.jquery.com/ui/1.11.3/themes/smoothness/jquery-ui.css">
<link rel="stylesheet" href="Calendar/fullcalendar.min.css">
<script src="Calendar/moment.min.js"></script>
<script src="Calendar/fullcalendar.min.js"></script>
<link rel="stylesheet" href="css/CoveoFullSearch.css"/>
<style>
.calAvail{ background-color:#42d692; }
.calAvailHalf { background-color:#ee8a36;}
.calNotAvail { background-color:#d83a28;}
.ProposedHalf { background-color:#ee8a36;}
.Holiday { border-color: green }
.Training { border-color: red}
.Selected { border-top: 2px;border-bottom:2px;border-color:black}
.NotSelected { zoom: 1;
filter: alpha(opacity=20);
opacity: 0.2; }
.calReserveHalf { background-color:#ee8a36;}
.calReserved { background-color:#d83a28;}
.Calendar h2 {
font-size:1.2em;
}
.fc-bg tr td{
height: 20px;
}
.fc-content-skeleton tr {
height: 2px;
}
</style>
<script type="text/javascript">
var FieldnameAvail="@mydateavail";
var FieldnameAvailClean="mydateavail";
var NrOfMonths=0;
function getFullDates(min,max)
{
var result="";
var minDate = new Date(min);
var maxDate = new Date(max);
var NrofDays=0;
var one_day=1000*60*60*24;
NrOfMonths=maxDate.getMonth()-minDate.getMonth()+1;
NrofDays=Math.round((maxDate.getTime()-minDate.getTime())/one_day);
for (i = 0; i <= NrofDays; i++)
{
var check = new Date(minDate.getFullYear(),minDate.getMonth(),minDate.getDate()+i);
//Do not add saturday and sundays
if (check.getDay()%6==0)
{
}
else
{
if (result == "")
{
result = FieldnameAvail + "=\"" + $.datepicker.formatDate('yymmdd', check) /*+ Hours.ToString() */+ "\"";
}
else
{
result = result + " AND " + FieldnameAvail + "=\"" + $.datepicker.formatDate('yymmdd', check) /*+ Hours.ToString() */+ "\"";
}
}
}
return result;
}
$(function () {
//Used for the related results on a result
Coveo.Rest.SearchEndpoint.configureOnPremiseEndpoint('http://localhost:8080/rest/search');
$('#search').coveo('init');
//Initialize the date pickers
var dates = $( "#CALMinimumDateTxt, #CALMaximumDateTxt" ).datepicker({
defaultDate: '+0',
changeMonth: true,
dateFormat:'dd-mm-yy',
showAnim:'slideDown',
showWeek:true,
showButtonPanel:true,
firstday:1,
numberOfMonths: 3,
onSelect: function( selectedDate ) {
var option = this.id == "CALMinimumDateTxt"? "minDate" : "maxDate",
instance = $( this ).data( "datepicker" ),
date = $.datepicker.parseDate('dd-mm-yy', selectedDate, instance.settings );
dates.not( this ).datepicker( 'option', option, date );
$('#CALMinimumDateTxt').trigger('change');
}
});
//Hook up to the query to add the dates (if needed)
//We also will add the nested query to get resume content
$('#search').on("buildingQuery", function (e, args) {
var radiosel=$('input:radio[name=avail]:checked').val();
if ( radiosel!='All')
{
var addquery=getFullDates($('#CALMinimumDateTxt').datepicker('getDate'),$('#CALMaximumDateTxt').datepicker('getDate'));
if (radiosel=='Avail')
{
args.queryBuilder.advancedExpression.add("("+addquery+")");
}
else
{
args.queryBuilder.advancedExpression.add("NOT ("+addquery+")");
}
}
//We also want to add a nested query against the resume's
// add the disjunction query to get all comments, attachments and tickets matching the query
var basicExpression = args.queryBuilder.expression.build();
var completeQuery = (typeof basicExpression==='undefined') ? "":"(" + basicExpression + ")";
var advancedExpression = "";
if (completeQuery!="") {
args.queryBuilder.disjunctionExpression.add("@sysfiletype=activedirperson @employeenumber=[[@mycvemp] ("+completeQuery+") "+advancedExpression+" ]");
}
});
$('.CoveoSearchInterface').on('newResultDisplayed', function(e, args) {
//Add the calendar to the result, only if it is selected
var mycal=$(args.item).find('.Calendar');
mycal.empty();
if ($('#CALMaximumDateTxt').val()!="" && $('#CALMinimumDateTxt').val()!="")
{
var Start=$('#CALMinimumDateTxt').datepicker('getDate');
var StartDate=$('#CALMinimumDateTxt').datepicker('getDate');
var EndDate=$('#CALMaximumDateTxt').datepicker('getDate');
NrOfMonths=$('#CALMaximumDateTxt').datepicker('getDate').getMonth()-$('#CALMinimumDateTxt').datepicker('getDate').getMonth();
for(i=0;i<=NrOfMonths;i++)
{
var newcal = Coveo.$('<div/>').addClass('mycalendar'+i).appendTo(mycal);
newcal.css('width','200px').css('display','inline-block').css('margin','5px');
newcal.fullCalendar({
height: 150,
width: 150,
weekNumbers: false,
columnFormat: 'dd',
defaultDate: Start,
contentHeight: 'auto',
aspectRatio: 5,
header: {
left: 'title',
center: '',
right: ''
},
dayRender: function (date, cell) {
if (date<StartDate || date>EndDate)
{
//disable it
cell.addClass("NotSelected");
}
else
{
//disable it
cell.addClass("Selected");
}
//If our result contains this date then available else not
var curdate=moment(date).format('YYYYMMDD');
if (args.result.raw[FieldnameAvailClean].indexOf(curdate)!=-1)
{
//disable it
cell.addClass("calAvail");
cell.attr('title','Available');
}
else
{
//disable it
cell.addClass("calNotAvail");
cell.attr('title','Not Available');
}
}
});
Start=new Date(Start.getFullYear(),Start.getMonth()+1,Start.getDate());
}
}
});
});
</script>
</head>
<body id="search" class='CoveoSearchInterface' data-enable-history="true">
<div class="coveo-tab-section">
<a class="CoveoTab"
data-id="All"
data-caption="People"
data-icon="coveo-sprites-tab-all-content"
data-expression='@sysworkemail @mydateavail'
></a>
</div>
<div class="coveo-search-section">
<div class="coveo-logo-column">
<div class="coveo-logo"></div>
</div>
<div class="coveo-searchBox-column" >
<div class="coveo-search-section-wrapper">
<div class="CoveoSettings" data-include-in-menu=".CoveoShareQuery,.CoveoPreferencesPanel"></div>
<div class="CoveoSearchBox" data-activate-omnibox="true"></div>
</div>
</div>
<div class="coveo-logo-column">
</div>
<div class="coveo-searchBox-column" >
<div class="coveo-search-section-wrapper">
From: <input type="text" id="CALMinimumDateTxt"> To: <input type="text" id="CALMaximumDateTxt"><br>
Show availability: <input type="radio" name="avail" value="All" checked>All <input type="radio" name="avail" value="Avail">Only Available people
<input type="radio" name="avail" value="NotAvail">Only NOT Available people
</div>
</div>
</div>
<div class="coveo-results-section">
<div class="coveo-facet-column">
<div data-tab="All">
<div class="CoveoFacetRange" data-tab="All" data-title="Relative date distribution" data-field="@sysdate"
data-date-field="true" data-range-slider="true" data-slider-graph-steps="20"
data-slider-start="2007/12/31"
data-slider-end="2014/12/31"></div>
<div class="CoveoFacet"
data-title="Type"
data-field="@objecttype"
data-allow-toggling-operator="true"
data-show-icon="true"
data-tab="All"></div>
<div class="CoveoFacet"
data-title="File Type"
data-field="@sysfiletype"></div>
<div class="CoveoFacet"
data-title="Author"
data-field="@sysauthor"></div>
</div>
</div>
<div class="coveo-results-column">
<div class="CoveoShareQuery"></div>
<div class="CoveoPreferencesPanel">
<div class="CoveoResultsPreferences"></div>
<div class="CoveoResultsFiltersPreferences"></div>
</div>
<div class="CoveoBreadcrumb"></div>
<div class="coveo-results-header">
<div class="coveo-summary-section">
<span class="CoveoQuerySummary"></span>
<span class="CoveoQueryDuration"></span>
</div>
<div class="coveo-sort-section">
<span class="CoveoSort" data-sort-criteria="relevancy">Relevance</span>
<span class="CoveoSort" data-sort-criteria="date descending,date ascending">Date</span>
</div>
<div class="coveo-clear"></div>
</div>
<div class="CoveoHiddenQuery"></div>
<div class="CoveoDidYouMean"></div>
<div class="CoveoErrorReport" data-pop-up="false"></div>
<div class="CoveoResultList" data-wait-animation="fade">
<script id="Default" type="text/x-underscore-template">
<div style="margin:5px" width="100px">
<%= thumbnail(undefined,undefined,{'width':'100px'})%>
</div>
<div class="coveo-date"><%-dateTime(raw.sysdate)%></div>
<div class="coveo-title">
<a class="CoveoResultLink" ><%=title?highlight(title, titleHighlights):clickUri%></a>
<%= loadTemplate("DefaultQuickView") %>
</div>
<div class="coveo-excerpt">
<%=highlight(excerpt, excerptHighlights)%>
</div>
<div class="CoveoPrintableUri"></div>
<table class="CoveoFieldTable">
<tr data-field="@sysauthor" data-caption="Author"></tr>
</table>
<div class="Calendar" style=""></div>
</script>
<script id="DefaultQuickView" type="text/x-underscore-template">
<div class="CoveoQuickView" data-title="<%= attrEncode(fromFileTypeToIcon(obj) + title) %>"
data-fixed="true"
data-template-id="DefaultQuickViewContent">
</div>
</script>
<script id="DefaultQuickViewContent" type="text/x-underscore-template">
<div class="coveo-quick-view-header">
<table class="CoveoFieldTable">
<tr data-field="@sysdate" data-caption="Date" data-helper="dateTime"></tr>
<tr data-field="@objecttype" data-caption="Type"></tr>
</table>
</div>
<div class="CoveoQuickViewDocument"></div>
</script>
<script class="result-template" type="text/x-underscore-template">
<%=
loadTemplates({
'Default' : 'default'
})
%>
</script>
</div>
<div class="CoveoPager"></div>
</div>
</div>
</body>
</html>