Advertisement
Guest User

Untitled

a guest
Jan 19th, 2017
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.19 KB | None | 0 0
  1. var time = {
  2. "Jakub P": {completed: 0, all: 0, ti: 0, tc: 0},
  3. "Konrad S": {completed: 0, all: 0, ti: 0, tc: 0},
  4. "Marcin K": {completed: 0, all: 0, ti: 0, tc: 0},
  5. "Radoslaw W": {completed: 0, all: 0, ti: 0, tc: 0}
  6. };
  7. if ($("#ticket-table").length > 0) {
  8. $("#ticket-table tbody tr").each(function(){
  9. td = $(this).find('td.estimated_time span');
  10. as = $(this).find('td.assignee a').text();
  11. t = $(td).html();
  12. ti = 0;
  13. if (t !== undefined && time[as] != undefined) {
  14. if (t.indexOf("mins") >= 0) {
  15. t.replace(" mins", "");
  16. ti = parseInt(t);
  17. } else {
  18. t = t.replace(" hrs", "");
  19. t = t.replace(" hr", "");
  20. ti = parseInt(t) * 60;
  21. }
  22. time[as].ti += 1;
  23. time[as].all += ti;
  24. if ($(this).find('span.status').html().indexOf('Completed') >= 0) {
  25. time[as].completed += ti;
  26. time[as].tc += 1;
  27. }
  28. }
  29. });
  30. for (var i in time) {
  31. $(".meta-ticket-header__count").append(i + ":<b>" + time[i].tc + "/" + time[i].ti + "/" + time[i].completed + '/' + time[i].all + "</b>, ");
  32. }
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement