<% if(monthRow) { %> <%= monthRow %> <% } %> <% actionType = timeLineItem.get('action_type') %> <% eventType = timeLineItem.get('event_type') %> <% callSource = timeLineItem.get('callSource') %> <% callReceiver = timeLineItem.get('callReceiver') %> <% type = timeLineItem.get('type') %> <% logInfoDescription = '' %> <% leadId = timeLineItem.get('lead_id') %> <% leadFirstName = '' leadLastName = '' if(!_.isEmpty(leadInfo)){ leadFirstName = leadInfo[leadId].lead_first_name leadLastName = leadInfo[leadId].lead_last_name } %> <% timelineDateCreatedAt = moment(timeLineItem.get('created_at'), 'YYYY-MM-DD HH:mm:ss').format('DD-MMM-YYYY') %> <%= (timelineDateCreatedAt !== 'Invalid date') ? timelineDateCreatedAt : '' %> <%= _.isUndefined(i18n['at'])?'at':i18n['at'] %> <%= !_.isEmpty(timeLineItem.get('created_at')) ? timeLineItem.get('created_at').replace(/.*\s/gi, "") : '' %>

<%= _.isEmpty(leadFirstName) ? '': leadFirstName %> <%= _.isEmpty(leadLastName) ? '': leadLastName %>

