Skip to content

Commit

Permalink
fix(calendar(js)): allow event invitations to be moved
Browse files Browse the repository at this point in the history
Fixes #4926
  • Loading branch information
cgx committed Jan 17, 2020
1 parent 62f6431 commit 001d76f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
2 changes: 1 addition & 1 deletion UI/Templates/SchedulerUI/UIxAppointmentViewTemplate.wox
Expand Up @@ -49,7 +49,7 @@
</md-menu-content>
</md-menu>
</md-menu-item>
<md-menu-item ng-hide="::editor.component.isReadOnly">
<md-menu-item ng-show="editor.component.isMovable()">
<md-menu>
<md-button label:aria-label="Move To" ng-click="$mdMenu.open($event)">
<var:string label:value="Move To"/>
Expand Down
14 changes: 13 additions & 1 deletion UI/WebServerResources/js/Scheduler/Component.service.js
Expand Up @@ -694,13 +694,25 @@
/**
* @function isInvitationOccurrence
* @memberof Component.prototype
* @desc Check if the component an invitation and an occurrence of a recurrent component
* @desc Check if the component is an invitation and an occurrence of a recurrent component
* @returns true or false
*/
Component.prototype.isInvitationOccurrence = function() {
return (this.occurrenceId && this.userHasRSVP);
};

/**
* @function isMovable
* @memberof Component.prototype
* @desc Return true if the component can be moved to a different calendar which occurs in two cases:
* - the component is editable, ie is owned by the current user;
* - the component is an invitation and the current user is an attendee.
* @returns true or false
*/
Component.prototype.isMovable = function() {
return (!this.isReadOnly || this.userHasRSVP);
};

/**
* @function showPercentComplete
* @memberof Component.prototype
Expand Down

0 comments on commit 001d76f

Please sign in to comment.