team.ui.js 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. /**
  2. * Delete memeber of execution team.
  3. *
  4. * @param int $executionID
  5. * @param int $userID
  6. * @access public
  7. * @return void
  8. */
  9. window.deleteMember = function(executionID, userID)
  10. {
  11. zui.Modal.confirm({message: confirmUnlinkMember, icon:'icon-exclamation-sign', iconClass: 'warning-pale rounded-full icon-2x'}).then((res) =>
  12. {
  13. if(res) $.ajaxSubmit({url: $.createLink('execution', 'unlinkMember', 'executionID=' + executionID + '&userID=' + userID)});
  14. });
  15. }
  16. /**
  17. * Set team summary for table footer.
  18. *
  19. * @access public
  20. * @return object
  21. */
  22. window.setTeamStatistics = function()
  23. {
  24. const rows = this.layout.allRows;
  25. let totalHours = 0;
  26. rows.forEach(function(row)
  27. {
  28. totalHours += parseFloat(row.data.totalHours);
  29. });
  30. return {html: pageSummary.replace('%totalHours%', totalHours)};
  31. }
  32. window.renderCell = function(result, {col, row})
  33. {
  34. if(col.name == 'realname' && !deptUsers[row.data.userID])
  35. {
  36. result[0] = {html: "<a href='javascript:checkUserDept();'>" + row.data.realname + '</a>'};
  37. return result;
  38. }
  39. return result;
  40. }
  41. window.checkUserDept = function()
  42. {
  43. alert(noAccess);
  44. }