2015-06-04 01:42:30 +02:00
|
|
|
/* -*- Mode: javascript; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
|
|
|
|
(function() {
|
2015-07-24 22:14:53 +02:00
|
|
|
/* jshint validthis: true */
|
2015-06-04 01:42:30 +02:00
|
|
|
'use strict';
|
|
|
|
|
|
|
|
/**
|
|
|
|
* sgIMIP - A directive to handle IMIP actions on emails
|
|
|
|
* @memberof SOGo.MailerUI
|
|
|
|
* @example:
|
|
|
|
|
|
|
|
*/
|
|
|
|
function sgImip() {
|
|
|
|
return {
|
|
|
|
restrict: 'A',
|
|
|
|
link: link,
|
2015-07-28 20:37:49 +02:00
|
|
|
controller: 'sgImipController'
|
2015-06-04 01:42:30 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
function link(scope, iElement, attrs, ctrl) {
|
|
|
|
ctrl.pathToAttachment = attrs.sgImipPath;
|
|
|
|
}
|
2015-07-28 20:37:49 +02:00
|
|
|
}
|
2015-06-04 01:42:30 +02:00
|
|
|
|
2015-07-28 20:37:49 +02:00
|
|
|
/**
|
|
|
|
* @ngInject
|
|
|
|
*/
|
|
|
|
sgImipController.$inject = ['$scope', 'User'];
|
|
|
|
function sgImipController($scope, User) {
|
|
|
|
var vm = this;
|
2015-07-24 22:14:53 +02:00
|
|
|
|
2015-07-28 20:37:49 +02:00
|
|
|
$scope.delegateInvitation = false;
|
|
|
|
$scope.delegatedTo = '';
|
|
|
|
$scope.searchText = '';
|
2015-07-24 22:14:53 +02:00
|
|
|
|
2015-07-28 20:37:49 +02:00
|
|
|
$scope.userFilter = function($query) {
|
|
|
|
return User.$filter($query);
|
|
|
|
};
|
2015-07-24 22:14:53 +02:00
|
|
|
|
2015-07-28 20:37:49 +02:00
|
|
|
$scope.iCalendarAction = function(action) {
|
|
|
|
var data;
|
2015-07-24 22:14:53 +02:00
|
|
|
|
2015-07-28 20:37:49 +02:00
|
|
|
if (action == 'delegate') {
|
|
|
|
data = {
|
|
|
|
receiveUpdates: false,
|
|
|
|
delegatedTo: $scope.delegatedTo.c_email
|
|
|
|
};
|
|
|
|
}
|
2015-06-04 01:42:30 +02:00
|
|
|
|
2015-08-04 19:52:31 +02:00
|
|
|
$scope.viewer.message.$imipAction(vm.pathToAttachment, action, data);
|
2015-07-28 20:37:49 +02:00
|
|
|
};
|
2015-06-04 01:42:30 +02:00
|
|
|
}
|
2015-07-24 22:14:53 +02:00
|
|
|
|
2015-06-04 01:42:30 +02:00
|
|
|
angular
|
|
|
|
.module('SOGo.MailerUI')
|
2015-07-28 20:37:49 +02:00
|
|
|
.controller('sgImipController', sgImipController)
|
2015-06-04 01:42:30 +02:00
|
|
|
.directive('sgImip', sgImip);
|
|
|
|
})();
|
|
|
|
|