(web) Allow to change participants roles

This commit is contained in:
Francis Lachapelle committed 2019-02-19 11:52:13 -05:00
1 parent 76e8633423
commit 5371838159
7 files changed
+76 -8

No files matched your search

+1
View File
@@ -6,6 +6,7 @@ Enhancements
- [web] updated Angular to version 1.7.7
- [web] restored support for next/previous slot suggestion in attendees editor
- [web] improved auto-completion display of contacts
- [web] allow modification of attendees participation role
- [core] baseDN now accept dynamic domain values (#3685 - sponsored by iRedMail)
- [core] we now handle optional and non-required attendee states
+31 -1
View File
@@ -440,15 +440,45 @@ validate_untilbeforeend = "The recurrence must end after the first occurrence
"Are you sure you want to delete the selected components?"
= "Are you sure you want to delete the selected components?";
/* Legend */
/* Participation role */
"Role" = "Role";
/* Participant role: participation is required */
"Participant" = "Participant";
/* Participant role: participation is required */
"req-participant" = "Participant";
/* Participant role: participation is optional */
"Optional Participant" = "Optional Participant";
/* Participant role: participation is optional */
"opt-participant" = "Optional Participant";
/* Participant role: participant is copied for information purposes only */
"Non Participant" = "Non Participant";
/* Participant role: participant is copied for information purposes only */
"non-participant" = "Non Participant";
/* Participant role: participant is chair of the calendar entity */
"Chair" = "Chair";
/* Participant role: participant is chair of the calendar entity */
"chair" = "Chair";
/* Participant status: needs action */
"Needs action" = "Needs action";
/* Participant status: event accepted */
"Accepted" = "Accepted";
/* Participant status: event declined */
"Declined" = "Declined";
/* Participant status: tentatively accepted */
"Tentative" = "Tentative";
"Free" = "Free";
"Busy" = "Busy";
"Maybe busy" = "Maybe busy";
@@ -4,6 +4,7 @@
xmlns:var="http://www.skyrix.com/od/binding"
xmlns:const="http://www.skyrix.com/od/constant"
xmlns:label="OGo:label"
xmlns:rsrc="OGo:url"
>
<script type="text/javascript">
var dayStartHour = <var:string value="dayStartHour"/>;
@@ -51,6 +52,16 @@
ng-click="editor.removeAttendee(currentAttendee, eventForm)">
<md-icon>remove_circle</md-icon>
</md-button>
<md-button class="md-icon-button"
label:aria-label="Role"
ng-click="editor.component.$attendees.nextRole(currentAttendee)"
ng-switch="currentAttendee.role">
<md-tooltip md-direction="right">{{ currentAttendee.role | loc }}</md-tooltip>
<md-icon class="ng-animate-disabled" ng-switch-when="req-participant">record_voice_over</md-icon>
<md-icon class="ng-animate-disabled" ng-switch-when="opt-participant">person_outline</md-icon>
<md-icon class="ng-animate-disabled" ng-switch-when="non-participant" rsrc:md-svg-src="img/voice_over_off.svg"><!-- non-participant --></md-icon>
<md-icon class="ng-animate-disabled" ng-switch-when="chair">event_seat</md-icon>
</md-button>
<sg-avatar-image class="md-avatar"
sg-email="currentAttendee.email"
size="40">person</sg-avatar-image>
@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M12.99 9.18c0-.06.01-.12.01-.18 0-2.21-1.79-4-4-4-.06 0-.12.01-.18.01l4.17 4.17zm-6.1-3.56L4.27 3 3 4.27l2.62 2.62C5.23 7.5 5 8.22 5 9c0 2.21 1.79 4 4 4 .78 0 1.5-.23 2.11-.62L19.73 21 21 19.73l-8.62-8.62-5.49-5.49zM9 15c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4zm7.76-9.64l-1.68 1.69c.84 1.18.84 2.71 0 3.89l1.68 1.69c2.02-2.02 2.02-5.07 0-7.27zM20.07 2l-1.63 1.63c2.77 3.02 2.77 7.56 0 10.74L20.07 16c3.9-3.89 3.91-9.95 0-14z"/><path fill="none" d="M0 0h24v24H0V0z"/></svg>

After

Width:  |  Height:  |  Size: 570 B

@@ -139,8 +139,11 @@
/**
* @ngInject
*/
configure.$inject = ['$logProvider', '$compileProvider', '$httpProvider', '$mdThemingProvider', '$mdAriaProvider', '$qProvider'];
function configure($logProvider, $compileProvider, $httpProvider, $mdThemingProvider, $mdAriaProvider, $qProvider) {
configure.$inject = ['$animateProvider', '$logProvider', '$compileProvider', '$httpProvider', '$mdThemingProvider', '$mdAriaProvider', '$qProvider'];
function configure($animateProvider, $logProvider, $compileProvider, $httpProvider, $mdThemingProvider, $mdAriaProvider, $qProvider) {
// Disabled animation for elements with class ng-animate-disabled
$animateProvider.classNameFilter(/^(?:(?!ng-animate-disabled).)*$/);
// Accent palette
$mdThemingProvider.definePalette('sogo-green', {
'50': 'eaf5e9',
@@ -32,7 +32,7 @@
* @desc The factory we'll use to register with Angular
* @returns the Attendees constructor
*/
Attendees.$factory = ['$q', '$timeout', '$log', 'sgSettings', 'Preferences', 'User', 'Card', 'Gravatar', 'Resource', function($q, $timeout, $log, Settings, Preferences, User, Card, Gravatar, Resource) {
Attendees.$factory = ['$q', '$timeout', '$log', 'sgSettings', 'Attendees_ROLES', 'Preferences', 'User', 'Card', 'Gravatar', 'Resource', function($q, $timeout, $log, Settings, ROLES, Preferences, User, Card, Gravatar, Resource) {
angular.extend(Attendees, {
$q: $q,
$timeout: $timeout,
@@ -42,7 +42,8 @@
$Preferences: Preferences,
$Card: Card,
$gravatar: Gravatar,
$$resource: new Resource(Settings.activeUser('folderURL') + 'Calendar', Settings.activeUser())
$$resource: new Resource(Settings.activeUser('folderURL') + 'Calendar', Settings.activeUser()),
ROLES: ROLES
});
Attendees.dayStartHour = parseInt(Preferences.defaults.SOGoDayStartTime.split(':')[0]);
@@ -62,9 +63,14 @@
angular.module('SOGo.SchedulerUI', ['SOGo.Common']);
}
angular.module('SOGo.SchedulerUI')
.constant('Attendees_ROLES', {
REQ_PARTICIPANT: 'req-participant',
OPT_PARTICIPANT: 'opt-participant',
NON_PARTICIPANT: 'non-participant',
CHAIR: 'chair'
})
.factory('Attendees', Attendees.$factory);
/**
* @function timeToQuarters
* @memberof Attendees
@@ -138,7 +144,7 @@
attendee = {
name: ref.c_cn,
email: ref.$preferredEmail(options? options.partial : undefined),
role: 'req-participant',
role: Attendees.ROLES.REQ_PARTICIPANT,
partstat: 'needs-action',
uid: ref.c_uid,
$avatarIcon: 'person',
@@ -165,7 +171,7 @@
isMSExchange: card.ismsexchange,
name: card.c_cn,
email: card.$preferredEmail(),
role: 'req-participant',
role: Attendees.ROLES.REQ_PARTICIPANT,
partstat: 'needs-action',
$avatarIcon: card.$avatarIcon
};
@@ -183,6 +189,20 @@
}
};
/**
* @function nextRole
* @memberof Attendees.prototype
* @desc Switch the attendee to the next participation role.
* @param {Object} attendee - the attendee definition
*/
Attendees.prototype.nextRole = function(attendee) {
var roles = _.values(Attendees.ROLES);
var index = _.findIndex(roles, function(role) {
return attendee.role === role;
});
attendee.role = roles[++index % 4];
};
/**
* @function hasAttendee
* @memberof Attendees.prototype
@@ -234,6 +234,8 @@
oldEndDate = new Date(this.component.end.getTime());
if (this.component.due)
oldDueDate = new Date(this.component.due.getTime());
$timeout(scrollToStart);
};
this.addAttachUrl = function () {