Fixed issue #1478 - Allow cti log entries to check done (also if no hangup state is available).

This commit is contained in:
Martin Edenhofer 2017-09-26 11:08:04 +02:00
parent 31b11546f4
commit 2075117635
2 changed files with 9 additions and 4 deletions

View file

@ -142,7 +142,7 @@ class App.CTI extends App.Controller
for item in @list
item.status_class = ''
item.disabled = true
if item.state is 'newCall'
item.state_human = 'ringing'
item.status_class = 'neutral'
@ -150,6 +150,7 @@ class App.CTI extends App.Controller
item.state_human = 'connected'
item.status_class = 'ok'
else if item.state is 'hangup'
item.disabled = false
item.state_human = switch item.comment
when 'cancel', 'noAnswer', 'congestion' then 'not reached'
when 'busy' then 'busy'
@ -164,6 +165,10 @@ class App.CTI extends App.Controller
if item.start && item.end
item.duration = format((Date.parse(item.end) - Date.parse(item.start))/1000)
diff_in_min = ((Date.now() - Date.parse(item.created_at)) / 1000) / 60
if diff_in_min > 1
item.disabled = false
@userPopupsDestroy()
@callerLog.html( App.view('cti/caller_log')(list: @list))
@userPopups()

View file

@ -11,10 +11,10 @@
</thead>
<tbody>
<% for item in @list: %>
<tr <% if item.state is 'hangup' && item.done: %>class="is-grayed-out"<% end %> data-id="<%- item.id %>">
<tr <% if item.done: %>class="is-grayed-out"<% end %> data-id="<%- item.id %>">
<td class="table-checkbox" style="vertical-align: middle">
<label class="checkbox-replacement<% if item.state isnt 'hangup': %> is-disabled<% end %>">
<input type="checkbox" class="js-check"<% if item.done: %> checked<% end %><% if item.state isnt 'hangup': %> disabled<% end %>>
<label class="checkbox-replacement<% if item.disabled is true: %> is-disabled<% end %>">
<input type="checkbox" class="js-check"<% if item.done: %> checked<% end %><% if item.disabled is true: %> disabled<% end %>>
<%- @Icon('checkbox', 'icon-unchecked') %>
<%- @Icon('checkbox-checked', 'icon-checked') %>
</label>