mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-07-08 09:55:09 +00:00
file lost through rebasing
This commit is contained in:
committed by
Francis Lachapelle
parent
edbd661104
commit
3bf1224c9b
@@ -0,0 +1,54 @@
|
||||
(function() {
|
||||
'use strict';
|
||||
|
||||
function AclUsers(addressbook) {
|
||||
this.addressbook_id = addressbook.id;
|
||||
this.addressbook_name = addressbook.name;
|
||||
this.addressbook_owner = addressbook.owner;
|
||||
}
|
||||
|
||||
/* The factory we'll use to register with Angular */
|
||||
AclUsers.factory = ['$q', '$timeout', 'sgSettings', 'sgResource', function($q, $timeout, Settings, Resource) {
|
||||
angular.extend(AclUsers, {
|
||||
$q: $q,
|
||||
$timeout: $timeout,
|
||||
$$resource: new Resource(Settings.baseURL)
|
||||
});
|
||||
|
||||
return AclUsers; // return constructor
|
||||
}];
|
||||
|
||||
/* Factory registration in Angular module */
|
||||
angular.module('SOGo.Common').factory('sgAclUsers', AclUsers.factory);
|
||||
|
||||
/* Instance methods
|
||||
* Public method, assigned to prototype
|
||||
*/
|
||||
AclUsers.prototype.getUsers = function() {
|
||||
return AclUsers.$$resource.fetch(this.addressbook_id, "getUsersForObject");
|
||||
};
|
||||
|
||||
AclUsers.prototype.searchUsers = function(inputText) {
|
||||
var param = "search=" + inputText;
|
||||
return AclUsers.$$resource.fetch(null, "usersSearch", param);
|
||||
};
|
||||
|
||||
AclUsers.prototype.openRightsForUserId = function(user) {
|
||||
var param = "uid=" + user;
|
||||
return AclUsers.$$resource.fetch(this.addressbook_id, "userRights", param);
|
||||
};
|
||||
|
||||
AclUsers.prototype.addUser = function(user) {
|
||||
var param = "uid=" + user;
|
||||
AclUsers.$$resource.fetch(this.addressbook_id, "addUserInAcls", param);
|
||||
};
|
||||
|
||||
AclUsers.prototype.removeUser = function(user) {
|
||||
var userId = "uid=" + user.UID;
|
||||
AclUsers.$$resource.fetch(this.addressbook_id, "removeUserFromAcls", userId);
|
||||
};
|
||||
|
||||
AclUsers.prototype.saveUsersRights = function(dirtyObjects) {
|
||||
AclUsers.$$resource.saveAclUsers(this.addressbook_id, "saveUserRights", dirtyObjects);
|
||||
};
|
||||
})();
|
||||
@@ -173,7 +173,19 @@
|
||||
$scope.share = function() {
|
||||
var modal = $modal.open({
|
||||
templateUrl: 'addressbookSharing.html',
|
||||
controller: function($scope, $modalInstance) {
|
||||
controller: function($scope, $http, $modalInstance, sgAclUsers) {
|
||||
/* Variables for the scope */
|
||||
$scope.AclUsers = new sgAclUsers($rootScope.addressbook);
|
||||
$scope.userObjects = {};
|
||||
$scope.AclUsers.getUsers().then(function(data) {
|
||||
$scope.users = data;
|
||||
});
|
||||
var dirtyObjects = {};
|
||||
|
||||
/* Functions */
|
||||
$scope.removeButton = function() {
|
||||
return ($scope.userSelected && $scope.userSelected.userClass != "public-user") ? false : true;
|
||||
};
|
||||
$scope.closeModal = function() {
|
||||
$modalInstance.close();
|
||||
};
|
||||
|
||||
@@ -353,6 +353,123 @@ $column-gutter: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
#modalACL {
|
||||
@include grid-row();
|
||||
#usersList {
|
||||
background-color: $f-dropdown-list-hover-bg;
|
||||
border: solid black 1px;
|
||||
box-shadow: 5px 5px 2px #888888;
|
||||
@include grid-column($columns:7);
|
||||
@media #{$medium-up} {
|
||||
@include grid-column($columns:7);
|
||||
}
|
||||
.subscriptionArea {
|
||||
float:right;
|
||||
input, span {
|
||||
vertical-align: -webkit-baseline-middle;
|
||||
margin: 0
|
||||
}
|
||||
}
|
||||
ul {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
li {
|
||||
list-style-type: none;
|
||||
width: 100%;
|
||||
float: left;
|
||||
clear: left;
|
||||
background-color: $f-dropdown-list-hover-bg;
|
||||
transition: background 300ms ease;
|
||||
display: block;
|
||||
color: #666;
|
||||
line-height: rem-calc(24);
|
||||
padding: $table-head-padding;
|
||||
span {
|
||||
vertical-align: -webkit-baseline-middle;
|
||||
}
|
||||
&:hover, &:active {
|
||||
background-color: $f-dropdown-list-hover-bg;
|
||||
background-color: #fff;
|
||||
}
|
||||
&._selected, &._selected span {
|
||||
background-color: $module-color;
|
||||
background-color: #fff;
|
||||
}
|
||||
.removeAclUser:hover {
|
||||
&:focus, &:hover {
|
||||
color: $primary-color;
|
||||
color: #fff;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.addContactsToolbar {
|
||||
width:99%;
|
||||
padding-left: 5px;
|
||||
display:inline-block;
|
||||
}
|
||||
}
|
||||
|
||||
#AccessRightList {
|
||||
overflow: auto;
|
||||
overflow-x: hidden;
|
||||
border-left: solid black;
|
||||
border-top:solid black 1px;
|
||||
border-right:solid black 1px;
|
||||
border-bottom: solid black 1px;
|
||||
min-height: 272px;
|
||||
@include grid-column($columns:6);
|
||||
@media #{$medium-up} {
|
||||
@include grid-column($columns:6);
|
||||
}
|
||||
box-shadow: 5px 5px 2px #888888;
|
||||
background-color: $f-dropdown-list-hover-bg;
|
||||
transition: background 300ms ease;
|
||||
DIV.title
|
||||
{ border-bottom: solid black;
|
||||
background-color:white;
|
||||
}
|
||||
DIV.title SPAN
|
||||
{ float: left;
|
||||
line-height: 14px;
|
||||
text-align: right;
|
||||
width: 120px;
|
||||
}
|
||||
DIV.title SPAN.value
|
||||
{ float: none;
|
||||
margin-left: 2em;
|
||||
font-size: 14px;
|
||||
font-weight: bold;
|
||||
}
|
||||
DIV.title label
|
||||
{ margin-left: 1em;
|
||||
}
|
||||
ul {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
li {
|
||||
list-style-type: none;
|
||||
width: 100%;
|
||||
float: left;
|
||||
clear: left;
|
||||
display: block;
|
||||
color: #666;
|
||||
line-height: rem-calc(24);
|
||||
padding: $table-head-padding;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#aclButtons {
|
||||
clear:both;
|
||||
text-align: right;
|
||||
padding-top:1em;
|
||||
button{
|
||||
margin:0;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.buttonsToolbar {
|
||||
text-align: right;
|
||||
|
||||
Reference in New Issue
Block a user