var almanachCalendar=angular.module("silverpeas.almanachcalendar",["silverpeas.services","silverpeas.components","silverpeas.controllers"]);almanachCalendar.controller("mainController",["$controller","CalendarService","$scope",function($controller,CalendarService,$scope){$controller("silverpeasCalendarController",{$scope:$scope});$scope.getCalendarService=function(){return CalendarService}}]);
almanachCalendar.controller("calendarController",["$controller","$scope","context",function($controller,$scope,context){$controller("mainController",{$scope:$scope});$scope.participationIds=$scope.participation.getParticipants()||[];$scope.viewMyCalendar=function(){if($scope.participationIds.indexOfElement(context.currentUserId))$scope.participationIds.addElement(context.currentUserId)};$scope.$watchCollection("participationIds",function(participationIds){$scope.participationIds=angular.copy(participationIds);
$scope.participation.setParticipants(participationIds)})}]);almanachCalendar.controller("editController",["$controller","$scope",function($controller,$scope){$controller("mainController",{$scope:$scope});$scope.loadOccurrenceFromContext(true)}]);almanachCalendar.controller("viewController",["$controller","$scope",function($controller,$scope){$controller("mainController",{$scope:$scope});$scope.reloadOccurrenceFromContext()}]);
almanachCalendar.controller("portletController",["$controller","CalendarService","$scope",function($controller,CalendarService,$scope){$controller("silverpeasCalendarController",{$scope:$scope});CalendarService.getNextOccurrences().then(function(occurrences){$scope.occurrences=occurrences})}]);