| Line 95... |
Line 95... |
| 95 |
<th>Check Out Time</th>
|
95 |
<th>Check Out Time</th>
|
| 96 |
<th>Time Spent at Outlet</th>
|
96 |
<th>Time Spent at Outlet</th>
|
| 97 |
<th>Transit Time</th>
|
97 |
<th>Transit Time</th>
|
| 98 |
<th>Distance (km)</th>
|
98 |
<th>Distance (km)</th>
|
| 99 |
<th>Estimated Time</th>
|
99 |
<th>Estimated Time</th>
|
| - |
|
100 |
<th>Description</th>
|
| 100 |
</tr>
|
101 |
</tr>
|
| 101 |
</thead>
|
102 |
</thead>
|
| 102 |
<tbody>
|
103 |
<tbody>
|
| 103 |
#if($punchIn)
|
104 |
#if($punchIn)
|
| 104 |
<tr style="background:#d5f5e3;">
|
105 |
<tr style="background:#d5f5e3;">
|
| 105 |
<td>--</td>
|
106 |
<td>--</td>
|
| 106 |
<td><strong>PUNCH IN</strong></td>
|
107 |
<td><strong>PUNCH IN</strong></td>
|
| 107 |
<td>$!punchIn.getTaskType()</td>
|
108 |
<td>$!punchIn.getTaskType()</td>
|
| 108 |
<td><span class="label label-info">PUNCHIN</span> #if($punchIn.getAttachment() && $punchIn.getAttachment() != "")<a href="javascript:void(0);" class="view-attachment-link" data-attachment="$punchIn.getAttachment()" data-checkin-latlng="$!punchIn.getCheckInLatLng()" data-visit-location="$!punchIn.getVisitLocation()" data-tracking-id="$punchIn.getId()" title="View Attachment"><i class="fa fa-paperclip" style="color:#e67e22; margin-left:5px;"></i></a>#end</td>
|
109 |
<td><span class="label label-info">PUNCHIN</span> #if($punchIn.getAttachment() && $punchIn.getAttachment() != "")<a href="javascript:void(0);" class="view-attachment-link" data-attachment="$punchIn.getAttachment()" data-checkin-latlng="$!punchIn.getCheckInLatLng()" data-visit-location="$!punchIn.getVisitLocation()" data-tracking-id="$punchIn.getId()" title="View Attachment"><i class="fa fa-paperclip" style="color:#27ae60; margin-left:5px;"></i></a>#end</td>
|
| 109 |
<td>$!punchIn.getAddress()</td>
|
110 |
<td>$!punchIn.getAddress()</td>
|
| 110 |
<td>$!punchIn.getCheckInTime()</td>
|
111 |
<td>$!punchIn.getCheckInTime()</td>
|
| 111 |
<td>--</td>
|
112 |
<td>--</td>
|
| 112 |
<td>--</td>
|
113 |
<td>--</td>
|
| 113 |
<td>--</td>
|
114 |
<td>--</td>
|
| 114 |
<td>$!punchIn.getTotalDistance()</td>
|
115 |
<td>$!punchIn.getTotalDistance()</td>
|
| 115 |
<td>$!punchIn.getEstimatedTime()</td>
|
116 |
<td>$!punchIn.getEstimatedTime()</td>
|
| - |
|
117 |
<td>--</td>
|
| 116 |
</tr>
|
118 |
</tr>
|
| 117 |
#end
|
119 |
#end
|
| 118 |
#set($idx = 1)
|
120 |
#set($idx = 1)
|
| 119 |
#foreach($v in $visits)
|
121 |
#foreach($v in $visits)
|
| 120 |
<tr>
|
122 |
<tr>
|
| Line 130... |
Line 132... |
| 130 |
<span class="label label-danger">$v.getMarkType()</span>
|
132 |
<span class="label label-danger">$v.getMarkType()</span>
|
| 131 |
#else
|
133 |
#else
|
| 132 |
<span class="label label-default">$!v.getMarkType()</span>
|
134 |
<span class="label label-default">$!v.getMarkType()</span>
|
| 133 |
#end
|
135 |
#end
|
| 134 |
<a href="javascript:void(0);" class="beat-history-link" data-userid="$userId" data-taskid="$v.getTaskId()" data-tasktype="$!v.getTaskType()" data-taskname="$!v.getTaskName()" title="View History" style="margin-left:5px;"><i class="fa fa-history" style="color:#3498db; font-size:14px;"></i></a>
|
136 |
<a href="javascript:void(0);" class="beat-history-link" data-userid="$userId" data-taskid="$v.getTaskId()" data-tasktype="$!v.getTaskType()" data-taskname="$!v.getTaskName()" title="View History" style="margin-left:5px;"><i class="fa fa-history" style="color:#3498db; font-size:14px;"></i></a>
|
| 135 |
#if($v.getAttachment() && $v.getAttachment() != "")<a href="javascript:void(0);" class="view-attachment-link" data-attachment="$v.getAttachment()" data-checkin-latlng="$!v.getCheckInLatLng()" data-visit-location="$!v.getVisitLocation()" data-tracking-id="$v.getId()" title="View Attachment"><i class="fa fa-paperclip" style="color:#e67e22; margin-left:3px; font-size:14px;"></i></a>#end
|
137 |
#if($v.getAttachment() && $v.getAttachment() != "")<a href="javascript:void(0);" class="view-attachment-link" data-attachment="$v.getAttachment()" data-checkin-latlng="$!v.getCheckInLatLng()" data-visit-location="$!v.getVisitLocation()" data-tracking-id="$v.getId()" title="View Attachment"><i class="fa fa-paperclip" style="color:#27ae60; margin-left:3px; font-size:14px;"></i></a>#end
|
| 136 |
</td>
|
138 |
</td>
|
| 137 |
<td>$!v.getAddress()</td>
|
139 |
<td>$!v.getAddress()</td>
|
| 138 |
<td>$!v.getCheckInTime()</td>
|
140 |
<td>$!v.getCheckInTime()</td>
|
| 139 |
<td>$!v.getCheckOutTime()</td>
|
141 |
<td>$!v.getCheckOutTime()</td>
|
| 140 |
<td>$!v.getTimeSpent()</td>
|
142 |
<td>$!v.getTimeSpent()</td>
|
| 141 |
<td>$!v.getTransitTime()</td>
|
143 |
<td>$!v.getTransitTime()</td>
|
| 142 |
<td>$!v.getTotalDistance()</td>
|
144 |
<td>$!v.getTotalDistance()</td>
|
| 143 |
<td>$!v.getEstimatedTime()</td>
|
145 |
<td>$!v.getEstimatedTime()</td>
|
| - |
|
146 |
<td>#if($v.getTaskDescription() && $v.getTaskDescription() != "")#if($v.getTaskDescription().length() > 50)<span class="desc-short">$v.getTaskDescription().substring(0, 50)... <a href="javascript:void(0);" class="read-more-link" style="color:#3498db;">read more</a></span><span class="desc-full" style="display:none;">$v.getTaskDescription() <a href="javascript:void(0);" class="read-less-link" style="color:#3498db;">read less</a></span>#else$v.getTaskDescription()#end#else--#end</td>
|
| 144 |
</tr>
|
147 |
</tr>
|
| 145 |
#set($idx = $idx + 1)
|
148 |
#set($idx = $idx + 1)
|
| 146 |
#end
|
149 |
#end
|
| 147 |
#if($punchOut)
|
150 |
#if($punchOut)
|
| 148 |
<tr style="background:#fadbd8;">
|
151 |
<tr style="background:#fadbd8;">
|
| 149 |
<td>--</td>
|
152 |
<td>--</td>
|
| 150 |
<td><strong>PUNCH OUT</strong></td>
|
153 |
<td><strong>PUNCH OUT</strong></td>
|
| 151 |
<td>$!punchOut.getTaskType()</td>
|
154 |
<td>$!punchOut.getTaskType()</td>
|
| 152 |
<td><span class="label label-danger">PUNCHOUT</span> #if($punchOut.getAttachment() && $punchOut.getAttachment() != "")<a href="javascript:void(0);" class="view-attachment-link" data-attachment="$punchOut.getAttachment()" data-checkin-latlng="$!punchOut.getCheckInLatLng()" data-visit-location="$!punchOut.getVisitLocation()" data-tracking-id="$punchOut.getId()" title="View Attachment"><i class="fa fa-paperclip" style="color:#e67e22; margin-left:5px;"></i></a>#end</td>
|
155 |
<td><span class="label label-danger">PUNCHOUT</span> #if($punchOut.getAttachment() && $punchOut.getAttachment() != "")<a href="javascript:void(0);" class="view-attachment-link" data-attachment="$punchOut.getAttachment()" data-checkin-latlng="$!punchOut.getCheckInLatLng()" data-visit-location="$!punchOut.getVisitLocation()" data-tracking-id="$punchOut.getId()" title="View Attachment"><i class="fa fa-paperclip" style="color:#27ae60; margin-left:5px;"></i></a>#end</td>
|
| 153 |
<td>$!punchOut.getAddress()</td>
|
156 |
<td>$!punchOut.getAddress()</td>
|
| 154 |
<td>$!punchOut.getCheckInTime()</td>
|
157 |
<td>$!punchOut.getCheckInTime()</td>
|
| 155 |
<td>--</td>
|
158 |
<td>--</td>
|
| 156 |
<td>--</td>
|
159 |
<td>--</td>
|
| 157 |
<td>--</td>
|
160 |
<td>--</td>
|
| 158 |
<td>$!punchOut.getTotalDistance()</td>
|
161 |
<td>$!punchOut.getTotalDistance()</td>
|
| 159 |
<td>$!punchOut.getEstimatedTime()</td>
|
162 |
<td>$!punchOut.getEstimatedTime()</td>
|
| - |
|
163 |
<td>--</td>
|
| 160 |
</tr>
|
164 |
</tr>
|
| 161 |
#end
|
165 |
#end
|
| 162 |
</tbody>
|
166 |
</tbody>
|
| 163 |
<tfoot>
|
167 |
<tfoot>
|
| 164 |
<tr style="background:#f2f3f4; font-weight:bold;">
|
168 |
<tr style="background:#f2f3f4; font-weight:bold;">
|
| Line 167... |
Line 171... |
| 167 |
<td>--</td>
|
171 |
<td>--</td>
|
| 168 |
<td>$totalTimeSpentStr</td>
|
172 |
<td>$totalTimeSpentStr</td>
|
| 169 |
<td>$totalTransitStr</td>
|
173 |
<td>$totalTransitStr</td>
|
| 170 |
<td>$totalDistanceStr km | Visits: $visitCount | Leads: $leadCount</td>
|
174 |
<td>$totalDistanceStr km | Visits: $visitCount | Leads: $leadCount</td>
|
| 171 |
<td></td>
|
175 |
<td></td>
|
| - |
|
176 |
<td></td>
|
| 172 |
</tr>
|
177 |
</tr>
|
| 173 |
</tfoot>
|
178 |
</tfoot>
|
| 174 |
</table>
|
179 |
</table>
|
| 175 |
</div>
|
180 |
</div>
|
| 176 |
</section>
|
181 |
</section>
|
| Line 248... |
Line 253... |
| 248 |
"bInfo": true,
|
253 |
"bInfo": true,
|
| 249 |
"bAutoWidth": false,
|
254 |
"bAutoWidth": false,
|
| 250 |
"ordering": false
|
255 |
"ordering": false
|
| 251 |
});
|
256 |
});
|
| 252 |
|
257 |
|
| - |
|
258 |
$('.view-attachment-link').each(function () {
|
| - |
|
259 |
var checkinLatLng = $(this).data('checkin-latlng') || '';
|
| - |
|
260 |
var visitLocation = $(this).data('visit-location') || '';
|
| - |
|
261 |
if (checkinLatLng && visitLocation && checkinLatLng.toString().indexOf(',') > 0 && visitLocation.toString().indexOf(',') > 0) {
|
| - |
|
262 |
var cParts = checkinLatLng.toString().split(',');
|
| - |
|
263 |
var vParts = visitLocation.toString().split(',');
|
| - |
|
264 |
var cLat = parseFloat(cParts[0]), cLng = parseFloat(cParts[1]);
|
| - |
|
265 |
var vLat = parseFloat(vParts[0]), vLng = parseFloat(vParts[1]);
|
| - |
|
266 |
if (!isNaN(cLat) && !isNaN(cLng) && !isNaN(vLat) && !isNaN(vLng) && !(cLat === 0 && cLng === 0) && !(vLat === 0 && vLng === 0)) {
|
| - |
|
267 |
if (haversineMeters(cLat, cLng, vLat, vLng) > 50) {
|
| - |
|
268 |
$(this).find('i').css('color', '#e74c3c');
|
| - |
|
269 |
}
|
| - |
|
270 |
}
|
| - |
|
271 |
}
|
| - |
|
272 |
});
|
| - |
|
273 |
|
| 253 |
(function () {
|
274 |
(function () {
|
| 254 |
var level = $('#user-detail-level').data('selected');
|
275 |
var level = $('#user-detail-level').data('selected');
|
| 255 |
var selectedAuth = $('#user-detail-user').data('selected-auth');
|
276 |
var selectedAuth = $('#user-detail-user').data('selected-auth');
|
| 256 |
if (level && selectedAuth) {
|
277 |
if (level && selectedAuth) {
|
| 257 |
$.ajax({
|
278 |
$.ajax({
|
| Line 267... |
Line 288... |
| 267 |
}
|
288 |
}
|
| 268 |
});
|
289 |
});
|
| 269 |
}
|
290 |
}
|
| 270 |
})();
|
291 |
})();
|
| 271 |
|
292 |
|
| - |
|
293 |
$(document).on('click', '.read-more-link', function () {
|
| - |
|
294 |
$(this).closest('td').find('.desc-short').hide();
|
| - |
|
295 |
$(this).closest('td').find('.desc-full').show();
|
| - |
|
296 |
});
|
| - |
|
297 |
$(document).on('click', '.read-less-link', function () {
|
| - |
|
298 |
$(this).closest('td').find('.desc-full').hide();
|
| - |
|
299 |
$(this).closest('td').find('.desc-short').show();
|
| - |
|
300 |
});
|
| - |
|
301 |
|
| 272 |
$(document).off('click.beatdetail').off('click.livetrack');
|
302 |
$(document).off('click.beatdetail').off('click.livetrack');
|
| 273 |
|
303 |
|
| 274 |
$(document).on('click.beatdetail', '.beat-history-link', function () {
|
304 |
$(document).on('click.beatdetail', '.beat-history-link', function () {
|
| 275 |
var userId = $(this).data('userid');
|
305 |
var userId = $(this).data('userid');
|
| 276 |
var taskId = $(this).data('taskid');
|
306 |
var taskId = $(this).data('taskid');
|