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.

userpicker.controller.js 1.9KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. /**
  2. * Created by robin on 11/6/15.
  3. */
  4. angular.module('luticate')
  5. .controller('UserPickerController', ['$scope', 'luticateAuthUsers', 'data', '$q', 'dialogs', 'luticateAuthCache',
  6. function($scope, luticateAuthUsers, data, $q, dialogs, luticateAuthCache) {
  7. $scope.selectedUsers = [];
  8. $scope.userPicker = {
  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. permissions: {
  37. add: 'LU_USER_ADD',
  38. del: 'LU_USER_DEL',
  39. edit: 'LU_USER_EDIT'
  40. },
  41. getLoadPagePromise: function (page, perPage, promise) {
  42. return luticateAuthUsers.getAll({page: page, perPage: perPage}, promise);
  43. },
  44. getDelPromise: function (id, promise) {
  45. return luticateAuthUsers.del({user_id: id}, promise);
  46. },
  47. getEditController: function () {
  48. return "UserEdit";
  49. }
  50. };
  51. }]);