You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

groupusers.controller.js 2.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. /**
  2. * Created by robin on 11/2/15.
  3. */
  4. angular.module('luticate')
  5. .controller('GroupUsersController', ['$scope', 'luticateAuthGroups', 'data', 'dialogs',
  6. function($scope, luticateAuthGroups, data, dialogs) {
  7. $scope.group = data;
  8. $scope.itemPicker = {
  9. columns: [
  10. {
  11. name: "Username",
  12. width: 3,
  13. getValue: function (item) {
  14. return item.Username;
  15. }
  16. }, {
  17. name: "Email",
  18. width: 3,
  19. getValue: function (item) {
  20. return item.Email;
  21. }
  22. }, {
  23. name: "Firstname",
  24. width: 3,
  25. getValue: function (item) {
  26. return item.Firstname;
  27. }
  28. }, {
  29. name: "Lastname",
  30. width: 3,
  31. getValue: function (item) {
  32. return item.Lastname;
  33. }
  34. }
  35. ],
  36. onItemClicked: function(item)
  37. {
  38. $scope.itemPicker.luBasicTableScope.toggleCheckedItem(item);
  39. },
  40. editData: $scope.group,
  41. canAdd: 'LU_GROUP_USER_ADD',
  42. canDel: 'LU_GROUP_USER_DEL',
  43. canEdit: function()
  44. {
  45. return true;
  46. },
  47. canFilter: function()
  48. {
  49. return false;
  50. },
  51. getLoadPagePromise: function (page, perPage, query, promise) {
  52. return luticateAuthGroups.usersGetAll({
  53. group_id: $scope.group.Id,
  54. page: page,
  55. perPage: perPage,
  56. query: query
  57. }, promise);
  58. },
  59. getDelPromise: function (id, promise) {
  60. return luticateAuthGroups.usersDel({
  61. group_id: $scope.group.Id,
  62. user_id: id
  63. }, promise);
  64. },
  65. getEditController: function () {
  66. return "GroupUsersAdd";
  67. },
  68. getItemText: function(item)
  69. {
  70. return item.Username;
  71. }
  72. };
  73. }]);