<% if(type === 'form') {%> <%= _.isUndefined(i18n['Filled up a form'])?'Filled up a form':i18n['Filled up a form'] %> <%=timeLineItem.get('formName')%> <%= _.isUndefined(i18n['on'])?'on':i18n['on'] %> <%= timeLineItem.get('formUrl') %> - <%= _.isUndefined(i18n['View details'])?'View details':i18n['View details'] %>

<% } %> <% if(type === 'meeting') {%> <% if(timeLineItem.get('meetingStatus') === 'created') { %> <%= timeLineItem.get('meetingCreatorId') == currentUserId ? _.isUndefined(i18n['You'])?'You':i18n['You'] : users[timeLineItem.get('meetingCreatorId')] %> <%= _.isUndefined(i18n['scheduled a meeting'])?'scheduled a meeting':i18n['scheduled a meeting'] %> <% } %> <% if(timeLineItem.get('meetingStatus') === 'upcoming') { %> <%= _.isUndefined(i18n['Meeting'])?'Meeting':i18n['Meeting'] %> <% if (timeLineItem.get('meetingSubject') !== null && timeLineItem.get('meetingSubject') !== '') {%> "<%= timeLineItem.get('meetingSubject') %>" <% } %> <%= _.isUndefined(i18n['started'])?'started':i18n['started'] %>. <%= _.isUndefined(i18n['Created by'])?'Created by':i18n['Created by'] %> <%= timeLineItem.get('meetingCreatorId') == currentUserId ? _.isUndefined(i18n['You'])?'You':i18n['You'] : users[timeLineItem.get('meetingCreatorId')] %> <% } %> <% if(timeLineItem.get('meetingStatus') === 'finished') { %> <%= _.isUndefined(i18n['Meeting'])?'Meeting':i18n['Meeting'] %> <% if (timeLineItem.get('meetingSubject') !== null && timeLineItem.get('meetingSubject') !== '') {%> "<%= timeLineItem.get('meetingSubject') %>" <% } %> <%= _.isUndefined(i18n['finished'])?'finished':i18n['finished'] %>. <%= _.isUndefined(i18n['Created by'])?'Created by':i18n['Created by'] %> <%= timeLineItem.get('meetingCreatorId') == currentUserId ? _.isUndefined(i18n['You'])?'You':i18n['You'] : users[timeLineItem.get('meetingCreatorId')] %> <% } %> <% meetingEndTimeDateFormatted = moment(timeLineItem.get('meetingEndTimeDate'), 'YYYY-MM-DD HH:mm:ss').format('DD-MMM-YYYY') %> <%= _.isUndefined(i18n['for'])?'for':i18n['for'] %> <%= (meetingEndTimeDateFormatted !== 'Invalid date') ? meetingEndTimeDateFormatted +' at' : '' %> <%= timeLineItem.get('meetingEndTimeDate').replace(/.*\s/gi, "") %> in <%= timeLineItem.get('meetingLocation') %> with « <%= timeLineItem.get('meetingInviteAttendees') %> » - <%= _.isUndefined(i18n['View details'])?'View details':i18n['View details'] %> <% if(timeLineItem.get('meetingStatus') === 'finished') { %> <%= _.isUndefined(i18n['Add/edit additional comment'])?'Add/edit additional comment':i18n['Add/edit additional comment'] %> <% } %> <% if(logType === 'expired' || logType === 'today') { %> <% if(timeLineItem.get('meetingStatus') === 'finished') { %> <% } %> <% } %> <% } %> <% if(type === 'call' && actionType === 'outbound') {%> <%= timeLineItem.get('callCreatorId') == currentUserId ? _.isUndefined(i18n['You'])?'You':i18n['You'] : users[timeLineItem.get('callCreatorId')] %> <%= _.isUndefined(i18n['placed a call'])?'placed a call':i18n['placed a call'] %> "<%= timeLineItem.get('caller') %>" <%= _.isUndefined(i18n['with status'])?'with status':i18n['with status'] %> "<%= timeLineItem.get('callStatus') %>" <% if(timeLineItem.get('callStatus') === 'completed') { %> <% } %> <% if(_.isNull(timeLineItem.get('callDetails')) || timeLineItem.get('callDetails') === '') { %> <% callDetails = ''; %> <% callLogLabel = _.isUndefined(i18n['Add call details'])?'Add call details':i18n['Add call details']; %> <% } else { %> <% callDetails = timeLineItem.get('callDetails'); %> <% callLogLabel = _.isUndefined(i18n['View call notes'])?'View call notes':i18n['View call notes']; %> <% } %> <%= callLogLabel %> <% } %> <% if(type === 'call' && actionType === 'inbound') {%> <% if (_.isNull(callReceiver)) { %> <% callReceiver = '' %> <% } %> <% if(_.isNull(callSource)) { %> <%= _.isUndefined(i18n['Call received with status'])?'Call received with status':i18n['Call received with status'] %> "<%= timeLineItem.get('callStatus') %>" <% } else { %> <% if (callSource.match('http:\/\/')) { %> <%= _.isUndefined(i18n['Call received through'])?'Call received through':i18n['Call received through'] %> <%=callReceiver %> <%= callSource %> <%= _.isUndefined(i18n['with status'])?'with status':i18n['with status'] %> "<%= timeLineItem.get('callStatus') %>" <% } else { %> <%= _.isUndefined(i18n['Call received through'])?'Call received through':i18n['Call received through'] %> <%=callReceiver %> (<%= callSource %>) <%= _.isUndefined(i18n['with status'])?'with status':i18n['with status'] %> "<%= timeLineItem.get('callStatus') %>" <% } %> <% } %> <% if(timeLineItem.get('callStatus') === 'completed') { %> <% } %> <%= _.isUndefined(i18n['Add call details'])?'Add call details':i18n['Add call details'] %> <% } %> <% if(type === 'email') {%> <% typeLabel = '' %> <% sentToEmail = '' %> <% if (actionType === 'outbound' && timeLineItem.get('emailStatus') === 'sent') { %> <% typeLabel = _.isUndefined(i18n['You sent an email'])?'You sent an email':i18n['You sent an email']; %> <% sentToEmail = ' to '+timeLineItem.get('emailTo') +' '%> <% } %> <% if (actionType === 'outbound' && timeLineItem.get('emailStatus') === 'opened') { %> <% typeLabel = timeLineItem.get('emailTo')+' '+(_.isUndefined(i18n['opened an email'])?'opened an email':i18n['opened an email']) %> <% sentToEmail = '' %> <% } %> <% if (actionType === 'outbound' && timeLineItem.get('emailStatus') === 'openattachment') { %> <% typeLabel = timeLineItem.get('emailTo')+' '+(_.isUndefined(i18n['opened an attachment in email'])?'opened an attachment in email':i18n['opened an attachment in email']) %> <% attachmentLink = $('#website_url').val()+'media/'+timeLineItem.get('emailAttachmentFileFolder') + '/' +timeLineItem.get('emailAttachmentFileName') %> <% sentToEmail = ''+timeLineItem.get('emailAttachmentFileName')+' ' %> <% } %> <%= typeLabel %> "<%= timeLineItem.get('emailSubject') %>" <%= sentToEmail %><%= _.isUndefined(i18n['View email'])?'View email':i18n['View email'] %> <% } %> <% quoteIsDeleted = timeLineItem.get('quoteIsDeleted')%> <% if((type === 'quote' || type === 'quote_deleted') && actionType === 'outbound') {%> <% if(timeLineItem.get('quoteStatus') == 'deleted'){%> <%= timeLineItem.get('quoteCreatorId') == currentUserId ? _.isUndefined(i18n['You'])?'You':i18n['You'] : users[timeLineItem.get('quoteDeletedBy')] %> <%= _.isUndefined(i18n['deleted a quote'])?'deleted a quote':i18n['deleted a quote'] %> "<%= timeLineItem.get('quoteTitle') %>" <%= _.isUndefined(i18n['Current status of the quote'])?'Current status of the quote':i18n['Current status of the quote'] %> "<%= !_.isUndefined(i18n[timeLineItem.get('quoteStatus')])?i18n[timeLineItem.get('quoteStatus')]:timeLineItem.get('quoteStatus') %>" <%= _.isUndefined(i18n['Total'])?'Total':i18n['Total'] %>: <%= accounting.formatMoney(timeLineItem.get('quoteTotal'), JSON.parse(moneyFormat)) %> href="<%= $('#website_url').val()+timeLineItem.get('quoteLink') %>"> <%= timeLineItem.get('quoteLink') %> <% } else if (timeLineItem.get('quoteSent') == '1') { %> <%= timeLineItem.get('quoteCreatorId') == currentUserId ? _.isUndefined(i18n['You'])?'You':i18n['You'] : users[timeLineItem.get('quoteCreatorId')] %> <%= _.isUndefined(i18n['sent a quote'])?'sent a quote':i18n['sent a quote'] %> "<%= timeLineItem.get('quoteTitle') %>" <%= _.isUndefined(i18n['Current status of the quote'])?'Current status of the quote':i18n['Current status of the quote'] %> "<%= !_.isUndefined(i18n[timeLineItem.get('quoteStatus')])?i18n[timeLineItem.get('quoteStatus')]:timeLineItem.get('quoteStatus') %>" <%= _.isUndefined(i18n['Total'])?'Total':i18n['Total'] %>: <%= accounting.formatMoney(timeLineItem.get('quoteTotal'), JSON.parse(moneyFormat)) %> href="<%= $('#website_url').val()+timeLineItem.get('quoteLink') %>"> <%= timeLineItem.get('quoteLink') %> <% } else { %> <%= timeLineItem.get('quoteCreatorId') == currentUserId ? _.isUndefined(i18n['You'])?'You':i18n['You'] : users[timeLineItem.get('quoteCreatorId')] %> <%= _.isUndefined(i18n['edited a quote'])?'edited a quote':i18n['edited a quote'] %> "<%= timeLineItem.get('quoteTitle') %>" <%= _.isUndefined(i18n['Current status of the quote'])?'Current status of the quote':i18n['Current status of the quote'] %> "<%= !_.isUndefined(i18n[timeLineItem.get('quoteStatus')])?i18n[timeLineItem.get('quoteStatus')]:timeLineItem.get('quoteStatus') %>" <%= _.isUndefined(i18n['Total'])?'Total':i18n['Total'] %>: <%= accounting.formatMoney(timeLineItem.get('quoteTotal'), JSON.parse(moneyFormat)) %> href="<%= $('#website_url').val()+timeLineItem.get('quoteLink') %>"> <%= timeLineItem.get('quoteLink') %> <% } %> <% } %> <% if((type === 'quote' || type === 'quote_deleted') && actionType === 'inbound') {%> <% if(timeLineItem.get('quoteStatus') == 'deleted'){%> <%= _.isUndefined(i18n['User deleted a quote'])?'User deleted a quote':i18n['User deleted a quote'] %> "<%= timeLineItem.get('quoteTitle') %>" <%= _.isUndefined(i18n['Current status of the quote'])?'Current status of the quote':i18n['Current status of the quote'] %> "<%= !_.isUndefined(i18n[timeLineItem.get('quoteStatus')])?i18n[timeLineItem.get('quoteStatus')]:timeLineItem.get('quoteStatus') %>" <%= _.isUndefined(i18n['Total'])?'Total':i18n['Total'] %>: <%= accounting.formatMoney(timeLineItem.get('quoteTotal'), JSON.parse(moneyFormat)) %> href="<%= $('#website_url').val()+timeLineItem.get('quoteLink') %>"> <%= timeLineItem.get('quoteLink') %> <%} else if (timeLineItem.get('quoteSent') == '1') { %> <%= _.isUndefined(i18n['User sent a quote'])?'User sent a quote':i18n['User sent a quote'] %> "<%= timeLineItem.get('quoteTitle') %>" <%= _.isUndefined(i18n['Current status of the quote'])?'Current status of the quote':i18n['Current status of the quote'] %> "<%= !_.isUndefined(i18n[timeLineItem.get('quoteStatus')])?i18n[timeLineItem.get('quoteStatus')]:timeLineItem.get('quoteStatus') %>" <%= _.isUndefined(i18n['Total'])?'Total':i18n['Total'] %>: <%= accounting.formatMoney(timeLineItem.get('quoteTotal'), JSON.parse(moneyFormat)) %> href="<%= $('#website_url').val()+timeLineItem.get('quoteLink') %>"> <%= timeLineItem.get('quoteLink') %> <% } else { %> <%= _.isUndefined(i18n['User edited a quote'])?'User edited a quote':i18n['User edited a quote'] %> "<%= timeLineItem.get('quoteTitle') %>" <%= _.isUndefined(i18n['Current status of the quote'])?'Current status of the quote':i18n['Current status of the quote'] %> "<%= !_.isUndefined(i18n[timeLineItem.get('quoteStatus')])?i18n[timeLineItem.get('quoteStatus')]:timeLineItem.get('quoteStatus') %>" <%= _.isUndefined(i18n['Total'])?'Total':i18n['Total'] %>: <%= accounting.formatMoney(timeLineItem.get('quoteTotal'), JSON.parse(moneyFormat)) %> href="<%= $('#website_url').val()+timeLineItem.get('quoteLink') %>"> <%= timeLineItem.get('quoteLink') %> <% } %> <% } %> <% if(type === 'purchase') {%> <% if (timeLineItem.get('purchaseStatus') === 'completed') { %> <%= _.isUndefined(i18n['Placed'])?'Placed':i18n['Placed'] %> <%= _.isUndefined(i18n['order'])?'order':i18n['order'] %> <%= _.isUndefined(i18n['for'])?'for':i18n['for'] %> <%= accounting.formatMoney(timeLineItem.get('purchaseTotal'), JSON.parse(moneyFormat)) %> <% } else { %> <%= _.isUndefined(i18n['Refunded'])?'Refunded':i18n['Refunded'] %> <%= _.isUndefined(i18n['order'])?'order':i18n['order'] %> <%= _.isUndefined(i18n['on'])?'on':i18n['on'] %> <%= accounting.formatMoney(timeLineItem.get('purchaseTotal'), JSON.parse(moneyFormat)) %> <% } %> <% } %> <% if(type === 'registration') {%> <%= _.isUndefined(i18n['User registered as'])?'User registered as':i18n['User registered as'] %> <%= timeLineItem.get('registrationLogUserRole') %> <%= _.isUndefined(i18n['using'])?'using':i18n['using'] %> <%= _.isUndefined(i18n['Registration page'])?'Registration page':i18n['Registration page'] %> <% if(timeLineItem.get('leadUserId') !== null) { %> - <%= _.isUndefined(i18n['View Profile'])?'View Profile':i18n['View Profile'] %> <% } %> <% } %> <% if(type === 'download') {%> <%= _.isUndefined(i18n['File'])?'File':i18n['File'] %> "<%= timeLineItem.get('downloadedFile') %>" <%= _.isUndefined(i18n['downloaded from'])?'downloaded from':i18n['downloaded from'] %> <%= $('#website_url').val() + timeLineItem.get('downloadedPageUrl') %> - <%= _.isUndefined(i18n['View details'])?'View details':i18n['View details'] %> <% } %> <% if(type === 'visit') {%> <% ms = timeLineItem.get('visitTotalTime')*1000 %> <% date = moment.utc(ms) %> <% dateMinutes = date.minutes() %> <% dateSeconds = date.seconds() %> <% formattedDate = '' %> <% if(dateMinutes != '00') { %> <% formattedDate += dateMinutes + ' min ' %> <% } %> <% if(dateSeconds != '00') { %> <% formattedDate += dateSeconds + ' sec' %> <% } %> <%= _.isUndefined(i18n['Visited website'])?'Visited website':i18n['Visited website'] %> <%= _.isNull(timeLineItem.get('visitTotalActions')) ? '': 'for ' + formattedDate +' ('+timeLineItem.get('visitTotalActions') + ' pages)'%> - <%= _.isUndefined(i18n['Visit profile'])?'Visit profile':i18n['Visit profile'] %> <% } %> <% if(type === 'quote_view') {%> <%= _.isUndefined(i18n['Visited website'])?'Viewed quote':i18n['Viewed quote'] %> "<%= timeLineItem.get('quoteTitle') %>" <%= _.isUndefined(i18n['Current quote status is'])?'Current quote status is':i18n['Current quote status is'] %> "<%= !_.isUndefined(i18n[timeLineItem.get('quoteStatus')])?i18n[timeLineItem.get('quoteStatus')]:timeLineItem.get('quoteStatus') %>" <%= _.isUndefined(i18n['Total'])?'Total':i18n['Total'] %>: <%= accounting.formatMoney(timeLineItem.get('quoteTotal'), JSON.parse(moneyFormat)) %> href="<%= $('#website_url').val()+timeLineItem.get('quoteLink') %>"> <%= timeLineItem.get('quoteLink') %> <% } %> <% if(type === 'task') {%> <% if(eventType === 'expired') {%> <%= timeLineItem.get('taskCreatorId') == currentUserId ? _.isUndefined(i18n['You'])?'You':i18n['You'] : users[timeLineItem.get('taskCreatorId')] %> created a task "<%= timeLineItem.get('taskTitle') %>" for <%= currentUserId == timeLineItem.get('taskAssignedToId') ? _.isUndefined(i18n['You'])?'You':i18n['You'] : users[timeLineItem.get('taskAssignedToId')] %> - <%= _.isUndefined(i18n['View details'])?'View details':i18n['View details'] %> <% } else { %> <%= currentUserId == timeLineItem.get('taskAssignedToId') ? _.isUndefined(i18n['You'])?'You':i18n['You'] : users[timeLineItem.get('taskAssignedToId')] %> <%= currentUserId == timeLineItem.get('taskAssignedToId') ? _.isUndefined(i18n['have'])?'have':i18n['have'] : 'has' %> a task scheduled by <%= timeLineItem.get('taskCreatorId') == currentUserId ? _.isUndefined(i18n['You'])?'You':i18n['You'] : users[timeLineItem.get('taskCreatorId')] %> "<%= timeLineItem.get('taskTitle') %>" - <%= _.isUndefined(i18n['View details'])?'View details':i18n['View details'] %> <% } %>
<% if(eventType !== 'expired') {%> <% if(timeLineItem.get('isTaskCompleted') === '0') { %> <% } else { %> <% } %> /> <% } %>
<% if (timeLineItem.get('isTaskCompleted') === '1' && !_.isEmpty(timeLineItem.get('taskCompletionComment')) && !_.isNull(timeLineItem.get('taskCompletionComment'))) { %> <% } %> <% } %> <% if(type === 'task_completed') {%> <%= _.isUndefined(i18n['Task'])?'Task':i18n['Task'] %> "<%= timeLineItem.get('taskTitle') %>" <%= _.isUndefined(i18n['assigned to'])?'assigned to':i18n['assigned to'] %> <%= currentUserId == timeLineItem.get('taskAssignedToId') ? _.isUndefined(i18n['You'])?'You':i18n['You'] : users[timeLineItem.get('taskAssignedToId')] %> <%= _.isUndefined(i18n['by'])?'by':i18n['by'] %> <%= timeLineItem.get('taskCreatorId') == currentUserId ? _.isUndefined(i18n['You'])?'You':i18n['You'] : users[timeLineItem.get('taskCreatorId')] %> <%= _.isUndefined(i18n['completed by'])?'completed by':i18n['completed by'] %> <%= timeLineItem.get('taskCompletedBy') == currentUserId ? _.isUndefined(i18n['You'])?'You':i18n['You'] : users[timeLineItem.get('taskCompletedBy')] %> - <%= _.isUndefined(i18n['View details'])?'View details':i18n['View details'] %>
<% if(timeLineItem.get('isTaskCompleted') === '0') { %> <% } else { %> <% } %> />
<% if (timeLineItem.get('isTaskCompleted') === '1' && !_.isEmpty(timeLineItem.get('taskCompletionComment')) && !_.isNull(timeLineItem.get('taskCompletionComment'))) { %> <% } %> <% } %> <% if (type === 'external') { %> <% eventOldFormat = false; try { eventData = JSON.parse(timeLineItem.get('additional_content')); } catch (e) { eventOldFormat = true; } %> <% if (eventOldFormat === true) { %> <%= timeLineItem.get('additional_content') %> <% } else { %> <%= eventData.shortDescription %> - <%= _.isUndefined(i18n['View details'])?'View details':i18n['View details'] %> <% } %> <% } %>